compute-gen.go 4.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470
  1. // Copyright 2019 Google LLC.
  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. // For product documentation, see: https://developers.google.com/compute/docs/reference/latest/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/compute/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // computeService, err := compute.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // computeService, err := compute.NewService(ctx, option.WithScopes(compute.DevstorageReadWriteScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // computeService, err := compute.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // computeService, err := compute.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package compute // import "google.golang.org/api/compute/v1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "compute:v1"
  71. const apiName = "compute"
  72. const apiVersion = "v1"
  73. const basePath = "https://www.googleapis.com/compute/v1/projects/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View and manage your Google Compute Engine resources
  79. ComputeScope = "https://www.googleapis.com/auth/compute"
  80. // View your Google Compute Engine resources
  81. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  82. // Manage your data and permissions in Google Cloud Storage
  83. DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
  84. // View your data in Google Cloud Storage
  85. DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
  86. // Manage your data in Google Cloud Storage
  87. DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
  88. )
  89. // NewService creates a new Service.
  90. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  91. scopesOption := option.WithScopes(
  92. "https://www.googleapis.com/auth/cloud-platform",
  93. "https://www.googleapis.com/auth/compute",
  94. "https://www.googleapis.com/auth/compute.readonly",
  95. "https://www.googleapis.com/auth/devstorage.full_control",
  96. "https://www.googleapis.com/auth/devstorage.read_only",
  97. "https://www.googleapis.com/auth/devstorage.read_write",
  98. )
  99. // NOTE: prepend, so we don't override user-specified scopes.
  100. opts = append([]option.ClientOption{scopesOption}, opts...)
  101. client, endpoint, err := htransport.NewClient(ctx, opts...)
  102. if err != nil {
  103. return nil, err
  104. }
  105. s, err := New(client)
  106. if err != nil {
  107. return nil, err
  108. }
  109. if endpoint != "" {
  110. s.BasePath = endpoint
  111. }
  112. return s, nil
  113. }
  114. // New creates a new Service. It uses the provided http.Client for requests.
  115. //
  116. // Deprecated: please use NewService instead.
  117. // To provide a custom HTTP client, use option.WithHTTPClient.
  118. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  119. func New(client *http.Client) (*Service, error) {
  120. if client == nil {
  121. return nil, errors.New("client is nil")
  122. }
  123. s := &Service{client: client, BasePath: basePath}
  124. s.AcceleratorTypes = NewAcceleratorTypesService(s)
  125. s.Addresses = NewAddressesService(s)
  126. s.Autoscalers = NewAutoscalersService(s)
  127. s.BackendBuckets = NewBackendBucketsService(s)
  128. s.BackendServices = NewBackendServicesService(s)
  129. s.DiskTypes = NewDiskTypesService(s)
  130. s.Disks = NewDisksService(s)
  131. s.Firewalls = NewFirewallsService(s)
  132. s.ForwardingRules = NewForwardingRulesService(s)
  133. s.GlobalAddresses = NewGlobalAddressesService(s)
  134. s.GlobalForwardingRules = NewGlobalForwardingRulesService(s)
  135. s.GlobalOperations = NewGlobalOperationsService(s)
  136. s.HealthChecks = NewHealthChecksService(s)
  137. s.HttpHealthChecks = NewHttpHealthChecksService(s)
  138. s.HttpsHealthChecks = NewHttpsHealthChecksService(s)
  139. s.Images = NewImagesService(s)
  140. s.InstanceGroupManagers = NewInstanceGroupManagersService(s)
  141. s.InstanceGroups = NewInstanceGroupsService(s)
  142. s.InstanceTemplates = NewInstanceTemplatesService(s)
  143. s.Instances = NewInstancesService(s)
  144. s.InterconnectAttachments = NewInterconnectAttachmentsService(s)
  145. s.InterconnectLocations = NewInterconnectLocationsService(s)
  146. s.Interconnects = NewInterconnectsService(s)
  147. s.LicenseCodes = NewLicenseCodesService(s)
  148. s.Licenses = NewLicensesService(s)
  149. s.MachineTypes = NewMachineTypesService(s)
  150. s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s)
  151. s.Networks = NewNetworksService(s)
  152. s.NodeGroups = NewNodeGroupsService(s)
  153. s.NodeTemplates = NewNodeTemplatesService(s)
  154. s.NodeTypes = NewNodeTypesService(s)
  155. s.Projects = NewProjectsService(s)
  156. s.RegionAutoscalers = NewRegionAutoscalersService(s)
  157. s.RegionBackendServices = NewRegionBackendServicesService(s)
  158. s.RegionCommitments = NewRegionCommitmentsService(s)
  159. s.RegionDiskTypes = NewRegionDiskTypesService(s)
  160. s.RegionDisks = NewRegionDisksService(s)
  161. s.RegionInstanceGroupManagers = NewRegionInstanceGroupManagersService(s)
  162. s.RegionInstanceGroups = NewRegionInstanceGroupsService(s)
  163. s.RegionOperations = NewRegionOperationsService(s)
  164. s.Regions = NewRegionsService(s)
  165. s.Routers = NewRoutersService(s)
  166. s.Routes = NewRoutesService(s)
  167. s.SecurityPolicies = NewSecurityPoliciesService(s)
  168. s.Snapshots = NewSnapshotsService(s)
  169. s.SslCertificates = NewSslCertificatesService(s)
  170. s.SslPolicies = NewSslPoliciesService(s)
  171. s.Subnetworks = NewSubnetworksService(s)
  172. s.TargetHttpProxies = NewTargetHttpProxiesService(s)
  173. s.TargetHttpsProxies = NewTargetHttpsProxiesService(s)
  174. s.TargetInstances = NewTargetInstancesService(s)
  175. s.TargetPools = NewTargetPoolsService(s)
  176. s.TargetSslProxies = NewTargetSslProxiesService(s)
  177. s.TargetTcpProxies = NewTargetTcpProxiesService(s)
  178. s.TargetVpnGateways = NewTargetVpnGatewaysService(s)
  179. s.UrlMaps = NewUrlMapsService(s)
  180. s.VpnTunnels = NewVpnTunnelsService(s)
  181. s.ZoneOperations = NewZoneOperationsService(s)
  182. s.Zones = NewZonesService(s)
  183. return s, nil
  184. }
  185. type Service struct {
  186. client *http.Client
  187. BasePath string // API endpoint base URL
  188. UserAgent string // optional additional User-Agent fragment
  189. AcceleratorTypes *AcceleratorTypesService
  190. Addresses *AddressesService
  191. Autoscalers *AutoscalersService
  192. BackendBuckets *BackendBucketsService
  193. BackendServices *BackendServicesService
  194. DiskTypes *DiskTypesService
  195. Disks *DisksService
  196. Firewalls *FirewallsService
  197. ForwardingRules *ForwardingRulesService
  198. GlobalAddresses *GlobalAddressesService
  199. GlobalForwardingRules *GlobalForwardingRulesService
  200. GlobalOperations *GlobalOperationsService
  201. HealthChecks *HealthChecksService
  202. HttpHealthChecks *HttpHealthChecksService
  203. HttpsHealthChecks *HttpsHealthChecksService
  204. Images *ImagesService
  205. InstanceGroupManagers *InstanceGroupManagersService
  206. InstanceGroups *InstanceGroupsService
  207. InstanceTemplates *InstanceTemplatesService
  208. Instances *InstancesService
  209. InterconnectAttachments *InterconnectAttachmentsService
  210. InterconnectLocations *InterconnectLocationsService
  211. Interconnects *InterconnectsService
  212. LicenseCodes *LicenseCodesService
  213. Licenses *LicensesService
  214. MachineTypes *MachineTypesService
  215. NetworkEndpointGroups *NetworkEndpointGroupsService
  216. Networks *NetworksService
  217. NodeGroups *NodeGroupsService
  218. NodeTemplates *NodeTemplatesService
  219. NodeTypes *NodeTypesService
  220. Projects *ProjectsService
  221. RegionAutoscalers *RegionAutoscalersService
  222. RegionBackendServices *RegionBackendServicesService
  223. RegionCommitments *RegionCommitmentsService
  224. RegionDiskTypes *RegionDiskTypesService
  225. RegionDisks *RegionDisksService
  226. RegionInstanceGroupManagers *RegionInstanceGroupManagersService
  227. RegionInstanceGroups *RegionInstanceGroupsService
  228. RegionOperations *RegionOperationsService
  229. Regions *RegionsService
  230. Routers *RoutersService
  231. Routes *RoutesService
  232. SecurityPolicies *SecurityPoliciesService
  233. Snapshots *SnapshotsService
  234. SslCertificates *SslCertificatesService
  235. SslPolicies *SslPoliciesService
  236. Subnetworks *SubnetworksService
  237. TargetHttpProxies *TargetHttpProxiesService
  238. TargetHttpsProxies *TargetHttpsProxiesService
  239. TargetInstances *TargetInstancesService
  240. TargetPools *TargetPoolsService
  241. TargetSslProxies *TargetSslProxiesService
  242. TargetTcpProxies *TargetTcpProxiesService
  243. TargetVpnGateways *TargetVpnGatewaysService
  244. UrlMaps *UrlMapsService
  245. VpnTunnels *VpnTunnelsService
  246. ZoneOperations *ZoneOperationsService
  247. Zones *ZonesService
  248. }
  249. func (s *Service) userAgent() string {
  250. if s.UserAgent == "" {
  251. return googleapi.UserAgent
  252. }
  253. return googleapi.UserAgent + " " + s.UserAgent
  254. }
  255. func NewAcceleratorTypesService(s *Service) *AcceleratorTypesService {
  256. rs := &AcceleratorTypesService{s: s}
  257. return rs
  258. }
  259. type AcceleratorTypesService struct {
  260. s *Service
  261. }
  262. func NewAddressesService(s *Service) *AddressesService {
  263. rs := &AddressesService{s: s}
  264. return rs
  265. }
  266. type AddressesService struct {
  267. s *Service
  268. }
  269. func NewAutoscalersService(s *Service) *AutoscalersService {
  270. rs := &AutoscalersService{s: s}
  271. return rs
  272. }
  273. type AutoscalersService struct {
  274. s *Service
  275. }
  276. func NewBackendBucketsService(s *Service) *BackendBucketsService {
  277. rs := &BackendBucketsService{s: s}
  278. return rs
  279. }
  280. type BackendBucketsService struct {
  281. s *Service
  282. }
  283. func NewBackendServicesService(s *Service) *BackendServicesService {
  284. rs := &BackendServicesService{s: s}
  285. return rs
  286. }
  287. type BackendServicesService struct {
  288. s *Service
  289. }
  290. func NewDiskTypesService(s *Service) *DiskTypesService {
  291. rs := &DiskTypesService{s: s}
  292. return rs
  293. }
  294. type DiskTypesService struct {
  295. s *Service
  296. }
  297. func NewDisksService(s *Service) *DisksService {
  298. rs := &DisksService{s: s}
  299. return rs
  300. }
  301. type DisksService struct {
  302. s *Service
  303. }
  304. func NewFirewallsService(s *Service) *FirewallsService {
  305. rs := &FirewallsService{s: s}
  306. return rs
  307. }
  308. type FirewallsService struct {
  309. s *Service
  310. }
  311. func NewForwardingRulesService(s *Service) *ForwardingRulesService {
  312. rs := &ForwardingRulesService{s: s}
  313. return rs
  314. }
  315. type ForwardingRulesService struct {
  316. s *Service
  317. }
  318. func NewGlobalAddressesService(s *Service) *GlobalAddressesService {
  319. rs := &GlobalAddressesService{s: s}
  320. return rs
  321. }
  322. type GlobalAddressesService struct {
  323. s *Service
  324. }
  325. func NewGlobalForwardingRulesService(s *Service) *GlobalForwardingRulesService {
  326. rs := &GlobalForwardingRulesService{s: s}
  327. return rs
  328. }
  329. type GlobalForwardingRulesService struct {
  330. s *Service
  331. }
  332. func NewGlobalOperationsService(s *Service) *GlobalOperationsService {
  333. rs := &GlobalOperationsService{s: s}
  334. return rs
  335. }
  336. type GlobalOperationsService struct {
  337. s *Service
  338. }
  339. func NewHealthChecksService(s *Service) *HealthChecksService {
  340. rs := &HealthChecksService{s: s}
  341. return rs
  342. }
  343. type HealthChecksService struct {
  344. s *Service
  345. }
  346. func NewHttpHealthChecksService(s *Service) *HttpHealthChecksService {
  347. rs := &HttpHealthChecksService{s: s}
  348. return rs
  349. }
  350. type HttpHealthChecksService struct {
  351. s *Service
  352. }
  353. func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService {
  354. rs := &HttpsHealthChecksService{s: s}
  355. return rs
  356. }
  357. type HttpsHealthChecksService struct {
  358. s *Service
  359. }
  360. func NewImagesService(s *Service) *ImagesService {
  361. rs := &ImagesService{s: s}
  362. return rs
  363. }
  364. type ImagesService struct {
  365. s *Service
  366. }
  367. func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService {
  368. rs := &InstanceGroupManagersService{s: s}
  369. return rs
  370. }
  371. type InstanceGroupManagersService struct {
  372. s *Service
  373. }
  374. func NewInstanceGroupsService(s *Service) *InstanceGroupsService {
  375. rs := &InstanceGroupsService{s: s}
  376. return rs
  377. }
  378. type InstanceGroupsService struct {
  379. s *Service
  380. }
  381. func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService {
  382. rs := &InstanceTemplatesService{s: s}
  383. return rs
  384. }
  385. type InstanceTemplatesService struct {
  386. s *Service
  387. }
  388. func NewInstancesService(s *Service) *InstancesService {
  389. rs := &InstancesService{s: s}
  390. return rs
  391. }
  392. type InstancesService struct {
  393. s *Service
  394. }
  395. func NewInterconnectAttachmentsService(s *Service) *InterconnectAttachmentsService {
  396. rs := &InterconnectAttachmentsService{s: s}
  397. return rs
  398. }
  399. type InterconnectAttachmentsService struct {
  400. s *Service
  401. }
  402. func NewInterconnectLocationsService(s *Service) *InterconnectLocationsService {
  403. rs := &InterconnectLocationsService{s: s}
  404. return rs
  405. }
  406. type InterconnectLocationsService struct {
  407. s *Service
  408. }
  409. func NewInterconnectsService(s *Service) *InterconnectsService {
  410. rs := &InterconnectsService{s: s}
  411. return rs
  412. }
  413. type InterconnectsService struct {
  414. s *Service
  415. }
  416. func NewLicenseCodesService(s *Service) *LicenseCodesService {
  417. rs := &LicenseCodesService{s: s}
  418. return rs
  419. }
  420. type LicenseCodesService struct {
  421. s *Service
  422. }
  423. func NewLicensesService(s *Service) *LicensesService {
  424. rs := &LicensesService{s: s}
  425. return rs
  426. }
  427. type LicensesService struct {
  428. s *Service
  429. }
  430. func NewMachineTypesService(s *Service) *MachineTypesService {
  431. rs := &MachineTypesService{s: s}
  432. return rs
  433. }
  434. type MachineTypesService struct {
  435. s *Service
  436. }
  437. func NewNetworkEndpointGroupsService(s *Service) *NetworkEndpointGroupsService {
  438. rs := &NetworkEndpointGroupsService{s: s}
  439. return rs
  440. }
  441. type NetworkEndpointGroupsService struct {
  442. s *Service
  443. }
  444. func NewNetworksService(s *Service) *NetworksService {
  445. rs := &NetworksService{s: s}
  446. return rs
  447. }
  448. type NetworksService struct {
  449. s *Service
  450. }
  451. func NewNodeGroupsService(s *Service) *NodeGroupsService {
  452. rs := &NodeGroupsService{s: s}
  453. return rs
  454. }
  455. type NodeGroupsService struct {
  456. s *Service
  457. }
  458. func NewNodeTemplatesService(s *Service) *NodeTemplatesService {
  459. rs := &NodeTemplatesService{s: s}
  460. return rs
  461. }
  462. type NodeTemplatesService struct {
  463. s *Service
  464. }
  465. func NewNodeTypesService(s *Service) *NodeTypesService {
  466. rs := &NodeTypesService{s: s}
  467. return rs
  468. }
  469. type NodeTypesService struct {
  470. s *Service
  471. }
  472. func NewProjectsService(s *Service) *ProjectsService {
  473. rs := &ProjectsService{s: s}
  474. return rs
  475. }
  476. type ProjectsService struct {
  477. s *Service
  478. }
  479. func NewRegionAutoscalersService(s *Service) *RegionAutoscalersService {
  480. rs := &RegionAutoscalersService{s: s}
  481. return rs
  482. }
  483. type RegionAutoscalersService struct {
  484. s *Service
  485. }
  486. func NewRegionBackendServicesService(s *Service) *RegionBackendServicesService {
  487. rs := &RegionBackendServicesService{s: s}
  488. return rs
  489. }
  490. type RegionBackendServicesService struct {
  491. s *Service
  492. }
  493. func NewRegionCommitmentsService(s *Service) *RegionCommitmentsService {
  494. rs := &RegionCommitmentsService{s: s}
  495. return rs
  496. }
  497. type RegionCommitmentsService struct {
  498. s *Service
  499. }
  500. func NewRegionDiskTypesService(s *Service) *RegionDiskTypesService {
  501. rs := &RegionDiskTypesService{s: s}
  502. return rs
  503. }
  504. type RegionDiskTypesService struct {
  505. s *Service
  506. }
  507. func NewRegionDisksService(s *Service) *RegionDisksService {
  508. rs := &RegionDisksService{s: s}
  509. return rs
  510. }
  511. type RegionDisksService struct {
  512. s *Service
  513. }
  514. func NewRegionInstanceGroupManagersService(s *Service) *RegionInstanceGroupManagersService {
  515. rs := &RegionInstanceGroupManagersService{s: s}
  516. return rs
  517. }
  518. type RegionInstanceGroupManagersService struct {
  519. s *Service
  520. }
  521. func NewRegionInstanceGroupsService(s *Service) *RegionInstanceGroupsService {
  522. rs := &RegionInstanceGroupsService{s: s}
  523. return rs
  524. }
  525. type RegionInstanceGroupsService struct {
  526. s *Service
  527. }
  528. func NewRegionOperationsService(s *Service) *RegionOperationsService {
  529. rs := &RegionOperationsService{s: s}
  530. return rs
  531. }
  532. type RegionOperationsService struct {
  533. s *Service
  534. }
  535. func NewRegionsService(s *Service) *RegionsService {
  536. rs := &RegionsService{s: s}
  537. return rs
  538. }
  539. type RegionsService struct {
  540. s *Service
  541. }
  542. func NewRoutersService(s *Service) *RoutersService {
  543. rs := &RoutersService{s: s}
  544. return rs
  545. }
  546. type RoutersService struct {
  547. s *Service
  548. }
  549. func NewRoutesService(s *Service) *RoutesService {
  550. rs := &RoutesService{s: s}
  551. return rs
  552. }
  553. type RoutesService struct {
  554. s *Service
  555. }
  556. func NewSecurityPoliciesService(s *Service) *SecurityPoliciesService {
  557. rs := &SecurityPoliciesService{s: s}
  558. return rs
  559. }
  560. type SecurityPoliciesService struct {
  561. s *Service
  562. }
  563. func NewSnapshotsService(s *Service) *SnapshotsService {
  564. rs := &SnapshotsService{s: s}
  565. return rs
  566. }
  567. type SnapshotsService struct {
  568. s *Service
  569. }
  570. func NewSslCertificatesService(s *Service) *SslCertificatesService {
  571. rs := &SslCertificatesService{s: s}
  572. return rs
  573. }
  574. type SslCertificatesService struct {
  575. s *Service
  576. }
  577. func NewSslPoliciesService(s *Service) *SslPoliciesService {
  578. rs := &SslPoliciesService{s: s}
  579. return rs
  580. }
  581. type SslPoliciesService struct {
  582. s *Service
  583. }
  584. func NewSubnetworksService(s *Service) *SubnetworksService {
  585. rs := &SubnetworksService{s: s}
  586. return rs
  587. }
  588. type SubnetworksService struct {
  589. s *Service
  590. }
  591. func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService {
  592. rs := &TargetHttpProxiesService{s: s}
  593. return rs
  594. }
  595. type TargetHttpProxiesService struct {
  596. s *Service
  597. }
  598. func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService {
  599. rs := &TargetHttpsProxiesService{s: s}
  600. return rs
  601. }
  602. type TargetHttpsProxiesService struct {
  603. s *Service
  604. }
  605. func NewTargetInstancesService(s *Service) *TargetInstancesService {
  606. rs := &TargetInstancesService{s: s}
  607. return rs
  608. }
  609. type TargetInstancesService struct {
  610. s *Service
  611. }
  612. func NewTargetPoolsService(s *Service) *TargetPoolsService {
  613. rs := &TargetPoolsService{s: s}
  614. return rs
  615. }
  616. type TargetPoolsService struct {
  617. s *Service
  618. }
  619. func NewTargetSslProxiesService(s *Service) *TargetSslProxiesService {
  620. rs := &TargetSslProxiesService{s: s}
  621. return rs
  622. }
  623. type TargetSslProxiesService struct {
  624. s *Service
  625. }
  626. func NewTargetTcpProxiesService(s *Service) *TargetTcpProxiesService {
  627. rs := &TargetTcpProxiesService{s: s}
  628. return rs
  629. }
  630. type TargetTcpProxiesService struct {
  631. s *Service
  632. }
  633. func NewTargetVpnGatewaysService(s *Service) *TargetVpnGatewaysService {
  634. rs := &TargetVpnGatewaysService{s: s}
  635. return rs
  636. }
  637. type TargetVpnGatewaysService struct {
  638. s *Service
  639. }
  640. func NewUrlMapsService(s *Service) *UrlMapsService {
  641. rs := &UrlMapsService{s: s}
  642. return rs
  643. }
  644. type UrlMapsService struct {
  645. s *Service
  646. }
  647. func NewVpnTunnelsService(s *Service) *VpnTunnelsService {
  648. rs := &VpnTunnelsService{s: s}
  649. return rs
  650. }
  651. type VpnTunnelsService struct {
  652. s *Service
  653. }
  654. func NewZoneOperationsService(s *Service) *ZoneOperationsService {
  655. rs := &ZoneOperationsService{s: s}
  656. return rs
  657. }
  658. type ZoneOperationsService struct {
  659. s *Service
  660. }
  661. func NewZonesService(s *Service) *ZonesService {
  662. rs := &ZonesService{s: s}
  663. return rs
  664. }
  665. type ZonesService struct {
  666. s *Service
  667. }
  668. // AcceleratorConfig: A specification of the type and number of
  669. // accelerator cards attached to the instance.
  670. type AcceleratorConfig struct {
  671. // AcceleratorCount: The number of the guest accelerator cards exposed
  672. // to this instance.
  673. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  674. // AcceleratorType: Full or partial URL of the accelerator type resource
  675. // to attach to this instance. For example:
  676. // projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-
  677. // p100 If you are creating an instance template, specify only the
  678. // accelerator name. See GPUs on Compute Engine for a full list of
  679. // accelerator types.
  680. AcceleratorType string `json:"acceleratorType,omitempty"`
  681. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  682. // unconditionally include in API requests. By default, fields with
  683. // empty values are omitted from API requests. However, any non-pointer,
  684. // non-interface field appearing in ForceSendFields will be sent to the
  685. // server regardless of whether the field is empty or not. This may be
  686. // used to include empty fields in Patch requests.
  687. ForceSendFields []string `json:"-"`
  688. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  689. // include in API requests with the JSON null value. By default, fields
  690. // with empty values are omitted from API requests. However, any field
  691. // with an empty value appearing in NullFields will be sent to the
  692. // server as null. It is an error if a field in this list has a
  693. // non-empty value. This may be used to include null fields in Patch
  694. // requests.
  695. NullFields []string `json:"-"`
  696. }
  697. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  698. type NoMethod AcceleratorConfig
  699. raw := NoMethod(*s)
  700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  701. }
  702. // AcceleratorType: An Accelerator Type resource. (== resource_for
  703. // beta.acceleratorTypes ==) (== resource_for v1.acceleratorTypes ==)
  704. type AcceleratorType struct {
  705. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  706. // format.
  707. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  708. // Deprecated: [Output Only] The deprecation status associated with this
  709. // accelerator type.
  710. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  711. // Description: [Output Only] An optional textual description of the
  712. // resource.
  713. Description string `json:"description,omitempty"`
  714. // Id: [Output Only] The unique identifier for the resource. This
  715. // identifier is defined by the server.
  716. Id uint64 `json:"id,omitempty,string"`
  717. // Kind: [Output Only] The type of the resource. Always
  718. // compute#acceleratorType for accelerator types.
  719. Kind string `json:"kind,omitempty"`
  720. // MaximumCardsPerInstance: [Output Only] Maximum accelerator cards
  721. // allowed per instance.
  722. MaximumCardsPerInstance int64 `json:"maximumCardsPerInstance,omitempty"`
  723. // Name: [Output Only] Name of the resource.
  724. Name string `json:"name,omitempty"`
  725. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  726. // resource.
  727. SelfLink string `json:"selfLink,omitempty"`
  728. // Zone: [Output Only] The name of the zone where the accelerator type
  729. // resides, such as us-central1-a. You must specify this field as part
  730. // of the HTTP request URL. It is not settable as a field in the request
  731. // body.
  732. Zone string `json:"zone,omitempty"`
  733. // ServerResponse contains the HTTP response code and headers from the
  734. // server.
  735. googleapi.ServerResponse `json:"-"`
  736. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  737. // to unconditionally include in API requests. By default, fields with
  738. // empty values are omitted from API requests. However, any non-pointer,
  739. // non-interface field appearing in ForceSendFields will be sent to the
  740. // server regardless of whether the field is empty or not. This may be
  741. // used to include empty fields in Patch requests.
  742. ForceSendFields []string `json:"-"`
  743. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  744. // include in API requests with the JSON null value. By default, fields
  745. // with empty values are omitted from API requests. However, any field
  746. // with an empty value appearing in NullFields will be sent to the
  747. // server as null. It is an error if a field in this list has a
  748. // non-empty value. This may be used to include null fields in Patch
  749. // requests.
  750. NullFields []string `json:"-"`
  751. }
  752. func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
  753. type NoMethod AcceleratorType
  754. raw := NoMethod(*s)
  755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  756. }
  757. type AcceleratorTypeAggregatedList struct {
  758. // Id: [Output Only] Unique identifier for the resource; defined by the
  759. // server.
  760. Id string `json:"id,omitempty"`
  761. // Items: A list of AcceleratorTypesScopedList resources.
  762. Items map[string]AcceleratorTypesScopedList `json:"items,omitempty"`
  763. // Kind: [Output Only] Type of resource. Always
  764. // compute#acceleratorTypeAggregatedList for aggregated lists of
  765. // accelerator types.
  766. Kind string `json:"kind,omitempty"`
  767. // NextPageToken: [Output Only] This token allows you to get the next
  768. // page of results for list requests. If the number of results is larger
  769. // than maxResults, use the nextPageToken as a value for the query
  770. // parameter pageToken in the next list request. Subsequent list
  771. // requests will have their own nextPageToken to continue paging through
  772. // the results.
  773. NextPageToken string `json:"nextPageToken,omitempty"`
  774. // SelfLink: [Output Only] Server-defined URL for this resource.
  775. SelfLink string `json:"selfLink,omitempty"`
  776. // Warning: [Output Only] Informational warning message.
  777. Warning *AcceleratorTypeAggregatedListWarning `json:"warning,omitempty"`
  778. // ServerResponse contains the HTTP response code and headers from the
  779. // server.
  780. googleapi.ServerResponse `json:"-"`
  781. // ForceSendFields is a list of field names (e.g. "Id") to
  782. // unconditionally include in API requests. By default, fields with
  783. // empty values are omitted from API requests. However, any non-pointer,
  784. // non-interface field appearing in ForceSendFields will be sent to the
  785. // server regardless of whether the field is empty or not. This may be
  786. // used to include empty fields in Patch requests.
  787. ForceSendFields []string `json:"-"`
  788. // NullFields is a list of field names (e.g. "Id") to include in API
  789. // requests with the JSON null value. By default, fields with empty
  790. // values are omitted from API requests. However, any field with an
  791. // empty value appearing in NullFields will be sent to the server as
  792. // null. It is an error if a field in this list has a non-empty value.
  793. // This may be used to include null fields in Patch requests.
  794. NullFields []string `json:"-"`
  795. }
  796. func (s *AcceleratorTypeAggregatedList) MarshalJSON() ([]byte, error) {
  797. type NoMethod AcceleratorTypeAggregatedList
  798. raw := NoMethod(*s)
  799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  800. }
  801. // AcceleratorTypeAggregatedListWarning: [Output Only] Informational
  802. // warning message.
  803. type AcceleratorTypeAggregatedListWarning struct {
  804. // Code: [Output Only] A warning code, if applicable. For example,
  805. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  806. // the response.
  807. //
  808. // Possible values:
  809. // "CLEANUP_FAILED"
  810. // "DEPRECATED_RESOURCE_USED"
  811. // "DEPRECATED_TYPE_USED"
  812. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  813. // "EXPERIMENTAL_TYPE_USED"
  814. // "EXTERNAL_API_WARNING"
  815. // "FIELD_VALUE_OVERRIDEN"
  816. // "INJECTED_KERNELS_DEPRECATED"
  817. // "MISSING_TYPE_DEPENDENCY"
  818. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  819. // "NEXT_HOP_CANNOT_IP_FORWARD"
  820. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  821. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  822. // "NEXT_HOP_NOT_RUNNING"
  823. // "NOT_CRITICAL_ERROR"
  824. // "NO_RESULTS_ON_PAGE"
  825. // "REQUIRED_TOS_AGREEMENT"
  826. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  827. // "RESOURCE_NOT_DELETED"
  828. // "SCHEMA_VALIDATION_IGNORED"
  829. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  830. // "UNDECLARED_PROPERTIES"
  831. // "UNREACHABLE"
  832. Code string `json:"code,omitempty"`
  833. // Data: [Output Only] Metadata about this warning in key: value format.
  834. // For example:
  835. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  836. Data []*AcceleratorTypeAggregatedListWarningData `json:"data,omitempty"`
  837. // Message: [Output Only] A human-readable description of the warning
  838. // code.
  839. Message string `json:"message,omitempty"`
  840. // ForceSendFields is a list of field names (e.g. "Code") to
  841. // unconditionally include in API requests. By default, fields with
  842. // empty values are omitted from API requests. However, any non-pointer,
  843. // non-interface field appearing in ForceSendFields will be sent to the
  844. // server regardless of whether the field is empty or not. This may be
  845. // used to include empty fields in Patch requests.
  846. ForceSendFields []string `json:"-"`
  847. // NullFields is a list of field names (e.g. "Code") to include in API
  848. // requests with the JSON null value. By default, fields with empty
  849. // values are omitted from API requests. However, any field with an
  850. // empty value appearing in NullFields will be sent to the server as
  851. // null. It is an error if a field in this list has a non-empty value.
  852. // This may be used to include null fields in Patch requests.
  853. NullFields []string `json:"-"`
  854. }
  855. func (s *AcceleratorTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  856. type NoMethod AcceleratorTypeAggregatedListWarning
  857. raw := NoMethod(*s)
  858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  859. }
  860. type AcceleratorTypeAggregatedListWarningData struct {
  861. // Key: [Output Only] A key that provides more detail on the warning
  862. // being returned. For example, for warnings where there are no results
  863. // in a list request for a particular zone, this key might be scope and
  864. // the key value might be the zone name. Other examples might be a key
  865. // indicating a deprecated resource and a suggested replacement, or a
  866. // warning about invalid network settings (for example, if an instance
  867. // attempts to perform IP forwarding but is not enabled for IP
  868. // forwarding).
  869. Key string `json:"key,omitempty"`
  870. // Value: [Output Only] A warning data value corresponding to the key.
  871. Value string `json:"value,omitempty"`
  872. // ForceSendFields is a list of field names (e.g. "Key") to
  873. // unconditionally include in API requests. By default, fields with
  874. // empty values are omitted from API requests. However, any non-pointer,
  875. // non-interface field appearing in ForceSendFields will be sent to the
  876. // server regardless of whether the field is empty or not. This may be
  877. // used to include empty fields in Patch requests.
  878. ForceSendFields []string `json:"-"`
  879. // NullFields is a list of field names (e.g. "Key") to include in API
  880. // requests with the JSON null value. By default, fields with empty
  881. // values are omitted from API requests. However, any field with an
  882. // empty value appearing in NullFields will be sent to the server as
  883. // null. It is an error if a field in this list has a non-empty value.
  884. // This may be used to include null fields in Patch requests.
  885. NullFields []string `json:"-"`
  886. }
  887. func (s *AcceleratorTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  888. type NoMethod AcceleratorTypeAggregatedListWarningData
  889. raw := NoMethod(*s)
  890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  891. }
  892. // AcceleratorTypeList: Contains a list of accelerator types.
  893. type AcceleratorTypeList struct {
  894. // Id: [Output Only] Unique identifier for the resource; defined by the
  895. // server.
  896. Id string `json:"id,omitempty"`
  897. // Items: A list of AcceleratorType resources.
  898. Items []*AcceleratorType `json:"items,omitempty"`
  899. // Kind: [Output Only] Type of resource. Always
  900. // compute#acceleratorTypeList for lists of accelerator types.
  901. Kind string `json:"kind,omitempty"`
  902. // NextPageToken: [Output Only] This token allows you to get the next
  903. // page of results for list requests. If the number of results is larger
  904. // than maxResults, use the nextPageToken as a value for the query
  905. // parameter pageToken in the next list request. Subsequent list
  906. // requests will have their own nextPageToken to continue paging through
  907. // the results.
  908. NextPageToken string `json:"nextPageToken,omitempty"`
  909. // SelfLink: [Output Only] Server-defined URL for this resource.
  910. SelfLink string `json:"selfLink,omitempty"`
  911. // Warning: [Output Only] Informational warning message.
  912. Warning *AcceleratorTypeListWarning `json:"warning,omitempty"`
  913. // ServerResponse contains the HTTP response code and headers from the
  914. // server.
  915. googleapi.ServerResponse `json:"-"`
  916. // ForceSendFields is a list of field names (e.g. "Id") to
  917. // unconditionally include in API requests. By default, fields with
  918. // empty values are omitted from API requests. However, any non-pointer,
  919. // non-interface field appearing in ForceSendFields will be sent to the
  920. // server regardless of whether the field is empty or not. This may be
  921. // used to include empty fields in Patch requests.
  922. ForceSendFields []string `json:"-"`
  923. // NullFields is a list of field names (e.g. "Id") to include in API
  924. // requests with the JSON null value. By default, fields with empty
  925. // values are omitted from API requests. However, any field with an
  926. // empty value appearing in NullFields will be sent to the server as
  927. // null. It is an error if a field in this list has a non-empty value.
  928. // This may be used to include null fields in Patch requests.
  929. NullFields []string `json:"-"`
  930. }
  931. func (s *AcceleratorTypeList) MarshalJSON() ([]byte, error) {
  932. type NoMethod AcceleratorTypeList
  933. raw := NoMethod(*s)
  934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  935. }
  936. // AcceleratorTypeListWarning: [Output Only] Informational warning
  937. // message.
  938. type AcceleratorTypeListWarning struct {
  939. // Code: [Output Only] A warning code, if applicable. For example,
  940. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  941. // the response.
  942. //
  943. // Possible values:
  944. // "CLEANUP_FAILED"
  945. // "DEPRECATED_RESOURCE_USED"
  946. // "DEPRECATED_TYPE_USED"
  947. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  948. // "EXPERIMENTAL_TYPE_USED"
  949. // "EXTERNAL_API_WARNING"
  950. // "FIELD_VALUE_OVERRIDEN"
  951. // "INJECTED_KERNELS_DEPRECATED"
  952. // "MISSING_TYPE_DEPENDENCY"
  953. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  954. // "NEXT_HOP_CANNOT_IP_FORWARD"
  955. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  956. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  957. // "NEXT_HOP_NOT_RUNNING"
  958. // "NOT_CRITICAL_ERROR"
  959. // "NO_RESULTS_ON_PAGE"
  960. // "REQUIRED_TOS_AGREEMENT"
  961. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  962. // "RESOURCE_NOT_DELETED"
  963. // "SCHEMA_VALIDATION_IGNORED"
  964. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  965. // "UNDECLARED_PROPERTIES"
  966. // "UNREACHABLE"
  967. Code string `json:"code,omitempty"`
  968. // Data: [Output Only] Metadata about this warning in key: value format.
  969. // For example:
  970. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  971. Data []*AcceleratorTypeListWarningData `json:"data,omitempty"`
  972. // Message: [Output Only] A human-readable description of the warning
  973. // code.
  974. Message string `json:"message,omitempty"`
  975. // ForceSendFields is a list of field names (e.g. "Code") to
  976. // unconditionally include in API requests. By default, fields with
  977. // empty values are omitted from API requests. However, any non-pointer,
  978. // non-interface field appearing in ForceSendFields will be sent to the
  979. // server regardless of whether the field is empty or not. This may be
  980. // used to include empty fields in Patch requests.
  981. ForceSendFields []string `json:"-"`
  982. // NullFields is a list of field names (e.g. "Code") to include in API
  983. // requests with the JSON null value. By default, fields with empty
  984. // values are omitted from API requests. However, any field with an
  985. // empty value appearing in NullFields will be sent to the server as
  986. // null. It is an error if a field in this list has a non-empty value.
  987. // This may be used to include null fields in Patch requests.
  988. NullFields []string `json:"-"`
  989. }
  990. func (s *AcceleratorTypeListWarning) MarshalJSON() ([]byte, error) {
  991. type NoMethod AcceleratorTypeListWarning
  992. raw := NoMethod(*s)
  993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  994. }
  995. type AcceleratorTypeListWarningData struct {
  996. // Key: [Output Only] A key that provides more detail on the warning
  997. // being returned. For example, for warnings where there are no results
  998. // in a list request for a particular zone, this key might be scope and
  999. // the key value might be the zone name. Other examples might be a key
  1000. // indicating a deprecated resource and a suggested replacement, or a
  1001. // warning about invalid network settings (for example, if an instance
  1002. // attempts to perform IP forwarding but is not enabled for IP
  1003. // forwarding).
  1004. Key string `json:"key,omitempty"`
  1005. // Value: [Output Only] A warning data value corresponding to the key.
  1006. Value string `json:"value,omitempty"`
  1007. // ForceSendFields is a list of field names (e.g. "Key") to
  1008. // unconditionally include in API requests. By default, fields with
  1009. // empty values are omitted from API requests. However, any non-pointer,
  1010. // non-interface field appearing in ForceSendFields will be sent to the
  1011. // server regardless of whether the field is empty or not. This may be
  1012. // used to include empty fields in Patch requests.
  1013. ForceSendFields []string `json:"-"`
  1014. // NullFields is a list of field names (e.g. "Key") to include in API
  1015. // requests with the JSON null value. By default, fields with empty
  1016. // values are omitted from API requests. However, any field with an
  1017. // empty value appearing in NullFields will be sent to the server as
  1018. // null. It is an error if a field in this list has a non-empty value.
  1019. // This may be used to include null fields in Patch requests.
  1020. NullFields []string `json:"-"`
  1021. }
  1022. func (s *AcceleratorTypeListWarningData) MarshalJSON() ([]byte, error) {
  1023. type NoMethod AcceleratorTypeListWarningData
  1024. raw := NoMethod(*s)
  1025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1026. }
  1027. type AcceleratorTypesScopedList struct {
  1028. // AcceleratorTypes: [Output Only] A list of accelerator types contained
  1029. // in this scope.
  1030. AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
  1031. // Warning: [Output Only] An informational warning that appears when the
  1032. // accelerator types list is empty.
  1033. Warning *AcceleratorTypesScopedListWarning `json:"warning,omitempty"`
  1034. // ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1035. // unconditionally include in API requests. By default, fields with
  1036. // empty values are omitted from API requests. However, any non-pointer,
  1037. // non-interface field appearing in ForceSendFields will be sent to the
  1038. // server regardless of whether the field is empty or not. This may be
  1039. // used to include empty fields in Patch requests.
  1040. ForceSendFields []string `json:"-"`
  1041. // NullFields is a list of field names (e.g. "AcceleratorTypes") to
  1042. // include in API requests with the JSON null value. By default, fields
  1043. // with empty values are omitted from API requests. However, any field
  1044. // with an empty value appearing in NullFields will be sent to the
  1045. // server as null. It is an error if a field in this list has a
  1046. // non-empty value. This may be used to include null fields in Patch
  1047. // requests.
  1048. NullFields []string `json:"-"`
  1049. }
  1050. func (s *AcceleratorTypesScopedList) MarshalJSON() ([]byte, error) {
  1051. type NoMethod AcceleratorTypesScopedList
  1052. raw := NoMethod(*s)
  1053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1054. }
  1055. // AcceleratorTypesScopedListWarning: [Output Only] An informational
  1056. // warning that appears when the accelerator types list is empty.
  1057. type AcceleratorTypesScopedListWarning struct {
  1058. // Code: [Output Only] A warning code, if applicable. For example,
  1059. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1060. // the response.
  1061. //
  1062. // Possible values:
  1063. // "CLEANUP_FAILED"
  1064. // "DEPRECATED_RESOURCE_USED"
  1065. // "DEPRECATED_TYPE_USED"
  1066. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1067. // "EXPERIMENTAL_TYPE_USED"
  1068. // "EXTERNAL_API_WARNING"
  1069. // "FIELD_VALUE_OVERRIDEN"
  1070. // "INJECTED_KERNELS_DEPRECATED"
  1071. // "MISSING_TYPE_DEPENDENCY"
  1072. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1073. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1074. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1075. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1076. // "NEXT_HOP_NOT_RUNNING"
  1077. // "NOT_CRITICAL_ERROR"
  1078. // "NO_RESULTS_ON_PAGE"
  1079. // "REQUIRED_TOS_AGREEMENT"
  1080. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1081. // "RESOURCE_NOT_DELETED"
  1082. // "SCHEMA_VALIDATION_IGNORED"
  1083. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1084. // "UNDECLARED_PROPERTIES"
  1085. // "UNREACHABLE"
  1086. Code string `json:"code,omitempty"`
  1087. // Data: [Output Only] Metadata about this warning in key: value format.
  1088. // For example:
  1089. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1090. Data []*AcceleratorTypesScopedListWarningData `json:"data,omitempty"`
  1091. // Message: [Output Only] A human-readable description of the warning
  1092. // code.
  1093. Message string `json:"message,omitempty"`
  1094. // ForceSendFields is a list of field names (e.g. "Code") to
  1095. // unconditionally include in API requests. By default, fields with
  1096. // empty values are omitted from API requests. However, any non-pointer,
  1097. // non-interface field appearing in ForceSendFields will be sent to the
  1098. // server regardless of whether the field is empty or not. This may be
  1099. // used to include empty fields in Patch requests.
  1100. ForceSendFields []string `json:"-"`
  1101. // NullFields is a list of field names (e.g. "Code") to include in API
  1102. // requests with the JSON null value. By default, fields with empty
  1103. // values are omitted from API requests. However, any field with an
  1104. // empty value appearing in NullFields will be sent to the server as
  1105. // null. It is an error if a field in this list has a non-empty value.
  1106. // This may be used to include null fields in Patch requests.
  1107. NullFields []string `json:"-"`
  1108. }
  1109. func (s *AcceleratorTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  1110. type NoMethod AcceleratorTypesScopedListWarning
  1111. raw := NoMethod(*s)
  1112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1113. }
  1114. type AcceleratorTypesScopedListWarningData struct {
  1115. // Key: [Output Only] A key that provides more detail on the warning
  1116. // being returned. For example, for warnings where there are no results
  1117. // in a list request for a particular zone, this key might be scope and
  1118. // the key value might be the zone name. Other examples might be a key
  1119. // indicating a deprecated resource and a suggested replacement, or a
  1120. // warning about invalid network settings (for example, if an instance
  1121. // attempts to perform IP forwarding but is not enabled for IP
  1122. // forwarding).
  1123. Key string `json:"key,omitempty"`
  1124. // Value: [Output Only] A warning data value corresponding to the key.
  1125. Value string `json:"value,omitempty"`
  1126. // ForceSendFields is a list of field names (e.g. "Key") to
  1127. // unconditionally include in API requests. By default, fields with
  1128. // empty values are omitted from API requests. However, any non-pointer,
  1129. // non-interface field appearing in ForceSendFields will be sent to the
  1130. // server regardless of whether the field is empty or not. This may be
  1131. // used to include empty fields in Patch requests.
  1132. ForceSendFields []string `json:"-"`
  1133. // NullFields is a list of field names (e.g. "Key") to include in API
  1134. // requests with the JSON null value. By default, fields with empty
  1135. // values are omitted from API requests. However, any field with an
  1136. // empty value appearing in NullFields will be sent to the server as
  1137. // null. It is an error if a field in this list has a non-empty value.
  1138. // This may be used to include null fields in Patch requests.
  1139. NullFields []string `json:"-"`
  1140. }
  1141. func (s *AcceleratorTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1142. type NoMethod AcceleratorTypesScopedListWarningData
  1143. raw := NoMethod(*s)
  1144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1145. }
  1146. // AccessConfig: An access configuration attached to an instance's
  1147. // network interface. Only one access config per instance is supported.
  1148. type AccessConfig struct {
  1149. // Kind: [Output Only] Type of the resource. Always compute#accessConfig
  1150. // for access configs.
  1151. Kind string `json:"kind,omitempty"`
  1152. // Name: The name of this access configuration. The default and
  1153. // recommended name is External NAT but you can use any arbitrary string
  1154. // you would like. For example, My external IP or Network Access.
  1155. Name string `json:"name,omitempty"`
  1156. // NatIP: An external IP address associated with this instance. Specify
  1157. // an unused static external IP address available to the project or
  1158. // leave this field undefined to use an IP from a shared ephemeral IP
  1159. // address pool. If you specify a static external IP address, it must
  1160. // live in the same region as the zone of the instance.
  1161. NatIP string `json:"natIP,omitempty"`
  1162. // NetworkTier: This signifies the networking tier used for configuring
  1163. // this access configuration and can only take the following values:
  1164. // PREMIUM, STANDARD.
  1165. //
  1166. // If an AccessConfig is specified without a valid external IP address,
  1167. // an ephemeral IP will be created with this networkTier.
  1168. //
  1169. // If an AccessConfig with a valid external IP address is specified, it
  1170. // must match that of the networkTier associated with the Address
  1171. // resource owning that IP.
  1172. //
  1173. // Possible values:
  1174. // "PREMIUM"
  1175. // "STANDARD"
  1176. NetworkTier string `json:"networkTier,omitempty"`
  1177. // PublicPtrDomainName: The DNS domain name for the public PTR record.
  1178. // This field can only be set when the set_public_ptr field is enabled.
  1179. PublicPtrDomainName string `json:"publicPtrDomainName,omitempty"`
  1180. // SetPublicPtr: Specifies whether a public DNS ?PTR? record should be
  1181. // created to map the external IP address of the instance to a DNS
  1182. // domain name.
  1183. SetPublicPtr bool `json:"setPublicPtr,omitempty"`
  1184. // Type: The type of configuration. The default and only option is
  1185. // ONE_TO_ONE_NAT.
  1186. //
  1187. // Possible values:
  1188. // "ONE_TO_ONE_NAT" (default)
  1189. Type string `json:"type,omitempty"`
  1190. // ForceSendFields is a list of field names (e.g. "Kind") to
  1191. // unconditionally include in API requests. By default, fields with
  1192. // empty values are omitted from API requests. However, any non-pointer,
  1193. // non-interface field appearing in ForceSendFields will be sent to the
  1194. // server regardless of whether the field is empty or not. This may be
  1195. // used to include empty fields in Patch requests.
  1196. ForceSendFields []string `json:"-"`
  1197. // NullFields is a list of field names (e.g. "Kind") to include in API
  1198. // requests with the JSON null value. By default, fields with empty
  1199. // values are omitted from API requests. However, any field with an
  1200. // empty value appearing in NullFields will be sent to the server as
  1201. // null. It is an error if a field in this list has a non-empty value.
  1202. // This may be used to include null fields in Patch requests.
  1203. NullFields []string `json:"-"`
  1204. }
  1205. func (s *AccessConfig) MarshalJSON() ([]byte, error) {
  1206. type NoMethod AccessConfig
  1207. raw := NoMethod(*s)
  1208. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1209. }
  1210. // Address: A reserved address resource. (== resource_for beta.addresses
  1211. // ==) (== resource_for v1.addresses ==) (== resource_for
  1212. // beta.globalAddresses ==) (== resource_for v1.globalAddresses ==)
  1213. type Address struct {
  1214. // Address: The static IP address represented by this resource.
  1215. Address string `json:"address,omitempty"`
  1216. // AddressType: The type of address to reserve, either INTERNAL or
  1217. // EXTERNAL. If unspecified, defaults to EXTERNAL.
  1218. //
  1219. // Possible values:
  1220. // "EXTERNAL"
  1221. // "INTERNAL"
  1222. // "UNSPECIFIED_TYPE"
  1223. AddressType string `json:"addressType,omitempty"`
  1224. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  1225. // format.
  1226. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1227. // Description: An optional description of this resource. Provide this
  1228. // property when you create the resource.
  1229. Description string `json:"description,omitempty"`
  1230. // Id: [Output Only] The unique identifier for the resource. This
  1231. // identifier is defined by the server.
  1232. Id uint64 `json:"id,omitempty,string"`
  1233. // IpVersion: The IP Version that will be used by this address. Valid
  1234. // options are IPV4 or IPV6. This can only be specified for a global
  1235. // address.
  1236. //
  1237. // Possible values:
  1238. // "IPV4"
  1239. // "IPV6"
  1240. // "UNSPECIFIED_VERSION"
  1241. IpVersion string `json:"ipVersion,omitempty"`
  1242. // Kind: [Output Only] Type of the resource. Always compute#address for
  1243. // addresses.
  1244. Kind string `json:"kind,omitempty"`
  1245. // Name: Name of the resource. Provided by the client when the resource
  1246. // is created. The name must be 1-63 characters long, and comply with
  1247. // RFC1035. Specifically, the name must be 1-63 characters long and
  1248. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  1249. // the first character must be a lowercase letter, and all following
  1250. // characters must be a dash, lowercase letter, or digit, except the
  1251. // last character, which cannot be a dash.
  1252. Name string `json:"name,omitempty"`
  1253. // Network: The URL of the network in which to reserve the address. This
  1254. // field can only be used with INTERNAL type with VPC_PEERING purpose.
  1255. Network string `json:"network,omitempty"`
  1256. // NetworkTier: This signifies the networking tier used for configuring
  1257. // this Address and can only take the following values: PREMIUM,
  1258. // STANDARD. Global forwarding rules can only be Premium Tier. Regional
  1259. // forwarding rules can be either Premium or Standard Tier. Standard
  1260. // Tier addresses applied to regional forwarding rules can be used with
  1261. // any external load balancer. Regional forwarding rules in Premium Tier
  1262. // can only be used with a Network load balancer.
  1263. //
  1264. // If this field is not specified, it is assumed to be PREMIUM.
  1265. //
  1266. // Possible values:
  1267. // "PREMIUM"
  1268. // "STANDARD"
  1269. NetworkTier string `json:"networkTier,omitempty"`
  1270. // PrefixLength: The prefix length if the resource reprensents an IP
  1271. // range.
  1272. PrefixLength int64 `json:"prefixLength,omitempty"`
  1273. // Purpose: The purpose of resource, only used with INTERNAL type.
  1274. //
  1275. // Possible values:
  1276. // "DNS_RESOLVER"
  1277. // "GCE_ENDPOINT"
  1278. // "NAT_AUTO"
  1279. // "VPC_PEERING"
  1280. Purpose string `json:"purpose,omitempty"`
  1281. // Region: [Output Only] URL of the region where the regional address
  1282. // resides. This field is not applicable to global addresses. You must
  1283. // specify this field as part of the HTTP request URL. You cannot set
  1284. // this field in the request body.
  1285. Region string `json:"region,omitempty"`
  1286. // SelfLink: [Output Only] Server-defined URL for the resource.
  1287. SelfLink string `json:"selfLink,omitempty"`
  1288. // Status: [Output Only] The status of the address, which can be one of
  1289. // RESERVING, RESERVED, or IN_USE. An address that is RESERVING is
  1290. // currently in the process of being reserved. A RESERVED address is
  1291. // currently reserved and available to use. An IN_USE address is
  1292. // currently being used by another resource and is not available.
  1293. //
  1294. // Possible values:
  1295. // "IN_USE"
  1296. // "RESERVED"
  1297. // "RESERVING"
  1298. Status string `json:"status,omitempty"`
  1299. // Subnetwork: The URL of the subnetwork in which to reserve the
  1300. // address. If an IP address is specified, it must be within the
  1301. // subnetwork's IP range. This field can only be used with INTERNAL type
  1302. // with GCE_ENDPOINT/DNS_RESOLVER purposes.
  1303. Subnetwork string `json:"subnetwork,omitempty"`
  1304. // Users: [Output Only] The URLs of the resources that are using this
  1305. // address.
  1306. Users []string `json:"users,omitempty"`
  1307. // ServerResponse contains the HTTP response code and headers from the
  1308. // server.
  1309. googleapi.ServerResponse `json:"-"`
  1310. // ForceSendFields is a list of field names (e.g. "Address") to
  1311. // unconditionally include in API requests. By default, fields with
  1312. // empty values are omitted from API requests. However, any non-pointer,
  1313. // non-interface field appearing in ForceSendFields will be sent to the
  1314. // server regardless of whether the field is empty or not. This may be
  1315. // used to include empty fields in Patch requests.
  1316. ForceSendFields []string `json:"-"`
  1317. // NullFields is a list of field names (e.g. "Address") to include in
  1318. // API requests with the JSON null value. By default, fields with empty
  1319. // values are omitted from API requests. However, any field with an
  1320. // empty value appearing in NullFields will be sent to the server as
  1321. // null. It is an error if a field in this list has a non-empty value.
  1322. // This may be used to include null fields in Patch requests.
  1323. NullFields []string `json:"-"`
  1324. }
  1325. func (s *Address) MarshalJSON() ([]byte, error) {
  1326. type NoMethod Address
  1327. raw := NoMethod(*s)
  1328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1329. }
  1330. type AddressAggregatedList struct {
  1331. // Id: [Output Only] Unique identifier for the resource; defined by the
  1332. // server.
  1333. Id string `json:"id,omitempty"`
  1334. // Items: A list of AddressesScopedList resources.
  1335. Items map[string]AddressesScopedList `json:"items,omitempty"`
  1336. // Kind: [Output Only] Type of resource. Always
  1337. // compute#addressAggregatedList for aggregated lists of addresses.
  1338. Kind string `json:"kind,omitempty"`
  1339. // NextPageToken: [Output Only] This token allows you to get the next
  1340. // page of results for list requests. If the number of results is larger
  1341. // than maxResults, use the nextPageToken as a value for the query
  1342. // parameter pageToken in the next list request. Subsequent list
  1343. // requests will have their own nextPageToken to continue paging through
  1344. // the results.
  1345. NextPageToken string `json:"nextPageToken,omitempty"`
  1346. // SelfLink: [Output Only] Server-defined URL for this resource.
  1347. SelfLink string `json:"selfLink,omitempty"`
  1348. // Warning: [Output Only] Informational warning message.
  1349. Warning *AddressAggregatedListWarning `json:"warning,omitempty"`
  1350. // ServerResponse contains the HTTP response code and headers from the
  1351. // server.
  1352. googleapi.ServerResponse `json:"-"`
  1353. // ForceSendFields is a list of field names (e.g. "Id") to
  1354. // unconditionally include in API requests. By default, fields with
  1355. // empty values are omitted from API requests. However, any non-pointer,
  1356. // non-interface field appearing in ForceSendFields will be sent to the
  1357. // server regardless of whether the field is empty or not. This may be
  1358. // used to include empty fields in Patch requests.
  1359. ForceSendFields []string `json:"-"`
  1360. // NullFields is a list of field names (e.g. "Id") to include in API
  1361. // requests with the JSON null value. By default, fields with empty
  1362. // values are omitted from API requests. However, any field with an
  1363. // empty value appearing in NullFields will be sent to the server as
  1364. // null. It is an error if a field in this list has a non-empty value.
  1365. // This may be used to include null fields in Patch requests.
  1366. NullFields []string `json:"-"`
  1367. }
  1368. func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) {
  1369. type NoMethod AddressAggregatedList
  1370. raw := NoMethod(*s)
  1371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1372. }
  1373. // AddressAggregatedListWarning: [Output Only] Informational warning
  1374. // message.
  1375. type AddressAggregatedListWarning struct {
  1376. // Code: [Output Only] A warning code, if applicable. For example,
  1377. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1378. // the response.
  1379. //
  1380. // Possible values:
  1381. // "CLEANUP_FAILED"
  1382. // "DEPRECATED_RESOURCE_USED"
  1383. // "DEPRECATED_TYPE_USED"
  1384. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1385. // "EXPERIMENTAL_TYPE_USED"
  1386. // "EXTERNAL_API_WARNING"
  1387. // "FIELD_VALUE_OVERRIDEN"
  1388. // "INJECTED_KERNELS_DEPRECATED"
  1389. // "MISSING_TYPE_DEPENDENCY"
  1390. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1391. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1392. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1393. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1394. // "NEXT_HOP_NOT_RUNNING"
  1395. // "NOT_CRITICAL_ERROR"
  1396. // "NO_RESULTS_ON_PAGE"
  1397. // "REQUIRED_TOS_AGREEMENT"
  1398. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1399. // "RESOURCE_NOT_DELETED"
  1400. // "SCHEMA_VALIDATION_IGNORED"
  1401. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1402. // "UNDECLARED_PROPERTIES"
  1403. // "UNREACHABLE"
  1404. Code string `json:"code,omitempty"`
  1405. // Data: [Output Only] Metadata about this warning in key: value format.
  1406. // For example:
  1407. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1408. Data []*AddressAggregatedListWarningData `json:"data,omitempty"`
  1409. // Message: [Output Only] A human-readable description of the warning
  1410. // code.
  1411. Message string `json:"message,omitempty"`
  1412. // ForceSendFields is a list of field names (e.g. "Code") to
  1413. // unconditionally include in API requests. By default, fields with
  1414. // empty values are omitted from API requests. However, any non-pointer,
  1415. // non-interface field appearing in ForceSendFields will be sent to the
  1416. // server regardless of whether the field is empty or not. This may be
  1417. // used to include empty fields in Patch requests.
  1418. ForceSendFields []string `json:"-"`
  1419. // NullFields is a list of field names (e.g. "Code") to include in API
  1420. // requests with the JSON null value. By default, fields with empty
  1421. // values are omitted from API requests. However, any field with an
  1422. // empty value appearing in NullFields will be sent to the server as
  1423. // null. It is an error if a field in this list has a non-empty value.
  1424. // This may be used to include null fields in Patch requests.
  1425. NullFields []string `json:"-"`
  1426. }
  1427. func (s *AddressAggregatedListWarning) MarshalJSON() ([]byte, error) {
  1428. type NoMethod AddressAggregatedListWarning
  1429. raw := NoMethod(*s)
  1430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1431. }
  1432. type AddressAggregatedListWarningData struct {
  1433. // Key: [Output Only] A key that provides more detail on the warning
  1434. // being returned. For example, for warnings where there are no results
  1435. // in a list request for a particular zone, this key might be scope and
  1436. // the key value might be the zone name. Other examples might be a key
  1437. // indicating a deprecated resource and a suggested replacement, or a
  1438. // warning about invalid network settings (for example, if an instance
  1439. // attempts to perform IP forwarding but is not enabled for IP
  1440. // forwarding).
  1441. Key string `json:"key,omitempty"`
  1442. // Value: [Output Only] A warning data value corresponding to the key.
  1443. Value string `json:"value,omitempty"`
  1444. // ForceSendFields is a list of field names (e.g. "Key") to
  1445. // unconditionally include in API requests. By default, fields with
  1446. // empty values are omitted from API requests. However, any non-pointer,
  1447. // non-interface field appearing in ForceSendFields will be sent to the
  1448. // server regardless of whether the field is empty or not. This may be
  1449. // used to include empty fields in Patch requests.
  1450. ForceSendFields []string `json:"-"`
  1451. // NullFields is a list of field names (e.g. "Key") to include in API
  1452. // requests with the JSON null value. By default, fields with empty
  1453. // values are omitted from API requests. However, any field with an
  1454. // empty value appearing in NullFields will be sent to the server as
  1455. // null. It is an error if a field in this list has a non-empty value.
  1456. // This may be used to include null fields in Patch requests.
  1457. NullFields []string `json:"-"`
  1458. }
  1459. func (s *AddressAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  1460. type NoMethod AddressAggregatedListWarningData
  1461. raw := NoMethod(*s)
  1462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1463. }
  1464. // AddressList: Contains a list of addresses.
  1465. type AddressList struct {
  1466. // Id: [Output Only] Unique identifier for the resource; defined by the
  1467. // server.
  1468. Id string `json:"id,omitempty"`
  1469. // Items: A list of Address resources.
  1470. Items []*Address `json:"items,omitempty"`
  1471. // Kind: [Output Only] Type of resource. Always compute#addressList for
  1472. // lists of addresses.
  1473. Kind string `json:"kind,omitempty"`
  1474. // NextPageToken: [Output Only] This token allows you to get the next
  1475. // page of results for list requests. If the number of results is larger
  1476. // than maxResults, use the nextPageToken as a value for the query
  1477. // parameter pageToken in the next list request. Subsequent list
  1478. // requests will have their own nextPageToken to continue paging through
  1479. // the results.
  1480. NextPageToken string `json:"nextPageToken,omitempty"`
  1481. // SelfLink: [Output Only] Server-defined URL for this resource.
  1482. SelfLink string `json:"selfLink,omitempty"`
  1483. // Warning: [Output Only] Informational warning message.
  1484. Warning *AddressListWarning `json:"warning,omitempty"`
  1485. // ServerResponse contains the HTTP response code and headers from the
  1486. // server.
  1487. googleapi.ServerResponse `json:"-"`
  1488. // ForceSendFields is a list of field names (e.g. "Id") to
  1489. // unconditionally include in API requests. By default, fields with
  1490. // empty values are omitted from API requests. However, any non-pointer,
  1491. // non-interface field appearing in ForceSendFields will be sent to the
  1492. // server regardless of whether the field is empty or not. This may be
  1493. // used to include empty fields in Patch requests.
  1494. ForceSendFields []string `json:"-"`
  1495. // NullFields is a list of field names (e.g. "Id") to include in API
  1496. // requests with the JSON null value. By default, fields with empty
  1497. // values are omitted from API requests. However, any field with an
  1498. // empty value appearing in NullFields will be sent to the server as
  1499. // null. It is an error if a field in this list has a non-empty value.
  1500. // This may be used to include null fields in Patch requests.
  1501. NullFields []string `json:"-"`
  1502. }
  1503. func (s *AddressList) MarshalJSON() ([]byte, error) {
  1504. type NoMethod AddressList
  1505. raw := NoMethod(*s)
  1506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1507. }
  1508. // AddressListWarning: [Output Only] Informational warning message.
  1509. type AddressListWarning struct {
  1510. // Code: [Output Only] A warning code, if applicable. For example,
  1511. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1512. // the response.
  1513. //
  1514. // Possible values:
  1515. // "CLEANUP_FAILED"
  1516. // "DEPRECATED_RESOURCE_USED"
  1517. // "DEPRECATED_TYPE_USED"
  1518. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1519. // "EXPERIMENTAL_TYPE_USED"
  1520. // "EXTERNAL_API_WARNING"
  1521. // "FIELD_VALUE_OVERRIDEN"
  1522. // "INJECTED_KERNELS_DEPRECATED"
  1523. // "MISSING_TYPE_DEPENDENCY"
  1524. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1525. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1526. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1527. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1528. // "NEXT_HOP_NOT_RUNNING"
  1529. // "NOT_CRITICAL_ERROR"
  1530. // "NO_RESULTS_ON_PAGE"
  1531. // "REQUIRED_TOS_AGREEMENT"
  1532. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1533. // "RESOURCE_NOT_DELETED"
  1534. // "SCHEMA_VALIDATION_IGNORED"
  1535. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1536. // "UNDECLARED_PROPERTIES"
  1537. // "UNREACHABLE"
  1538. Code string `json:"code,omitempty"`
  1539. // Data: [Output Only] Metadata about this warning in key: value format.
  1540. // For example:
  1541. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1542. Data []*AddressListWarningData `json:"data,omitempty"`
  1543. // Message: [Output Only] A human-readable description of the warning
  1544. // code.
  1545. Message string `json:"message,omitempty"`
  1546. // ForceSendFields is a list of field names (e.g. "Code") to
  1547. // unconditionally include in API requests. By default, fields with
  1548. // empty values are omitted from API requests. However, any non-pointer,
  1549. // non-interface field appearing in ForceSendFields will be sent to the
  1550. // server regardless of whether the field is empty or not. This may be
  1551. // used to include empty fields in Patch requests.
  1552. ForceSendFields []string `json:"-"`
  1553. // NullFields is a list of field names (e.g. "Code") to include in API
  1554. // requests with the JSON null value. By default, fields with empty
  1555. // values are omitted from API requests. However, any field with an
  1556. // empty value appearing in NullFields will be sent to the server as
  1557. // null. It is an error if a field in this list has a non-empty value.
  1558. // This may be used to include null fields in Patch requests.
  1559. NullFields []string `json:"-"`
  1560. }
  1561. func (s *AddressListWarning) MarshalJSON() ([]byte, error) {
  1562. type NoMethod AddressListWarning
  1563. raw := NoMethod(*s)
  1564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1565. }
  1566. type AddressListWarningData struct {
  1567. // Key: [Output Only] A key that provides more detail on the warning
  1568. // being returned. For example, for warnings where there are no results
  1569. // in a list request for a particular zone, this key might be scope and
  1570. // the key value might be the zone name. Other examples might be a key
  1571. // indicating a deprecated resource and a suggested replacement, or a
  1572. // warning about invalid network settings (for example, if an instance
  1573. // attempts to perform IP forwarding but is not enabled for IP
  1574. // forwarding).
  1575. Key string `json:"key,omitempty"`
  1576. // Value: [Output Only] A warning data value corresponding to the key.
  1577. Value string `json:"value,omitempty"`
  1578. // ForceSendFields is a list of field names (e.g. "Key") to
  1579. // unconditionally include in API requests. By default, fields with
  1580. // empty values are omitted from API requests. However, any non-pointer,
  1581. // non-interface field appearing in ForceSendFields will be sent to the
  1582. // server regardless of whether the field is empty or not. This may be
  1583. // used to include empty fields in Patch requests.
  1584. ForceSendFields []string `json:"-"`
  1585. // NullFields is a list of field names (e.g. "Key") to include in API
  1586. // requests with the JSON null value. By default, fields with empty
  1587. // values are omitted from API requests. However, any field with an
  1588. // empty value appearing in NullFields will be sent to the server as
  1589. // null. It is an error if a field in this list has a non-empty value.
  1590. // This may be used to include null fields in Patch requests.
  1591. NullFields []string `json:"-"`
  1592. }
  1593. func (s *AddressListWarningData) MarshalJSON() ([]byte, error) {
  1594. type NoMethod AddressListWarningData
  1595. raw := NoMethod(*s)
  1596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1597. }
  1598. type AddressesScopedList struct {
  1599. // Addresses: [Output Only] A list of addresses contained in this scope.
  1600. Addresses []*Address `json:"addresses,omitempty"`
  1601. // Warning: [Output Only] Informational warning which replaces the list
  1602. // of addresses when the list is empty.
  1603. Warning *AddressesScopedListWarning `json:"warning,omitempty"`
  1604. // ForceSendFields is a list of field names (e.g. "Addresses") to
  1605. // unconditionally include in API requests. By default, fields with
  1606. // empty values are omitted from API requests. However, any non-pointer,
  1607. // non-interface field appearing in ForceSendFields will be sent to the
  1608. // server regardless of whether the field is empty or not. This may be
  1609. // used to include empty fields in Patch requests.
  1610. ForceSendFields []string `json:"-"`
  1611. // NullFields is a list of field names (e.g. "Addresses") to include in
  1612. // API requests with the JSON null value. By default, fields with empty
  1613. // values are omitted from API requests. However, any field with an
  1614. // empty value appearing in NullFields will be sent to the server as
  1615. // null. It is an error if a field in this list has a non-empty value.
  1616. // This may be used to include null fields in Patch requests.
  1617. NullFields []string `json:"-"`
  1618. }
  1619. func (s *AddressesScopedList) MarshalJSON() ([]byte, error) {
  1620. type NoMethod AddressesScopedList
  1621. raw := NoMethod(*s)
  1622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1623. }
  1624. // AddressesScopedListWarning: [Output Only] Informational warning which
  1625. // replaces the list of addresses when the list is empty.
  1626. type AddressesScopedListWarning struct {
  1627. // Code: [Output Only] A warning code, if applicable. For example,
  1628. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1629. // the response.
  1630. //
  1631. // Possible values:
  1632. // "CLEANUP_FAILED"
  1633. // "DEPRECATED_RESOURCE_USED"
  1634. // "DEPRECATED_TYPE_USED"
  1635. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  1636. // "EXPERIMENTAL_TYPE_USED"
  1637. // "EXTERNAL_API_WARNING"
  1638. // "FIELD_VALUE_OVERRIDEN"
  1639. // "INJECTED_KERNELS_DEPRECATED"
  1640. // "MISSING_TYPE_DEPENDENCY"
  1641. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  1642. // "NEXT_HOP_CANNOT_IP_FORWARD"
  1643. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  1644. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  1645. // "NEXT_HOP_NOT_RUNNING"
  1646. // "NOT_CRITICAL_ERROR"
  1647. // "NO_RESULTS_ON_PAGE"
  1648. // "REQUIRED_TOS_AGREEMENT"
  1649. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  1650. // "RESOURCE_NOT_DELETED"
  1651. // "SCHEMA_VALIDATION_IGNORED"
  1652. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  1653. // "UNDECLARED_PROPERTIES"
  1654. // "UNREACHABLE"
  1655. Code string `json:"code,omitempty"`
  1656. // Data: [Output Only] Metadata about this warning in key: value format.
  1657. // For example:
  1658. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1659. Data []*AddressesScopedListWarningData `json:"data,omitempty"`
  1660. // Message: [Output Only] A human-readable description of the warning
  1661. // code.
  1662. Message string `json:"message,omitempty"`
  1663. // ForceSendFields is a list of field names (e.g. "Code") to
  1664. // unconditionally include in API requests. By default, fields with
  1665. // empty values are omitted from API requests. However, any non-pointer,
  1666. // non-interface field appearing in ForceSendFields will be sent to the
  1667. // server regardless of whether the field is empty or not. This may be
  1668. // used to include empty fields in Patch requests.
  1669. ForceSendFields []string `json:"-"`
  1670. // NullFields is a list of field names (e.g. "Code") to include in API
  1671. // requests with the JSON null value. By default, fields with empty
  1672. // values are omitted from API requests. However, any field with an
  1673. // empty value appearing in NullFields will be sent to the server as
  1674. // null. It is an error if a field in this list has a non-empty value.
  1675. // This may be used to include null fields in Patch requests.
  1676. NullFields []string `json:"-"`
  1677. }
  1678. func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) {
  1679. type NoMethod AddressesScopedListWarning
  1680. raw := NoMethod(*s)
  1681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1682. }
  1683. type AddressesScopedListWarningData struct {
  1684. // Key: [Output Only] A key that provides more detail on the warning
  1685. // being returned. For example, for warnings where there are no results
  1686. // in a list request for a particular zone, this key might be scope and
  1687. // the key value might be the zone name. Other examples might be a key
  1688. // indicating a deprecated resource and a suggested replacement, or a
  1689. // warning about invalid network settings (for example, if an instance
  1690. // attempts to perform IP forwarding but is not enabled for IP
  1691. // forwarding).
  1692. Key string `json:"key,omitempty"`
  1693. // Value: [Output Only] A warning data value corresponding to the key.
  1694. Value string `json:"value,omitempty"`
  1695. // ForceSendFields is a list of field names (e.g. "Key") to
  1696. // unconditionally include in API requests. By default, fields with
  1697. // empty values are omitted from API requests. However, any non-pointer,
  1698. // non-interface field appearing in ForceSendFields will be sent to the
  1699. // server regardless of whether the field is empty or not. This may be
  1700. // used to include empty fields in Patch requests.
  1701. ForceSendFields []string `json:"-"`
  1702. // NullFields is a list of field names (e.g. "Key") to include in API
  1703. // requests with the JSON null value. By default, fields with empty
  1704. // values are omitted from API requests. However, any field with an
  1705. // empty value appearing in NullFields will be sent to the server as
  1706. // null. It is an error if a field in this list has a non-empty value.
  1707. // This may be used to include null fields in Patch requests.
  1708. NullFields []string `json:"-"`
  1709. }
  1710. func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) {
  1711. type NoMethod AddressesScopedListWarningData
  1712. raw := NoMethod(*s)
  1713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1714. }
  1715. // AliasIpRange: An alias IP range attached to an instance's network
  1716. // interface.
  1717. type AliasIpRange struct {
  1718. // IpCidrRange: The IP CIDR range represented by this alias IP range.
  1719. // This IP CIDR range must belong to the specified subnetwork and cannot
  1720. // contain IP addresses reserved by system or used by other network
  1721. // interfaces. This range may be a single IP address (e.g. 10.2.3.4), a
  1722. // netmask (e.g. /24) or a CIDR format string (e.g. 10.1.2.0/24).
  1723. IpCidrRange string `json:"ipCidrRange,omitempty"`
  1724. // SubnetworkRangeName: Optional subnetwork secondary range name
  1725. // specifying the secondary range from which to allocate the IP CIDR
  1726. // range for this alias IP range. If left unspecified, the primary range
  1727. // of the subnetwork will be used.
  1728. SubnetworkRangeName string `json:"subnetworkRangeName,omitempty"`
  1729. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  1730. // unconditionally include in API requests. By default, fields with
  1731. // empty values are omitted from API requests. However, any non-pointer,
  1732. // non-interface field appearing in ForceSendFields will be sent to the
  1733. // server regardless of whether the field is empty or not. This may be
  1734. // used to include empty fields in Patch requests.
  1735. ForceSendFields []string `json:"-"`
  1736. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  1737. // in API requests with the JSON null value. By default, fields with
  1738. // empty values are omitted from API requests. However, any field with
  1739. // an empty value appearing in NullFields will be sent to the server as
  1740. // null. It is an error if a field in this list has a non-empty value.
  1741. // This may be used to include null fields in Patch requests.
  1742. NullFields []string `json:"-"`
  1743. }
  1744. func (s *AliasIpRange) MarshalJSON() ([]byte, error) {
  1745. type NoMethod AliasIpRange
  1746. raw := NoMethod(*s)
  1747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1748. }
  1749. // AttachedDisk: An instance-attached disk resource.
  1750. type AttachedDisk struct {
  1751. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  1752. // instance is deleted (but not when the disk is detached from the
  1753. // instance).
  1754. AutoDelete bool `json:"autoDelete,omitempty"`
  1755. // Boot: Indicates that this is a boot disk. The virtual machine will
  1756. // use the first partition of the disk for its root filesystem.
  1757. Boot bool `json:"boot,omitempty"`
  1758. // DeviceName: Specifies a unique device name of your choice that is
  1759. // reflected into the /dev/disk/by-id/google-* tree of a Linux operating
  1760. // system running within the instance. This name can be used to
  1761. // reference the device for mounting, resizing, and so on, from within
  1762. // the instance.
  1763. //
  1764. // If not specified, the server chooses a default device name to apply
  1765. // to this disk, in the form persistent-disk-x, where x is a number
  1766. // assigned by Google Compute Engine. This field is only applicable for
  1767. // persistent disks.
  1768. DeviceName string `json:"deviceName,omitempty"`
  1769. // DiskEncryptionKey: Encrypts or decrypts a disk using a
  1770. // customer-supplied encryption key.
  1771. //
  1772. // If you are creating a new disk, this field encrypts the new disk
  1773. // using an encryption key that you provide. If you are attaching an
  1774. // existing disk that is already encrypted, this field decrypts the disk
  1775. // using the customer-supplied encryption key.
  1776. //
  1777. // If you encrypt a disk using a customer-supplied key, you must provide
  1778. // the same key again when you attempt to use this resource at a later
  1779. // time. For example, you must provide the key when you create a
  1780. // snapshot or an image from the disk or when you attach the disk to a
  1781. // virtual machine instance.
  1782. //
  1783. // If you do not provide an encryption key, then the disk will be
  1784. // encrypted using an automatically generated key and you do not need to
  1785. // provide a key to use the disk later.
  1786. //
  1787. // Instance templates do not store customer-supplied encryption keys, so
  1788. // you cannot use your own keys to encrypt disks in a managed instance
  1789. // group.
  1790. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  1791. // GuestOsFeatures: A list of features to enable on the guest operating
  1792. // system. Applicable only for bootable images. Read Enabling guest
  1793. // operating system features to see a list of available options.
  1794. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  1795. // Index: [Output Only] A zero-based index to this disk, where 0 is
  1796. // reserved for the boot disk. If you have many disks attached to an
  1797. // instance, each disk would have a unique index number.
  1798. Index int64 `json:"index,omitempty"`
  1799. // InitializeParams: [Input Only] Specifies the parameters for a new
  1800. // 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. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"`
  1807. // Interface: Specifies the disk interface to use for attaching this
  1808. // disk, which is either SCSI or NVME. The default is SCSI. Persistent
  1809. // disks must always use SCSI and the request will fail if you attempt
  1810. // to attach a persistent disk in any other format than SCSI. Local SSDs
  1811. // can use either NVME or SCSI. For performance characteristics of SCSI
  1812. // over NVMe, see Local SSD performance.
  1813. //
  1814. // Possible values:
  1815. // "NVME"
  1816. // "SCSI"
  1817. Interface string `json:"interface,omitempty"`
  1818. // Kind: [Output Only] Type of the resource. Always compute#attachedDisk
  1819. // for attached disks.
  1820. Kind string `json:"kind,omitempty"`
  1821. // Licenses: [Output Only] Any valid publicly visible licenses.
  1822. Licenses []string `json:"licenses,omitempty"`
  1823. // Mode: The mode in which to attach this disk, either READ_WRITE or
  1824. // READ_ONLY. If not specified, the default is to attach the disk in
  1825. // READ_WRITE mode.
  1826. //
  1827. // Possible values:
  1828. // "READ_ONLY"
  1829. // "READ_WRITE"
  1830. Mode string `json:"mode,omitempty"`
  1831. // Source: Specifies a valid partial or full URL to an existing
  1832. // Persistent Disk resource. When creating a new instance, one of
  1833. // initializeParams.sourceImage or disks.source is required except for
  1834. // local SSD.
  1835. //
  1836. // If desired, you can also attach existing non-root persistent disks
  1837. // using this property. This field is only applicable for persistent
  1838. // disks.
  1839. //
  1840. // Note that for InstanceTemplate, specify the disk name, not the URL
  1841. // for the disk.
  1842. Source string `json:"source,omitempty"`
  1843. // Type: Specifies the type of the disk, either SCRATCH or PERSISTENT.
  1844. // If not specified, the default is PERSISTENT.
  1845. //
  1846. // Possible values:
  1847. // "PERSISTENT"
  1848. // "SCRATCH"
  1849. Type string `json:"type,omitempty"`
  1850. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  1851. // unconditionally include in API requests. By default, fields with
  1852. // empty values are omitted from API requests. However, any non-pointer,
  1853. // non-interface field appearing in ForceSendFields will be sent to the
  1854. // server regardless of whether the field is empty or not. This may be
  1855. // used to include empty fields in Patch requests.
  1856. ForceSendFields []string `json:"-"`
  1857. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  1858. // API requests with the JSON null value. By default, fields with empty
  1859. // values are omitted from API requests. However, any field with an
  1860. // empty value appearing in NullFields will be sent to the server as
  1861. // null. It is an error if a field in this list has a non-empty value.
  1862. // This may be used to include null fields in Patch requests.
  1863. NullFields []string `json:"-"`
  1864. }
  1865. func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
  1866. type NoMethod AttachedDisk
  1867. raw := NoMethod(*s)
  1868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1869. }
  1870. // AttachedDiskInitializeParams: [Input Only] Specifies the parameters
  1871. // for a new disk that will be created alongside the new instance. Use
  1872. // initialization parameters to create boot disks or local SSDs attached
  1873. // to the new instance.
  1874. //
  1875. // This property is mutually exclusive with the source property; you can
  1876. // only define one or the other, but not both.
  1877. type AttachedDiskInitializeParams struct {
  1878. // Description: An optional description. Provide this property when
  1879. // creating the disk.
  1880. Description string `json:"description,omitempty"`
  1881. // DiskName: Specifies the disk name. If not specified, the default is
  1882. // to use the name of the instance. If the disk with the instance name
  1883. // exists already in the given zone/region, a new name will be
  1884. // automatically generated.
  1885. DiskName string `json:"diskName,omitempty"`
  1886. // DiskSizeGb: Specifies the size of the disk in base-2 GB.
  1887. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  1888. // DiskType: Specifies the disk type to use to create the instance. If
  1889. // not specified, the default is pd-standard, specified using the full
  1890. // URL. For
  1891. // example:
  1892. // https://www.googleapis.com/compute/v1/projects/project/zones/
  1893. // zone/diskTypes/pd-standard
  1894. //
  1895. //
  1896. // Other values include pd-ssd and local-ssd. If you define this field,
  1897. // you can provide either the full or partial URL. For example, the
  1898. // following are valid values:
  1899. // -
  1900. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType
  1901. // - projects/project/zones/zone/diskTypes/diskType
  1902. // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this
  1903. // is the name of the disk type, not URL.
  1904. DiskType string `json:"diskType,omitempty"`
  1905. // Labels: Labels to apply to this disk. These can be later modified by
  1906. // the disks.setLabels method. This field is only applicable for
  1907. // persistent disks.
  1908. Labels map[string]string `json:"labels,omitempty"`
  1909. // SourceImage: The source image to create this disk. When creating a
  1910. // new instance, one of initializeParams.sourceImage or disks.source is
  1911. // required except for local SSD.
  1912. //
  1913. // To create a disk with one of the public operating system images,
  1914. // specify the image by its family name. For example, specify
  1915. // family/debian-9 to use the latest Debian 9
  1916. // image:
  1917. // projects/debian-cloud/global/images/family/debian-9
  1918. //
  1919. //
  1920. // Alternati
  1921. // vely, use a specific version of a public operating system
  1922. // image:
  1923. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  1924. //
  1925. //
  1926. //
  1927. // To create a disk with a custom image that you created, specify the
  1928. // image name in the following
  1929. // format:
  1930. // global/images/my-custom-image
  1931. //
  1932. //
  1933. // You can also specify a custom image by its image family, which
  1934. // returns the latest version of the image in that family. Replace the
  1935. // image name with
  1936. // family/family-name:
  1937. // global/images/family/my-image-family
  1938. //
  1939. //
  1940. // If the source image is deleted later, this field will not be set.
  1941. SourceImage string `json:"sourceImage,omitempty"`
  1942. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  1943. // source image. Required if the source image is protected by a
  1944. // customer-supplied encryption key.
  1945. //
  1946. // Instance templates do not store customer-supplied encryption keys, so
  1947. // you cannot create disks for instances in a managed instance group if
  1948. // the source images are encrypted with your own keys.
  1949. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  1950. // SourceSnapshot: The source snapshot to create this disk. When
  1951. // creating a new instance, one of initializeParams.sourceSnapshot or
  1952. // disks.source is required except for local SSD.
  1953. //
  1954. // To create a disk with a snapshot that you created, specify the
  1955. // snapshot name in the following
  1956. // format:
  1957. // global/snapshots/my-backup
  1958. //
  1959. //
  1960. // If the source snapshot is deleted later, this field will not be set.
  1961. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  1962. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  1963. // the source snapshot.
  1964. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  1965. // ForceSendFields is a list of field names (e.g. "Description") to
  1966. // unconditionally include in API requests. By default, fields with
  1967. // empty values are omitted from API requests. However, any non-pointer,
  1968. // non-interface field appearing in ForceSendFields will be sent to the
  1969. // server regardless of whether the field is empty or not. This may be
  1970. // used to include empty fields in Patch requests.
  1971. ForceSendFields []string `json:"-"`
  1972. // NullFields is a list of field names (e.g. "Description") to include
  1973. // in API requests with the JSON null value. By default, fields with
  1974. // empty values are omitted from API requests. However, any field with
  1975. // an empty value appearing in NullFields will be sent to the server as
  1976. // null. It is an error if a field in this list has a non-empty value.
  1977. // This may be used to include null fields in Patch requests.
  1978. NullFields []string `json:"-"`
  1979. }
  1980. func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) {
  1981. type NoMethod AttachedDiskInitializeParams
  1982. raw := NoMethod(*s)
  1983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1984. }
  1985. // AuditConfig: Specifies the audit configuration for a service. The
  1986. // configuration determines which permission types are logged, and what
  1987. // identities, if any, are exempted from logging. An AuditConfig must
  1988. // have one or more AuditLogConfigs.
  1989. //
  1990. // If there are AuditConfigs for both `allServices` and a specific
  1991. // service, the union of the two AuditConfigs is used for that service:
  1992. // the log_types specified in each AuditConfig are enabled, and the
  1993. // exempted_members in each AuditLogConfig are exempted.
  1994. //
  1995. // Example Policy with multiple AuditConfigs:
  1996. //
  1997. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  1998. // [ { "log_type": "DATA_READ", "exempted_members": [
  1999. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  2000. // "log_type": "ADMIN_READ", } ] }, { "service":
  2001. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  2002. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  2003. // "user:bar@gmail.com" ] } ] } ] }
  2004. //
  2005. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2006. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  2007. // logging, and bar@gmail.com from DATA_WRITE logging.
  2008. type AuditConfig struct {
  2009. // AuditLogConfigs: The configuration for logging of each type of
  2010. // permission.
  2011. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2012. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2013. // Service: Specifies a service that will be enabled for audit logging.
  2014. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  2015. // `allServices` is a special value that covers all services.
  2016. Service string `json:"service,omitempty"`
  2017. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2018. // unconditionally include in API requests. By default, fields with
  2019. // empty values are omitted from API requests. However, any non-pointer,
  2020. // non-interface field appearing in ForceSendFields will be sent to the
  2021. // server regardless of whether the field is empty or not. This may be
  2022. // used to include empty fields in Patch requests.
  2023. ForceSendFields []string `json:"-"`
  2024. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2025. // include in API requests with the JSON null value. By default, fields
  2026. // with empty values are omitted from API requests. However, any field
  2027. // with an empty value appearing in NullFields will be sent to the
  2028. // server as null. It is an error if a field in this list has a
  2029. // non-empty value. This may be used to include null fields in Patch
  2030. // requests.
  2031. NullFields []string `json:"-"`
  2032. }
  2033. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  2034. type NoMethod AuditConfig
  2035. raw := NoMethod(*s)
  2036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2037. }
  2038. // AuditLogConfig: Provides the configuration for logging a type of
  2039. // permissions. Example:
  2040. //
  2041. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  2042. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  2043. // "DATA_WRITE", } ] }
  2044. //
  2045. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  2046. // foo@gmail.com from DATA_READ logging.
  2047. type AuditLogConfig struct {
  2048. // ExemptedMembers: Specifies the identities that do not cause logging
  2049. // for this type of permission. Follows the same format of
  2050. // [Binding.members][].
  2051. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2052. // LogType: The log type that this config enables.
  2053. //
  2054. // Possible values:
  2055. // "ADMIN_READ"
  2056. // "DATA_READ"
  2057. // "DATA_WRITE"
  2058. // "LOG_TYPE_UNSPECIFIED"
  2059. LogType string `json:"logType,omitempty"`
  2060. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2061. // unconditionally include in API requests. By default, fields with
  2062. // empty values are omitted from API requests. However, any non-pointer,
  2063. // non-interface field appearing in ForceSendFields will be sent to the
  2064. // server regardless of whether the field is empty or not. This may be
  2065. // used to include empty fields in Patch requests.
  2066. ForceSendFields []string `json:"-"`
  2067. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2068. // include in API requests with the JSON null value. By default, fields
  2069. // with empty values are omitted from API requests. However, any field
  2070. // with an empty value appearing in NullFields will be sent to the
  2071. // server as null. It is an error if a field in this list has a
  2072. // non-empty value. This may be used to include null fields in Patch
  2073. // requests.
  2074. NullFields []string `json:"-"`
  2075. }
  2076. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  2077. type NoMethod AuditLogConfig
  2078. raw := NoMethod(*s)
  2079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2080. }
  2081. // AuthorizationLoggingOptions: Authorization-related information used
  2082. // by Cloud Audit Logging.
  2083. type AuthorizationLoggingOptions struct {
  2084. // PermissionType: The type of the permission that was checked.
  2085. //
  2086. // Possible values:
  2087. // "ADMIN_READ"
  2088. // "ADMIN_WRITE"
  2089. // "DATA_READ"
  2090. // "DATA_WRITE"
  2091. // "PERMISSION_TYPE_UNSPECIFIED"
  2092. PermissionType string `json:"permissionType,omitempty"`
  2093. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  2094. // unconditionally include in API requests. By default, fields with
  2095. // empty values are omitted from API requests. However, any non-pointer,
  2096. // non-interface field appearing in ForceSendFields will be sent to the
  2097. // server regardless of whether the field is empty or not. This may be
  2098. // used to include empty fields in Patch requests.
  2099. ForceSendFields []string `json:"-"`
  2100. // NullFields is a list of field names (e.g. "PermissionType") to
  2101. // include in API requests with the JSON null value. By default, fields
  2102. // with empty values are omitted from API requests. However, any field
  2103. // with an empty value appearing in NullFields will be sent to the
  2104. // server as null. It is an error if a field in this list has a
  2105. // non-empty value. This may be used to include null fields in Patch
  2106. // requests.
  2107. NullFields []string `json:"-"`
  2108. }
  2109. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  2110. type NoMethod AuthorizationLoggingOptions
  2111. raw := NoMethod(*s)
  2112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2113. }
  2114. // Autoscaler: Represents an Autoscaler resource. Autoscalers allow you
  2115. // to automatically scale virtual machine instances in managed instance
  2116. // groups according to an autoscaling policy that you define. For more
  2117. // information, read Autoscaling Groups of Instances. (== resource_for
  2118. // beta.autoscalers ==) (== resource_for v1.autoscalers ==) (==
  2119. // resource_for beta.regionAutoscalers ==) (== resource_for
  2120. // v1.regionAutoscalers ==)
  2121. type Autoscaler struct {
  2122. // AutoscalingPolicy: The configuration parameters for the autoscaling
  2123. // algorithm. You can define one or more of the policies for an
  2124. // autoscaler: cpuUtilization, customMetricUtilizations, and
  2125. // loadBalancingUtilization.
  2126. //
  2127. // If none of these are specified, the default will be to autoscale
  2128. // based on cpuUtilization to 0.6 or 60%.
  2129. AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"`
  2130. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2131. // format.
  2132. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2133. // Description: An optional description of this resource. Provide this
  2134. // property when you create the resource.
  2135. Description string `json:"description,omitempty"`
  2136. // Id: [Output Only] The unique identifier for the resource. This
  2137. // identifier is defined by the server.
  2138. Id uint64 `json:"id,omitempty,string"`
  2139. // Kind: [Output Only] Type of the resource. Always compute#autoscaler
  2140. // for autoscalers.
  2141. Kind string `json:"kind,omitempty"`
  2142. // Name: Name of the resource. Provided by the client when the resource
  2143. // is created. The name must be 1-63 characters long, and comply with
  2144. // RFC1035. Specifically, the name must be 1-63 characters long and
  2145. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2146. // the first character must be a lowercase letter, and all following
  2147. // characters must be a dash, lowercase letter, or digit, except the
  2148. // last character, which cannot be a dash.
  2149. Name string `json:"name,omitempty"`
  2150. // Region: [Output Only] URL of the region where the instance group
  2151. // resides (for autoscalers living in regional scope).
  2152. Region string `json:"region,omitempty"`
  2153. // SelfLink: [Output Only] Server-defined URL for the resource.
  2154. SelfLink string `json:"selfLink,omitempty"`
  2155. // Status: [Output Only] The status of the autoscaler configuration.
  2156. //
  2157. // Possible values:
  2158. // "ACTIVE"
  2159. // "DELETING"
  2160. // "ERROR"
  2161. // "PENDING"
  2162. Status string `json:"status,omitempty"`
  2163. // StatusDetails: [Output Only] Human-readable details about the current
  2164. // state of the autoscaler. Read the documentation for Commonly returned
  2165. // status messages for examples of status messages you might encounter.
  2166. StatusDetails []*AutoscalerStatusDetails `json:"statusDetails,omitempty"`
  2167. // Target: URL of the managed instance group that this autoscaler will
  2168. // scale.
  2169. Target string `json:"target,omitempty"`
  2170. // Zone: [Output Only] URL of the zone where the instance group resides
  2171. // (for autoscalers living in zonal scope).
  2172. Zone string `json:"zone,omitempty"`
  2173. // ServerResponse contains the HTTP response code and headers from the
  2174. // server.
  2175. googleapi.ServerResponse `json:"-"`
  2176. // ForceSendFields is a list of field names (e.g. "AutoscalingPolicy")
  2177. // to unconditionally include in API requests. By default, fields with
  2178. // empty values are omitted from API requests. However, any non-pointer,
  2179. // non-interface field appearing in ForceSendFields will be sent to the
  2180. // server regardless of whether the field is empty or not. This may be
  2181. // used to include empty fields in Patch requests.
  2182. ForceSendFields []string `json:"-"`
  2183. // NullFields is a list of field names (e.g. "AutoscalingPolicy") to
  2184. // include in API requests with the JSON null value. By default, fields
  2185. // with empty values are omitted from API requests. However, any field
  2186. // with an empty value appearing in NullFields will be sent to the
  2187. // server as null. It is an error if a field in this list has a
  2188. // non-empty value. This may be used to include null fields in Patch
  2189. // requests.
  2190. NullFields []string `json:"-"`
  2191. }
  2192. func (s *Autoscaler) MarshalJSON() ([]byte, error) {
  2193. type NoMethod Autoscaler
  2194. raw := NoMethod(*s)
  2195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2196. }
  2197. type AutoscalerAggregatedList struct {
  2198. // Id: [Output Only] Unique identifier for the resource; defined by the
  2199. // server.
  2200. Id string `json:"id,omitempty"`
  2201. // Items: A list of AutoscalersScopedList resources.
  2202. Items map[string]AutoscalersScopedList `json:"items,omitempty"`
  2203. // Kind: [Output Only] Type of resource. Always
  2204. // compute#autoscalerAggregatedList for aggregated lists of autoscalers.
  2205. Kind string `json:"kind,omitempty"`
  2206. // NextPageToken: [Output Only] This token allows you to get the next
  2207. // page of results for list requests. If the number of results is larger
  2208. // than maxResults, use the nextPageToken as a value for the query
  2209. // parameter pageToken in the next list request. Subsequent list
  2210. // requests will have their own nextPageToken to continue paging through
  2211. // the results.
  2212. NextPageToken string `json:"nextPageToken,omitempty"`
  2213. // SelfLink: [Output Only] Server-defined URL for this resource.
  2214. SelfLink string `json:"selfLink,omitempty"`
  2215. // Warning: [Output Only] Informational warning message.
  2216. Warning *AutoscalerAggregatedListWarning `json:"warning,omitempty"`
  2217. // ServerResponse contains the HTTP response code and headers from the
  2218. // server.
  2219. googleapi.ServerResponse `json:"-"`
  2220. // ForceSendFields is a list of field names (e.g. "Id") to
  2221. // unconditionally include in API requests. By default, fields with
  2222. // empty values are omitted from API requests. However, any non-pointer,
  2223. // non-interface field appearing in ForceSendFields will be sent to the
  2224. // server regardless of whether the field is empty or not. This may be
  2225. // used to include empty fields in Patch requests.
  2226. ForceSendFields []string `json:"-"`
  2227. // NullFields is a list of field names (e.g. "Id") to include in API
  2228. // requests with the JSON null value. By default, fields with empty
  2229. // values are omitted from API requests. However, any field with an
  2230. // empty value appearing in NullFields will be sent to the server as
  2231. // null. It is an error if a field in this list has a non-empty value.
  2232. // This may be used to include null fields in Patch requests.
  2233. NullFields []string `json:"-"`
  2234. }
  2235. func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) {
  2236. type NoMethod AutoscalerAggregatedList
  2237. raw := NoMethod(*s)
  2238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2239. }
  2240. // AutoscalerAggregatedListWarning: [Output Only] Informational warning
  2241. // message.
  2242. type AutoscalerAggregatedListWarning struct {
  2243. // Code: [Output Only] A warning code, if applicable. For example,
  2244. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2245. // the response.
  2246. //
  2247. // Possible values:
  2248. // "CLEANUP_FAILED"
  2249. // "DEPRECATED_RESOURCE_USED"
  2250. // "DEPRECATED_TYPE_USED"
  2251. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2252. // "EXPERIMENTAL_TYPE_USED"
  2253. // "EXTERNAL_API_WARNING"
  2254. // "FIELD_VALUE_OVERRIDEN"
  2255. // "INJECTED_KERNELS_DEPRECATED"
  2256. // "MISSING_TYPE_DEPENDENCY"
  2257. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2258. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2259. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2260. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2261. // "NEXT_HOP_NOT_RUNNING"
  2262. // "NOT_CRITICAL_ERROR"
  2263. // "NO_RESULTS_ON_PAGE"
  2264. // "REQUIRED_TOS_AGREEMENT"
  2265. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2266. // "RESOURCE_NOT_DELETED"
  2267. // "SCHEMA_VALIDATION_IGNORED"
  2268. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2269. // "UNDECLARED_PROPERTIES"
  2270. // "UNREACHABLE"
  2271. Code string `json:"code,omitempty"`
  2272. // Data: [Output Only] Metadata about this warning in key: value format.
  2273. // For example:
  2274. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2275. Data []*AutoscalerAggregatedListWarningData `json:"data,omitempty"`
  2276. // Message: [Output Only] A human-readable description of the warning
  2277. // code.
  2278. Message string `json:"message,omitempty"`
  2279. // ForceSendFields is a list of field names (e.g. "Code") to
  2280. // unconditionally include in API requests. By default, fields with
  2281. // empty values are omitted from API requests. However, any non-pointer,
  2282. // non-interface field appearing in ForceSendFields will be sent to the
  2283. // server regardless of whether the field is empty or not. This may be
  2284. // used to include empty fields in Patch requests.
  2285. ForceSendFields []string `json:"-"`
  2286. // NullFields is a list of field names (e.g. "Code") to include in API
  2287. // requests with the JSON null value. By default, fields with empty
  2288. // values are omitted from API requests. However, any field with an
  2289. // empty value appearing in NullFields will be sent to the server as
  2290. // null. It is an error if a field in this list has a non-empty value.
  2291. // This may be used to include null fields in Patch requests.
  2292. NullFields []string `json:"-"`
  2293. }
  2294. func (s *AutoscalerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  2295. type NoMethod AutoscalerAggregatedListWarning
  2296. raw := NoMethod(*s)
  2297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2298. }
  2299. type AutoscalerAggregatedListWarningData struct {
  2300. // Key: [Output Only] A key that provides more detail on the warning
  2301. // being returned. For example, for warnings where there are no results
  2302. // in a list request for a particular zone, this key might be scope and
  2303. // the key value might be the zone name. Other examples might be a key
  2304. // indicating a deprecated resource and a suggested replacement, or a
  2305. // warning about invalid network settings (for example, if an instance
  2306. // attempts to perform IP forwarding but is not enabled for IP
  2307. // forwarding).
  2308. Key string `json:"key,omitempty"`
  2309. // Value: [Output Only] A warning data value corresponding to the key.
  2310. Value string `json:"value,omitempty"`
  2311. // ForceSendFields is a list of field names (e.g. "Key") to
  2312. // unconditionally include in API requests. By default, fields with
  2313. // empty values are omitted from API requests. However, any non-pointer,
  2314. // non-interface field appearing in ForceSendFields will be sent to the
  2315. // server regardless of whether the field is empty or not. This may be
  2316. // used to include empty fields in Patch requests.
  2317. ForceSendFields []string `json:"-"`
  2318. // NullFields is a list of field names (e.g. "Key") to include in API
  2319. // requests with the JSON null value. By default, fields with empty
  2320. // values are omitted from API requests. However, any field with an
  2321. // empty value appearing in NullFields will be sent to the server as
  2322. // null. It is an error if a field in this list has a non-empty value.
  2323. // This may be used to include null fields in Patch requests.
  2324. NullFields []string `json:"-"`
  2325. }
  2326. func (s *AutoscalerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  2327. type NoMethod AutoscalerAggregatedListWarningData
  2328. raw := NoMethod(*s)
  2329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2330. }
  2331. // AutoscalerList: Contains a list of Autoscaler resources.
  2332. type AutoscalerList struct {
  2333. // Id: [Output Only] Unique identifier for the resource; defined by the
  2334. // server.
  2335. Id string `json:"id,omitempty"`
  2336. // Items: A list of Autoscaler resources.
  2337. Items []*Autoscaler `json:"items,omitempty"`
  2338. // Kind: [Output Only] Type of resource. Always compute#autoscalerList
  2339. // for lists of autoscalers.
  2340. Kind string `json:"kind,omitempty"`
  2341. // NextPageToken: [Output Only] This token allows you to get the next
  2342. // page of results for list requests. If the number of results is larger
  2343. // than maxResults, use the nextPageToken as a value for the query
  2344. // parameter pageToken in the next list request. Subsequent list
  2345. // requests will have their own nextPageToken to continue paging through
  2346. // the results.
  2347. NextPageToken string `json:"nextPageToken,omitempty"`
  2348. // SelfLink: [Output Only] Server-defined URL for this resource.
  2349. SelfLink string `json:"selfLink,omitempty"`
  2350. // Warning: [Output Only] Informational warning message.
  2351. Warning *AutoscalerListWarning `json:"warning,omitempty"`
  2352. // ServerResponse contains the HTTP response code and headers from the
  2353. // server.
  2354. googleapi.ServerResponse `json:"-"`
  2355. // ForceSendFields is a list of field names (e.g. "Id") to
  2356. // unconditionally include in API requests. By default, fields with
  2357. // empty values are omitted from API requests. However, any non-pointer,
  2358. // non-interface field appearing in ForceSendFields will be sent to the
  2359. // server regardless of whether the field is empty or not. This may be
  2360. // used to include empty fields in Patch requests.
  2361. ForceSendFields []string `json:"-"`
  2362. // NullFields is a list of field names (e.g. "Id") to include in API
  2363. // requests with the JSON null value. By default, fields with empty
  2364. // values are omitted from API requests. However, any field with an
  2365. // empty value appearing in NullFields will be sent to the server as
  2366. // null. It is an error if a field in this list has a non-empty value.
  2367. // This may be used to include null fields in Patch requests.
  2368. NullFields []string `json:"-"`
  2369. }
  2370. func (s *AutoscalerList) MarshalJSON() ([]byte, error) {
  2371. type NoMethod AutoscalerList
  2372. raw := NoMethod(*s)
  2373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2374. }
  2375. // AutoscalerListWarning: [Output Only] Informational warning message.
  2376. type AutoscalerListWarning struct {
  2377. // Code: [Output Only] A warning code, if applicable. For example,
  2378. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2379. // the response.
  2380. //
  2381. // Possible values:
  2382. // "CLEANUP_FAILED"
  2383. // "DEPRECATED_RESOURCE_USED"
  2384. // "DEPRECATED_TYPE_USED"
  2385. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2386. // "EXPERIMENTAL_TYPE_USED"
  2387. // "EXTERNAL_API_WARNING"
  2388. // "FIELD_VALUE_OVERRIDEN"
  2389. // "INJECTED_KERNELS_DEPRECATED"
  2390. // "MISSING_TYPE_DEPENDENCY"
  2391. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2392. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2393. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2394. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2395. // "NEXT_HOP_NOT_RUNNING"
  2396. // "NOT_CRITICAL_ERROR"
  2397. // "NO_RESULTS_ON_PAGE"
  2398. // "REQUIRED_TOS_AGREEMENT"
  2399. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2400. // "RESOURCE_NOT_DELETED"
  2401. // "SCHEMA_VALIDATION_IGNORED"
  2402. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2403. // "UNDECLARED_PROPERTIES"
  2404. // "UNREACHABLE"
  2405. Code string `json:"code,omitempty"`
  2406. // Data: [Output Only] Metadata about this warning in key: value format.
  2407. // For example:
  2408. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2409. Data []*AutoscalerListWarningData `json:"data,omitempty"`
  2410. // Message: [Output Only] A human-readable description of the warning
  2411. // code.
  2412. Message string `json:"message,omitempty"`
  2413. // ForceSendFields is a list of field names (e.g. "Code") to
  2414. // unconditionally include in API requests. By default, fields with
  2415. // empty values are omitted from API requests. However, any non-pointer,
  2416. // non-interface field appearing in ForceSendFields will be sent to the
  2417. // server regardless of whether the field is empty or not. This may be
  2418. // used to include empty fields in Patch requests.
  2419. ForceSendFields []string `json:"-"`
  2420. // NullFields is a list of field names (e.g. "Code") to include in API
  2421. // requests with the JSON null value. By default, fields with empty
  2422. // values are omitted from API requests. However, any field with an
  2423. // empty value appearing in NullFields will be sent to the server as
  2424. // null. It is an error if a field in this list has a non-empty value.
  2425. // This may be used to include null fields in Patch requests.
  2426. NullFields []string `json:"-"`
  2427. }
  2428. func (s *AutoscalerListWarning) MarshalJSON() ([]byte, error) {
  2429. type NoMethod AutoscalerListWarning
  2430. raw := NoMethod(*s)
  2431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2432. }
  2433. type AutoscalerListWarningData struct {
  2434. // Key: [Output Only] A key that provides more detail on the warning
  2435. // being returned. For example, for warnings where there are no results
  2436. // in a list request for a particular zone, this key might be scope and
  2437. // the key value might be the zone name. Other examples might be a key
  2438. // indicating a deprecated resource and a suggested replacement, or a
  2439. // warning about invalid network settings (for example, if an instance
  2440. // attempts to perform IP forwarding but is not enabled for IP
  2441. // forwarding).
  2442. Key string `json:"key,omitempty"`
  2443. // Value: [Output Only] A warning data value corresponding to the key.
  2444. Value string `json:"value,omitempty"`
  2445. // ForceSendFields is a list of field names (e.g. "Key") to
  2446. // unconditionally include in API requests. By default, fields with
  2447. // empty values are omitted from API requests. However, any non-pointer,
  2448. // non-interface field appearing in ForceSendFields will be sent to the
  2449. // server regardless of whether the field is empty or not. This may be
  2450. // used to include empty fields in Patch requests.
  2451. ForceSendFields []string `json:"-"`
  2452. // NullFields is a list of field names (e.g. "Key") to include in API
  2453. // requests with the JSON null value. By default, fields with empty
  2454. // values are omitted from API requests. However, any field with an
  2455. // empty value appearing in NullFields will be sent to the server as
  2456. // null. It is an error if a field in this list has a non-empty value.
  2457. // This may be used to include null fields in Patch requests.
  2458. NullFields []string `json:"-"`
  2459. }
  2460. func (s *AutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  2461. type NoMethod AutoscalerListWarningData
  2462. raw := NoMethod(*s)
  2463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2464. }
  2465. type AutoscalerStatusDetails struct {
  2466. // Message: The status message.
  2467. Message string `json:"message,omitempty"`
  2468. // Type: The type of error returned.
  2469. //
  2470. // Possible values:
  2471. // "ALL_INSTANCES_UNHEALTHY"
  2472. // "BACKEND_SERVICE_DOES_NOT_EXIST"
  2473. // "CAPPED_AT_MAX_NUM_REPLICAS"
  2474. // "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"
  2475. // "CUSTOM_METRIC_INVALID"
  2476. // "MIN_EQUALS_MAX"
  2477. // "MISSING_CUSTOM_METRIC_DATA_POINTS"
  2478. // "MISSING_LOAD_BALANCING_DATA_POINTS"
  2479. // "MORE_THAN_ONE_BACKEND_SERVICE"
  2480. // "NOT_ENOUGH_QUOTA_AVAILABLE"
  2481. // "REGION_RESOURCE_STOCKOUT"
  2482. // "SCALING_TARGET_DOES_NOT_EXIST"
  2483. // "UNKNOWN"
  2484. // "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"
  2485. // "ZONE_RESOURCE_STOCKOUT"
  2486. Type string `json:"type,omitempty"`
  2487. // ForceSendFields is a list of field names (e.g. "Message") 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. "Message") to include in
  2495. // API 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 *AutoscalerStatusDetails) MarshalJSON() ([]byte, error) {
  2503. type NoMethod AutoscalerStatusDetails
  2504. raw := NoMethod(*s)
  2505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2506. }
  2507. type AutoscalersScopedList struct {
  2508. // Autoscalers: [Output Only] A list of autoscalers contained in this
  2509. // scope.
  2510. Autoscalers []*Autoscaler `json:"autoscalers,omitempty"`
  2511. // Warning: [Output Only] Informational warning which replaces the list
  2512. // of autoscalers when the list is empty.
  2513. Warning *AutoscalersScopedListWarning `json:"warning,omitempty"`
  2514. // ForceSendFields is a list of field names (e.g. "Autoscalers") to
  2515. // unconditionally include in API requests. By default, fields with
  2516. // empty values are omitted from API requests. However, any non-pointer,
  2517. // non-interface field appearing in ForceSendFields will be sent to the
  2518. // server regardless of whether the field is empty or not. This may be
  2519. // used to include empty fields in Patch requests.
  2520. ForceSendFields []string `json:"-"`
  2521. // NullFields is a list of field names (e.g. "Autoscalers") to include
  2522. // in API requests with the JSON null value. By default, fields with
  2523. // empty values are omitted from API requests. However, any field with
  2524. // an empty value appearing in NullFields will be sent to the server as
  2525. // null. It is an error if a field in this list has a non-empty value.
  2526. // This may be used to include null fields in Patch requests.
  2527. NullFields []string `json:"-"`
  2528. }
  2529. func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) {
  2530. type NoMethod AutoscalersScopedList
  2531. raw := NoMethod(*s)
  2532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2533. }
  2534. // AutoscalersScopedListWarning: [Output Only] Informational warning
  2535. // which replaces the list of autoscalers when the list is empty.
  2536. type AutoscalersScopedListWarning struct {
  2537. // Code: [Output Only] A warning code, if applicable. For example,
  2538. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2539. // the response.
  2540. //
  2541. // Possible values:
  2542. // "CLEANUP_FAILED"
  2543. // "DEPRECATED_RESOURCE_USED"
  2544. // "DEPRECATED_TYPE_USED"
  2545. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  2546. // "EXPERIMENTAL_TYPE_USED"
  2547. // "EXTERNAL_API_WARNING"
  2548. // "FIELD_VALUE_OVERRIDEN"
  2549. // "INJECTED_KERNELS_DEPRECATED"
  2550. // "MISSING_TYPE_DEPENDENCY"
  2551. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  2552. // "NEXT_HOP_CANNOT_IP_FORWARD"
  2553. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  2554. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  2555. // "NEXT_HOP_NOT_RUNNING"
  2556. // "NOT_CRITICAL_ERROR"
  2557. // "NO_RESULTS_ON_PAGE"
  2558. // "REQUIRED_TOS_AGREEMENT"
  2559. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  2560. // "RESOURCE_NOT_DELETED"
  2561. // "SCHEMA_VALIDATION_IGNORED"
  2562. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  2563. // "UNDECLARED_PROPERTIES"
  2564. // "UNREACHABLE"
  2565. Code string `json:"code,omitempty"`
  2566. // Data: [Output Only] Metadata about this warning in key: value format.
  2567. // For example:
  2568. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2569. Data []*AutoscalersScopedListWarningData `json:"data,omitempty"`
  2570. // Message: [Output Only] A human-readable description of the warning
  2571. // code.
  2572. Message string `json:"message,omitempty"`
  2573. // ForceSendFields is a list of field names (e.g. "Code") to
  2574. // 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. "Code") to include in API
  2581. // requests with the JSON null value. By default, fields with empty
  2582. // values are omitted from API requests. However, any field with an
  2583. // empty value appearing in NullFields will be sent to the server as
  2584. // null. It is an error if a field in this list has a non-empty value.
  2585. // This may be used to include null fields in Patch requests.
  2586. NullFields []string `json:"-"`
  2587. }
  2588. func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) {
  2589. type NoMethod AutoscalersScopedListWarning
  2590. raw := NoMethod(*s)
  2591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2592. }
  2593. type AutoscalersScopedListWarningData struct {
  2594. // Key: [Output Only] A key that provides more detail on the warning
  2595. // being returned. For example, for warnings where there are no results
  2596. // in a list request for a particular zone, this key might be scope and
  2597. // the key value might be the zone name. Other examples might be a key
  2598. // indicating a deprecated resource and a suggested replacement, or a
  2599. // warning about invalid network settings (for example, if an instance
  2600. // attempts to perform IP forwarding but is not enabled for IP
  2601. // forwarding).
  2602. Key string `json:"key,omitempty"`
  2603. // Value: [Output Only] A warning data value corresponding to the key.
  2604. Value string `json:"value,omitempty"`
  2605. // ForceSendFields is a list of field names (e.g. "Key") to
  2606. // unconditionally include in API requests. By default, fields with
  2607. // empty values are omitted from API requests. However, any non-pointer,
  2608. // non-interface field appearing in ForceSendFields will be sent to the
  2609. // server regardless of whether the field is empty or not. This may be
  2610. // used to include empty fields in Patch requests.
  2611. ForceSendFields []string `json:"-"`
  2612. // NullFields is a list of field names (e.g. "Key") to include in API
  2613. // requests with the JSON null value. By default, fields with empty
  2614. // values are omitted from API requests. However, any field with an
  2615. // empty value appearing in NullFields will be sent to the server as
  2616. // null. It is an error if a field in this list has a non-empty value.
  2617. // This may be used to include null fields in Patch requests.
  2618. NullFields []string `json:"-"`
  2619. }
  2620. func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) {
  2621. type NoMethod AutoscalersScopedListWarningData
  2622. raw := NoMethod(*s)
  2623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2624. }
  2625. // AutoscalingPolicy: Cloud Autoscaler policy.
  2626. type AutoscalingPolicy struct {
  2627. // CoolDownPeriodSec: The number of seconds that the autoscaler should
  2628. // wait before it starts collecting information from a new instance.
  2629. // This prevents the autoscaler from collecting information when the
  2630. // instance is initializing, during which the collected usage would not
  2631. // be reliable. The default time autoscaler waits is 60
  2632. // seconds.
  2633. //
  2634. // Virtual machine initialization times might vary because of numerous
  2635. // factors. We recommend that you test how long an instance may take to
  2636. // initialize. To do this, create an instance and time the startup
  2637. // process.
  2638. CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"`
  2639. // CpuUtilization: Defines the CPU utilization policy that allows the
  2640. // autoscaler to scale based on the average CPU utilization of a managed
  2641. // instance group.
  2642. CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"`
  2643. // CustomMetricUtilizations: Configuration parameters of autoscaling
  2644. // based on a custom metric.
  2645. CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"`
  2646. // LoadBalancingUtilization: Configuration parameters of autoscaling
  2647. // based on load balancer.
  2648. LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"`
  2649. // MaxNumReplicas: The maximum number of instances that the autoscaler
  2650. // can scale up to. This is required when creating or updating an
  2651. // autoscaler. The maximum number of replicas should not be lower than
  2652. // minimal number of replicas.
  2653. MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"`
  2654. // MinNumReplicas: The minimum number of replicas that the autoscaler
  2655. // can scale down to. This cannot be less than 0. If not provided,
  2656. // autoscaler will choose a default value depending on maximum number of
  2657. // instances allowed.
  2658. MinNumReplicas int64 `json:"minNumReplicas,omitempty"`
  2659. // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec")
  2660. // to unconditionally include in API requests. By default, fields with
  2661. // empty values are omitted from API requests. However, any non-pointer,
  2662. // non-interface field appearing in ForceSendFields will be sent to the
  2663. // server regardless of whether the field is empty or not. This may be
  2664. // used to include empty fields in Patch requests.
  2665. ForceSendFields []string `json:"-"`
  2666. // NullFields is a list of field names (e.g. "CoolDownPeriodSec") to
  2667. // include in API requests with the JSON null value. By default, fields
  2668. // with empty values are omitted from API requests. However, any field
  2669. // with an empty value appearing in NullFields will be sent to the
  2670. // server as null. It is an error if a field in this list has a
  2671. // non-empty value. This may be used to include null fields in Patch
  2672. // requests.
  2673. NullFields []string `json:"-"`
  2674. }
  2675. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  2676. type NoMethod AutoscalingPolicy
  2677. raw := NoMethod(*s)
  2678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2679. }
  2680. // AutoscalingPolicyCpuUtilization: CPU utilization policy.
  2681. type AutoscalingPolicyCpuUtilization struct {
  2682. // UtilizationTarget: The target CPU utilization that the autoscaler
  2683. // should maintain. Must be a float value in the range (0, 1]. If not
  2684. // specified, the default is 0.6.
  2685. //
  2686. // If the CPU level is below the target utilization, the autoscaler
  2687. // scales down the number of instances until it reaches the minimum
  2688. // number of instances you specified or until the average CPU of your
  2689. // instances reaches the target utilization.
  2690. //
  2691. // If the average CPU is above the target utilization, the autoscaler
  2692. // scales up until it reaches the maximum number of instances you
  2693. // specified or until the average utilization reaches the target
  2694. // utilization.
  2695. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2696. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2697. // to unconditionally include in API requests. By default, fields with
  2698. // empty values are omitted from API requests. However, any non-pointer,
  2699. // non-interface field appearing in ForceSendFields will be sent to the
  2700. // server regardless of whether the field is empty or not. This may be
  2701. // used to include empty fields in Patch requests.
  2702. ForceSendFields []string `json:"-"`
  2703. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2704. // include in API requests with the JSON null value. By default, fields
  2705. // with empty values are omitted from API requests. However, any field
  2706. // with an empty value appearing in NullFields will be sent to the
  2707. // server as null. It is an error if a field in this list has a
  2708. // non-empty value. This may be used to include null fields in Patch
  2709. // requests.
  2710. NullFields []string `json:"-"`
  2711. }
  2712. func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) {
  2713. type NoMethod AutoscalingPolicyCpuUtilization
  2714. raw := NoMethod(*s)
  2715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2716. }
  2717. func (s *AutoscalingPolicyCpuUtilization) UnmarshalJSON(data []byte) error {
  2718. type NoMethod AutoscalingPolicyCpuUtilization
  2719. var s1 struct {
  2720. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2721. *NoMethod
  2722. }
  2723. s1.NoMethod = (*NoMethod)(s)
  2724. if err := json.Unmarshal(data, &s1); err != nil {
  2725. return err
  2726. }
  2727. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2728. return nil
  2729. }
  2730. // AutoscalingPolicyCustomMetricUtilization: Custom utilization metric
  2731. // policy.
  2732. type AutoscalingPolicyCustomMetricUtilization struct {
  2733. // Metric: The identifier (type) of the Stackdriver Monitoring metric.
  2734. // The metric cannot have negative values.
  2735. //
  2736. // The metric must have a value type of INT64 or DOUBLE.
  2737. Metric string `json:"metric,omitempty"`
  2738. // UtilizationTarget: The target value of the metric that autoscaler
  2739. // should maintain. This must be a positive value. A utilization metric
  2740. // scales number of virtual machines handling requests to increase or
  2741. // decrease proportionally to the metric.
  2742. //
  2743. // For example, a good metric to use as a utilization_target is
  2744. // compute.googleapis.com/instance/network/received_bytes_count. The
  2745. // autoscaler will work to keep this value constant for each of the
  2746. // instances.
  2747. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2748. // UtilizationTargetType: Defines how target utilization value is
  2749. // expressed for a Stackdriver Monitoring metric. Either GAUGE,
  2750. // DELTA_PER_SECOND, or DELTA_PER_MINUTE.
  2751. //
  2752. // Possible values:
  2753. // "DELTA_PER_MINUTE"
  2754. // "DELTA_PER_SECOND"
  2755. // "GAUGE"
  2756. UtilizationTargetType string `json:"utilizationTargetType,omitempty"`
  2757. // ForceSendFields is a list of field names (e.g. "Metric") to
  2758. // unconditionally include in API requests. By default, fields with
  2759. // empty values are omitted from API requests. However, any non-pointer,
  2760. // non-interface field appearing in ForceSendFields will be sent to the
  2761. // server regardless of whether the field is empty or not. This may be
  2762. // used to include empty fields in Patch requests.
  2763. ForceSendFields []string `json:"-"`
  2764. // NullFields is a list of field names (e.g. "Metric") to include in API
  2765. // requests with the JSON null value. By default, fields with empty
  2766. // values are omitted from API requests. However, any field with an
  2767. // empty value appearing in NullFields will be sent to the server as
  2768. // null. It is an error if a field in this list has a non-empty value.
  2769. // This may be used to include null fields in Patch requests.
  2770. NullFields []string `json:"-"`
  2771. }
  2772. func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) {
  2773. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2774. raw := NoMethod(*s)
  2775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2776. }
  2777. func (s *AutoscalingPolicyCustomMetricUtilization) UnmarshalJSON(data []byte) error {
  2778. type NoMethod AutoscalingPolicyCustomMetricUtilization
  2779. var s1 struct {
  2780. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2781. *NoMethod
  2782. }
  2783. s1.NoMethod = (*NoMethod)(s)
  2784. if err := json.Unmarshal(data, &s1); err != nil {
  2785. return err
  2786. }
  2787. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2788. return nil
  2789. }
  2790. // AutoscalingPolicyLoadBalancingUtilization: Configuration parameters
  2791. // of autoscaling based on load balancing.
  2792. type AutoscalingPolicyLoadBalancingUtilization struct {
  2793. // UtilizationTarget: Fraction of backend capacity utilization (set in
  2794. // HTTP(S) load balancing configuration) that autoscaler should
  2795. // maintain. Must be a positive float value. If not defined, the default
  2796. // is 0.8.
  2797. UtilizationTarget float64 `json:"utilizationTarget,omitempty"`
  2798. // ForceSendFields is a list of field names (e.g. "UtilizationTarget")
  2799. // to unconditionally include in API requests. By default, fields with
  2800. // empty values are omitted from API requests. However, any non-pointer,
  2801. // non-interface field appearing in ForceSendFields will be sent to the
  2802. // server regardless of whether the field is empty or not. This may be
  2803. // used to include empty fields in Patch requests.
  2804. ForceSendFields []string `json:"-"`
  2805. // NullFields is a list of field names (e.g. "UtilizationTarget") to
  2806. // include in API requests with the JSON null value. By default, fields
  2807. // with empty values are omitted from API requests. However, any field
  2808. // with an empty value appearing in NullFields will be sent to the
  2809. // server as null. It is an error if a field in this list has a
  2810. // non-empty value. This may be used to include null fields in Patch
  2811. // requests.
  2812. NullFields []string `json:"-"`
  2813. }
  2814. func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) {
  2815. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2816. raw := NoMethod(*s)
  2817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2818. }
  2819. func (s *AutoscalingPolicyLoadBalancingUtilization) UnmarshalJSON(data []byte) error {
  2820. type NoMethod AutoscalingPolicyLoadBalancingUtilization
  2821. var s1 struct {
  2822. UtilizationTarget gensupport.JSONFloat64 `json:"utilizationTarget"`
  2823. *NoMethod
  2824. }
  2825. s1.NoMethod = (*NoMethod)(s)
  2826. if err := json.Unmarshal(data, &s1); err != nil {
  2827. return err
  2828. }
  2829. s.UtilizationTarget = float64(s1.UtilizationTarget)
  2830. return nil
  2831. }
  2832. // Backend: Message containing information of one individual backend.
  2833. type Backend struct {
  2834. // BalancingMode: Specifies the balancing mode for this backend. For
  2835. // global HTTP(S) or TCP/SSL load balancing, the default is UTILIZATION.
  2836. // Valid values are UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for
  2837. // TCP/SSL).
  2838. //
  2839. // For Internal Load Balancing, the default and only supported mode is
  2840. // CONNECTION.
  2841. //
  2842. // Possible values:
  2843. // "CONNECTION"
  2844. // "RATE"
  2845. // "UTILIZATION"
  2846. BalancingMode string `json:"balancingMode,omitempty"`
  2847. // CapacityScaler: A multiplier applied to the group's maximum servicing
  2848. // capacity (based on UTILIZATION, RATE or CONNECTION). Default value is
  2849. // 1, which means the group will serve up to 100% of its configured
  2850. // capacity (depending on balancingMode). A setting of 0 means the group
  2851. // is completely drained, offering 0% of its available Capacity. Valid
  2852. // range is [0.0,1.0].
  2853. //
  2854. // This cannot be used for internal load balancing.
  2855. CapacityScaler float64 `json:"capacityScaler,omitempty"`
  2856. // Description: An optional description of this resource. Provide this
  2857. // property when you create the resource.
  2858. Description string `json:"description,omitempty"`
  2859. // Group: The fully-qualified URL of an Instance Group or Network
  2860. // Endpoint Group resource. In case of instance group this defines the
  2861. // list of instances that serve traffic. Member virtual machine
  2862. // instances from each instance group must live in the same zone as the
  2863. // instance group itself. No two backends in a backend service are
  2864. // allowed to use same Instance Group resource.
  2865. //
  2866. // For Network Endpoint Groups this defines list of endpoints. All
  2867. // endpoints of Network Endpoint Group must be hosted on instances
  2868. // located in the same zone as the Network Endpoint Group.
  2869. //
  2870. // Backend service can not contain mix of Instance Group and Network
  2871. // Endpoint Group backends.
  2872. //
  2873. // Note that you must specify an Instance Group or Network Endpoint
  2874. // Group resource using the fully-qualified URL, rather than a partial
  2875. // URL.
  2876. //
  2877. // When the BackendService has load balancing scheme INTERNAL, the
  2878. // instance group must be within the same region as the BackendService.
  2879. // Network Endpoint Groups are not supported for INTERNAL load balancing
  2880. // scheme.
  2881. Group string `json:"group,omitempty"`
  2882. // MaxConnections: The max number of simultaneous connections for the
  2883. // group. Can be used with either CONNECTION or UTILIZATION balancing
  2884. // modes. For CONNECTION mode, either maxConnections or
  2885. // maxConnectionsPerInstance must be set.
  2886. //
  2887. // This cannot be used for internal load balancing.
  2888. MaxConnections int64 `json:"maxConnections,omitempty"`
  2889. // MaxConnectionsPerEndpoint: The max number of simultaneous connections
  2890. // that a single backend network endpoint can handle. This is used to
  2891. // calculate the capacity of the group. Can be used in either CONNECTION
  2892. // or UTILIZATION balancing modes. For CONNECTION mode, either
  2893. // maxConnections or maxConnectionsPerEndpoint must be set.
  2894. //
  2895. // This cannot be used for internal load balancing.
  2896. MaxConnectionsPerEndpoint int64 `json:"maxConnectionsPerEndpoint,omitempty"`
  2897. // MaxConnectionsPerInstance: The max number of simultaneous connections
  2898. // that a single backend instance can handle. This is used to calculate
  2899. // the capacity of the group. Can be used in either CONNECTION or
  2900. // UTILIZATION balancing modes. For CONNECTION mode, either
  2901. // maxConnections or maxConnectionsPerInstance must be set.
  2902. //
  2903. // This cannot be used for internal load balancing.
  2904. MaxConnectionsPerInstance int64 `json:"maxConnectionsPerInstance,omitempty"`
  2905. // MaxRate: The max requests per second (RPS) of the group. Can be used
  2906. // with either RATE or UTILIZATION balancing modes, but required if RATE
  2907. // mode. For RATE mode, either maxRate or maxRatePerInstance must be
  2908. // set.
  2909. //
  2910. // This cannot be used for internal load balancing.
  2911. MaxRate int64 `json:"maxRate,omitempty"`
  2912. // MaxRatePerEndpoint: The max requests per second (RPS) that a single
  2913. // backend network endpoint can handle. This is used to calculate the
  2914. // capacity of the group. Can be used in either balancing mode. For RATE
  2915. // mode, either maxRate or maxRatePerEndpoint must be set.
  2916. //
  2917. // This cannot be used for internal load balancing.
  2918. MaxRatePerEndpoint float64 `json:"maxRatePerEndpoint,omitempty"`
  2919. // MaxRatePerInstance: The max requests per second (RPS) that a single
  2920. // backend instance can handle. This is used to calculate the capacity
  2921. // of the group. Can be used in either balancing mode. For RATE mode,
  2922. // either maxRate or maxRatePerInstance must be set.
  2923. //
  2924. // This cannot be used for internal load balancing.
  2925. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"`
  2926. // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio
  2927. // defines the CPU utilization target for the group. The default is 0.8.
  2928. // Valid range is [0.0, 1.0].
  2929. //
  2930. // This cannot be used for internal load balancing.
  2931. MaxUtilization float64 `json:"maxUtilization,omitempty"`
  2932. // ForceSendFields is a list of field names (e.g. "BalancingMode") to
  2933. // unconditionally include in API requests. By default, fields with
  2934. // empty values are omitted from API requests. However, any non-pointer,
  2935. // non-interface field appearing in ForceSendFields will be sent to the
  2936. // server regardless of whether the field is empty or not. This may be
  2937. // used to include empty fields in Patch requests.
  2938. ForceSendFields []string `json:"-"`
  2939. // NullFields is a list of field names (e.g. "BalancingMode") to include
  2940. // in API requests with the JSON null value. By default, fields with
  2941. // empty values are omitted from API requests. However, any field with
  2942. // an empty value appearing in NullFields will be sent to the server as
  2943. // null. It is an error if a field in this list has a non-empty value.
  2944. // This may be used to include null fields in Patch requests.
  2945. NullFields []string `json:"-"`
  2946. }
  2947. func (s *Backend) MarshalJSON() ([]byte, error) {
  2948. type NoMethod Backend
  2949. raw := NoMethod(*s)
  2950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2951. }
  2952. func (s *Backend) UnmarshalJSON(data []byte) error {
  2953. type NoMethod Backend
  2954. var s1 struct {
  2955. CapacityScaler gensupport.JSONFloat64 `json:"capacityScaler"`
  2956. MaxRatePerEndpoint gensupport.JSONFloat64 `json:"maxRatePerEndpoint"`
  2957. MaxRatePerInstance gensupport.JSONFloat64 `json:"maxRatePerInstance"`
  2958. MaxUtilization gensupport.JSONFloat64 `json:"maxUtilization"`
  2959. *NoMethod
  2960. }
  2961. s1.NoMethod = (*NoMethod)(s)
  2962. if err := json.Unmarshal(data, &s1); err != nil {
  2963. return err
  2964. }
  2965. s.CapacityScaler = float64(s1.CapacityScaler)
  2966. s.MaxRatePerEndpoint = float64(s1.MaxRatePerEndpoint)
  2967. s.MaxRatePerInstance = float64(s1.MaxRatePerInstance)
  2968. s.MaxUtilization = float64(s1.MaxUtilization)
  2969. return nil
  2970. }
  2971. // BackendBucket: A BackendBucket resource. This resource defines a
  2972. // Cloud Storage bucket.
  2973. type BackendBucket struct {
  2974. // BucketName: Cloud Storage bucket name.
  2975. BucketName string `json:"bucketName,omitempty"`
  2976. // CdnPolicy: Cloud CDN configuration for this BackendBucket.
  2977. CdnPolicy *BackendBucketCdnPolicy `json:"cdnPolicy,omitempty"`
  2978. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  2979. // format.
  2980. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  2981. // Description: An optional textual description of the resource;
  2982. // provided by the client when the resource is created.
  2983. Description string `json:"description,omitempty"`
  2984. // EnableCdn: If true, enable Cloud CDN for this BackendBucket.
  2985. EnableCdn bool `json:"enableCdn,omitempty"`
  2986. // Id: [Output Only] Unique identifier for the resource; defined by the
  2987. // server.
  2988. Id uint64 `json:"id,omitempty,string"`
  2989. // Kind: Type of the resource.
  2990. Kind string `json:"kind,omitempty"`
  2991. // Name: Name of the resource. Provided by the client when the resource
  2992. // is created. The name must be 1-63 characters long, and comply with
  2993. // RFC1035. Specifically, the name must be 1-63 characters long and
  2994. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  2995. // the first character must be a lowercase letter, and all following
  2996. // characters must be a dash, lowercase letter, or digit, except the
  2997. // last character, which cannot be a dash.
  2998. Name string `json:"name,omitempty"`
  2999. // SelfLink: [Output Only] Server-defined URL for the resource.
  3000. SelfLink string `json:"selfLink,omitempty"`
  3001. // ServerResponse contains the HTTP response code and headers from the
  3002. // server.
  3003. googleapi.ServerResponse `json:"-"`
  3004. // ForceSendFields is a list of field names (e.g. "BucketName") to
  3005. // unconditionally include in API requests. By default, fields with
  3006. // empty values are omitted from API requests. However, any non-pointer,
  3007. // non-interface field appearing in ForceSendFields will be sent to the
  3008. // server regardless of whether the field is empty or not. This may be
  3009. // used to include empty fields in Patch requests.
  3010. ForceSendFields []string `json:"-"`
  3011. // NullFields is a list of field names (e.g. "BucketName") to include in
  3012. // API requests with the JSON null value. By default, fields with empty
  3013. // values are omitted from API requests. However, any field with an
  3014. // empty value appearing in NullFields will be sent to the server as
  3015. // null. It is an error if a field in this list has a non-empty value.
  3016. // This may be used to include null fields in Patch requests.
  3017. NullFields []string `json:"-"`
  3018. }
  3019. func (s *BackendBucket) MarshalJSON() ([]byte, error) {
  3020. type NoMethod BackendBucket
  3021. raw := NoMethod(*s)
  3022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3023. }
  3024. // BackendBucketCdnPolicy: Message containing Cloud CDN configuration
  3025. // for a backend bucket.
  3026. type BackendBucketCdnPolicy struct {
  3027. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3028. // signed URL request will be considered fresh. After this time period,
  3029. // the response will be revalidated before being served. Defaults to 1hr
  3030. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3031. // will internally behave as though all responses from this backend had
  3032. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3033. // existing Cache-Control header. The actual headers served in responses
  3034. // will not be altered.
  3035. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3036. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3037. // request URLs.
  3038. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3039. // ForceSendFields is a list of field names (e.g.
  3040. // "SignedUrlCacheMaxAgeSec") to unconditionally include in API
  3041. // requests. By default, fields with empty values are omitted from API
  3042. // requests. However, any non-pointer, non-interface field appearing in
  3043. // ForceSendFields will be sent to the server regardless of whether the
  3044. // field is empty or not. This may be used to include empty fields in
  3045. // Patch requests.
  3046. ForceSendFields []string `json:"-"`
  3047. // NullFields is a list of field names (e.g. "SignedUrlCacheMaxAgeSec")
  3048. // to include in API requests with the JSON null value. By default,
  3049. // fields with empty values are omitted from API requests. However, any
  3050. // field with an empty value appearing in NullFields will be sent to the
  3051. // server as null. It is an error if a field in this list has a
  3052. // non-empty value. This may be used to include null fields in Patch
  3053. // requests.
  3054. NullFields []string `json:"-"`
  3055. }
  3056. func (s *BackendBucketCdnPolicy) MarshalJSON() ([]byte, error) {
  3057. type NoMethod BackendBucketCdnPolicy
  3058. raw := NoMethod(*s)
  3059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3060. }
  3061. // BackendBucketList: Contains a list of BackendBucket resources.
  3062. type BackendBucketList struct {
  3063. // Id: [Output Only] Unique identifier for the resource; defined by the
  3064. // server.
  3065. Id string `json:"id,omitempty"`
  3066. // Items: A list of BackendBucket resources.
  3067. Items []*BackendBucket `json:"items,omitempty"`
  3068. // Kind: Type of resource.
  3069. Kind string `json:"kind,omitempty"`
  3070. // NextPageToken: [Output Only] This token allows you to get the next
  3071. // page of results for list requests. If the number of results is larger
  3072. // than maxResults, use the nextPageToken as a value for the query
  3073. // parameter pageToken in the next list request. Subsequent list
  3074. // requests will have their own nextPageToken to continue paging through
  3075. // the results.
  3076. NextPageToken string `json:"nextPageToken,omitempty"`
  3077. // SelfLink: [Output Only] Server-defined URL for this resource.
  3078. SelfLink string `json:"selfLink,omitempty"`
  3079. // Warning: [Output Only] Informational warning message.
  3080. Warning *BackendBucketListWarning `json:"warning,omitempty"`
  3081. // ServerResponse contains the HTTP response code and headers from the
  3082. // server.
  3083. googleapi.ServerResponse `json:"-"`
  3084. // ForceSendFields is a list of field names (e.g. "Id") to
  3085. // unconditionally include in API requests. By default, fields with
  3086. // empty values are omitted from API requests. However, any non-pointer,
  3087. // non-interface field appearing in ForceSendFields will be sent to the
  3088. // server regardless of whether the field is empty or not. This may be
  3089. // used to include empty fields in Patch requests.
  3090. ForceSendFields []string `json:"-"`
  3091. // NullFields is a list of field names (e.g. "Id") to include in API
  3092. // requests with the JSON null value. By default, fields with empty
  3093. // values are omitted from API requests. However, any field with an
  3094. // empty value appearing in NullFields will be sent to the server as
  3095. // null. It is an error if a field in this list has a non-empty value.
  3096. // This may be used to include null fields in Patch requests.
  3097. NullFields []string `json:"-"`
  3098. }
  3099. func (s *BackendBucketList) MarshalJSON() ([]byte, error) {
  3100. type NoMethod BackendBucketList
  3101. raw := NoMethod(*s)
  3102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3103. }
  3104. // BackendBucketListWarning: [Output Only] Informational warning
  3105. // message.
  3106. type BackendBucketListWarning struct {
  3107. // Code: [Output Only] A warning code, if applicable. For example,
  3108. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3109. // the response.
  3110. //
  3111. // Possible values:
  3112. // "CLEANUP_FAILED"
  3113. // "DEPRECATED_RESOURCE_USED"
  3114. // "DEPRECATED_TYPE_USED"
  3115. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3116. // "EXPERIMENTAL_TYPE_USED"
  3117. // "EXTERNAL_API_WARNING"
  3118. // "FIELD_VALUE_OVERRIDEN"
  3119. // "INJECTED_KERNELS_DEPRECATED"
  3120. // "MISSING_TYPE_DEPENDENCY"
  3121. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3122. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3123. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3124. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3125. // "NEXT_HOP_NOT_RUNNING"
  3126. // "NOT_CRITICAL_ERROR"
  3127. // "NO_RESULTS_ON_PAGE"
  3128. // "REQUIRED_TOS_AGREEMENT"
  3129. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3130. // "RESOURCE_NOT_DELETED"
  3131. // "SCHEMA_VALIDATION_IGNORED"
  3132. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3133. // "UNDECLARED_PROPERTIES"
  3134. // "UNREACHABLE"
  3135. Code string `json:"code,omitempty"`
  3136. // Data: [Output Only] Metadata about this warning in key: value format.
  3137. // For example:
  3138. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3139. Data []*BackendBucketListWarningData `json:"data,omitempty"`
  3140. // Message: [Output Only] A human-readable description of the warning
  3141. // code.
  3142. Message string `json:"message,omitempty"`
  3143. // ForceSendFields is a list of field names (e.g. "Code") to
  3144. // unconditionally include in API requests. By default, fields with
  3145. // empty values are omitted from API requests. However, any non-pointer,
  3146. // non-interface field appearing in ForceSendFields will be sent to the
  3147. // server regardless of whether the field is empty or not. This may be
  3148. // used to include empty fields in Patch requests.
  3149. ForceSendFields []string `json:"-"`
  3150. // NullFields is a list of field names (e.g. "Code") to include in API
  3151. // requests with the JSON null value. By default, fields with empty
  3152. // values are omitted from API requests. However, any field with an
  3153. // empty value appearing in NullFields will be sent to the server as
  3154. // null. It is an error if a field in this list has a non-empty value.
  3155. // This may be used to include null fields in Patch requests.
  3156. NullFields []string `json:"-"`
  3157. }
  3158. func (s *BackendBucketListWarning) MarshalJSON() ([]byte, error) {
  3159. type NoMethod BackendBucketListWarning
  3160. raw := NoMethod(*s)
  3161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3162. }
  3163. type BackendBucketListWarningData struct {
  3164. // Key: [Output Only] A key that provides more detail on the warning
  3165. // being returned. For example, for warnings where there are no results
  3166. // in a list request for a particular zone, this key might be scope and
  3167. // the key value might be the zone name. Other examples might be a key
  3168. // indicating a deprecated resource and a suggested replacement, or a
  3169. // warning about invalid network settings (for example, if an instance
  3170. // attempts to perform IP forwarding but is not enabled for IP
  3171. // forwarding).
  3172. Key string `json:"key,omitempty"`
  3173. // Value: [Output Only] A warning data value corresponding to the key.
  3174. Value string `json:"value,omitempty"`
  3175. // ForceSendFields is a list of field names (e.g. "Key") to
  3176. // unconditionally include in API requests. By default, fields with
  3177. // empty values are omitted from API requests. However, any non-pointer,
  3178. // non-interface field appearing in ForceSendFields will be sent to the
  3179. // server regardless of whether the field is empty or not. This may be
  3180. // used to include empty fields in Patch requests.
  3181. ForceSendFields []string `json:"-"`
  3182. // NullFields is a list of field names (e.g. "Key") to include in API
  3183. // requests with the JSON null value. By default, fields with empty
  3184. // values are omitted from API requests. However, any field with an
  3185. // empty value appearing in NullFields will be sent to the server as
  3186. // null. It is an error if a field in this list has a non-empty value.
  3187. // This may be used to include null fields in Patch requests.
  3188. NullFields []string `json:"-"`
  3189. }
  3190. func (s *BackendBucketListWarningData) MarshalJSON() ([]byte, error) {
  3191. type NoMethod BackendBucketListWarningData
  3192. raw := NoMethod(*s)
  3193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3194. }
  3195. // BackendService: A BackendService resource. This resource defines a
  3196. // group of backend virtual machines and their serving capacity. (==
  3197. // resource_for v1.backendService ==) (== resource_for
  3198. // beta.backendService ==)
  3199. type BackendService struct {
  3200. // AffinityCookieTtlSec: Lifetime of cookies in seconds if
  3201. // session_affinity is GENERATED_COOKIE. If set to 0, the cookie is
  3202. // non-persistent and lasts only until the end of the browser session
  3203. // (or equivalent). The maximum allowed value for TTL is one day.
  3204. //
  3205. // When the load balancing scheme is INTERNAL, this field is not used.
  3206. AffinityCookieTtlSec int64 `json:"affinityCookieTtlSec,omitempty"`
  3207. // Backends: The list of backends that serve this BackendService.
  3208. Backends []*Backend `json:"backends,omitempty"`
  3209. // CdnPolicy: Cloud CDN configuration for this BackendService.
  3210. CdnPolicy *BackendServiceCdnPolicy `json:"cdnPolicy,omitempty"`
  3211. ConnectionDraining *ConnectionDraining `json:"connectionDraining,omitempty"`
  3212. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  3213. // format.
  3214. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  3215. // CustomRequestHeaders: Headers that the HTTP/S load balancer should
  3216. // add to proxied requests.
  3217. CustomRequestHeaders []string `json:"customRequestHeaders,omitempty"`
  3218. // Description: An optional description of this resource. Provide this
  3219. // property when you create the resource.
  3220. Description string `json:"description,omitempty"`
  3221. // EnableCDN: If true, enable Cloud CDN for this BackendService.
  3222. //
  3223. // When the load balancing scheme is INTERNAL, this field is not used.
  3224. EnableCDN bool `json:"enableCDN,omitempty"`
  3225. // Fingerprint: Fingerprint of this resource. A hash of the contents
  3226. // stored in this object. This field is used in optimistic locking. This
  3227. // field will be ignored when inserting a BackendService. An up-to-date
  3228. // fingerprint must be provided in order to update the BackendService,
  3229. // otherwise the request will fail with error 412 conditionNotMet.
  3230. //
  3231. // To see the latest fingerprint, make a get() request to retrieve a
  3232. // BackendService.
  3233. Fingerprint string `json:"fingerprint,omitempty"`
  3234. // HealthChecks: The list of URLs to the HttpHealthCheck or
  3235. // HttpsHealthCheck resource for health checking this BackendService.
  3236. // Currently at most one health check can be specified, and a health
  3237. // check is required for Compute Engine backend services. A health check
  3238. // must not be specified for App Engine backend and Cloud Function
  3239. // backend.
  3240. //
  3241. // For internal load balancing, a URL to a HealthCheck resource must be
  3242. // specified instead.
  3243. HealthChecks []string `json:"healthChecks,omitempty"`
  3244. Iap *BackendServiceIAP `json:"iap,omitempty"`
  3245. // Id: [Output Only] The unique identifier for the resource. This
  3246. // identifier is defined by the server.
  3247. Id uint64 `json:"id,omitempty,string"`
  3248. // Kind: [Output Only] Type of resource. Always compute#backendService
  3249. // for backend services.
  3250. Kind string `json:"kind,omitempty"`
  3251. // LoadBalancingScheme: Indicates whether the backend service will be
  3252. // used with internal or external load balancing. A backend service
  3253. // created for one type of load balancing cannot be used with the other.
  3254. // Possible values are INTERNAL and EXTERNAL.
  3255. //
  3256. // Possible values:
  3257. // "EXTERNAL"
  3258. // "INTERNAL"
  3259. // "INTERNAL_SELF_MANAGED"
  3260. // "INVALID_LOAD_BALANCING_SCHEME"
  3261. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  3262. // Name: Name of the resource. Provided by the client when the resource
  3263. // is created. The name must be 1-63 characters long, and comply with
  3264. // RFC1035. Specifically, the name must be 1-63 characters long and
  3265. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  3266. // the first character must be a lowercase letter, and all following
  3267. // characters must be a dash, lowercase letter, or digit, except the
  3268. // last character, which cannot be a dash.
  3269. Name string `json:"name,omitempty"`
  3270. // Port: Deprecated in favor of portName. The TCP port to connect on the
  3271. // backend. The default value is 80.
  3272. //
  3273. // This cannot be used for internal load balancing.
  3274. Port int64 `json:"port,omitempty"`
  3275. // PortName: Name of backend port. The same name should appear in the
  3276. // instance groups referenced by this service. Required when the load
  3277. // balancing scheme is EXTERNAL.
  3278. //
  3279. // When the load balancing scheme is INTERNAL, this field is not used.
  3280. PortName string `json:"portName,omitempty"`
  3281. // Protocol: The protocol this BackendService uses to communicate with
  3282. // backends.
  3283. //
  3284. // Possible values are HTTP, HTTPS, TCP, and SSL. The default is
  3285. // HTTP.
  3286. //
  3287. // For internal load balancing, the possible values are TCP and UDP, and
  3288. // the default is TCP.
  3289. //
  3290. // Possible values:
  3291. // "HTTP"
  3292. // "HTTP2"
  3293. // "HTTPS"
  3294. // "SSL"
  3295. // "TCP"
  3296. // "UDP"
  3297. Protocol string `json:"protocol,omitempty"`
  3298. // Region: [Output Only] URL of the region where the regional backend
  3299. // service resides. This field is not applicable to global backend
  3300. // services. You must specify this field as part of the HTTP request
  3301. // URL. It is not settable as a field in the request body.
  3302. Region string `json:"region,omitempty"`
  3303. // SecurityPolicy: [Output Only] The resource URL for the security
  3304. // policy associated with this backend service.
  3305. SecurityPolicy string `json:"securityPolicy,omitempty"`
  3306. // SelfLink: [Output Only] Server-defined URL for the resource.
  3307. SelfLink string `json:"selfLink,omitempty"`
  3308. // SessionAffinity: Type of session affinity to use. The default is
  3309. // NONE.
  3310. //
  3311. // When the load balancing scheme is EXTERNAL, can be NONE, CLIENT_IP,
  3312. // or GENERATED_COOKIE.
  3313. //
  3314. // When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP,
  3315. // CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO.
  3316. //
  3317. // When the protocol is UDP, this field is not used.
  3318. //
  3319. // Possible values:
  3320. // "CLIENT_IP"
  3321. // "CLIENT_IP_PORT_PROTO"
  3322. // "CLIENT_IP_PROTO"
  3323. // "GENERATED_COOKIE"
  3324. // "NONE"
  3325. SessionAffinity string `json:"sessionAffinity,omitempty"`
  3326. // TimeoutSec: How many seconds to wait for the backend before
  3327. // considering it a failed request. Default is 30 seconds.
  3328. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  3329. // ServerResponse contains the HTTP response code and headers from the
  3330. // server.
  3331. googleapi.ServerResponse `json:"-"`
  3332. // ForceSendFields is a list of field names (e.g.
  3333. // "AffinityCookieTtlSec") to unconditionally include in API requests.
  3334. // By default, fields with empty values are omitted from API requests.
  3335. // However, any non-pointer, non-interface field appearing in
  3336. // ForceSendFields will be sent to the server regardless of whether the
  3337. // field is empty or not. This may be used to include empty fields in
  3338. // Patch requests.
  3339. ForceSendFields []string `json:"-"`
  3340. // NullFields is a list of field names (e.g. "AffinityCookieTtlSec") to
  3341. // include in API requests with the JSON null value. By default, fields
  3342. // with empty values are omitted from API requests. However, any field
  3343. // with an empty value appearing in NullFields will be sent to the
  3344. // server as null. It is an error if a field in this list has a
  3345. // non-empty value. This may be used to include null fields in Patch
  3346. // requests.
  3347. NullFields []string `json:"-"`
  3348. }
  3349. func (s *BackendService) MarshalJSON() ([]byte, error) {
  3350. type NoMethod BackendService
  3351. raw := NoMethod(*s)
  3352. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3353. }
  3354. // BackendServiceAggregatedList: Contains a list of
  3355. // BackendServicesScopedList.
  3356. type BackendServiceAggregatedList struct {
  3357. // Id: [Output Only] Unique identifier for the resource; defined by the
  3358. // server.
  3359. Id string `json:"id,omitempty"`
  3360. // Items: A list of BackendServicesScopedList resources.
  3361. Items map[string]BackendServicesScopedList `json:"items,omitempty"`
  3362. // Kind: Type of resource.
  3363. Kind string `json:"kind,omitempty"`
  3364. // NextPageToken: [Output Only] This token allows you to get the next
  3365. // page of results for list requests. If the number of results is larger
  3366. // than maxResults, use the nextPageToken as a value for the query
  3367. // parameter pageToken in the next list request. Subsequent list
  3368. // requests will have their own nextPageToken to continue paging through
  3369. // the results.
  3370. NextPageToken string `json:"nextPageToken,omitempty"`
  3371. // SelfLink: [Output Only] Server-defined URL for this resource.
  3372. SelfLink string `json:"selfLink,omitempty"`
  3373. // Warning: [Output Only] Informational warning message.
  3374. Warning *BackendServiceAggregatedListWarning `json:"warning,omitempty"`
  3375. // ServerResponse contains the HTTP response code and headers from the
  3376. // server.
  3377. googleapi.ServerResponse `json:"-"`
  3378. // ForceSendFields is a list of field names (e.g. "Id") to
  3379. // unconditionally include in API requests. By default, fields with
  3380. // empty values are omitted from API requests. However, any non-pointer,
  3381. // non-interface field appearing in ForceSendFields will be sent to the
  3382. // server regardless of whether the field is empty or not. This may be
  3383. // used to include empty fields in Patch requests.
  3384. ForceSendFields []string `json:"-"`
  3385. // NullFields is a list of field names (e.g. "Id") to include in API
  3386. // requests with the JSON null value. By default, fields with empty
  3387. // values are omitted from API requests. However, any field with an
  3388. // empty value appearing in NullFields will be sent to the server as
  3389. // null. It is an error if a field in this list has a non-empty value.
  3390. // This may be used to include null fields in Patch requests.
  3391. NullFields []string `json:"-"`
  3392. }
  3393. func (s *BackendServiceAggregatedList) MarshalJSON() ([]byte, error) {
  3394. type NoMethod BackendServiceAggregatedList
  3395. raw := NoMethod(*s)
  3396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3397. }
  3398. // BackendServiceAggregatedListWarning: [Output Only] Informational
  3399. // warning message.
  3400. type BackendServiceAggregatedListWarning struct {
  3401. // Code: [Output Only] A warning code, if applicable. For example,
  3402. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3403. // the response.
  3404. //
  3405. // Possible values:
  3406. // "CLEANUP_FAILED"
  3407. // "DEPRECATED_RESOURCE_USED"
  3408. // "DEPRECATED_TYPE_USED"
  3409. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3410. // "EXPERIMENTAL_TYPE_USED"
  3411. // "EXTERNAL_API_WARNING"
  3412. // "FIELD_VALUE_OVERRIDEN"
  3413. // "INJECTED_KERNELS_DEPRECATED"
  3414. // "MISSING_TYPE_DEPENDENCY"
  3415. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3416. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3417. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3418. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3419. // "NEXT_HOP_NOT_RUNNING"
  3420. // "NOT_CRITICAL_ERROR"
  3421. // "NO_RESULTS_ON_PAGE"
  3422. // "REQUIRED_TOS_AGREEMENT"
  3423. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3424. // "RESOURCE_NOT_DELETED"
  3425. // "SCHEMA_VALIDATION_IGNORED"
  3426. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3427. // "UNDECLARED_PROPERTIES"
  3428. // "UNREACHABLE"
  3429. Code string `json:"code,omitempty"`
  3430. // Data: [Output Only] Metadata about this warning in key: value format.
  3431. // For example:
  3432. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3433. Data []*BackendServiceAggregatedListWarningData `json:"data,omitempty"`
  3434. // Message: [Output Only] A human-readable description of the warning
  3435. // code.
  3436. Message string `json:"message,omitempty"`
  3437. // ForceSendFields is a list of field names (e.g. "Code") to
  3438. // unconditionally include in API requests. By default, fields with
  3439. // empty values are omitted from API requests. However, any non-pointer,
  3440. // non-interface field appearing in ForceSendFields will be sent to the
  3441. // server regardless of whether the field is empty or not. This may be
  3442. // used to include empty fields in Patch requests.
  3443. ForceSendFields []string `json:"-"`
  3444. // NullFields is a list of field names (e.g. "Code") to include in API
  3445. // requests with the JSON null value. By default, fields with empty
  3446. // values are omitted from API requests. However, any field with an
  3447. // empty value appearing in NullFields will be sent to the server as
  3448. // null. It is an error if a field in this list has a non-empty value.
  3449. // This may be used to include null fields in Patch requests.
  3450. NullFields []string `json:"-"`
  3451. }
  3452. func (s *BackendServiceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  3453. type NoMethod BackendServiceAggregatedListWarning
  3454. raw := NoMethod(*s)
  3455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3456. }
  3457. type BackendServiceAggregatedListWarningData struct {
  3458. // Key: [Output Only] A key that provides more detail on the warning
  3459. // being returned. For example, for warnings where there are no results
  3460. // in a list request for a particular zone, this key might be scope and
  3461. // the key value might be the zone name. Other examples might be a key
  3462. // indicating a deprecated resource and a suggested replacement, or a
  3463. // warning about invalid network settings (for example, if an instance
  3464. // attempts to perform IP forwarding but is not enabled for IP
  3465. // forwarding).
  3466. Key string `json:"key,omitempty"`
  3467. // Value: [Output Only] A warning data value corresponding to the key.
  3468. Value string `json:"value,omitempty"`
  3469. // ForceSendFields is a list of field names (e.g. "Key") to
  3470. // unconditionally include in API requests. By default, fields with
  3471. // empty values are omitted from API requests. However, any non-pointer,
  3472. // non-interface field appearing in ForceSendFields will be sent to the
  3473. // server regardless of whether the field is empty or not. This may be
  3474. // used to include empty fields in Patch requests.
  3475. ForceSendFields []string `json:"-"`
  3476. // NullFields is a list of field names (e.g. "Key") to include in API
  3477. // requests with the JSON null value. By default, fields with empty
  3478. // values are omitted from API requests. However, any field with an
  3479. // empty value appearing in NullFields will be sent to the server as
  3480. // null. It is an error if a field in this list has a non-empty value.
  3481. // This may be used to include null fields in Patch requests.
  3482. NullFields []string `json:"-"`
  3483. }
  3484. func (s *BackendServiceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  3485. type NoMethod BackendServiceAggregatedListWarningData
  3486. raw := NoMethod(*s)
  3487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3488. }
  3489. // BackendServiceCdnPolicy: Message containing Cloud CDN configuration
  3490. // for a backend service.
  3491. type BackendServiceCdnPolicy struct {
  3492. // CacheKeyPolicy: The CacheKeyPolicy for this CdnPolicy.
  3493. CacheKeyPolicy *CacheKeyPolicy `json:"cacheKeyPolicy,omitempty"`
  3494. // SignedUrlCacheMaxAgeSec: Maximum number of seconds the response to a
  3495. // signed URL request will be considered fresh. After this time period,
  3496. // the response will be revalidated before being served. Defaults to 1hr
  3497. // (3600s). When serving responses to signed URL requests, Cloud CDN
  3498. // will internally behave as though all responses from this backend had
  3499. // a "Cache-Control: public, max-age=[TTL]" header, regardless of any
  3500. // existing Cache-Control header. The actual headers served in responses
  3501. // will not be altered.
  3502. SignedUrlCacheMaxAgeSec int64 `json:"signedUrlCacheMaxAgeSec,omitempty,string"`
  3503. // SignedUrlKeyNames: [Output Only] Names of the keys for signing
  3504. // request URLs.
  3505. SignedUrlKeyNames []string `json:"signedUrlKeyNames,omitempty"`
  3506. // ForceSendFields is a list of field names (e.g. "CacheKeyPolicy") to
  3507. // unconditionally include in API requests. By default, fields with
  3508. // empty values are omitted from API requests. However, any non-pointer,
  3509. // non-interface field appearing in ForceSendFields will be sent to the
  3510. // server regardless of whether the field is empty or not. This may be
  3511. // used to include empty fields in Patch requests.
  3512. ForceSendFields []string `json:"-"`
  3513. // NullFields is a list of field names (e.g. "CacheKeyPolicy") to
  3514. // include in API requests with the JSON null value. By default, fields
  3515. // with empty values are omitted from API requests. However, any field
  3516. // with an empty value appearing in NullFields will be sent to the
  3517. // server as null. It is an error if a field in this list has a
  3518. // non-empty value. This may be used to include null fields in Patch
  3519. // requests.
  3520. NullFields []string `json:"-"`
  3521. }
  3522. func (s *BackendServiceCdnPolicy) MarshalJSON() ([]byte, error) {
  3523. type NoMethod BackendServiceCdnPolicy
  3524. raw := NoMethod(*s)
  3525. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3526. }
  3527. type BackendServiceGroupHealth struct {
  3528. // HealthStatus: Health state of the backend instances or endpoints in
  3529. // requested instance or network endpoint group, determined based on
  3530. // configured health checks.
  3531. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  3532. // Kind: [Output Only] Type of resource. Always
  3533. // compute#backendServiceGroupHealth for the health of backend services.
  3534. Kind string `json:"kind,omitempty"`
  3535. // ServerResponse contains the HTTP response code and headers from the
  3536. // server.
  3537. googleapi.ServerResponse `json:"-"`
  3538. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  3539. // unconditionally include in API requests. By default, fields with
  3540. // empty values are omitted from API requests. However, any non-pointer,
  3541. // non-interface field appearing in ForceSendFields will be sent to the
  3542. // server regardless of whether the field is empty or not. This may be
  3543. // used to include empty fields in Patch requests.
  3544. ForceSendFields []string `json:"-"`
  3545. // NullFields is a list of field names (e.g. "HealthStatus") to include
  3546. // in API requests with the JSON null value. By default, fields with
  3547. // empty values are omitted from API requests. However, any field with
  3548. // an empty value appearing in NullFields will be sent to the server as
  3549. // null. It is an error if a field in this list has a non-empty value.
  3550. // This may be used to include null fields in Patch requests.
  3551. NullFields []string `json:"-"`
  3552. }
  3553. func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) {
  3554. type NoMethod BackendServiceGroupHealth
  3555. raw := NoMethod(*s)
  3556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3557. }
  3558. // BackendServiceIAP: Identity-Aware Proxy
  3559. type BackendServiceIAP struct {
  3560. Enabled bool `json:"enabled,omitempty"`
  3561. Oauth2ClientId string `json:"oauth2ClientId,omitempty"`
  3562. Oauth2ClientSecret string `json:"oauth2ClientSecret,omitempty"`
  3563. // Oauth2ClientSecretSha256: [Output Only] SHA256 hash value for the
  3564. // field oauth2_client_secret above.
  3565. Oauth2ClientSecretSha256 string `json:"oauth2ClientSecretSha256,omitempty"`
  3566. // ForceSendFields is a list of field names (e.g. "Enabled") to
  3567. // unconditionally include in API requests. By default, fields with
  3568. // empty values are omitted from API requests. However, any non-pointer,
  3569. // non-interface field appearing in ForceSendFields will be sent to the
  3570. // server regardless of whether the field is empty or not. This may be
  3571. // used to include empty fields in Patch requests.
  3572. ForceSendFields []string `json:"-"`
  3573. // NullFields is a list of field names (e.g. "Enabled") to include in
  3574. // API requests with the JSON null value. By default, fields with empty
  3575. // values are omitted from API requests. However, any field with an
  3576. // empty value appearing in NullFields will be sent to the server as
  3577. // null. It is an error if a field in this list has a non-empty value.
  3578. // This may be used to include null fields in Patch requests.
  3579. NullFields []string `json:"-"`
  3580. }
  3581. func (s *BackendServiceIAP) MarshalJSON() ([]byte, error) {
  3582. type NoMethod BackendServiceIAP
  3583. raw := NoMethod(*s)
  3584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3585. }
  3586. // BackendServiceList: Contains a list of BackendService resources.
  3587. type BackendServiceList struct {
  3588. // Id: [Output Only] Unique identifier for the resource; defined by the
  3589. // server.
  3590. Id string `json:"id,omitempty"`
  3591. // Items: A list of BackendService resources.
  3592. Items []*BackendService `json:"items,omitempty"`
  3593. // Kind: [Output Only] Type of resource. Always
  3594. // compute#backendServiceList for lists of backend services.
  3595. Kind string `json:"kind,omitempty"`
  3596. // NextPageToken: [Output Only] This token allows you to get the next
  3597. // page of results for list requests. If the number of results is larger
  3598. // than maxResults, use the nextPageToken as a value for the query
  3599. // parameter pageToken in the next list request. Subsequent list
  3600. // requests will have their own nextPageToken to continue paging through
  3601. // the results.
  3602. NextPageToken string `json:"nextPageToken,omitempty"`
  3603. // SelfLink: [Output Only] Server-defined URL for this resource.
  3604. SelfLink string `json:"selfLink,omitempty"`
  3605. // Warning: [Output Only] Informational warning message.
  3606. Warning *BackendServiceListWarning `json:"warning,omitempty"`
  3607. // ServerResponse contains the HTTP response code and headers from the
  3608. // server.
  3609. googleapi.ServerResponse `json:"-"`
  3610. // ForceSendFields is a list of field names (e.g. "Id") to
  3611. // unconditionally include in API requests. By default, fields with
  3612. // empty values are omitted from API requests. However, any non-pointer,
  3613. // non-interface field appearing in ForceSendFields will be sent to the
  3614. // server regardless of whether the field is empty or not. This may be
  3615. // used to include empty fields in Patch requests.
  3616. ForceSendFields []string `json:"-"`
  3617. // NullFields is a list of field names (e.g. "Id") to include in API
  3618. // requests with the JSON null value. By default, fields with empty
  3619. // values are omitted from API requests. However, any field with an
  3620. // empty value appearing in NullFields will be sent to the server as
  3621. // null. It is an error if a field in this list has a non-empty value.
  3622. // This may be used to include null fields in Patch requests.
  3623. NullFields []string `json:"-"`
  3624. }
  3625. func (s *BackendServiceList) MarshalJSON() ([]byte, error) {
  3626. type NoMethod BackendServiceList
  3627. raw := NoMethod(*s)
  3628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3629. }
  3630. // BackendServiceListWarning: [Output Only] Informational warning
  3631. // message.
  3632. type BackendServiceListWarning struct {
  3633. // Code: [Output Only] A warning code, if applicable. For example,
  3634. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3635. // the response.
  3636. //
  3637. // Possible values:
  3638. // "CLEANUP_FAILED"
  3639. // "DEPRECATED_RESOURCE_USED"
  3640. // "DEPRECATED_TYPE_USED"
  3641. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3642. // "EXPERIMENTAL_TYPE_USED"
  3643. // "EXTERNAL_API_WARNING"
  3644. // "FIELD_VALUE_OVERRIDEN"
  3645. // "INJECTED_KERNELS_DEPRECATED"
  3646. // "MISSING_TYPE_DEPENDENCY"
  3647. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3648. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3649. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3650. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3651. // "NEXT_HOP_NOT_RUNNING"
  3652. // "NOT_CRITICAL_ERROR"
  3653. // "NO_RESULTS_ON_PAGE"
  3654. // "REQUIRED_TOS_AGREEMENT"
  3655. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3656. // "RESOURCE_NOT_DELETED"
  3657. // "SCHEMA_VALIDATION_IGNORED"
  3658. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3659. // "UNDECLARED_PROPERTIES"
  3660. // "UNREACHABLE"
  3661. Code string `json:"code,omitempty"`
  3662. // Data: [Output Only] Metadata about this warning in key: value format.
  3663. // For example:
  3664. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3665. Data []*BackendServiceListWarningData `json:"data,omitempty"`
  3666. // Message: [Output Only] A human-readable description of the warning
  3667. // code.
  3668. Message string `json:"message,omitempty"`
  3669. // ForceSendFields is a list of field names (e.g. "Code") to
  3670. // unconditionally include in API requests. By default, fields with
  3671. // empty values are omitted from API requests. However, any non-pointer,
  3672. // non-interface field appearing in ForceSendFields will be sent to the
  3673. // server regardless of whether the field is empty or not. This may be
  3674. // used to include empty fields in Patch requests.
  3675. ForceSendFields []string `json:"-"`
  3676. // NullFields is a list of field names (e.g. "Code") to include in API
  3677. // requests with the JSON null value. By default, fields with empty
  3678. // values are omitted from API requests. However, any field with an
  3679. // empty value appearing in NullFields will be sent to the server as
  3680. // null. It is an error if a field in this list has a non-empty value.
  3681. // This may be used to include null fields in Patch requests.
  3682. NullFields []string `json:"-"`
  3683. }
  3684. func (s *BackendServiceListWarning) MarshalJSON() ([]byte, error) {
  3685. type NoMethod BackendServiceListWarning
  3686. raw := NoMethod(*s)
  3687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3688. }
  3689. type BackendServiceListWarningData struct {
  3690. // Key: [Output Only] A key that provides more detail on the warning
  3691. // being returned. For example, for warnings where there are no results
  3692. // in a list request for a particular zone, this key might be scope and
  3693. // the key value might be the zone name. Other examples might be a key
  3694. // indicating a deprecated resource and a suggested replacement, or a
  3695. // warning about invalid network settings (for example, if an instance
  3696. // attempts to perform IP forwarding but is not enabled for IP
  3697. // forwarding).
  3698. Key string `json:"key,omitempty"`
  3699. // Value: [Output Only] A warning data value corresponding to the key.
  3700. Value string `json:"value,omitempty"`
  3701. // ForceSendFields is a list of field names (e.g. "Key") to
  3702. // unconditionally include in API requests. By default, fields with
  3703. // empty values are omitted from API requests. However, any non-pointer,
  3704. // non-interface field appearing in ForceSendFields will be sent to the
  3705. // server regardless of whether the field is empty or not. This may be
  3706. // used to include empty fields in Patch requests.
  3707. ForceSendFields []string `json:"-"`
  3708. // NullFields is a list of field names (e.g. "Key") to include in API
  3709. // requests with the JSON null value. By default, fields with empty
  3710. // values are omitted from API requests. However, any field with an
  3711. // empty value appearing in NullFields will be sent to the server as
  3712. // null. It is an error if a field in this list has a non-empty value.
  3713. // This may be used to include null fields in Patch requests.
  3714. NullFields []string `json:"-"`
  3715. }
  3716. func (s *BackendServiceListWarningData) MarshalJSON() ([]byte, error) {
  3717. type NoMethod BackendServiceListWarningData
  3718. raw := NoMethod(*s)
  3719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3720. }
  3721. type BackendServiceReference struct {
  3722. BackendService string `json:"backendService,omitempty"`
  3723. // ForceSendFields is a list of field names (e.g. "BackendService") to
  3724. // unconditionally include in API requests. By default, fields with
  3725. // empty values are omitted from API requests. However, any non-pointer,
  3726. // non-interface field appearing in ForceSendFields will be sent to the
  3727. // server regardless of whether the field is empty or not. This may be
  3728. // used to include empty fields in Patch requests.
  3729. ForceSendFields []string `json:"-"`
  3730. // NullFields is a list of field names (e.g. "BackendService") to
  3731. // include in API requests with the JSON null value. By default, fields
  3732. // with empty values are omitted from API requests. However, any field
  3733. // with an empty value appearing in NullFields will be sent to the
  3734. // server as null. It is an error if a field in this list has a
  3735. // non-empty value. This may be used to include null fields in Patch
  3736. // requests.
  3737. NullFields []string `json:"-"`
  3738. }
  3739. func (s *BackendServiceReference) MarshalJSON() ([]byte, error) {
  3740. type NoMethod BackendServiceReference
  3741. raw := NoMethod(*s)
  3742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3743. }
  3744. type BackendServicesScopedList struct {
  3745. // BackendServices: A list of BackendServices contained in this scope.
  3746. BackendServices []*BackendService `json:"backendServices,omitempty"`
  3747. // Warning: Informational warning which replaces the list of backend
  3748. // services when the list is empty.
  3749. Warning *BackendServicesScopedListWarning `json:"warning,omitempty"`
  3750. // ForceSendFields is a list of field names (e.g. "BackendServices") to
  3751. // unconditionally include in API requests. By default, fields with
  3752. // empty values are omitted from API requests. However, any non-pointer,
  3753. // non-interface field appearing in ForceSendFields will be sent to the
  3754. // server regardless of whether the field is empty or not. This may be
  3755. // used to include empty fields in Patch requests.
  3756. ForceSendFields []string `json:"-"`
  3757. // NullFields is a list of field names (e.g. "BackendServices") to
  3758. // include in API requests with the JSON null value. By default, fields
  3759. // with empty values are omitted from API requests. However, any field
  3760. // with an empty value appearing in NullFields will be sent to the
  3761. // server as null. It is an error if a field in this list has a
  3762. // non-empty value. This may be used to include null fields in Patch
  3763. // requests.
  3764. NullFields []string `json:"-"`
  3765. }
  3766. func (s *BackendServicesScopedList) MarshalJSON() ([]byte, error) {
  3767. type NoMethod BackendServicesScopedList
  3768. raw := NoMethod(*s)
  3769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3770. }
  3771. // BackendServicesScopedListWarning: Informational warning which
  3772. // replaces the list of backend services when the list is empty.
  3773. type BackendServicesScopedListWarning struct {
  3774. // Code: [Output Only] A warning code, if applicable. For example,
  3775. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  3776. // the response.
  3777. //
  3778. // Possible values:
  3779. // "CLEANUP_FAILED"
  3780. // "DEPRECATED_RESOURCE_USED"
  3781. // "DEPRECATED_TYPE_USED"
  3782. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  3783. // "EXPERIMENTAL_TYPE_USED"
  3784. // "EXTERNAL_API_WARNING"
  3785. // "FIELD_VALUE_OVERRIDEN"
  3786. // "INJECTED_KERNELS_DEPRECATED"
  3787. // "MISSING_TYPE_DEPENDENCY"
  3788. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  3789. // "NEXT_HOP_CANNOT_IP_FORWARD"
  3790. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  3791. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  3792. // "NEXT_HOP_NOT_RUNNING"
  3793. // "NOT_CRITICAL_ERROR"
  3794. // "NO_RESULTS_ON_PAGE"
  3795. // "REQUIRED_TOS_AGREEMENT"
  3796. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  3797. // "RESOURCE_NOT_DELETED"
  3798. // "SCHEMA_VALIDATION_IGNORED"
  3799. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  3800. // "UNDECLARED_PROPERTIES"
  3801. // "UNREACHABLE"
  3802. Code string `json:"code,omitempty"`
  3803. // Data: [Output Only] Metadata about this warning in key: value format.
  3804. // For example:
  3805. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  3806. Data []*BackendServicesScopedListWarningData `json:"data,omitempty"`
  3807. // Message: [Output Only] A human-readable description of the warning
  3808. // code.
  3809. Message string `json:"message,omitempty"`
  3810. // ForceSendFields is a list of field names (e.g. "Code") to
  3811. // unconditionally include in API requests. By default, fields with
  3812. // empty values are omitted from API requests. However, any non-pointer,
  3813. // non-interface field appearing in ForceSendFields will be sent to the
  3814. // server regardless of whether the field is empty or not. This may be
  3815. // used to include empty fields in Patch requests.
  3816. ForceSendFields []string `json:"-"`
  3817. // NullFields is a list of field names (e.g. "Code") to include in API
  3818. // requests with the JSON null value. By default, fields with empty
  3819. // values are omitted from API requests. However, any field with an
  3820. // empty value appearing in NullFields will be sent to the server as
  3821. // null. It is an error if a field in this list has a non-empty value.
  3822. // This may be used to include null fields in Patch requests.
  3823. NullFields []string `json:"-"`
  3824. }
  3825. func (s *BackendServicesScopedListWarning) MarshalJSON() ([]byte, error) {
  3826. type NoMethod BackendServicesScopedListWarning
  3827. raw := NoMethod(*s)
  3828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3829. }
  3830. type BackendServicesScopedListWarningData struct {
  3831. // Key: [Output Only] A key that provides more detail on the warning
  3832. // being returned. For example, for warnings where there are no results
  3833. // in a list request for a particular zone, this key might be scope and
  3834. // the key value might be the zone name. Other examples might be a key
  3835. // indicating a deprecated resource and a suggested replacement, or a
  3836. // warning about invalid network settings (for example, if an instance
  3837. // attempts to perform IP forwarding but is not enabled for IP
  3838. // forwarding).
  3839. Key string `json:"key,omitempty"`
  3840. // Value: [Output Only] A warning data value corresponding to the key.
  3841. Value string `json:"value,omitempty"`
  3842. // ForceSendFields is a list of field names (e.g. "Key") to
  3843. // unconditionally include in API requests. By default, fields with
  3844. // empty values are omitted from API requests. However, any non-pointer,
  3845. // non-interface field appearing in ForceSendFields will be sent to the
  3846. // server regardless of whether the field is empty or not. This may be
  3847. // used to include empty fields in Patch requests.
  3848. ForceSendFields []string `json:"-"`
  3849. // NullFields is a list of field names (e.g. "Key") to include in API
  3850. // requests with the JSON null value. By default, fields with empty
  3851. // values are omitted from API requests. However, any field with an
  3852. // empty value appearing in NullFields will be sent to the server as
  3853. // null. It is an error if a field in this list has a non-empty value.
  3854. // This may be used to include null fields in Patch requests.
  3855. NullFields []string `json:"-"`
  3856. }
  3857. func (s *BackendServicesScopedListWarningData) MarshalJSON() ([]byte, error) {
  3858. type NoMethod BackendServicesScopedListWarningData
  3859. raw := NoMethod(*s)
  3860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3861. }
  3862. // Binding: Associates `members` with a `role`.
  3863. type Binding struct {
  3864. // Condition: The condition that is associated with this binding. NOTE:
  3865. // An unsatisfied condition will not allow user access via current
  3866. // binding. Different bindings, including their conditions, are examined
  3867. // independently.
  3868. Condition *Expr `json:"condition,omitempty"`
  3869. // Members: Specifies the identities requesting access for a Cloud
  3870. // Platform resource. `members` can have the following values:
  3871. //
  3872. // * `allUsers`: A special identifier that represents anyone who is on
  3873. // the internet; with or without a Google account.
  3874. //
  3875. // * `allAuthenticatedUsers`: A special identifier that represents
  3876. // anyone who is authenticated with a Google account or a service
  3877. // account.
  3878. //
  3879. // * `user:{emailid}`: An email address that represents a specific
  3880. // Google account. For example, `alice@gmail.com` .
  3881. //
  3882. //
  3883. //
  3884. // * `serviceAccount:{emailid}`: An email address that represents a
  3885. // service account. For example,
  3886. // `my-other-app@appspot.gserviceaccount.com`.
  3887. //
  3888. // * `group:{emailid}`: An email address that represents a Google group.
  3889. // For example, `admins@example.com`.
  3890. //
  3891. //
  3892. //
  3893. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  3894. // the users of that domain. For example, `google.com` or `example.com`.
  3895. Members []string `json:"members,omitempty"`
  3896. // Role: Role that is assigned to `members`. For example,
  3897. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  3898. Role string `json:"role,omitempty"`
  3899. // ForceSendFields is a list of field names (e.g. "Condition") to
  3900. // unconditionally include in API requests. By default, fields with
  3901. // empty values are omitted from API requests. However, any non-pointer,
  3902. // non-interface field appearing in ForceSendFields will be sent to the
  3903. // server regardless of whether the field is empty or not. This may be
  3904. // used to include empty fields in Patch requests.
  3905. ForceSendFields []string `json:"-"`
  3906. // NullFields is a list of field names (e.g. "Condition") to include in
  3907. // API requests with the JSON null value. By default, fields with empty
  3908. // values are omitted from API requests. However, any field with an
  3909. // empty value appearing in NullFields will be sent to the server as
  3910. // null. It is an error if a field in this list has a non-empty value.
  3911. // This may be used to include null fields in Patch requests.
  3912. NullFields []string `json:"-"`
  3913. }
  3914. func (s *Binding) MarshalJSON() ([]byte, error) {
  3915. type NoMethod Binding
  3916. raw := NoMethod(*s)
  3917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3918. }
  3919. type CacheInvalidationRule struct {
  3920. // Host: If set, this invalidation rule will only apply to requests with
  3921. // a Host header matching host.
  3922. Host string `json:"host,omitempty"`
  3923. Path string `json:"path,omitempty"`
  3924. // ForceSendFields is a list of field names (e.g. "Host") to
  3925. // unconditionally include in API requests. By default, fields with
  3926. // empty values are omitted from API requests. However, any non-pointer,
  3927. // non-interface field appearing in ForceSendFields will be sent to the
  3928. // server regardless of whether the field is empty or not. This may be
  3929. // used to include empty fields in Patch requests.
  3930. ForceSendFields []string `json:"-"`
  3931. // NullFields is a list of field names (e.g. "Host") to include in API
  3932. // requests with the JSON null value. By default, fields with empty
  3933. // values are omitted from API requests. However, any field with an
  3934. // empty value appearing in NullFields will be sent to the server as
  3935. // null. It is an error if a field in this list has a non-empty value.
  3936. // This may be used to include null fields in Patch requests.
  3937. NullFields []string `json:"-"`
  3938. }
  3939. func (s *CacheInvalidationRule) MarshalJSON() ([]byte, error) {
  3940. type NoMethod CacheInvalidationRule
  3941. raw := NoMethod(*s)
  3942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3943. }
  3944. // CacheKeyPolicy: Message containing what to include in the cache key
  3945. // for a request for Cloud CDN.
  3946. type CacheKeyPolicy struct {
  3947. // IncludeHost: If true, requests to different hosts will be cached
  3948. // separately.
  3949. IncludeHost bool `json:"includeHost,omitempty"`
  3950. // IncludeProtocol: If true, http and https requests will be cached
  3951. // separately.
  3952. IncludeProtocol bool `json:"includeProtocol,omitempty"`
  3953. // IncludeQueryString: If true, include query string parameters in the
  3954. // cache key according to query_string_whitelist and
  3955. // query_string_blacklist. If neither is set, the entire query string
  3956. // will be included. If false, the query string will be excluded from
  3957. // the cache key entirely.
  3958. IncludeQueryString bool `json:"includeQueryString,omitempty"`
  3959. // QueryStringBlacklist: Names of query string parameters to exclude in
  3960. // cache keys. All other parameters will be included. Either specify
  3961. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3962. // '=' will be percent encoded and not treated as delimiters.
  3963. QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
  3964. // QueryStringWhitelist: Names of query string parameters to include in
  3965. // cache keys. All other parameters will be excluded. Either specify
  3966. // query_string_whitelist or query_string_blacklist, not both. '&' and
  3967. // '=' will be percent encoded and not treated as delimiters.
  3968. QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
  3969. // ForceSendFields is a list of field names (e.g. "IncludeHost") to
  3970. // unconditionally include in API requests. By default, fields with
  3971. // empty values are omitted from API requests. However, any non-pointer,
  3972. // non-interface field appearing in ForceSendFields will be sent to the
  3973. // server regardless of whether the field is empty or not. This may be
  3974. // used to include empty fields in Patch requests.
  3975. ForceSendFields []string `json:"-"`
  3976. // NullFields is a list of field names (e.g. "IncludeHost") to include
  3977. // in API requests with the JSON null value. By default, fields with
  3978. // empty values are omitted from API requests. However, any field with
  3979. // an empty value appearing in NullFields will be sent to the server as
  3980. // null. It is an error if a field in this list has a non-empty value.
  3981. // This may be used to include null fields in Patch requests.
  3982. NullFields []string `json:"-"`
  3983. }
  3984. func (s *CacheKeyPolicy) MarshalJSON() ([]byte, error) {
  3985. type NoMethod CacheKeyPolicy
  3986. raw := NoMethod(*s)
  3987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3988. }
  3989. // Commitment: Represents a Commitment resource. Creating a Commitment
  3990. // resource means that you are purchasing a committed use contract with
  3991. // an explicit start and end time. You can create commitments based on
  3992. // vCPUs and memory usage and receive discounted rates. For full
  3993. // details, read Signing Up for Committed Use Discounts.
  3994. //
  3995. // Committed use discounts are subject to Google Cloud Platform's
  3996. // Service Specific Terms. By purchasing a committed use discount, you
  3997. // agree to these terms. Committed use discounts will not renew, so you
  3998. // must purchase a new commitment to continue receiving discounts. (==
  3999. // resource_for beta.commitments ==) (== resource_for v1.commitments ==)
  4000. type Commitment struct {
  4001. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4002. // format.
  4003. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4004. // Description: An optional description of this resource. Provide this
  4005. // property when you create the resource.
  4006. Description string `json:"description,omitempty"`
  4007. // EndTimestamp: [Output Only] Commitment end time in RFC3339 text
  4008. // format.
  4009. EndTimestamp string `json:"endTimestamp,omitempty"`
  4010. // Id: [Output Only] The unique identifier for the resource. This
  4011. // identifier is defined by the server.
  4012. Id uint64 `json:"id,omitempty,string"`
  4013. // Kind: [Output Only] Type of the resource. Always compute#commitment
  4014. // for commitments.
  4015. Kind string `json:"kind,omitempty"`
  4016. // Name: Name of the resource. Provided by the client when the resource
  4017. // is created. The name must be 1-63 characters long, and comply with
  4018. // RFC1035. Specifically, the name must be 1-63 characters long and
  4019. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4020. // the first character must be a lowercase letter, and all following
  4021. // characters must be a dash, lowercase letter, or digit, except the
  4022. // last character, which cannot be a dash.
  4023. Name string `json:"name,omitempty"`
  4024. // Plan: The plan for this commitment, which determines duration and
  4025. // discount rate. The currently supported plans are TWELVE_MONTH (1
  4026. // year), and THIRTY_SIX_MONTH (3 years).
  4027. //
  4028. // Possible values:
  4029. // "INVALID"
  4030. // "THIRTY_SIX_MONTH"
  4031. // "TWELVE_MONTH"
  4032. Plan string `json:"plan,omitempty"`
  4033. // Region: [Output Only] URL of the region where this commitment may be
  4034. // used.
  4035. Region string `json:"region,omitempty"`
  4036. // Resources: A list of commitment amounts for particular resources.
  4037. // Note that VCPU and MEMORY resource commitments must occur together.
  4038. Resources []*ResourceCommitment `json:"resources,omitempty"`
  4039. // SelfLink: [Output Only] Server-defined URL for the resource.
  4040. SelfLink string `json:"selfLink,omitempty"`
  4041. // StartTimestamp: [Output Only] Commitment start time in RFC3339 text
  4042. // format.
  4043. StartTimestamp string `json:"startTimestamp,omitempty"`
  4044. // Status: [Output Only] Status of the commitment with regards to
  4045. // eventual expiration (each commitment has an end date defined). One of
  4046. // the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED.
  4047. //
  4048. // Possible values:
  4049. // "ACTIVE"
  4050. // "CREATING"
  4051. // "EXPIRED"
  4052. // "NOT_YET_ACTIVE"
  4053. Status string `json:"status,omitempty"`
  4054. // StatusMessage: [Output Only] An optional, human-readable explanation
  4055. // of the status.
  4056. StatusMessage string `json:"statusMessage,omitempty"`
  4057. // ServerResponse contains the HTTP response code and headers from the
  4058. // server.
  4059. googleapi.ServerResponse `json:"-"`
  4060. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4061. // to unconditionally include in API requests. By default, fields with
  4062. // empty values are omitted from API requests. However, any non-pointer,
  4063. // non-interface field appearing in ForceSendFields will be sent to the
  4064. // server regardless of whether the field is empty or not. This may be
  4065. // used to include empty fields in Patch requests.
  4066. ForceSendFields []string `json:"-"`
  4067. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4068. // include in API requests with the JSON null value. By default, fields
  4069. // with empty values are omitted from API requests. However, any field
  4070. // with an empty value appearing in NullFields will be sent to the
  4071. // server as null. It is an error if a field in this list has a
  4072. // non-empty value. This may be used to include null fields in Patch
  4073. // requests.
  4074. NullFields []string `json:"-"`
  4075. }
  4076. func (s *Commitment) MarshalJSON() ([]byte, error) {
  4077. type NoMethod Commitment
  4078. raw := NoMethod(*s)
  4079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4080. }
  4081. type CommitmentAggregatedList struct {
  4082. // Id: [Output Only] Unique identifier for the resource; defined by the
  4083. // server.
  4084. Id string `json:"id,omitempty"`
  4085. // Items: A list of CommitmentsScopedList resources.
  4086. Items map[string]CommitmentsScopedList `json:"items,omitempty"`
  4087. // Kind: [Output Only] Type of resource. Always
  4088. // compute#commitmentAggregatedList for aggregated lists of commitments.
  4089. Kind string `json:"kind,omitempty"`
  4090. // NextPageToken: [Output Only] This token allows you to get the next
  4091. // page of results for list requests. If the number of results is larger
  4092. // than maxResults, use the nextPageToken as a value for the query
  4093. // parameter pageToken in the next list request. Subsequent list
  4094. // requests will have their own nextPageToken to continue paging through
  4095. // the results.
  4096. NextPageToken string `json:"nextPageToken,omitempty"`
  4097. // SelfLink: [Output Only] Server-defined URL for this resource.
  4098. SelfLink string `json:"selfLink,omitempty"`
  4099. // Warning: [Output Only] Informational warning message.
  4100. Warning *CommitmentAggregatedListWarning `json:"warning,omitempty"`
  4101. // ServerResponse contains the HTTP response code and headers from the
  4102. // server.
  4103. googleapi.ServerResponse `json:"-"`
  4104. // ForceSendFields is a list of field names (e.g. "Id") to
  4105. // unconditionally include in API requests. By default, fields with
  4106. // empty values are omitted from API requests. However, any non-pointer,
  4107. // non-interface field appearing in ForceSendFields will be sent to the
  4108. // server regardless of whether the field is empty or not. This may be
  4109. // used to include empty fields in Patch requests.
  4110. ForceSendFields []string `json:"-"`
  4111. // NullFields is a list of field names (e.g. "Id") to include in API
  4112. // requests with the JSON null value. By default, fields with empty
  4113. // values are omitted from API requests. However, any field with an
  4114. // empty value appearing in NullFields will be sent to the server as
  4115. // null. It is an error if a field in this list has a non-empty value.
  4116. // This may be used to include null fields in Patch requests.
  4117. NullFields []string `json:"-"`
  4118. }
  4119. func (s *CommitmentAggregatedList) MarshalJSON() ([]byte, error) {
  4120. type NoMethod CommitmentAggregatedList
  4121. raw := NoMethod(*s)
  4122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4123. }
  4124. // CommitmentAggregatedListWarning: [Output Only] Informational warning
  4125. // message.
  4126. type CommitmentAggregatedListWarning struct {
  4127. // Code: [Output Only] A warning code, if applicable. For example,
  4128. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4129. // the response.
  4130. //
  4131. // Possible values:
  4132. // "CLEANUP_FAILED"
  4133. // "DEPRECATED_RESOURCE_USED"
  4134. // "DEPRECATED_TYPE_USED"
  4135. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4136. // "EXPERIMENTAL_TYPE_USED"
  4137. // "EXTERNAL_API_WARNING"
  4138. // "FIELD_VALUE_OVERRIDEN"
  4139. // "INJECTED_KERNELS_DEPRECATED"
  4140. // "MISSING_TYPE_DEPENDENCY"
  4141. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4142. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4143. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4144. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4145. // "NEXT_HOP_NOT_RUNNING"
  4146. // "NOT_CRITICAL_ERROR"
  4147. // "NO_RESULTS_ON_PAGE"
  4148. // "REQUIRED_TOS_AGREEMENT"
  4149. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4150. // "RESOURCE_NOT_DELETED"
  4151. // "SCHEMA_VALIDATION_IGNORED"
  4152. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4153. // "UNDECLARED_PROPERTIES"
  4154. // "UNREACHABLE"
  4155. Code string `json:"code,omitempty"`
  4156. // Data: [Output Only] Metadata about this warning in key: value format.
  4157. // For example:
  4158. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4159. Data []*CommitmentAggregatedListWarningData `json:"data,omitempty"`
  4160. // Message: [Output Only] A human-readable description of the warning
  4161. // code.
  4162. Message string `json:"message,omitempty"`
  4163. // ForceSendFields is a list of field names (e.g. "Code") to
  4164. // unconditionally include in API requests. By default, fields with
  4165. // empty values are omitted from API requests. However, any non-pointer,
  4166. // non-interface field appearing in ForceSendFields will be sent to the
  4167. // server regardless of whether the field is empty or not. This may be
  4168. // used to include empty fields in Patch requests.
  4169. ForceSendFields []string `json:"-"`
  4170. // NullFields is a list of field names (e.g. "Code") to include in API
  4171. // requests with the JSON null value. By default, fields with empty
  4172. // values are omitted from API requests. However, any field with an
  4173. // empty value appearing in NullFields will be sent to the server as
  4174. // null. It is an error if a field in this list has a non-empty value.
  4175. // This may be used to include null fields in Patch requests.
  4176. NullFields []string `json:"-"`
  4177. }
  4178. func (s *CommitmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4179. type NoMethod CommitmentAggregatedListWarning
  4180. raw := NoMethod(*s)
  4181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4182. }
  4183. type CommitmentAggregatedListWarningData struct {
  4184. // Key: [Output Only] A key that provides more detail on the warning
  4185. // being returned. For example, for warnings where there are no results
  4186. // in a list request for a particular zone, this key might be scope and
  4187. // the key value might be the zone name. Other examples might be a key
  4188. // indicating a deprecated resource and a suggested replacement, or a
  4189. // warning about invalid network settings (for example, if an instance
  4190. // attempts to perform IP forwarding but is not enabled for IP
  4191. // forwarding).
  4192. Key string `json:"key,omitempty"`
  4193. // Value: [Output Only] A warning data value corresponding to the key.
  4194. Value string `json:"value,omitempty"`
  4195. // ForceSendFields is a list of field names (e.g. "Key") to
  4196. // unconditionally include in API requests. By default, fields with
  4197. // empty values are omitted from API requests. However, any non-pointer,
  4198. // non-interface field appearing in ForceSendFields will be sent to the
  4199. // server regardless of whether the field is empty or not. This may be
  4200. // used to include empty fields in Patch requests.
  4201. ForceSendFields []string `json:"-"`
  4202. // NullFields is a list of field names (e.g. "Key") to include in API
  4203. // requests with the JSON null value. By default, fields with empty
  4204. // values are omitted from API requests. However, any field with an
  4205. // empty value appearing in NullFields will be sent to the server as
  4206. // null. It is an error if a field in this list has a non-empty value.
  4207. // This may be used to include null fields in Patch requests.
  4208. NullFields []string `json:"-"`
  4209. }
  4210. func (s *CommitmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4211. type NoMethod CommitmentAggregatedListWarningData
  4212. raw := NoMethod(*s)
  4213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4214. }
  4215. // CommitmentList: Contains a list of Commitment resources.
  4216. type CommitmentList struct {
  4217. // Id: [Output Only] Unique identifier for the resource; defined by the
  4218. // server.
  4219. Id string `json:"id,omitempty"`
  4220. // Items: A list of Commitment resources.
  4221. Items []*Commitment `json:"items,omitempty"`
  4222. // Kind: [Output Only] Type of resource. Always compute#commitmentList
  4223. // for lists of commitments.
  4224. Kind string `json:"kind,omitempty"`
  4225. // NextPageToken: [Output Only] This token allows you to get the next
  4226. // page of results for list requests. If the number of results is larger
  4227. // than maxResults, use the nextPageToken as a value for the query
  4228. // parameter pageToken in the next list request. Subsequent list
  4229. // requests will have their own nextPageToken to continue paging through
  4230. // the results.
  4231. NextPageToken string `json:"nextPageToken,omitempty"`
  4232. // SelfLink: [Output Only] Server-defined URL for this resource.
  4233. SelfLink string `json:"selfLink,omitempty"`
  4234. // Warning: [Output Only] Informational warning message.
  4235. Warning *CommitmentListWarning `json:"warning,omitempty"`
  4236. // ServerResponse contains the HTTP response code and headers from the
  4237. // server.
  4238. googleapi.ServerResponse `json:"-"`
  4239. // ForceSendFields is a list of field names (e.g. "Id") to
  4240. // unconditionally include in API requests. By default, fields with
  4241. // empty values are omitted from API requests. However, any non-pointer,
  4242. // non-interface field appearing in ForceSendFields will be sent to the
  4243. // server regardless of whether the field is empty or not. This may be
  4244. // used to include empty fields in Patch requests.
  4245. ForceSendFields []string `json:"-"`
  4246. // NullFields is a list of field names (e.g. "Id") to include in API
  4247. // requests with the JSON null value. By default, fields with empty
  4248. // values are omitted from API requests. However, any field with an
  4249. // empty value appearing in NullFields will be sent to the server as
  4250. // null. It is an error if a field in this list has a non-empty value.
  4251. // This may be used to include null fields in Patch requests.
  4252. NullFields []string `json:"-"`
  4253. }
  4254. func (s *CommitmentList) MarshalJSON() ([]byte, error) {
  4255. type NoMethod CommitmentList
  4256. raw := NoMethod(*s)
  4257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4258. }
  4259. // CommitmentListWarning: [Output Only] Informational warning message.
  4260. type CommitmentListWarning struct {
  4261. // Code: [Output Only] A warning code, if applicable. For example,
  4262. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4263. // the response.
  4264. //
  4265. // Possible values:
  4266. // "CLEANUP_FAILED"
  4267. // "DEPRECATED_RESOURCE_USED"
  4268. // "DEPRECATED_TYPE_USED"
  4269. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4270. // "EXPERIMENTAL_TYPE_USED"
  4271. // "EXTERNAL_API_WARNING"
  4272. // "FIELD_VALUE_OVERRIDEN"
  4273. // "INJECTED_KERNELS_DEPRECATED"
  4274. // "MISSING_TYPE_DEPENDENCY"
  4275. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4276. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4277. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4278. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4279. // "NEXT_HOP_NOT_RUNNING"
  4280. // "NOT_CRITICAL_ERROR"
  4281. // "NO_RESULTS_ON_PAGE"
  4282. // "REQUIRED_TOS_AGREEMENT"
  4283. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4284. // "RESOURCE_NOT_DELETED"
  4285. // "SCHEMA_VALIDATION_IGNORED"
  4286. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4287. // "UNDECLARED_PROPERTIES"
  4288. // "UNREACHABLE"
  4289. Code string `json:"code,omitempty"`
  4290. // Data: [Output Only] Metadata about this warning in key: value format.
  4291. // For example:
  4292. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4293. Data []*CommitmentListWarningData `json:"data,omitempty"`
  4294. // Message: [Output Only] A human-readable description of the warning
  4295. // code.
  4296. Message string `json:"message,omitempty"`
  4297. // ForceSendFields is a list of field names (e.g. "Code") to
  4298. // unconditionally include in API requests. By default, fields with
  4299. // empty values are omitted from API requests. However, any non-pointer,
  4300. // non-interface field appearing in ForceSendFields will be sent to the
  4301. // server regardless of whether the field is empty or not. This may be
  4302. // used to include empty fields in Patch requests.
  4303. ForceSendFields []string `json:"-"`
  4304. // NullFields is a list of field names (e.g. "Code") to include in API
  4305. // requests with the JSON null value. By default, fields with empty
  4306. // values are omitted from API requests. However, any field with an
  4307. // empty value appearing in NullFields will be sent to the server as
  4308. // null. It is an error if a field in this list has a non-empty value.
  4309. // This may be used to include null fields in Patch requests.
  4310. NullFields []string `json:"-"`
  4311. }
  4312. func (s *CommitmentListWarning) MarshalJSON() ([]byte, error) {
  4313. type NoMethod CommitmentListWarning
  4314. raw := NoMethod(*s)
  4315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4316. }
  4317. type CommitmentListWarningData struct {
  4318. // Key: [Output Only] A key that provides more detail on the warning
  4319. // being returned. For example, for warnings where there are no results
  4320. // in a list request for a particular zone, this key might be scope and
  4321. // the key value might be the zone name. Other examples might be a key
  4322. // indicating a deprecated resource and a suggested replacement, or a
  4323. // warning about invalid network settings (for example, if an instance
  4324. // attempts to perform IP forwarding but is not enabled for IP
  4325. // forwarding).
  4326. Key string `json:"key,omitempty"`
  4327. // Value: [Output Only] A warning data value corresponding to the key.
  4328. Value string `json:"value,omitempty"`
  4329. // ForceSendFields is a list of field names (e.g. "Key") to
  4330. // unconditionally include in API requests. By default, fields with
  4331. // empty values are omitted from API requests. However, any non-pointer,
  4332. // non-interface field appearing in ForceSendFields will be sent to the
  4333. // server regardless of whether the field is empty or not. This may be
  4334. // used to include empty fields in Patch requests.
  4335. ForceSendFields []string `json:"-"`
  4336. // NullFields is a list of field names (e.g. "Key") to include in API
  4337. // requests with the JSON null value. By default, fields with empty
  4338. // values are omitted from API requests. However, any field with an
  4339. // empty value appearing in NullFields will be sent to the server as
  4340. // null. It is an error if a field in this list has a non-empty value.
  4341. // This may be used to include null fields in Patch requests.
  4342. NullFields []string `json:"-"`
  4343. }
  4344. func (s *CommitmentListWarningData) MarshalJSON() ([]byte, error) {
  4345. type NoMethod CommitmentListWarningData
  4346. raw := NoMethod(*s)
  4347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4348. }
  4349. type CommitmentsScopedList struct {
  4350. // Commitments: [Output Only] A list of commitments contained in this
  4351. // scope.
  4352. Commitments []*Commitment `json:"commitments,omitempty"`
  4353. // Warning: [Output Only] Informational warning which replaces the list
  4354. // of commitments when the list is empty.
  4355. Warning *CommitmentsScopedListWarning `json:"warning,omitempty"`
  4356. // ForceSendFields is a list of field names (e.g. "Commitments") to
  4357. // unconditionally include in API requests. By default, fields with
  4358. // empty values are omitted from API requests. However, any non-pointer,
  4359. // non-interface field appearing in ForceSendFields will be sent to the
  4360. // server regardless of whether the field is empty or not. This may be
  4361. // used to include empty fields in Patch requests.
  4362. ForceSendFields []string `json:"-"`
  4363. // NullFields is a list of field names (e.g. "Commitments") to include
  4364. // in API requests with the JSON null value. By default, fields with
  4365. // empty values are omitted from API requests. However, any field with
  4366. // an empty value appearing in NullFields will be sent to the server as
  4367. // null. It is an error if a field in this list has a non-empty value.
  4368. // This may be used to include null fields in Patch requests.
  4369. NullFields []string `json:"-"`
  4370. }
  4371. func (s *CommitmentsScopedList) MarshalJSON() ([]byte, error) {
  4372. type NoMethod CommitmentsScopedList
  4373. raw := NoMethod(*s)
  4374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4375. }
  4376. // CommitmentsScopedListWarning: [Output Only] Informational warning
  4377. // which replaces the list of commitments when the list is empty.
  4378. type CommitmentsScopedListWarning struct {
  4379. // Code: [Output Only] A warning code, if applicable. For example,
  4380. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4381. // the response.
  4382. //
  4383. // Possible values:
  4384. // "CLEANUP_FAILED"
  4385. // "DEPRECATED_RESOURCE_USED"
  4386. // "DEPRECATED_TYPE_USED"
  4387. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4388. // "EXPERIMENTAL_TYPE_USED"
  4389. // "EXTERNAL_API_WARNING"
  4390. // "FIELD_VALUE_OVERRIDEN"
  4391. // "INJECTED_KERNELS_DEPRECATED"
  4392. // "MISSING_TYPE_DEPENDENCY"
  4393. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4394. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4395. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4396. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4397. // "NEXT_HOP_NOT_RUNNING"
  4398. // "NOT_CRITICAL_ERROR"
  4399. // "NO_RESULTS_ON_PAGE"
  4400. // "REQUIRED_TOS_AGREEMENT"
  4401. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4402. // "RESOURCE_NOT_DELETED"
  4403. // "SCHEMA_VALIDATION_IGNORED"
  4404. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4405. // "UNDECLARED_PROPERTIES"
  4406. // "UNREACHABLE"
  4407. Code string `json:"code,omitempty"`
  4408. // Data: [Output Only] Metadata about this warning in key: value format.
  4409. // For example:
  4410. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4411. Data []*CommitmentsScopedListWarningData `json:"data,omitempty"`
  4412. // Message: [Output Only] A human-readable description of the warning
  4413. // code.
  4414. Message string `json:"message,omitempty"`
  4415. // ForceSendFields is a list of field names (e.g. "Code") to
  4416. // unconditionally include in API requests. By default, fields with
  4417. // empty values are omitted from API requests. However, any non-pointer,
  4418. // non-interface field appearing in ForceSendFields will be sent to the
  4419. // server regardless of whether the field is empty or not. This may be
  4420. // used to include empty fields in Patch requests.
  4421. ForceSendFields []string `json:"-"`
  4422. // NullFields is a list of field names (e.g. "Code") to include in API
  4423. // requests with the JSON null value. By default, fields with empty
  4424. // values are omitted from API requests. However, any field with an
  4425. // empty value appearing in NullFields will be sent to the server as
  4426. // null. It is an error if a field in this list has a non-empty value.
  4427. // This may be used to include null fields in Patch requests.
  4428. NullFields []string `json:"-"`
  4429. }
  4430. func (s *CommitmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  4431. type NoMethod CommitmentsScopedListWarning
  4432. raw := NoMethod(*s)
  4433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4434. }
  4435. type CommitmentsScopedListWarningData struct {
  4436. // Key: [Output Only] A key that provides more detail on the warning
  4437. // being returned. For example, for warnings where there are no results
  4438. // in a list request for a particular zone, this key might be scope and
  4439. // the key value might be the zone name. Other examples might be a key
  4440. // indicating a deprecated resource and a suggested replacement, or a
  4441. // warning about invalid network settings (for example, if an instance
  4442. // attempts to perform IP forwarding but is not enabled for IP
  4443. // forwarding).
  4444. Key string `json:"key,omitempty"`
  4445. // Value: [Output Only] A warning data value corresponding to the key.
  4446. Value string `json:"value,omitempty"`
  4447. // ForceSendFields is a list of field names (e.g. "Key") to
  4448. // unconditionally include in API requests. By default, fields with
  4449. // empty values are omitted from API requests. However, any non-pointer,
  4450. // non-interface field appearing in ForceSendFields will be sent to the
  4451. // server regardless of whether the field is empty or not. This may be
  4452. // used to include empty fields in Patch requests.
  4453. ForceSendFields []string `json:"-"`
  4454. // NullFields is a list of field names (e.g. "Key") to include in API
  4455. // requests with the JSON null value. By default, fields with empty
  4456. // values are omitted from API requests. However, any field with an
  4457. // empty value appearing in NullFields will be sent to the server as
  4458. // null. It is an error if a field in this list has a non-empty value.
  4459. // This may be used to include null fields in Patch requests.
  4460. NullFields []string `json:"-"`
  4461. }
  4462. func (s *CommitmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  4463. type NoMethod CommitmentsScopedListWarningData
  4464. raw := NoMethod(*s)
  4465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4466. }
  4467. // Condition: A condition to be met.
  4468. type Condition struct {
  4469. // Iam: Trusted attributes supplied by the IAM system.
  4470. //
  4471. // Possible values:
  4472. // "APPROVER"
  4473. // "ATTRIBUTION"
  4474. // "AUTHORITY"
  4475. // "CREDENTIALS_TYPE"
  4476. // "JUSTIFICATION_TYPE"
  4477. // "NO_ATTR"
  4478. // "SECURITY_REALM"
  4479. Iam string `json:"iam,omitempty"`
  4480. // Op: An operator to apply the subject with.
  4481. //
  4482. // Possible values:
  4483. // "DISCHARGED"
  4484. // "EQUALS"
  4485. // "IN"
  4486. // "NOT_EQUALS"
  4487. // "NOT_IN"
  4488. // "NO_OP"
  4489. Op string `json:"op,omitempty"`
  4490. // Svc: Trusted attributes discharged by the service.
  4491. Svc string `json:"svc,omitempty"`
  4492. // Sys: Trusted attributes supplied by any service that owns resources
  4493. // and uses the IAM system for access control.
  4494. //
  4495. // Possible values:
  4496. // "IP"
  4497. // "NAME"
  4498. // "NO_ATTR"
  4499. // "REGION"
  4500. // "SERVICE"
  4501. Sys string `json:"sys,omitempty"`
  4502. // Values: The objects of the condition.
  4503. Values []string `json:"values,omitempty"`
  4504. // ForceSendFields is a list of field names (e.g. "Iam") to
  4505. // unconditionally include in API requests. By default, fields with
  4506. // empty values are omitted from API requests. However, any non-pointer,
  4507. // non-interface field appearing in ForceSendFields will be sent to the
  4508. // server regardless of whether the field is empty or not. This may be
  4509. // used to include empty fields in Patch requests.
  4510. ForceSendFields []string `json:"-"`
  4511. // NullFields is a list of field names (e.g. "Iam") to include in API
  4512. // requests with the JSON null value. By default, fields with empty
  4513. // values are omitted from API requests. However, any field with an
  4514. // empty value appearing in NullFields will be sent to the server as
  4515. // null. It is an error if a field in this list has a non-empty value.
  4516. // This may be used to include null fields in Patch requests.
  4517. NullFields []string `json:"-"`
  4518. }
  4519. func (s *Condition) MarshalJSON() ([]byte, error) {
  4520. type NoMethod Condition
  4521. raw := NoMethod(*s)
  4522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4523. }
  4524. // ConnectionDraining: Message containing connection draining
  4525. // configuration.
  4526. type ConnectionDraining struct {
  4527. // DrainingTimeoutSec: Time for which instance will be drained (not
  4528. // accept new connections, but still work to finish started).
  4529. DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
  4530. // ForceSendFields is a list of field names (e.g. "DrainingTimeoutSec")
  4531. // to unconditionally include in API requests. By default, fields with
  4532. // empty values are omitted from API requests. However, any non-pointer,
  4533. // non-interface field appearing in ForceSendFields will be sent to the
  4534. // server regardless of whether the field is empty or not. This may be
  4535. // used to include empty fields in Patch requests.
  4536. ForceSendFields []string `json:"-"`
  4537. // NullFields is a list of field names (e.g. "DrainingTimeoutSec") to
  4538. // include in API requests with the JSON null value. By default, fields
  4539. // with empty values are omitted from API requests. However, any field
  4540. // with an empty value appearing in NullFields will be sent to the
  4541. // server as null. It is an error if a field in this list has a
  4542. // non-empty value. This may be used to include null fields in Patch
  4543. // requests.
  4544. NullFields []string `json:"-"`
  4545. }
  4546. func (s *ConnectionDraining) MarshalJSON() ([]byte, error) {
  4547. type NoMethod ConnectionDraining
  4548. raw := NoMethod(*s)
  4549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4550. }
  4551. // CustomerEncryptionKey: Represents a customer-supplied encryption key
  4552. type CustomerEncryptionKey struct {
  4553. // KmsKeyName: The name of the encryption key that is stored in Google
  4554. // Cloud KMS.
  4555. KmsKeyName string `json:"kmsKeyName,omitempty"`
  4556. // RawKey: Specifies a 256-bit customer-supplied encryption key, encoded
  4557. // in RFC 4648 base64 to either encrypt or decrypt this resource.
  4558. RawKey string `json:"rawKey,omitempty"`
  4559. // Sha256: [Output only] The RFC 4648 base64 encoded SHA-256 hash of the
  4560. // customer-supplied encryption key that protects this resource.
  4561. Sha256 string `json:"sha256,omitempty"`
  4562. // ForceSendFields is a list of field names (e.g. "KmsKeyName") to
  4563. // unconditionally include in API requests. By default, fields with
  4564. // empty values are omitted from API requests. However, any non-pointer,
  4565. // non-interface field appearing in ForceSendFields will be sent to the
  4566. // server regardless of whether the field is empty or not. This may be
  4567. // used to include empty fields in Patch requests.
  4568. ForceSendFields []string `json:"-"`
  4569. // NullFields is a list of field names (e.g. "KmsKeyName") to include in
  4570. // API requests with the JSON null value. By default, fields with empty
  4571. // values are omitted from API requests. However, any field with an
  4572. // empty value appearing in NullFields will be sent to the server as
  4573. // null. It is an error if a field in this list has a non-empty value.
  4574. // This may be used to include null fields in Patch requests.
  4575. NullFields []string `json:"-"`
  4576. }
  4577. func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
  4578. type NoMethod CustomerEncryptionKey
  4579. raw := NoMethod(*s)
  4580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4581. }
  4582. type CustomerEncryptionKeyProtectedDisk struct {
  4583. // DiskEncryptionKey: Decrypts data associated with the disk with a
  4584. // customer-supplied encryption key.
  4585. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4586. // Source: Specifies a valid partial or full URL to an existing
  4587. // Persistent Disk resource. This field is only applicable for
  4588. // persistent disks.
  4589. Source string `json:"source,omitempty"`
  4590. // ForceSendFields is a list of field names (e.g. "DiskEncryptionKey")
  4591. // to unconditionally include in API requests. By default, fields with
  4592. // empty values are omitted from API requests. However, any non-pointer,
  4593. // non-interface field appearing in ForceSendFields will be sent to the
  4594. // server regardless of whether the field is empty or not. This may be
  4595. // used to include empty fields in Patch requests.
  4596. ForceSendFields []string `json:"-"`
  4597. // NullFields is a list of field names (e.g. "DiskEncryptionKey") to
  4598. // include in API requests with the JSON null value. By default, fields
  4599. // with empty values are omitted from API requests. However, any field
  4600. // with an empty value appearing in NullFields will be sent to the
  4601. // server as null. It is an error if a field in this list has a
  4602. // non-empty value. This may be used to include null fields in Patch
  4603. // requests.
  4604. NullFields []string `json:"-"`
  4605. }
  4606. func (s *CustomerEncryptionKeyProtectedDisk) MarshalJSON() ([]byte, error) {
  4607. type NoMethod CustomerEncryptionKeyProtectedDisk
  4608. raw := NoMethod(*s)
  4609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4610. }
  4611. // DeprecationStatus: Deprecation status for a public resource.
  4612. type DeprecationStatus struct {
  4613. // Deleted: An optional RFC3339 timestamp on or after which the state of
  4614. // this resource is intended to change to DELETED. This is only
  4615. // informational and the status will not change unless the client
  4616. // explicitly changes it.
  4617. Deleted string `json:"deleted,omitempty"`
  4618. // Deprecated: An optional RFC3339 timestamp on or after which the state
  4619. // of this resource is intended to change to DEPRECATED. This is only
  4620. // informational and the status will not change unless the client
  4621. // explicitly changes it.
  4622. Deprecated string `json:"deprecated,omitempty"`
  4623. // Obsolete: An optional RFC3339 timestamp on or after which the state
  4624. // of this resource is intended to change to OBSOLETE. This is only
  4625. // informational and the status will not change unless the client
  4626. // explicitly changes it.
  4627. Obsolete string `json:"obsolete,omitempty"`
  4628. // Replacement: The URL of the suggested replacement for a deprecated
  4629. // resource. The suggested replacement resource must be the same kind of
  4630. // resource as the deprecated resource.
  4631. Replacement string `json:"replacement,omitempty"`
  4632. // State: The deprecation state of this resource. This can be ACTIVE,
  4633. // DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the
  4634. // end of life date for an image, can use ACTIVE. Operations which
  4635. // create a new resource using a DEPRECATED resource will return
  4636. // successfully, but with a warning indicating the deprecated resource
  4637. // and recommending its replacement. Operations which use OBSOLETE or
  4638. // DELETED resources will be rejected and result in an error.
  4639. //
  4640. // Possible values:
  4641. // "ACTIVE"
  4642. // "DELETED"
  4643. // "DEPRECATED"
  4644. // "OBSOLETE"
  4645. State string `json:"state,omitempty"`
  4646. // ForceSendFields is a list of field names (e.g. "Deleted") to
  4647. // unconditionally include in API requests. By default, fields with
  4648. // empty values are omitted from API requests. However, any non-pointer,
  4649. // non-interface field appearing in ForceSendFields will be sent to the
  4650. // server regardless of whether the field is empty or not. This may be
  4651. // used to include empty fields in Patch requests.
  4652. ForceSendFields []string `json:"-"`
  4653. // NullFields is a list of field names (e.g. "Deleted") to include in
  4654. // API requests with the JSON null value. By default, fields with empty
  4655. // values are omitted from API requests. However, any field with an
  4656. // empty value appearing in NullFields will be sent to the server as
  4657. // null. It is an error if a field in this list has a non-empty value.
  4658. // This may be used to include null fields in Patch requests.
  4659. NullFields []string `json:"-"`
  4660. }
  4661. func (s *DeprecationStatus) MarshalJSON() ([]byte, error) {
  4662. type NoMethod DeprecationStatus
  4663. raw := NoMethod(*s)
  4664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4665. }
  4666. // Disk: A Disk resource. (== resource_for beta.disks ==) (==
  4667. // resource_for v1.disks ==)
  4668. type Disk struct {
  4669. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  4670. // format.
  4671. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  4672. // Description: An optional description of this resource. Provide this
  4673. // property when you create the resource.
  4674. Description string `json:"description,omitempty"`
  4675. // DiskEncryptionKey: Encrypts the disk using a customer-supplied
  4676. // encryption key.
  4677. //
  4678. // After you encrypt a disk with a customer-supplied key, you must
  4679. // provide the same key if you use the disk later (e.g. to create a disk
  4680. // snapshot, to create a disk image, to create a machine image, or to
  4681. // attach the disk to a virtual machine).
  4682. //
  4683. // Customer-supplied encryption keys do not protect access to metadata
  4684. // of the disk.
  4685. //
  4686. // If you do not provide an encryption key when creating the disk, then
  4687. // the disk will be encrypted using an automatically generated key and
  4688. // you do not need to provide a key to use the disk later.
  4689. DiskEncryptionKey *CustomerEncryptionKey `json:"diskEncryptionKey,omitempty"`
  4690. // GuestOsFeatures: A list of features to enable on the guest operating
  4691. // system. Applicable only for bootable images. Read Enabling guest
  4692. // operating system features to see a list of available options.
  4693. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  4694. // Id: [Output Only] The unique identifier for the resource. This
  4695. // identifier is defined by the server.
  4696. Id uint64 `json:"id,omitempty,string"`
  4697. // Kind: [Output Only] Type of the resource. Always compute#disk for
  4698. // disks.
  4699. Kind string `json:"kind,omitempty"`
  4700. // LabelFingerprint: A fingerprint for the labels being applied to this
  4701. // disk, which is essentially a hash of the labels set used for
  4702. // optimistic locking. The fingerprint is initially generated by Compute
  4703. // Engine and changes after every request to modify or update labels.
  4704. // You must always provide an up-to-date fingerprint hash in order to
  4705. // update or change labels, otherwise the request will fail with error
  4706. // 412 conditionNotMet.
  4707. //
  4708. // To see the latest fingerprint, make a get() request to retrieve a
  4709. // disk.
  4710. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  4711. // Labels: Labels to apply to this disk. These can be later modified by
  4712. // the setLabels method.
  4713. Labels map[string]string `json:"labels,omitempty"`
  4714. // LastAttachTimestamp: [Output Only] Last attach timestamp in RFC3339
  4715. // text format.
  4716. LastAttachTimestamp string `json:"lastAttachTimestamp,omitempty"`
  4717. // LastDetachTimestamp: [Output Only] Last detach timestamp in RFC3339
  4718. // text format.
  4719. LastDetachTimestamp string `json:"lastDetachTimestamp,omitempty"`
  4720. // LicenseCodes: Integer license codes indicating which licenses are
  4721. // attached to this disk.
  4722. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  4723. // Licenses: A list of publicly visible licenses. Reserved for Google's
  4724. // use.
  4725. Licenses []string `json:"licenses,omitempty"`
  4726. // Name: Name of the resource. Provided by the client when the resource
  4727. // is created. The name must be 1-63 characters long, and comply with
  4728. // RFC1035. Specifically, the name must be 1-63 characters long and
  4729. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  4730. // the first character must be a lowercase letter, and all following
  4731. // characters must be a dash, lowercase letter, or digit, except the
  4732. // last character, which cannot be a dash.
  4733. Name string `json:"name,omitempty"`
  4734. // Options: Internal use only.
  4735. Options string `json:"options,omitempty"`
  4736. // PhysicalBlockSizeBytes: Physical block size of the persistent disk,
  4737. // in bytes. If not present in a request, a default value is used.
  4738. // Currently supported sizes are 4096 and 16384, other sizes may be
  4739. // added in the future. If an unsupported value is requested, the error
  4740. // message will list the supported values for the caller's project.
  4741. PhysicalBlockSizeBytes int64 `json:"physicalBlockSizeBytes,omitempty,string"`
  4742. // Region: [Output Only] URL of the region where the disk resides. Only
  4743. // applicable for regional resources. You must specify this field as
  4744. // part of the HTTP request URL. It is not settable as a field in the
  4745. // request body.
  4746. Region string `json:"region,omitempty"`
  4747. // ReplicaZones: URLs of the zones where the disk should be replicated
  4748. // to. Only applicable for regional resources.
  4749. ReplicaZones []string `json:"replicaZones,omitempty"`
  4750. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  4751. // resource.
  4752. SelfLink string `json:"selfLink,omitempty"`
  4753. // SizeGb: Size of the persistent disk, specified in GB. You can specify
  4754. // this field when creating a persistent disk using the sourceImage or
  4755. // sourceSnapshot parameter, or specify it alone to create an empty
  4756. // persistent disk.
  4757. //
  4758. // If you specify this field along with sourceImage or sourceSnapshot,
  4759. // the value of sizeGb must not be less than the size of the sourceImage
  4760. // or the size of the snapshot. Acceptable values are 1 to 65536,
  4761. // inclusive.
  4762. SizeGb int64 `json:"sizeGb,omitempty,string"`
  4763. // SourceImage: The source image used to create this disk. If the source
  4764. // image is deleted, this field will not be set.
  4765. //
  4766. // To create a disk with one of the public operating system images,
  4767. // specify the image by its family name. For example, specify
  4768. // family/debian-9 to use the latest Debian 9
  4769. // image:
  4770. // projects/debian-cloud/global/images/family/debian-9
  4771. //
  4772. //
  4773. // Alternati
  4774. // vely, use a specific version of a public operating system
  4775. // image:
  4776. // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD
  4777. //
  4778. //
  4779. //
  4780. // To create a disk with a custom image that you created, specify the
  4781. // image name in the following
  4782. // format:
  4783. // global/images/my-custom-image
  4784. //
  4785. //
  4786. // You can also specify a custom image by its image family, which
  4787. // returns the latest version of the image in that family. Replace the
  4788. // image name with
  4789. // family/family-name:
  4790. // global/images/family/my-image-family
  4791. SourceImage string `json:"sourceImage,omitempty"`
  4792. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  4793. // source image. Required if the source image is protected by a
  4794. // customer-supplied encryption key.
  4795. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  4796. // SourceImageId: [Output Only] The ID value of the image used to create
  4797. // this disk. This value identifies the exact image that was used to
  4798. // create this persistent disk. For example, if you created the
  4799. // persistent disk from an image that was later deleted and recreated
  4800. // under the same name, the source image ID would identify the exact
  4801. // version of the image that was used.
  4802. SourceImageId string `json:"sourceImageId,omitempty"`
  4803. // SourceSnapshot: The source snapshot used to create this disk. You can
  4804. // provide this as a partial or full URL to the resource. For example,
  4805. // the following are valid values:
  4806. // -
  4807. // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot
  4808. // - projects/project/global/snapshots/snapshot
  4809. // - global/snapshots/snapshot
  4810. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  4811. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  4812. // the source snapshot. Required if the source snapshot is protected by
  4813. // a customer-supplied encryption key.
  4814. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  4815. // SourceSnapshotId: [Output Only] The unique ID of the snapshot used to
  4816. // create this disk. This value identifies the exact snapshot that was
  4817. // used to create this persistent disk. For example, if you created the
  4818. // persistent disk from a snapshot that was later deleted and recreated
  4819. // under the same name, the source snapshot ID would identify the exact
  4820. // version of the snapshot that was used.
  4821. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  4822. // Status: [Output Only] The status of disk creation.
  4823. //
  4824. // Possible values:
  4825. // "CREATING"
  4826. // "DELETING"
  4827. // "FAILED"
  4828. // "READY"
  4829. // "RESTORING"
  4830. Status string `json:"status,omitempty"`
  4831. // Type: URL of the disk type resource describing which disk type to use
  4832. // to create the disk. Provide this when creating the disk. For example:
  4833. // projects/project/zones/zone/diskTypes/pd-standard or pd-ssd
  4834. Type string `json:"type,omitempty"`
  4835. // Users: [Output Only] Links to the users of the disk (attached
  4836. // instances) in form: projects/project/zones/zone/instances/instance
  4837. Users []string `json:"users,omitempty"`
  4838. // Zone: [Output Only] URL of the zone where the disk resides. You must
  4839. // specify this field as part of the HTTP request URL. It is not
  4840. // settable as a field in the request body.
  4841. Zone string `json:"zone,omitempty"`
  4842. // ServerResponse contains the HTTP response code and headers from the
  4843. // server.
  4844. googleapi.ServerResponse `json:"-"`
  4845. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  4846. // to unconditionally include in API requests. By default, fields with
  4847. // empty values are omitted from API requests. However, any non-pointer,
  4848. // non-interface field appearing in ForceSendFields will be sent to the
  4849. // server regardless of whether the field is empty or not. This may be
  4850. // used to include empty fields in Patch requests.
  4851. ForceSendFields []string `json:"-"`
  4852. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  4853. // include in API requests with the JSON null value. By default, fields
  4854. // with empty values are omitted from API requests. However, any field
  4855. // with an empty value appearing in NullFields will be sent to the
  4856. // server as null. It is an error if a field in this list has a
  4857. // non-empty value. This may be used to include null fields in Patch
  4858. // requests.
  4859. NullFields []string `json:"-"`
  4860. }
  4861. func (s *Disk) MarshalJSON() ([]byte, error) {
  4862. type NoMethod Disk
  4863. raw := NoMethod(*s)
  4864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4865. }
  4866. type DiskAggregatedList struct {
  4867. // Id: [Output Only] Unique identifier for the resource; defined by the
  4868. // server.
  4869. Id string `json:"id,omitempty"`
  4870. // Items: A list of DisksScopedList resources.
  4871. Items map[string]DisksScopedList `json:"items,omitempty"`
  4872. // Kind: [Output Only] Type of resource. Always
  4873. // compute#diskAggregatedList for aggregated lists of persistent disks.
  4874. Kind string `json:"kind,omitempty"`
  4875. // NextPageToken: [Output Only] This token allows you to get the next
  4876. // page of results for list requests. If the number of results is larger
  4877. // than maxResults, use the nextPageToken as a value for the query
  4878. // parameter pageToken in the next list request. Subsequent list
  4879. // requests will have their own nextPageToken to continue paging through
  4880. // the results.
  4881. NextPageToken string `json:"nextPageToken,omitempty"`
  4882. // SelfLink: [Output Only] Server-defined URL for this resource.
  4883. SelfLink string `json:"selfLink,omitempty"`
  4884. // Warning: [Output Only] Informational warning message.
  4885. Warning *DiskAggregatedListWarning `json:"warning,omitempty"`
  4886. // ServerResponse contains the HTTP response code and headers from the
  4887. // server.
  4888. googleapi.ServerResponse `json:"-"`
  4889. // ForceSendFields is a list of field names (e.g. "Id") to
  4890. // unconditionally include in API requests. By default, fields with
  4891. // empty values are omitted from API requests. However, any non-pointer,
  4892. // non-interface field appearing in ForceSendFields will be sent to the
  4893. // server regardless of whether the field is empty or not. This may be
  4894. // used to include empty fields in Patch requests.
  4895. ForceSendFields []string `json:"-"`
  4896. // NullFields is a list of field names (e.g. "Id") to include in API
  4897. // requests with the JSON null value. By default, fields with empty
  4898. // values are omitted from API requests. However, any field with an
  4899. // empty value appearing in NullFields will be sent to the server as
  4900. // null. It is an error if a field in this list has a non-empty value.
  4901. // This may be used to include null fields in Patch requests.
  4902. NullFields []string `json:"-"`
  4903. }
  4904. func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) {
  4905. type NoMethod DiskAggregatedList
  4906. raw := NoMethod(*s)
  4907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4908. }
  4909. // DiskAggregatedListWarning: [Output Only] Informational warning
  4910. // message.
  4911. type DiskAggregatedListWarning struct {
  4912. // Code: [Output Only] A warning code, if applicable. For example,
  4913. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  4914. // the response.
  4915. //
  4916. // Possible values:
  4917. // "CLEANUP_FAILED"
  4918. // "DEPRECATED_RESOURCE_USED"
  4919. // "DEPRECATED_TYPE_USED"
  4920. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  4921. // "EXPERIMENTAL_TYPE_USED"
  4922. // "EXTERNAL_API_WARNING"
  4923. // "FIELD_VALUE_OVERRIDEN"
  4924. // "INJECTED_KERNELS_DEPRECATED"
  4925. // "MISSING_TYPE_DEPENDENCY"
  4926. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  4927. // "NEXT_HOP_CANNOT_IP_FORWARD"
  4928. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  4929. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  4930. // "NEXT_HOP_NOT_RUNNING"
  4931. // "NOT_CRITICAL_ERROR"
  4932. // "NO_RESULTS_ON_PAGE"
  4933. // "REQUIRED_TOS_AGREEMENT"
  4934. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  4935. // "RESOURCE_NOT_DELETED"
  4936. // "SCHEMA_VALIDATION_IGNORED"
  4937. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  4938. // "UNDECLARED_PROPERTIES"
  4939. // "UNREACHABLE"
  4940. Code string `json:"code,omitempty"`
  4941. // Data: [Output Only] Metadata about this warning in key: value format.
  4942. // For example:
  4943. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  4944. Data []*DiskAggregatedListWarningData `json:"data,omitempty"`
  4945. // Message: [Output Only] A human-readable description of the warning
  4946. // code.
  4947. Message string `json:"message,omitempty"`
  4948. // ForceSendFields is a list of field names (e.g. "Code") to
  4949. // unconditionally include in API requests. By default, fields with
  4950. // empty values are omitted from API requests. However, any non-pointer,
  4951. // non-interface field appearing in ForceSendFields will be sent to the
  4952. // server regardless of whether the field is empty or not. This may be
  4953. // used to include empty fields in Patch requests.
  4954. ForceSendFields []string `json:"-"`
  4955. // NullFields is a list of field names (e.g. "Code") to include in API
  4956. // requests with the JSON null value. By default, fields with empty
  4957. // values are omitted from API requests. However, any field with an
  4958. // empty value appearing in NullFields will be sent to the server as
  4959. // null. It is an error if a field in this list has a non-empty value.
  4960. // This may be used to include null fields in Patch requests.
  4961. NullFields []string `json:"-"`
  4962. }
  4963. func (s *DiskAggregatedListWarning) MarshalJSON() ([]byte, error) {
  4964. type NoMethod DiskAggregatedListWarning
  4965. raw := NoMethod(*s)
  4966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4967. }
  4968. type DiskAggregatedListWarningData struct {
  4969. // Key: [Output Only] A key that provides more detail on the warning
  4970. // being returned. For example, for warnings where there are no results
  4971. // in a list request for a particular zone, this key might be scope and
  4972. // the key value might be the zone name. Other examples might be a key
  4973. // indicating a deprecated resource and a suggested replacement, or a
  4974. // warning about invalid network settings (for example, if an instance
  4975. // attempts to perform IP forwarding but is not enabled for IP
  4976. // forwarding).
  4977. Key string `json:"key,omitempty"`
  4978. // Value: [Output Only] A warning data value corresponding to the key.
  4979. Value string `json:"value,omitempty"`
  4980. // ForceSendFields is a list of field names (e.g. "Key") to
  4981. // unconditionally include in API requests. By default, fields with
  4982. // empty values are omitted from API requests. However, any non-pointer,
  4983. // non-interface field appearing in ForceSendFields will be sent to the
  4984. // server regardless of whether the field is empty or not. This may be
  4985. // used to include empty fields in Patch requests.
  4986. ForceSendFields []string `json:"-"`
  4987. // NullFields is a list of field names (e.g. "Key") to include in API
  4988. // requests with the JSON null value. By default, fields with empty
  4989. // values are omitted from API requests. However, any field with an
  4990. // empty value appearing in NullFields will be sent to the server as
  4991. // null. It is an error if a field in this list has a non-empty value.
  4992. // This may be used to include null fields in Patch requests.
  4993. NullFields []string `json:"-"`
  4994. }
  4995. func (s *DiskAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  4996. type NoMethod DiskAggregatedListWarningData
  4997. raw := NoMethod(*s)
  4998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4999. }
  5000. // DiskInstantiationConfig: A specification of the desired way to
  5001. // instantiate a disk in the instance template when its created from a
  5002. // source instance.
  5003. type DiskInstantiationConfig struct {
  5004. // AutoDelete: Specifies whether the disk will be auto-deleted when the
  5005. // instance is deleted (but not when the disk is detached from the
  5006. // instance).
  5007. AutoDelete bool `json:"autoDelete,omitempty"`
  5008. // CustomImage: The custom source image to be used to restore this disk
  5009. // when instantiating this instance template.
  5010. CustomImage string `json:"customImage,omitempty"`
  5011. // DeviceName: Specifies the device name of the disk to which the
  5012. // configurations apply to.
  5013. DeviceName string `json:"deviceName,omitempty"`
  5014. // InstantiateFrom: Specifies whether to include the disk and what image
  5015. // to use. Possible values are:
  5016. // - source-image: to use the same image that was used to create the
  5017. // source instance's corresponding disk. Applicable to the boot disk and
  5018. // additional read-write disks.
  5019. // - source-image-family: to use the same image family that was used to
  5020. // create the source instance's corresponding disk. Applicable to the
  5021. // boot disk and additional read-write disks.
  5022. // - custom-image: to use a user-provided image url for disk creation.
  5023. // Applicable to the boot disk and additional read-write disks.
  5024. // - attach-read-only: to attach a read-only disk. Applicable to
  5025. // read-only disks.
  5026. // - do-not-include: to exclude a disk from the template. Applicable to
  5027. // additional read-write disks, local SSDs, and read-only disks.
  5028. //
  5029. // Possible values:
  5030. // "ATTACH_READ_ONLY"
  5031. // "BLANK"
  5032. // "CUSTOM_IMAGE"
  5033. // "DEFAULT"
  5034. // "DO_NOT_INCLUDE"
  5035. // "SOURCE_IMAGE"
  5036. // "SOURCE_IMAGE_FAMILY"
  5037. InstantiateFrom string `json:"instantiateFrom,omitempty"`
  5038. // ForceSendFields is a list of field names (e.g. "AutoDelete") to
  5039. // unconditionally include in API requests. By default, fields with
  5040. // empty values are omitted from API requests. However, any non-pointer,
  5041. // non-interface field appearing in ForceSendFields will be sent to the
  5042. // server regardless of whether the field is empty or not. This may be
  5043. // used to include empty fields in Patch requests.
  5044. ForceSendFields []string `json:"-"`
  5045. // NullFields is a list of field names (e.g. "AutoDelete") to include in
  5046. // API requests with the JSON null value. By default, fields with empty
  5047. // values are omitted from API requests. However, any field with an
  5048. // empty value appearing in NullFields will be sent to the server as
  5049. // null. It is an error if a field in this list has a non-empty value.
  5050. // This may be used to include null fields in Patch requests.
  5051. NullFields []string `json:"-"`
  5052. }
  5053. func (s *DiskInstantiationConfig) MarshalJSON() ([]byte, error) {
  5054. type NoMethod DiskInstantiationConfig
  5055. raw := NoMethod(*s)
  5056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5057. }
  5058. // DiskList: A list of Disk resources.
  5059. type DiskList struct {
  5060. // Id: [Output Only] Unique identifier for the resource; defined by the
  5061. // server.
  5062. Id string `json:"id,omitempty"`
  5063. // Items: A list of Disk resources.
  5064. Items []*Disk `json:"items,omitempty"`
  5065. // Kind: [Output Only] Type of resource. Always compute#diskList for
  5066. // lists of disks.
  5067. Kind string `json:"kind,omitempty"`
  5068. // NextPageToken: [Output Only] This token allows you to get the next
  5069. // page of results for list requests. If the number of results is larger
  5070. // than maxResults, use the nextPageToken as a value for the query
  5071. // parameter pageToken in the next list request. Subsequent list
  5072. // requests will have their own nextPageToken to continue paging through
  5073. // the results.
  5074. NextPageToken string `json:"nextPageToken,omitempty"`
  5075. // SelfLink: [Output Only] Server-defined URL for this resource.
  5076. SelfLink string `json:"selfLink,omitempty"`
  5077. // Warning: [Output Only] Informational warning message.
  5078. Warning *DiskListWarning `json:"warning,omitempty"`
  5079. // ServerResponse contains the HTTP response code and headers from the
  5080. // server.
  5081. googleapi.ServerResponse `json:"-"`
  5082. // ForceSendFields is a list of field names (e.g. "Id") to
  5083. // unconditionally include in API requests. By default, fields with
  5084. // empty values are omitted from API requests. However, any non-pointer,
  5085. // non-interface field appearing in ForceSendFields will be sent to the
  5086. // server regardless of whether the field is empty or not. This may be
  5087. // used to include empty fields in Patch requests.
  5088. ForceSendFields []string `json:"-"`
  5089. // NullFields is a list of field names (e.g. "Id") to include in API
  5090. // requests with the JSON null value. By default, fields with empty
  5091. // values are omitted from API requests. However, any field with an
  5092. // empty value appearing in NullFields will be sent to the server as
  5093. // null. It is an error if a field in this list has a non-empty value.
  5094. // This may be used to include null fields in Patch requests.
  5095. NullFields []string `json:"-"`
  5096. }
  5097. func (s *DiskList) MarshalJSON() ([]byte, error) {
  5098. type NoMethod DiskList
  5099. raw := NoMethod(*s)
  5100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5101. }
  5102. // DiskListWarning: [Output Only] Informational warning message.
  5103. type DiskListWarning struct {
  5104. // Code: [Output Only] A warning code, if applicable. For example,
  5105. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5106. // the response.
  5107. //
  5108. // Possible values:
  5109. // "CLEANUP_FAILED"
  5110. // "DEPRECATED_RESOURCE_USED"
  5111. // "DEPRECATED_TYPE_USED"
  5112. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5113. // "EXPERIMENTAL_TYPE_USED"
  5114. // "EXTERNAL_API_WARNING"
  5115. // "FIELD_VALUE_OVERRIDEN"
  5116. // "INJECTED_KERNELS_DEPRECATED"
  5117. // "MISSING_TYPE_DEPENDENCY"
  5118. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5119. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5120. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5121. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5122. // "NEXT_HOP_NOT_RUNNING"
  5123. // "NOT_CRITICAL_ERROR"
  5124. // "NO_RESULTS_ON_PAGE"
  5125. // "REQUIRED_TOS_AGREEMENT"
  5126. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5127. // "RESOURCE_NOT_DELETED"
  5128. // "SCHEMA_VALIDATION_IGNORED"
  5129. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5130. // "UNDECLARED_PROPERTIES"
  5131. // "UNREACHABLE"
  5132. Code string `json:"code,omitempty"`
  5133. // Data: [Output Only] Metadata about this warning in key: value format.
  5134. // For example:
  5135. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5136. Data []*DiskListWarningData `json:"data,omitempty"`
  5137. // Message: [Output Only] A human-readable description of the warning
  5138. // code.
  5139. Message string `json:"message,omitempty"`
  5140. // ForceSendFields is a list of field names (e.g. "Code") to
  5141. // unconditionally include in API requests. By default, fields with
  5142. // empty values are omitted from API requests. However, any non-pointer,
  5143. // non-interface field appearing in ForceSendFields will be sent to the
  5144. // server regardless of whether the field is empty or not. This may be
  5145. // used to include empty fields in Patch requests.
  5146. ForceSendFields []string `json:"-"`
  5147. // NullFields is a list of field names (e.g. "Code") to include in API
  5148. // requests with the JSON null value. By default, fields with empty
  5149. // values are omitted from API requests. However, any field with an
  5150. // empty value appearing in NullFields will be sent to the server as
  5151. // null. It is an error if a field in this list has a non-empty value.
  5152. // This may be used to include null fields in Patch requests.
  5153. NullFields []string `json:"-"`
  5154. }
  5155. func (s *DiskListWarning) MarshalJSON() ([]byte, error) {
  5156. type NoMethod DiskListWarning
  5157. raw := NoMethod(*s)
  5158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5159. }
  5160. type DiskListWarningData struct {
  5161. // Key: [Output Only] A key that provides more detail on the warning
  5162. // being returned. For example, for warnings where there are no results
  5163. // in a list request for a particular zone, this key might be scope and
  5164. // the key value might be the zone name. Other examples might be a key
  5165. // indicating a deprecated resource and a suggested replacement, or a
  5166. // warning about invalid network settings (for example, if an instance
  5167. // attempts to perform IP forwarding but is not enabled for IP
  5168. // forwarding).
  5169. Key string `json:"key,omitempty"`
  5170. // Value: [Output Only] A warning data value corresponding to the key.
  5171. Value string `json:"value,omitempty"`
  5172. // ForceSendFields is a list of field names (e.g. "Key") to
  5173. // unconditionally include in API requests. By default, fields with
  5174. // empty values are omitted from API requests. However, any non-pointer,
  5175. // non-interface field appearing in ForceSendFields will be sent to the
  5176. // server regardless of whether the field is empty or not. This may be
  5177. // used to include empty fields in Patch requests.
  5178. ForceSendFields []string `json:"-"`
  5179. // NullFields is a list of field names (e.g. "Key") to include in API
  5180. // requests with the JSON null value. By default, fields with empty
  5181. // values are omitted from API requests. However, any field with an
  5182. // empty value appearing in NullFields will be sent to the server as
  5183. // null. It is an error if a field in this list has a non-empty value.
  5184. // This may be used to include null fields in Patch requests.
  5185. NullFields []string `json:"-"`
  5186. }
  5187. func (s *DiskListWarningData) MarshalJSON() ([]byte, error) {
  5188. type NoMethod DiskListWarningData
  5189. raw := NoMethod(*s)
  5190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5191. }
  5192. type DiskMoveRequest struct {
  5193. // DestinationZone: The URL of the destination zone to move the disk.
  5194. // This can be a full or partial URL. For example, the following are all
  5195. // valid URLs to a zone:
  5196. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  5197. //
  5198. // - projects/project/zones/zone
  5199. // - zones/zone
  5200. DestinationZone string `json:"destinationZone,omitempty"`
  5201. // TargetDisk: The URL of the target disk to move. This can be a full or
  5202. // partial URL. For example, the following are all valid URLs to a disk:
  5203. //
  5204. // -
  5205. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  5206. // - projects/project/zones/zone/disks/disk
  5207. // - zones/zone/disks/disk
  5208. TargetDisk string `json:"targetDisk,omitempty"`
  5209. // ForceSendFields is a list of field names (e.g. "DestinationZone") to
  5210. // unconditionally include in API requests. By default, fields with
  5211. // empty values are omitted from API requests. However, any non-pointer,
  5212. // non-interface field appearing in ForceSendFields will be sent to the
  5213. // server regardless of whether the field is empty or not. This may be
  5214. // used to include empty fields in Patch requests.
  5215. ForceSendFields []string `json:"-"`
  5216. // NullFields is a list of field names (e.g. "DestinationZone") to
  5217. // include in API requests with the JSON null value. By default, fields
  5218. // with empty values are omitted from API requests. However, any field
  5219. // with an empty value appearing in NullFields will be sent to the
  5220. // server as null. It is an error if a field in this list has a
  5221. // non-empty value. This may be used to include null fields in Patch
  5222. // requests.
  5223. NullFields []string `json:"-"`
  5224. }
  5225. func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) {
  5226. type NoMethod DiskMoveRequest
  5227. raw := NoMethod(*s)
  5228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5229. }
  5230. // DiskType: A DiskType resource. (== resource_for beta.diskTypes ==)
  5231. // (== resource_for v1.diskTypes ==)
  5232. type DiskType struct {
  5233. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5234. // format.
  5235. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5236. // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in
  5237. // GB.
  5238. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"`
  5239. // Deprecated: [Output Only] The deprecation status associated with this
  5240. // disk type.
  5241. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  5242. // Description: [Output Only] An optional description of this resource.
  5243. Description string `json:"description,omitempty"`
  5244. // Id: [Output Only] The unique identifier for the resource. This
  5245. // identifier is defined by the server.
  5246. Id uint64 `json:"id,omitempty,string"`
  5247. // Kind: [Output Only] Type of the resource. Always compute#diskType for
  5248. // disk types.
  5249. Kind string `json:"kind,omitempty"`
  5250. // Name: [Output Only] Name of the resource.
  5251. Name string `json:"name,omitempty"`
  5252. // Region: [Output Only] URL of the region where the disk type resides.
  5253. // Only applicable for regional resources. You must specify this field
  5254. // as part of the HTTP request URL. It is not settable as a field in the
  5255. // request body.
  5256. Region string `json:"region,omitempty"`
  5257. // SelfLink: [Output Only] Server-defined URL for the resource.
  5258. SelfLink string `json:"selfLink,omitempty"`
  5259. // ValidDiskSize: [Output Only] An optional textual description of the
  5260. // valid disk size, such as "10GB-10TB".
  5261. ValidDiskSize string `json:"validDiskSize,omitempty"`
  5262. // Zone: [Output Only] URL of the zone where the disk type resides. You
  5263. // must specify this field as part of the HTTP request URL. It is not
  5264. // settable as a field in the request body.
  5265. Zone string `json:"zone,omitempty"`
  5266. // ServerResponse contains the HTTP response code and headers from the
  5267. // server.
  5268. googleapi.ServerResponse `json:"-"`
  5269. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  5270. // to unconditionally include in API requests. By default, fields with
  5271. // empty values are omitted from API requests. However, any non-pointer,
  5272. // non-interface field appearing in ForceSendFields will be sent to the
  5273. // server regardless of whether the field is empty or not. This may be
  5274. // used to include empty fields in Patch requests.
  5275. ForceSendFields []string `json:"-"`
  5276. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  5277. // include in API requests with the JSON null value. By default, fields
  5278. // with empty values are omitted from API requests. However, any field
  5279. // with an empty value appearing in NullFields will be sent to the
  5280. // server as null. It is an error if a field in this list has a
  5281. // non-empty value. This may be used to include null fields in Patch
  5282. // requests.
  5283. NullFields []string `json:"-"`
  5284. }
  5285. func (s *DiskType) MarshalJSON() ([]byte, error) {
  5286. type NoMethod DiskType
  5287. raw := NoMethod(*s)
  5288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5289. }
  5290. type DiskTypeAggregatedList struct {
  5291. // Id: [Output Only] Unique identifier for the resource; defined by the
  5292. // server.
  5293. Id string `json:"id,omitempty"`
  5294. // Items: A list of DiskTypesScopedList resources.
  5295. Items map[string]DiskTypesScopedList `json:"items,omitempty"`
  5296. // Kind: [Output Only] Type of resource. Always
  5297. // compute#diskTypeAggregatedList.
  5298. Kind string `json:"kind,omitempty"`
  5299. // NextPageToken: [Output Only] This token allows you to get the next
  5300. // page of results for list requests. If the number of results is larger
  5301. // than maxResults, use the nextPageToken as a value for the query
  5302. // parameter pageToken in the next list request. Subsequent list
  5303. // requests will have their own nextPageToken to continue paging through
  5304. // the results.
  5305. NextPageToken string `json:"nextPageToken,omitempty"`
  5306. // SelfLink: [Output Only] Server-defined URL for this resource.
  5307. SelfLink string `json:"selfLink,omitempty"`
  5308. // Warning: [Output Only] Informational warning message.
  5309. Warning *DiskTypeAggregatedListWarning `json:"warning,omitempty"`
  5310. // ServerResponse contains the HTTP response code and headers from the
  5311. // server.
  5312. googleapi.ServerResponse `json:"-"`
  5313. // ForceSendFields is a list of field names (e.g. "Id") to
  5314. // unconditionally include in API requests. By default, fields with
  5315. // empty values are omitted from API requests. However, any non-pointer,
  5316. // non-interface field appearing in ForceSendFields will be sent to the
  5317. // server regardless of whether the field is empty or not. This may be
  5318. // used to include empty fields in Patch requests.
  5319. ForceSendFields []string `json:"-"`
  5320. // NullFields is a list of field names (e.g. "Id") to include in API
  5321. // requests with the JSON null value. By default, fields with empty
  5322. // values are omitted from API requests. However, any field with an
  5323. // empty value appearing in NullFields will be sent to the server as
  5324. // null. It is an error if a field in this list has a non-empty value.
  5325. // This may be used to include null fields in Patch requests.
  5326. NullFields []string `json:"-"`
  5327. }
  5328. func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) {
  5329. type NoMethod DiskTypeAggregatedList
  5330. raw := NoMethod(*s)
  5331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5332. }
  5333. // DiskTypeAggregatedListWarning: [Output Only] Informational warning
  5334. // message.
  5335. type DiskTypeAggregatedListWarning struct {
  5336. // Code: [Output Only] A warning code, if applicable. For example,
  5337. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5338. // the response.
  5339. //
  5340. // Possible values:
  5341. // "CLEANUP_FAILED"
  5342. // "DEPRECATED_RESOURCE_USED"
  5343. // "DEPRECATED_TYPE_USED"
  5344. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5345. // "EXPERIMENTAL_TYPE_USED"
  5346. // "EXTERNAL_API_WARNING"
  5347. // "FIELD_VALUE_OVERRIDEN"
  5348. // "INJECTED_KERNELS_DEPRECATED"
  5349. // "MISSING_TYPE_DEPENDENCY"
  5350. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5351. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5352. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5353. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5354. // "NEXT_HOP_NOT_RUNNING"
  5355. // "NOT_CRITICAL_ERROR"
  5356. // "NO_RESULTS_ON_PAGE"
  5357. // "REQUIRED_TOS_AGREEMENT"
  5358. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5359. // "RESOURCE_NOT_DELETED"
  5360. // "SCHEMA_VALIDATION_IGNORED"
  5361. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5362. // "UNDECLARED_PROPERTIES"
  5363. // "UNREACHABLE"
  5364. Code string `json:"code,omitempty"`
  5365. // Data: [Output Only] Metadata about this warning in key: value format.
  5366. // For example:
  5367. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5368. Data []*DiskTypeAggregatedListWarningData `json:"data,omitempty"`
  5369. // Message: [Output Only] A human-readable description of the warning
  5370. // code.
  5371. Message string `json:"message,omitempty"`
  5372. // ForceSendFields is a list of field names (e.g. "Code") to
  5373. // unconditionally include in API requests. By default, fields with
  5374. // empty values are omitted from API requests. However, any non-pointer,
  5375. // non-interface field appearing in ForceSendFields will be sent to the
  5376. // server regardless of whether the field is empty or not. This may be
  5377. // used to include empty fields in Patch requests.
  5378. ForceSendFields []string `json:"-"`
  5379. // NullFields is a list of field names (e.g. "Code") to include in API
  5380. // requests with the JSON null value. By default, fields with empty
  5381. // values are omitted from API requests. However, any field with an
  5382. // empty value appearing in NullFields will be sent to the server as
  5383. // null. It is an error if a field in this list has a non-empty value.
  5384. // This may be used to include null fields in Patch requests.
  5385. NullFields []string `json:"-"`
  5386. }
  5387. func (s *DiskTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  5388. type NoMethod DiskTypeAggregatedListWarning
  5389. raw := NoMethod(*s)
  5390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5391. }
  5392. type DiskTypeAggregatedListWarningData struct {
  5393. // Key: [Output Only] A key that provides more detail on the warning
  5394. // being returned. For example, for warnings where there are no results
  5395. // in a list request for a particular zone, this key might be scope and
  5396. // the key value might be the zone name. Other examples might be a key
  5397. // indicating a deprecated resource and a suggested replacement, or a
  5398. // warning about invalid network settings (for example, if an instance
  5399. // attempts to perform IP forwarding but is not enabled for IP
  5400. // forwarding).
  5401. Key string `json:"key,omitempty"`
  5402. // Value: [Output Only] A warning data value corresponding to the key.
  5403. Value string `json:"value,omitempty"`
  5404. // ForceSendFields is a list of field names (e.g. "Key") to
  5405. // unconditionally include in API requests. By default, fields with
  5406. // empty values are omitted from API requests. However, any non-pointer,
  5407. // non-interface field appearing in ForceSendFields will be sent to the
  5408. // server regardless of whether the field is empty or not. This may be
  5409. // used to include empty fields in Patch requests.
  5410. ForceSendFields []string `json:"-"`
  5411. // NullFields is a list of field names (e.g. "Key") to include in API
  5412. // requests with the JSON null value. By default, fields with empty
  5413. // values are omitted from API requests. However, any field with an
  5414. // empty value appearing in NullFields will be sent to the server as
  5415. // null. It is an error if a field in this list has a non-empty value.
  5416. // This may be used to include null fields in Patch requests.
  5417. NullFields []string `json:"-"`
  5418. }
  5419. func (s *DiskTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  5420. type NoMethod DiskTypeAggregatedListWarningData
  5421. raw := NoMethod(*s)
  5422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5423. }
  5424. // DiskTypeList: Contains a list of disk types.
  5425. type DiskTypeList struct {
  5426. // Id: [Output Only] Unique identifier for the resource; defined by the
  5427. // server.
  5428. Id string `json:"id,omitempty"`
  5429. // Items: A list of DiskType resources.
  5430. Items []*DiskType `json:"items,omitempty"`
  5431. // Kind: [Output Only] Type of resource. Always compute#diskTypeList for
  5432. // disk types.
  5433. Kind string `json:"kind,omitempty"`
  5434. // NextPageToken: [Output Only] This token allows you to get the next
  5435. // page of results for list requests. If the number of results is larger
  5436. // than maxResults, use the nextPageToken as a value for the query
  5437. // parameter pageToken in the next list request. Subsequent list
  5438. // requests will have their own nextPageToken to continue paging through
  5439. // the results.
  5440. NextPageToken string `json:"nextPageToken,omitempty"`
  5441. // SelfLink: [Output Only] Server-defined URL for this resource.
  5442. SelfLink string `json:"selfLink,omitempty"`
  5443. // Warning: [Output Only] Informational warning message.
  5444. Warning *DiskTypeListWarning `json:"warning,omitempty"`
  5445. // ServerResponse contains the HTTP response code and headers from the
  5446. // server.
  5447. googleapi.ServerResponse `json:"-"`
  5448. // ForceSendFields is a list of field names (e.g. "Id") to
  5449. // unconditionally include in API requests. By default, fields with
  5450. // empty values are omitted from API requests. However, any non-pointer,
  5451. // non-interface field appearing in ForceSendFields will be sent to the
  5452. // server regardless of whether the field is empty or not. This may be
  5453. // used to include empty fields in Patch requests.
  5454. ForceSendFields []string `json:"-"`
  5455. // NullFields is a list of field names (e.g. "Id") to include in API
  5456. // requests with the JSON null value. By default, fields with empty
  5457. // values are omitted from API requests. However, any field with an
  5458. // empty value appearing in NullFields will be sent to the server as
  5459. // null. It is an error if a field in this list has a non-empty value.
  5460. // This may be used to include null fields in Patch requests.
  5461. NullFields []string `json:"-"`
  5462. }
  5463. func (s *DiskTypeList) MarshalJSON() ([]byte, error) {
  5464. type NoMethod DiskTypeList
  5465. raw := NoMethod(*s)
  5466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5467. }
  5468. // DiskTypeListWarning: [Output Only] Informational warning message.
  5469. type DiskTypeListWarning struct {
  5470. // Code: [Output Only] A warning code, if applicable. For example,
  5471. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5472. // the response.
  5473. //
  5474. // Possible values:
  5475. // "CLEANUP_FAILED"
  5476. // "DEPRECATED_RESOURCE_USED"
  5477. // "DEPRECATED_TYPE_USED"
  5478. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5479. // "EXPERIMENTAL_TYPE_USED"
  5480. // "EXTERNAL_API_WARNING"
  5481. // "FIELD_VALUE_OVERRIDEN"
  5482. // "INJECTED_KERNELS_DEPRECATED"
  5483. // "MISSING_TYPE_DEPENDENCY"
  5484. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5485. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5486. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5487. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5488. // "NEXT_HOP_NOT_RUNNING"
  5489. // "NOT_CRITICAL_ERROR"
  5490. // "NO_RESULTS_ON_PAGE"
  5491. // "REQUIRED_TOS_AGREEMENT"
  5492. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5493. // "RESOURCE_NOT_DELETED"
  5494. // "SCHEMA_VALIDATION_IGNORED"
  5495. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5496. // "UNDECLARED_PROPERTIES"
  5497. // "UNREACHABLE"
  5498. Code string `json:"code,omitempty"`
  5499. // Data: [Output Only] Metadata about this warning in key: value format.
  5500. // For example:
  5501. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5502. Data []*DiskTypeListWarningData `json:"data,omitempty"`
  5503. // Message: [Output Only] A human-readable description of the warning
  5504. // code.
  5505. Message string `json:"message,omitempty"`
  5506. // ForceSendFields is a list of field names (e.g. "Code") to
  5507. // unconditionally include in API requests. By default, fields with
  5508. // empty values are omitted from API requests. However, any non-pointer,
  5509. // non-interface field appearing in ForceSendFields will be sent to the
  5510. // server regardless of whether the field is empty or not. This may be
  5511. // used to include empty fields in Patch requests.
  5512. ForceSendFields []string `json:"-"`
  5513. // NullFields is a list of field names (e.g. "Code") to include in API
  5514. // requests with the JSON null value. By default, fields with empty
  5515. // values are omitted from API requests. However, any field with an
  5516. // empty value appearing in NullFields will be sent to the server as
  5517. // null. It is an error if a field in this list has a non-empty value.
  5518. // This may be used to include null fields in Patch requests.
  5519. NullFields []string `json:"-"`
  5520. }
  5521. func (s *DiskTypeListWarning) MarshalJSON() ([]byte, error) {
  5522. type NoMethod DiskTypeListWarning
  5523. raw := NoMethod(*s)
  5524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5525. }
  5526. type DiskTypeListWarningData struct {
  5527. // Key: [Output Only] A key that provides more detail on the warning
  5528. // being returned. For example, for warnings where there are no results
  5529. // in a list request for a particular zone, this key might be scope and
  5530. // the key value might be the zone name. Other examples might be a key
  5531. // indicating a deprecated resource and a suggested replacement, or a
  5532. // warning about invalid network settings (for example, if an instance
  5533. // attempts to perform IP forwarding but is not enabled for IP
  5534. // forwarding).
  5535. Key string `json:"key,omitempty"`
  5536. // Value: [Output Only] A warning data value corresponding to the key.
  5537. Value string `json:"value,omitempty"`
  5538. // ForceSendFields is a list of field names (e.g. "Key") to
  5539. // unconditionally include in API requests. By default, fields with
  5540. // empty values are omitted from API requests. However, any non-pointer,
  5541. // non-interface field appearing in ForceSendFields will be sent to the
  5542. // server regardless of whether the field is empty or not. This may be
  5543. // used to include empty fields in Patch requests.
  5544. ForceSendFields []string `json:"-"`
  5545. // NullFields is a list of field names (e.g. "Key") to include in API
  5546. // requests with the JSON null value. By default, fields with empty
  5547. // values are omitted from API requests. However, any field with an
  5548. // empty value appearing in NullFields will be sent to the server as
  5549. // null. It is an error if a field in this list has a non-empty value.
  5550. // This may be used to include null fields in Patch requests.
  5551. NullFields []string `json:"-"`
  5552. }
  5553. func (s *DiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  5554. type NoMethod DiskTypeListWarningData
  5555. raw := NoMethod(*s)
  5556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5557. }
  5558. type DiskTypesScopedList struct {
  5559. // DiskTypes: [Output Only] A list of disk types contained in this
  5560. // scope.
  5561. DiskTypes []*DiskType `json:"diskTypes,omitempty"`
  5562. // Warning: [Output Only] Informational warning which replaces the list
  5563. // of disk types when the list is empty.
  5564. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"`
  5565. // ForceSendFields is a list of field names (e.g. "DiskTypes") to
  5566. // unconditionally include in API requests. By default, fields with
  5567. // empty values are omitted from API requests. However, any non-pointer,
  5568. // non-interface field appearing in ForceSendFields will be sent to the
  5569. // server regardless of whether the field is empty or not. This may be
  5570. // used to include empty fields in Patch requests.
  5571. ForceSendFields []string `json:"-"`
  5572. // NullFields is a list of field names (e.g. "DiskTypes") to include in
  5573. // API requests with the JSON null value. By default, fields with empty
  5574. // values are omitted from API requests. However, any field with an
  5575. // empty value appearing in NullFields will be sent to the server as
  5576. // null. It is an error if a field in this list has a non-empty value.
  5577. // This may be used to include null fields in Patch requests.
  5578. NullFields []string `json:"-"`
  5579. }
  5580. func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) {
  5581. type NoMethod DiskTypesScopedList
  5582. raw := NoMethod(*s)
  5583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5584. }
  5585. // DiskTypesScopedListWarning: [Output Only] Informational warning which
  5586. // replaces the list of disk types when the list is empty.
  5587. type DiskTypesScopedListWarning struct {
  5588. // Code: [Output Only] A warning code, if applicable. For example,
  5589. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5590. // the response.
  5591. //
  5592. // Possible values:
  5593. // "CLEANUP_FAILED"
  5594. // "DEPRECATED_RESOURCE_USED"
  5595. // "DEPRECATED_TYPE_USED"
  5596. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5597. // "EXPERIMENTAL_TYPE_USED"
  5598. // "EXTERNAL_API_WARNING"
  5599. // "FIELD_VALUE_OVERRIDEN"
  5600. // "INJECTED_KERNELS_DEPRECATED"
  5601. // "MISSING_TYPE_DEPENDENCY"
  5602. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5603. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5604. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5605. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5606. // "NEXT_HOP_NOT_RUNNING"
  5607. // "NOT_CRITICAL_ERROR"
  5608. // "NO_RESULTS_ON_PAGE"
  5609. // "REQUIRED_TOS_AGREEMENT"
  5610. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5611. // "RESOURCE_NOT_DELETED"
  5612. // "SCHEMA_VALIDATION_IGNORED"
  5613. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5614. // "UNDECLARED_PROPERTIES"
  5615. // "UNREACHABLE"
  5616. Code string `json:"code,omitempty"`
  5617. // Data: [Output Only] Metadata about this warning in key: value format.
  5618. // For example:
  5619. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5620. Data []*DiskTypesScopedListWarningData `json:"data,omitempty"`
  5621. // Message: [Output Only] A human-readable description of the warning
  5622. // code.
  5623. Message string `json:"message,omitempty"`
  5624. // ForceSendFields is a list of field names (e.g. "Code") to
  5625. // unconditionally include in API requests. By default, fields with
  5626. // empty values are omitted from API requests. However, any non-pointer,
  5627. // non-interface field appearing in ForceSendFields will be sent to the
  5628. // server regardless of whether the field is empty or not. This may be
  5629. // used to include empty fields in Patch requests.
  5630. ForceSendFields []string `json:"-"`
  5631. // NullFields is a list of field names (e.g. "Code") to include in API
  5632. // requests with the JSON null value. By default, fields with empty
  5633. // values are omitted from API requests. However, any field with an
  5634. // empty value appearing in NullFields will be sent to the server as
  5635. // null. It is an error if a field in this list has a non-empty value.
  5636. // This may be used to include null fields in Patch requests.
  5637. NullFields []string `json:"-"`
  5638. }
  5639. func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  5640. type NoMethod DiskTypesScopedListWarning
  5641. raw := NoMethod(*s)
  5642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5643. }
  5644. type DiskTypesScopedListWarningData struct {
  5645. // Key: [Output Only] A key that provides more detail on the warning
  5646. // being returned. For example, for warnings where there are no results
  5647. // in a list request for a particular zone, this key might be scope and
  5648. // the key value might be the zone name. Other examples might be a key
  5649. // indicating a deprecated resource and a suggested replacement, or a
  5650. // warning about invalid network settings (for example, if an instance
  5651. // attempts to perform IP forwarding but is not enabled for IP
  5652. // forwarding).
  5653. Key string `json:"key,omitempty"`
  5654. // Value: [Output Only] A warning data value corresponding to the key.
  5655. Value string `json:"value,omitempty"`
  5656. // ForceSendFields is a list of field names (e.g. "Key") to
  5657. // unconditionally include in API requests. By default, fields with
  5658. // empty values are omitted from API requests. However, any non-pointer,
  5659. // non-interface field appearing in ForceSendFields will be sent to the
  5660. // server regardless of whether the field is empty or not. This may be
  5661. // used to include empty fields in Patch requests.
  5662. ForceSendFields []string `json:"-"`
  5663. // NullFields is a list of field names (e.g. "Key") to include in API
  5664. // requests with the JSON null value. By default, fields with empty
  5665. // values are omitted from API requests. However, any field with an
  5666. // empty value appearing in NullFields will be sent to the server as
  5667. // null. It is an error if a field in this list has a non-empty value.
  5668. // This may be used to include null fields in Patch requests.
  5669. NullFields []string `json:"-"`
  5670. }
  5671. func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  5672. type NoMethod DiskTypesScopedListWarningData
  5673. raw := NoMethod(*s)
  5674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5675. }
  5676. type DisksResizeRequest struct {
  5677. // SizeGb: The new size of the persistent disk, which is specified in
  5678. // GB.
  5679. SizeGb int64 `json:"sizeGb,omitempty,string"`
  5680. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  5681. // unconditionally include in API requests. By default, fields with
  5682. // empty values are omitted from API requests. However, any non-pointer,
  5683. // non-interface field appearing in ForceSendFields will be sent to the
  5684. // server regardless of whether the field is empty or not. This may be
  5685. // used to include empty fields in Patch requests.
  5686. ForceSendFields []string `json:"-"`
  5687. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  5688. // requests with the JSON null value. By default, fields with empty
  5689. // values are omitted from API requests. However, any field with an
  5690. // empty value appearing in NullFields will be sent to the server as
  5691. // null. It is an error if a field in this list has a non-empty value.
  5692. // This may be used to include null fields in Patch requests.
  5693. NullFields []string `json:"-"`
  5694. }
  5695. func (s *DisksResizeRequest) MarshalJSON() ([]byte, error) {
  5696. type NoMethod DisksResizeRequest
  5697. raw := NoMethod(*s)
  5698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5699. }
  5700. type DisksScopedList struct {
  5701. // Disks: [Output Only] A list of disks contained in this scope.
  5702. Disks []*Disk `json:"disks,omitempty"`
  5703. // Warning: [Output Only] Informational warning which replaces the list
  5704. // of disks when the list is empty.
  5705. Warning *DisksScopedListWarning `json:"warning,omitempty"`
  5706. // ForceSendFields is a list of field names (e.g. "Disks") to
  5707. // unconditionally include in API requests. By default, fields with
  5708. // empty values are omitted from API requests. However, any non-pointer,
  5709. // non-interface field appearing in ForceSendFields will be sent to the
  5710. // server regardless of whether the field is empty or not. This may be
  5711. // used to include empty fields in Patch requests.
  5712. ForceSendFields []string `json:"-"`
  5713. // NullFields is a list of field names (e.g. "Disks") to include in API
  5714. // requests with the JSON null value. By default, fields with empty
  5715. // values are omitted from API requests. However, any field with an
  5716. // empty value appearing in NullFields will be sent to the server as
  5717. // null. It is an error if a field in this list has a non-empty value.
  5718. // This may be used to include null fields in Patch requests.
  5719. NullFields []string `json:"-"`
  5720. }
  5721. func (s *DisksScopedList) MarshalJSON() ([]byte, error) {
  5722. type NoMethod DisksScopedList
  5723. raw := NoMethod(*s)
  5724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5725. }
  5726. // DisksScopedListWarning: [Output Only] Informational warning which
  5727. // replaces the list of disks when the list is empty.
  5728. type DisksScopedListWarning struct {
  5729. // Code: [Output Only] A warning code, if applicable. For example,
  5730. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  5731. // the response.
  5732. //
  5733. // Possible values:
  5734. // "CLEANUP_FAILED"
  5735. // "DEPRECATED_RESOURCE_USED"
  5736. // "DEPRECATED_TYPE_USED"
  5737. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  5738. // "EXPERIMENTAL_TYPE_USED"
  5739. // "EXTERNAL_API_WARNING"
  5740. // "FIELD_VALUE_OVERRIDEN"
  5741. // "INJECTED_KERNELS_DEPRECATED"
  5742. // "MISSING_TYPE_DEPENDENCY"
  5743. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  5744. // "NEXT_HOP_CANNOT_IP_FORWARD"
  5745. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  5746. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  5747. // "NEXT_HOP_NOT_RUNNING"
  5748. // "NOT_CRITICAL_ERROR"
  5749. // "NO_RESULTS_ON_PAGE"
  5750. // "REQUIRED_TOS_AGREEMENT"
  5751. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  5752. // "RESOURCE_NOT_DELETED"
  5753. // "SCHEMA_VALIDATION_IGNORED"
  5754. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  5755. // "UNDECLARED_PROPERTIES"
  5756. // "UNREACHABLE"
  5757. Code string `json:"code,omitempty"`
  5758. // Data: [Output Only] Metadata about this warning in key: value format.
  5759. // For example:
  5760. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  5761. Data []*DisksScopedListWarningData `json:"data,omitempty"`
  5762. // Message: [Output Only] A human-readable description of the warning
  5763. // code.
  5764. Message string `json:"message,omitempty"`
  5765. // ForceSendFields is a list of field names (e.g. "Code") to
  5766. // unconditionally include in API requests. By default, fields with
  5767. // empty values are omitted from API requests. However, any non-pointer,
  5768. // non-interface field appearing in ForceSendFields will be sent to the
  5769. // server regardless of whether the field is empty or not. This may be
  5770. // used to include empty fields in Patch requests.
  5771. ForceSendFields []string `json:"-"`
  5772. // NullFields is a list of field names (e.g. "Code") to include in API
  5773. // requests with the JSON null value. By default, fields with empty
  5774. // values are omitted from API requests. However, any field with an
  5775. // empty value appearing in NullFields will be sent to the server as
  5776. // null. It is an error if a field in this list has a non-empty value.
  5777. // This may be used to include null fields in Patch requests.
  5778. NullFields []string `json:"-"`
  5779. }
  5780. func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) {
  5781. type NoMethod DisksScopedListWarning
  5782. raw := NoMethod(*s)
  5783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5784. }
  5785. type DisksScopedListWarningData struct {
  5786. // Key: [Output Only] A key that provides more detail on the warning
  5787. // being returned. For example, for warnings where there are no results
  5788. // in a list request for a particular zone, this key might be scope and
  5789. // the key value might be the zone name. Other examples might be a key
  5790. // indicating a deprecated resource and a suggested replacement, or a
  5791. // warning about invalid network settings (for example, if an instance
  5792. // attempts to perform IP forwarding but is not enabled for IP
  5793. // forwarding).
  5794. Key string `json:"key,omitempty"`
  5795. // Value: [Output Only] A warning data value corresponding to the key.
  5796. Value string `json:"value,omitempty"`
  5797. // ForceSendFields is a list of field names (e.g. "Key") to
  5798. // unconditionally include in API requests. By default, fields with
  5799. // empty values are omitted from API requests. However, any non-pointer,
  5800. // non-interface field appearing in ForceSendFields will be sent to the
  5801. // server regardless of whether the field is empty or not. This may be
  5802. // used to include empty fields in Patch requests.
  5803. ForceSendFields []string `json:"-"`
  5804. // NullFields is a list of field names (e.g. "Key") to include in API
  5805. // requests with the JSON null value. By default, fields with empty
  5806. // values are omitted from API requests. However, any field with an
  5807. // empty value appearing in NullFields will be sent to the server as
  5808. // null. It is an error if a field in this list has a non-empty value.
  5809. // This may be used to include null fields in Patch requests.
  5810. NullFields []string `json:"-"`
  5811. }
  5812. func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) {
  5813. type NoMethod DisksScopedListWarningData
  5814. raw := NoMethod(*s)
  5815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5816. }
  5817. type DistributionPolicy struct {
  5818. // Zones: Zones where the regional managed instance group will create
  5819. // and manage instances.
  5820. Zones []*DistributionPolicyZoneConfiguration `json:"zones,omitempty"`
  5821. // ForceSendFields is a list of field names (e.g. "Zones") to
  5822. // unconditionally include in API requests. By default, fields with
  5823. // empty values are omitted from API requests. However, any non-pointer,
  5824. // non-interface field appearing in ForceSendFields will be sent to the
  5825. // server regardless of whether the field is empty or not. This may be
  5826. // used to include empty fields in Patch requests.
  5827. ForceSendFields []string `json:"-"`
  5828. // NullFields is a list of field names (e.g. "Zones") to include in API
  5829. // requests with the JSON null value. By default, fields with empty
  5830. // values are omitted from API requests. However, any field with an
  5831. // empty value appearing in NullFields will be sent to the server as
  5832. // null. It is an error if a field in this list has a non-empty value.
  5833. // This may be used to include null fields in Patch requests.
  5834. NullFields []string `json:"-"`
  5835. }
  5836. func (s *DistributionPolicy) MarshalJSON() ([]byte, error) {
  5837. type NoMethod DistributionPolicy
  5838. raw := NoMethod(*s)
  5839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5840. }
  5841. type DistributionPolicyZoneConfiguration struct {
  5842. // Zone: The URL of the zone. The zone must exist in the region where
  5843. // the managed instance group is located.
  5844. Zone string `json:"zone,omitempty"`
  5845. // ForceSendFields is a list of field names (e.g. "Zone") to
  5846. // unconditionally include in API requests. By default, fields with
  5847. // empty values are omitted from API requests. However, any non-pointer,
  5848. // non-interface field appearing in ForceSendFields will be sent to the
  5849. // server regardless of whether the field is empty or not. This may be
  5850. // used to include empty fields in Patch requests.
  5851. ForceSendFields []string `json:"-"`
  5852. // NullFields is a list of field names (e.g. "Zone") to include in API
  5853. // requests with the JSON null value. By default, fields with empty
  5854. // values are omitted from API requests. However, any field with an
  5855. // empty value appearing in NullFields will be sent to the server as
  5856. // null. It is an error if a field in this list has a non-empty value.
  5857. // This may be used to include null fields in Patch requests.
  5858. NullFields []string `json:"-"`
  5859. }
  5860. func (s *DistributionPolicyZoneConfiguration) MarshalJSON() ([]byte, error) {
  5861. type NoMethod DistributionPolicyZoneConfiguration
  5862. raw := NoMethod(*s)
  5863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5864. }
  5865. // Expr: Represents an expression text. Example:
  5866. //
  5867. // title: "User account presence" description: "Determines whether the
  5868. // request has a user account" expression: "size(request.user) > 0"
  5869. type Expr struct {
  5870. // Description: An optional description of the expression. This is a
  5871. // longer text which describes the expression, e.g. when hovered over it
  5872. // in a UI.
  5873. Description string `json:"description,omitempty"`
  5874. // Expression: Textual representation of an expression in Common
  5875. // Expression Language syntax.
  5876. //
  5877. // The application context of the containing message determines which
  5878. // well-known feature set of CEL is supported.
  5879. Expression string `json:"expression,omitempty"`
  5880. // Location: An optional string indicating the location of the
  5881. // expression for error reporting, e.g. a file name and a position in
  5882. // the file.
  5883. Location string `json:"location,omitempty"`
  5884. // Title: An optional title for the expression, i.e. a short string
  5885. // describing its purpose. This can be used e.g. in UIs which allow to
  5886. // enter the expression.
  5887. Title string `json:"title,omitempty"`
  5888. // ForceSendFields is a list of field names (e.g. "Description") to
  5889. // unconditionally include in API requests. By default, fields with
  5890. // empty values are omitted from API requests. However, any non-pointer,
  5891. // non-interface field appearing in ForceSendFields will be sent to the
  5892. // server regardless of whether the field is empty or not. This may be
  5893. // used to include empty fields in Patch requests.
  5894. ForceSendFields []string `json:"-"`
  5895. // NullFields is a list of field names (e.g. "Description") to include
  5896. // in API requests with the JSON null value. By default, fields with
  5897. // empty values are omitted from API requests. However, any field with
  5898. // an empty value appearing in NullFields will be sent to the server as
  5899. // null. It is an error if a field in this list has a non-empty value.
  5900. // This may be used to include null fields in Patch requests.
  5901. NullFields []string `json:"-"`
  5902. }
  5903. func (s *Expr) MarshalJSON() ([]byte, error) {
  5904. type NoMethod Expr
  5905. raw := NoMethod(*s)
  5906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5907. }
  5908. // Firewall: Represents a Firewall resource.
  5909. type Firewall struct {
  5910. // Allowed: The list of ALLOW rules specified by this firewall. Each
  5911. // rule specifies a protocol and port-range tuple that describes a
  5912. // permitted connection.
  5913. Allowed []*FirewallAllowed `json:"allowed,omitempty"`
  5914. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  5915. // format.
  5916. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  5917. // Denied: The list of DENY rules specified by this firewall. Each rule
  5918. // specifies a protocol and port-range tuple that describes a denied
  5919. // connection.
  5920. Denied []*FirewallDenied `json:"denied,omitempty"`
  5921. // Description: An optional description of this resource. Provide this
  5922. // property when you create the resource.
  5923. Description string `json:"description,omitempty"`
  5924. // DestinationRanges: If destination ranges are specified, the firewall
  5925. // will apply only to traffic that has destination IP address in these
  5926. // ranges. These ranges must be expressed in CIDR format. Only IPv4 is
  5927. // supported.
  5928. DestinationRanges []string `json:"destinationRanges,omitempty"`
  5929. // Direction: Direction of traffic to which this firewall applies;
  5930. // default is INGRESS. Note: For INGRESS traffic, it is NOT supported to
  5931. // specify destinationRanges; For EGRESS traffic, it is NOT supported to
  5932. // specify sourceRanges OR sourceTags.
  5933. //
  5934. // Possible values:
  5935. // "EGRESS"
  5936. // "INGRESS"
  5937. Direction string `json:"direction,omitempty"`
  5938. // Disabled: Denotes whether the firewall rule is disabled, i.e not
  5939. // applied to the network it is associated with. When set to true, the
  5940. // firewall rule is not enforced and the network behaves as if it did
  5941. // not exist. If this is unspecified, the firewall rule will be enabled.
  5942. Disabled bool `json:"disabled,omitempty"`
  5943. // Id: [Output Only] The unique identifier for the resource. This
  5944. // identifier is defined by the server.
  5945. Id uint64 `json:"id,omitempty,string"`
  5946. // Kind: [Output Only] Type of the resource. Always compute#firewall for
  5947. // firewall rules.
  5948. Kind string `json:"kind,omitempty"`
  5949. // LogConfig: This field denotes the logging options for a particular
  5950. // firewall rule. If logging is enabled, logs will be exported to
  5951. // Stackdriver.
  5952. LogConfig *FirewallLogConfig `json:"logConfig,omitempty"`
  5953. // Name: Name of the resource; provided by the client when the resource
  5954. // is created. The name must be 1-63 characters long, and comply with
  5955. // RFC1035. Specifically, the name must be 1-63 characters long and
  5956. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  5957. // the first character must be a lowercase letter, and all following
  5958. // characters must be a dash, lowercase letter, or digit, except the
  5959. // last character, which cannot be a dash.
  5960. Name string `json:"name,omitempty"`
  5961. // Network: URL of the network resource for this firewall rule. If not
  5962. // specified when creating a firewall rule, the default network is
  5963. // used:
  5964. // global/networks/default
  5965. // If you choose to specify this property, you can specify the network
  5966. // as a full or partial URL. For example, the following are all valid
  5967. // URLs:
  5968. // -
  5969. // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network
  5970. // - projects/myproject/global/networks/my-network
  5971. // - global/networks/default
  5972. Network string `json:"network,omitempty"`
  5973. // Priority: Priority for this rule. This is an integer between 0 and
  5974. // 65535, both inclusive. When not specified, the value assumed is 1000.
  5975. // Relative priorities determine precedence of conflicting rules. Lower
  5976. // value of priority implies higher precedence (eg, a rule with priority
  5977. // 0 has higher precedence than a rule with priority 1). DENY rules take
  5978. // precedence over ALLOW rules having equal priority.
  5979. Priority int64 `json:"priority,omitempty"`
  5980. // SelfLink: [Output Only] Server-defined URL for the resource.
  5981. SelfLink string `json:"selfLink,omitempty"`
  5982. // SourceRanges: If source ranges are specified, the firewall will apply
  5983. // only to traffic that has source IP address in these ranges. These
  5984. // ranges must be expressed in CIDR format. One or both of sourceRanges
  5985. // and sourceTags may be set. If both properties are set, the firewall
  5986. // will apply to traffic that has source IP address within sourceRanges
  5987. // OR the source IP that belongs to a tag listed in the sourceTags
  5988. // property. The connection does not need to match both properties for
  5989. // the firewall to apply. Only IPv4 is supported.
  5990. SourceRanges []string `json:"sourceRanges,omitempty"`
  5991. // SourceServiceAccounts: If source service accounts are specified, the
  5992. // firewall will apply only to traffic originating from an instance with
  5993. // a service account in this list. Source service accounts cannot be
  5994. // used to control traffic to an instance's external IP address because
  5995. // service accounts are associated with an instance, not an IP address.
  5996. // sourceRanges can be set at the same time as sourceServiceAccounts. If
  5997. // both are set, the firewall will apply to traffic that has source IP
  5998. // address within sourceRanges OR the source IP belongs to an instance
  5999. // with service account listed in sourceServiceAccount. The connection
  6000. // does not need to match both properties for the firewall to apply.
  6001. // sourceServiceAccounts cannot be used at the same time as sourceTags
  6002. // or targetTags.
  6003. SourceServiceAccounts []string `json:"sourceServiceAccounts,omitempty"`
  6004. // SourceTags: If source tags are specified, the firewall rule applies
  6005. // only to traffic with source IPs that match the primary network
  6006. // interfaces of VM instances that have the tag and are in the same VPC
  6007. // network. Source tags cannot be used to control traffic to an
  6008. // instance's external IP address, it only applies to traffic between
  6009. // instances in the same virtual network. Because tags are associated
  6010. // with instances, not IP addresses. One or both of sourceRanges and
  6011. // sourceTags may be set. If both properties are set, the firewall will
  6012. // apply to traffic that has source IP address within sourceRanges OR
  6013. // the source IP that belongs to a tag listed in the sourceTags
  6014. // property. The connection does not need to match both properties for
  6015. // the firewall to apply.
  6016. SourceTags []string `json:"sourceTags,omitempty"`
  6017. // TargetServiceAccounts: A list of service accounts indicating sets of
  6018. // instances located in the network that may make network connections as
  6019. // specified in allowed[]. targetServiceAccounts cannot be used at the
  6020. // same time as targetTags or sourceTags. If neither
  6021. // targetServiceAccounts nor targetTags are specified, the firewall rule
  6022. // applies to all instances on the specified network.
  6023. TargetServiceAccounts []string `json:"targetServiceAccounts,omitempty"`
  6024. // TargetTags: A list of tags that controls which instances the firewall
  6025. // rule applies to. If targetTags are specified, then the firewall rule
  6026. // applies only to instances in the VPC network that have one of those
  6027. // tags. If no targetTags are specified, the firewall rule applies to
  6028. // all instances on the specified network.
  6029. TargetTags []string `json:"targetTags,omitempty"`
  6030. // ServerResponse contains the HTTP response code and headers from the
  6031. // server.
  6032. googleapi.ServerResponse `json:"-"`
  6033. // ForceSendFields is a list of field names (e.g. "Allowed") to
  6034. // unconditionally include in API requests. By default, fields with
  6035. // empty values are omitted from API requests. However, any non-pointer,
  6036. // non-interface field appearing in ForceSendFields will be sent to the
  6037. // server regardless of whether the field is empty or not. This may be
  6038. // used to include empty fields in Patch requests.
  6039. ForceSendFields []string `json:"-"`
  6040. // NullFields is a list of field names (e.g. "Allowed") to include in
  6041. // API requests with the JSON null value. By default, fields with empty
  6042. // values are omitted from API requests. However, any field with an
  6043. // empty value appearing in NullFields will be sent to the server as
  6044. // null. It is an error if a field in this list has a non-empty value.
  6045. // This may be used to include null fields in Patch requests.
  6046. NullFields []string `json:"-"`
  6047. }
  6048. func (s *Firewall) MarshalJSON() ([]byte, error) {
  6049. type NoMethod Firewall
  6050. raw := NoMethod(*s)
  6051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6052. }
  6053. type FirewallAllowed struct {
  6054. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6055. // type is required when creating a firewall rule. This value can either
  6056. // be one of the following well known protocol strings (tcp, udp, icmp,
  6057. // esp, ah, ipip, sctp), or the IP protocol number.
  6058. IPProtocol string `json:"IPProtocol,omitempty"`
  6059. // Ports: An optional list of ports to which this rule applies. This
  6060. // field is only applicable for UDP or TCP protocol. Each entry must be
  6061. // either an integer or a range. If not specified, this rule applies to
  6062. // connections through any port.
  6063. //
  6064. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6065. Ports []string `json:"ports,omitempty"`
  6066. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6067. // unconditionally include in API requests. By default, fields with
  6068. // empty values are omitted from API requests. However, any non-pointer,
  6069. // non-interface field appearing in ForceSendFields will be sent to the
  6070. // server regardless of whether the field is empty or not. This may be
  6071. // used to include empty fields in Patch requests.
  6072. ForceSendFields []string `json:"-"`
  6073. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6074. // API requests with the JSON null value. By default, fields with empty
  6075. // values are omitted from API requests. However, any field with an
  6076. // empty value appearing in NullFields will be sent to the server as
  6077. // null. It is an error if a field in this list has a non-empty value.
  6078. // This may be used to include null fields in Patch requests.
  6079. NullFields []string `json:"-"`
  6080. }
  6081. func (s *FirewallAllowed) MarshalJSON() ([]byte, error) {
  6082. type NoMethod FirewallAllowed
  6083. raw := NoMethod(*s)
  6084. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6085. }
  6086. type FirewallDenied struct {
  6087. // IPProtocol: The IP protocol to which this rule applies. The protocol
  6088. // type is required when creating a firewall rule. This value can either
  6089. // be one of the following well known protocol strings (tcp, udp, icmp,
  6090. // esp, ah, ipip, sctp), or the IP protocol number.
  6091. IPProtocol string `json:"IPProtocol,omitempty"`
  6092. // Ports: An optional list of ports to which this rule applies. This
  6093. // field is only applicable for UDP or TCP protocol. Each entry must be
  6094. // either an integer or a range. If not specified, this rule applies to
  6095. // connections through any port.
  6096. //
  6097. // Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
  6098. Ports []string `json:"ports,omitempty"`
  6099. // ForceSendFields is a list of field names (e.g. "IPProtocol") to
  6100. // unconditionally include in API requests. By default, fields with
  6101. // empty values are omitted from API requests. However, any non-pointer,
  6102. // non-interface field appearing in ForceSendFields will be sent to the
  6103. // server regardless of whether the field is empty or not. This may be
  6104. // used to include empty fields in Patch requests.
  6105. ForceSendFields []string `json:"-"`
  6106. // NullFields is a list of field names (e.g. "IPProtocol") to include in
  6107. // API requests with the JSON null value. By default, fields with empty
  6108. // values are omitted from API requests. However, any field with an
  6109. // empty value appearing in NullFields will be sent to the server as
  6110. // null. It is an error if a field in this list has a non-empty value.
  6111. // This may be used to include null fields in Patch requests.
  6112. NullFields []string `json:"-"`
  6113. }
  6114. func (s *FirewallDenied) MarshalJSON() ([]byte, error) {
  6115. type NoMethod FirewallDenied
  6116. raw := NoMethod(*s)
  6117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6118. }
  6119. // FirewallList: Contains a list of firewalls.
  6120. type FirewallList struct {
  6121. // Id: [Output Only] Unique identifier for the resource; defined by the
  6122. // server.
  6123. Id string `json:"id,omitempty"`
  6124. // Items: A list of Firewall resources.
  6125. Items []*Firewall `json:"items,omitempty"`
  6126. // Kind: [Output Only] Type of resource. Always compute#firewallList for
  6127. // lists of firewalls.
  6128. Kind string `json:"kind,omitempty"`
  6129. // NextPageToken: [Output Only] This token allows you to get the next
  6130. // page of results for list requests. If the number of results is larger
  6131. // than maxResults, use the nextPageToken as a value for the query
  6132. // parameter pageToken in the next list request. Subsequent list
  6133. // requests will have their own nextPageToken to continue paging through
  6134. // the results.
  6135. NextPageToken string `json:"nextPageToken,omitempty"`
  6136. // SelfLink: [Output Only] Server-defined URL for this resource.
  6137. SelfLink string `json:"selfLink,omitempty"`
  6138. // Warning: [Output Only] Informational warning message.
  6139. Warning *FirewallListWarning `json:"warning,omitempty"`
  6140. // ServerResponse contains the HTTP response code and headers from the
  6141. // server.
  6142. googleapi.ServerResponse `json:"-"`
  6143. // ForceSendFields is a list of field names (e.g. "Id") to
  6144. // unconditionally include in API requests. By default, fields with
  6145. // empty values are omitted from API requests. However, any non-pointer,
  6146. // non-interface field appearing in ForceSendFields will be sent to the
  6147. // server regardless of whether the field is empty or not. This may be
  6148. // used to include empty fields in Patch requests.
  6149. ForceSendFields []string `json:"-"`
  6150. // NullFields is a list of field names (e.g. "Id") to include in API
  6151. // requests with the JSON null value. By default, fields with empty
  6152. // values are omitted from API requests. However, any field with an
  6153. // empty value appearing in NullFields will be sent to the server as
  6154. // null. It is an error if a field in this list has a non-empty value.
  6155. // This may be used to include null fields in Patch requests.
  6156. NullFields []string `json:"-"`
  6157. }
  6158. func (s *FirewallList) MarshalJSON() ([]byte, error) {
  6159. type NoMethod FirewallList
  6160. raw := NoMethod(*s)
  6161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6162. }
  6163. // FirewallListWarning: [Output Only] Informational warning message.
  6164. type FirewallListWarning struct {
  6165. // Code: [Output Only] A warning code, if applicable. For example,
  6166. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6167. // the response.
  6168. //
  6169. // Possible values:
  6170. // "CLEANUP_FAILED"
  6171. // "DEPRECATED_RESOURCE_USED"
  6172. // "DEPRECATED_TYPE_USED"
  6173. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6174. // "EXPERIMENTAL_TYPE_USED"
  6175. // "EXTERNAL_API_WARNING"
  6176. // "FIELD_VALUE_OVERRIDEN"
  6177. // "INJECTED_KERNELS_DEPRECATED"
  6178. // "MISSING_TYPE_DEPENDENCY"
  6179. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6180. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6181. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6182. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6183. // "NEXT_HOP_NOT_RUNNING"
  6184. // "NOT_CRITICAL_ERROR"
  6185. // "NO_RESULTS_ON_PAGE"
  6186. // "REQUIRED_TOS_AGREEMENT"
  6187. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6188. // "RESOURCE_NOT_DELETED"
  6189. // "SCHEMA_VALIDATION_IGNORED"
  6190. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6191. // "UNDECLARED_PROPERTIES"
  6192. // "UNREACHABLE"
  6193. Code string `json:"code,omitempty"`
  6194. // Data: [Output Only] Metadata about this warning in key: value format.
  6195. // For example:
  6196. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6197. Data []*FirewallListWarningData `json:"data,omitempty"`
  6198. // Message: [Output Only] A human-readable description of the warning
  6199. // code.
  6200. Message string `json:"message,omitempty"`
  6201. // ForceSendFields is a list of field names (e.g. "Code") to
  6202. // unconditionally include in API requests. By default, fields with
  6203. // empty values are omitted from API requests. However, any non-pointer,
  6204. // non-interface field appearing in ForceSendFields will be sent to the
  6205. // server regardless of whether the field is empty or not. This may be
  6206. // used to include empty fields in Patch requests.
  6207. ForceSendFields []string `json:"-"`
  6208. // NullFields is a list of field names (e.g. "Code") to include in API
  6209. // requests with the JSON null value. By default, fields with empty
  6210. // values are omitted from API requests. However, any field with an
  6211. // empty value appearing in NullFields will be sent to the server as
  6212. // null. It is an error if a field in this list has a non-empty value.
  6213. // This may be used to include null fields in Patch requests.
  6214. NullFields []string `json:"-"`
  6215. }
  6216. func (s *FirewallListWarning) MarshalJSON() ([]byte, error) {
  6217. type NoMethod FirewallListWarning
  6218. raw := NoMethod(*s)
  6219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6220. }
  6221. type FirewallListWarningData struct {
  6222. // Key: [Output Only] A key that provides more detail on the warning
  6223. // being returned. For example, for warnings where there are no results
  6224. // in a list request for a particular zone, this key might be scope and
  6225. // the key value might be the zone name. Other examples might be a key
  6226. // indicating a deprecated resource and a suggested replacement, or a
  6227. // warning about invalid network settings (for example, if an instance
  6228. // attempts to perform IP forwarding but is not enabled for IP
  6229. // forwarding).
  6230. Key string `json:"key,omitempty"`
  6231. // Value: [Output Only] A warning data value corresponding to the key.
  6232. Value string `json:"value,omitempty"`
  6233. // ForceSendFields is a list of field names (e.g. "Key") to
  6234. // unconditionally include in API requests. By default, fields with
  6235. // empty values are omitted from API requests. However, any non-pointer,
  6236. // non-interface field appearing in ForceSendFields will be sent to the
  6237. // server regardless of whether the field is empty or not. This may be
  6238. // used to include empty fields in Patch requests.
  6239. ForceSendFields []string `json:"-"`
  6240. // NullFields is a list of field names (e.g. "Key") to include in API
  6241. // requests with the JSON null value. By default, fields with empty
  6242. // values are omitted from API requests. However, any field with an
  6243. // empty value appearing in NullFields will be sent to the server as
  6244. // null. It is an error if a field in this list has a non-empty value.
  6245. // This may be used to include null fields in Patch requests.
  6246. NullFields []string `json:"-"`
  6247. }
  6248. func (s *FirewallListWarningData) MarshalJSON() ([]byte, error) {
  6249. type NoMethod FirewallListWarningData
  6250. raw := NoMethod(*s)
  6251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6252. }
  6253. // FirewallLogConfig: The available logging options for a firewall rule.
  6254. type FirewallLogConfig struct {
  6255. // Enable: This field denotes whether to enable logging for a particular
  6256. // firewall rule.
  6257. Enable bool `json:"enable,omitempty"`
  6258. // ForceSendFields is a list of field names (e.g. "Enable") to
  6259. // unconditionally include in API requests. By default, fields with
  6260. // empty values are omitted from API requests. However, any non-pointer,
  6261. // non-interface field appearing in ForceSendFields will be sent to the
  6262. // server regardless of whether the field is empty or not. This may be
  6263. // used to include empty fields in Patch requests.
  6264. ForceSendFields []string `json:"-"`
  6265. // NullFields is a list of field names (e.g. "Enable") to include in API
  6266. // requests with the JSON null value. By default, fields with empty
  6267. // values are omitted from API requests. However, any field with an
  6268. // empty value appearing in NullFields will be sent to the server as
  6269. // null. It is an error if a field in this list has a non-empty value.
  6270. // This may be used to include null fields in Patch requests.
  6271. NullFields []string `json:"-"`
  6272. }
  6273. func (s *FirewallLogConfig) MarshalJSON() ([]byte, error) {
  6274. type NoMethod FirewallLogConfig
  6275. raw := NoMethod(*s)
  6276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6277. }
  6278. // FixedOrPercent: Encapsulates numeric value that can be either
  6279. // absolute or relative.
  6280. type FixedOrPercent struct {
  6281. // Calculated: [Output Only] Absolute value of VM instances calculated
  6282. // based on the specific mode.
  6283. //
  6284. //
  6285. // - If the value is fixed, then the calculated value is equal to the
  6286. // fixed value.
  6287. // - If the value is a percent, then the calculated value is percent/100
  6288. // * targetSize. For example, the calculated value of a 80% of a managed
  6289. // instance group with 150 instances would be (80/100 * 150) = 120 VM
  6290. // instances. If there is a remainder, the number is rounded up.
  6291. Calculated int64 `json:"calculated,omitempty"`
  6292. // Fixed: Specifies a fixed number of VM instances. This must be a
  6293. // positive integer.
  6294. Fixed int64 `json:"fixed,omitempty"`
  6295. // Percent: Specifies a percentage of instances between 0 to 100%,
  6296. // inclusive. For example, specify 80 for 80%.
  6297. Percent int64 `json:"percent,omitempty"`
  6298. // ForceSendFields is a list of field names (e.g. "Calculated") to
  6299. // unconditionally include in API requests. By default, fields with
  6300. // empty values are omitted from API requests. However, any non-pointer,
  6301. // non-interface field appearing in ForceSendFields will be sent to the
  6302. // server regardless of whether the field is empty or not. This may be
  6303. // used to include empty fields in Patch requests.
  6304. ForceSendFields []string `json:"-"`
  6305. // NullFields is a list of field names (e.g. "Calculated") to include in
  6306. // API requests with the JSON null value. By default, fields with empty
  6307. // values are omitted from API requests. However, any field with an
  6308. // empty value appearing in NullFields will be sent to the server as
  6309. // null. It is an error if a field in this list has a non-empty value.
  6310. // This may be used to include null fields in Patch requests.
  6311. NullFields []string `json:"-"`
  6312. }
  6313. func (s *FixedOrPercent) MarshalJSON() ([]byte, error) {
  6314. type NoMethod FixedOrPercent
  6315. raw := NoMethod(*s)
  6316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6317. }
  6318. // ForwardingRule: A ForwardingRule resource. A ForwardingRule resource
  6319. // specifies which pool of target virtual machines to forward a packet
  6320. // to if it matches the given [IPAddress, IPProtocol, ports] tuple. (==
  6321. // resource_for beta.forwardingRules ==) (== resource_for
  6322. // v1.forwardingRules ==) (== resource_for beta.globalForwardingRules
  6323. // ==) (== resource_for v1.globalForwardingRules ==) (== resource_for
  6324. // beta.regionForwardingRules ==) (== resource_for
  6325. // v1.regionForwardingRules ==)
  6326. type ForwardingRule struct {
  6327. // IPAddress: The IP address that this forwarding rule is serving on
  6328. // behalf of.
  6329. //
  6330. // Addresses are restricted based on the forwarding rule's load
  6331. // balancing scheme (EXTERNAL or INTERNAL) and scope (global or
  6332. // regional).
  6333. //
  6334. // When the load balancing scheme is EXTERNAL, for global forwarding
  6335. // rules, the address must be a global IP, and for regional forwarding
  6336. // rules, the address must live in the same region as the forwarding
  6337. // rule. If this field is empty, an ephemeral IPv4 address from the same
  6338. // scope (global or regional) will be assigned. A regional forwarding
  6339. // rule supports IPv4 only. A global forwarding rule supports either
  6340. // IPv4 or IPv6.
  6341. //
  6342. // When the load balancing scheme is INTERNAL_SELF_MANAGED, this must be
  6343. // a URL reference to an existing Address resource ( internal regional
  6344. // static IP address), with a purpose of GCE_END_POINT and address_type
  6345. // of INTERNAL.
  6346. //
  6347. // When the load balancing scheme is INTERNAL, this can only be an RFC
  6348. // 1918 IP address belonging to the network/subnet configured for the
  6349. // forwarding rule. By default, if this field is empty, an ephemeral
  6350. // internal IP address will be automatically allocated from the IP range
  6351. // of the subnet or network configured for this forwarding rule.
  6352. //
  6353. // An address can be specified either by a literal IP address or a URL
  6354. // reference to an existing Address resource. The following examples are
  6355. // all valid:
  6356. // - 100.1.2.3
  6357. // -
  6358. // https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address
  6359. // - projects/project/regions/region/addresses/address
  6360. // - regions/region/addresses/address
  6361. // - global/addresses/address
  6362. // - address
  6363. IPAddress string `json:"IPAddress,omitempty"`
  6364. // IPProtocol: The IP protocol to which this rule applies. Valid options
  6365. // are TCP, UDP, ESP, AH, SCTP or ICMP.
  6366. //
  6367. // When the load balancing scheme is INTERNAL, only TCP and UDP are
  6368. // valid. When the load balancing scheme is INTERNAL_SELF_MANAGED, only
  6369. // TCPis valid.
  6370. //
  6371. // Possible values:
  6372. // "AH"
  6373. // "ESP"
  6374. // "ICMP"
  6375. // "SCTP"
  6376. // "TCP"
  6377. // "UDP"
  6378. IPProtocol string `json:"IPProtocol,omitempty"`
  6379. // AllPorts: This field is used along with the backend_service field for
  6380. // internal load balancing or with the target field for internal
  6381. // TargetInstance. This field cannot be used with port or portRange
  6382. // fields.
  6383. //
  6384. // When the load balancing scheme is INTERNAL and protocol is TCP/UDP,
  6385. // specify this field to allow packets addressed to any ports will be
  6386. // forwarded to the backends configured with this forwarding rule.
  6387. AllPorts bool `json:"allPorts,omitempty"`
  6388. // BackendService: This field is only used for INTERNAL load
  6389. // balancing.
  6390. //
  6391. // For internal load balancing, this field identifies the BackendService
  6392. // resource to receive the matched traffic.
  6393. BackendService string `json:"backendService,omitempty"`
  6394. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  6395. // format.
  6396. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  6397. // Description: An optional description of this resource. Provide this
  6398. // property when you create the resource.
  6399. Description string `json:"description,omitempty"`
  6400. // Id: [Output Only] The unique identifier for the resource. This
  6401. // identifier is defined by the server.
  6402. Id uint64 `json:"id,omitempty,string"`
  6403. // IpVersion: The IP Version that will be used by this forwarding rule.
  6404. // Valid options are IPV4 or IPV6. This can only be specified for an
  6405. // external global forwarding rule.
  6406. //
  6407. // Possible values:
  6408. // "IPV4"
  6409. // "IPV6"
  6410. // "UNSPECIFIED_VERSION"
  6411. IpVersion string `json:"ipVersion,omitempty"`
  6412. // Kind: [Output Only] Type of the resource. Always
  6413. // compute#forwardingRule for Forwarding Rule resources.
  6414. Kind string `json:"kind,omitempty"`
  6415. // LoadBalancingScheme: This signifies what the ForwardingRule will be
  6416. // used for and can only take the following values: INTERNAL,
  6417. // INTERNAL_SELF_MANAGED, EXTERNAL. The value of INTERNAL means that
  6418. // this will be used for Internal Network Load Balancing (TCP, UDP). The
  6419. // value of INTERNAL_SELF_MANAGED means that this will be used for
  6420. // Internal Global HTTP(S) LB. The value of EXTERNAL means that this
  6421. // will be used for External Load Balancing (HTTP(S) LB, External
  6422. // TCP/UDP LB, SSL Proxy)
  6423. //
  6424. // Possible values:
  6425. // "EXTERNAL"
  6426. // "INTERNAL"
  6427. // "INTERNAL_SELF_MANAGED"
  6428. // "INVALID"
  6429. LoadBalancingScheme string `json:"loadBalancingScheme,omitempty"`
  6430. // Name: Name of the resource; provided by the client when the resource
  6431. // is created. The name must be 1-63 characters long, and comply with
  6432. // RFC1035. Specifically, the name must be 1-63 characters long and
  6433. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  6434. // the first character must be a lowercase letter, and all following
  6435. // characters must be a dash, lowercase letter, or digit, except the
  6436. // last character, which cannot be a dash.
  6437. Name string `json:"name,omitempty"`
  6438. // Network: This field is not used for external load balancing.
  6439. //
  6440. // For INTERNAL and INTERNAL_SELF_MANAGED load balancing, this field
  6441. // identifies the network that the load balanced IP should belong to for
  6442. // this Forwarding Rule. If this field is not specified, the default
  6443. // network will be used.
  6444. Network string `json:"network,omitempty"`
  6445. // NetworkTier: This signifies the networking tier used for configuring
  6446. // this load balancer and can only take the following values: PREMIUM ,
  6447. // STANDARD.
  6448. //
  6449. // For regional ForwardingRule, the valid values are PREMIUM and
  6450. // STANDARD. For GlobalForwardingRule, the valid value is PREMIUM.
  6451. //
  6452. // If this field is not specified, it is assumed to be PREMIUM. If
  6453. // IPAddress is specified, this value must be equal to the networkTier
  6454. // of the Address.
  6455. //
  6456. // Possible values:
  6457. // "PREMIUM"
  6458. // "STANDARD"
  6459. NetworkTier string `json:"networkTier,omitempty"`
  6460. // PortRange: This field is used along with the target field for
  6461. // TargetHttpProxy, TargetHttpsProxy, TargetSslProxy, TargetTcpProxy,
  6462. // TargetVpnGateway, TargetPool, TargetInstance.
  6463. //
  6464. // Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets
  6465. // addressed to ports in the specified range will be forwarded to
  6466. // target. Forwarding rules with the same [IPAddress, IPProtocol] pair
  6467. // must have disjoint port ranges.
  6468. //
  6469. // Some types of forwarding target have constraints on the acceptable
  6470. // ports:
  6471. // - TargetHttpProxy: 80, 8080
  6472. // - TargetHttpsProxy: 443
  6473. // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6474. // 995, 1688, 1883, 5222
  6475. // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993,
  6476. // 995, 1688, 1883, 5222
  6477. // - TargetVpnGateway: 500, 4500
  6478. PortRange string `json:"portRange,omitempty"`
  6479. // Ports: This field is used along with the backend_service field for
  6480. // internal load balancing.
  6481. //
  6482. // When the load balancing scheme is INTERNAL, a list of ports can be
  6483. // configured, for example, ['80'], ['8000','9000'] etc. Only packets
  6484. // addressed to these ports will be forwarded to the backends configured
  6485. // with this forwarding rule.
  6486. //
  6487. // You may specify a maximum of up to 5 ports.
  6488. Ports []string `json:"ports,omitempty"`
  6489. // Region: [Output Only] URL of the region where the regional forwarding
  6490. // rule resides. This field is not applicable to global forwarding
  6491. // rules. You must specify this field as part of the HTTP request URL.
  6492. // It is not settable as a field in the request body.
  6493. Region string `json:"region,omitempty"`
  6494. // SelfLink: [Output Only] Server-defined URL for the resource.
  6495. SelfLink string `json:"selfLink,omitempty"`
  6496. // ServiceLabel: An optional prefix to the service name for this
  6497. // Forwarding Rule. If specified, will be the first label of the fully
  6498. // qualified service name.
  6499. //
  6500. // The label must be 1-63 characters long, and comply with RFC1035.
  6501. // Specifically, the label must be 1-63 characters long and match the
  6502. // regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  6503. // character must be a lowercase letter, and all following characters
  6504. // must be a dash, lowercase letter, or digit, except the last
  6505. // character, which cannot be a dash.
  6506. //
  6507. // This field is only used for internal load balancing.
  6508. ServiceLabel string `json:"serviceLabel,omitempty"`
  6509. // ServiceName: [Output Only] The internal fully qualified service name
  6510. // for this Forwarding Rule.
  6511. //
  6512. // This field is only used for internal load balancing.
  6513. ServiceName string `json:"serviceName,omitempty"`
  6514. // Subnetwork: This field is only used for INTERNAL load balancing.
  6515. //
  6516. // For internal load balancing, this field identifies the subnetwork
  6517. // that the load balanced IP should belong to for this Forwarding
  6518. // Rule.
  6519. //
  6520. // If the network specified is in auto subnet mode, this field is
  6521. // optional. However, if the network is in custom subnet mode, a
  6522. // subnetwork must be specified.
  6523. Subnetwork string `json:"subnetwork,omitempty"`
  6524. // Target: The URL of the target resource to receive the matched
  6525. // traffic. For regional forwarding rules, this target must live in the
  6526. // same region as the forwarding rule. For global forwarding rules, this
  6527. // target must be a global load balancing resource. The forwarded
  6528. // traffic must be of a type appropriate to the target object. For
  6529. // INTERNAL_SELF_MANAGED load balancing, only HTTP and HTTPS targets are
  6530. // valid.
  6531. Target string `json:"target,omitempty"`
  6532. // ServerResponse contains the HTTP response code and headers from the
  6533. // server.
  6534. googleapi.ServerResponse `json:"-"`
  6535. // ForceSendFields is a list of field names (e.g. "IPAddress") to
  6536. // unconditionally include in API requests. By default, fields with
  6537. // empty values are omitted from API requests. However, any non-pointer,
  6538. // non-interface field appearing in ForceSendFields will be sent to the
  6539. // server regardless of whether the field is empty or not. This may be
  6540. // used to include empty fields in Patch requests.
  6541. ForceSendFields []string `json:"-"`
  6542. // NullFields is a list of field names (e.g. "IPAddress") to include in
  6543. // API requests with the JSON null value. By default, fields with empty
  6544. // values are omitted from API requests. However, any field with an
  6545. // empty value appearing in NullFields will be sent to the server as
  6546. // null. It is an error if a field in this list has a non-empty value.
  6547. // This may be used to include null fields in Patch requests.
  6548. NullFields []string `json:"-"`
  6549. }
  6550. func (s *ForwardingRule) MarshalJSON() ([]byte, error) {
  6551. type NoMethod ForwardingRule
  6552. raw := NoMethod(*s)
  6553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6554. }
  6555. type ForwardingRuleAggregatedList struct {
  6556. // Id: [Output Only] Unique identifier for the resource; defined by the
  6557. // server.
  6558. Id string `json:"id,omitempty"`
  6559. // Items: A list of ForwardingRulesScopedList resources.
  6560. Items map[string]ForwardingRulesScopedList `json:"items,omitempty"`
  6561. // Kind: [Output Only] Type of resource. Always
  6562. // compute#forwardingRuleAggregatedList for lists of forwarding rules.
  6563. Kind string `json:"kind,omitempty"`
  6564. // NextPageToken: [Output Only] This token allows you to get the next
  6565. // page of results for list requests. If the number of results is larger
  6566. // than maxResults, use the nextPageToken as a value for the query
  6567. // parameter pageToken in the next list request. Subsequent list
  6568. // requests will have their own nextPageToken to continue paging through
  6569. // the results.
  6570. NextPageToken string `json:"nextPageToken,omitempty"`
  6571. // SelfLink: [Output Only] Server-defined URL for this resource.
  6572. SelfLink string `json:"selfLink,omitempty"`
  6573. // Warning: [Output Only] Informational warning message.
  6574. Warning *ForwardingRuleAggregatedListWarning `json:"warning,omitempty"`
  6575. // ServerResponse contains the HTTP response code and headers from the
  6576. // server.
  6577. googleapi.ServerResponse `json:"-"`
  6578. // ForceSendFields is a list of field names (e.g. "Id") to
  6579. // unconditionally include in API requests. By default, fields with
  6580. // empty values are omitted from API requests. However, any non-pointer,
  6581. // non-interface field appearing in ForceSendFields will be sent to the
  6582. // server regardless of whether the field is empty or not. This may be
  6583. // used to include empty fields in Patch requests.
  6584. ForceSendFields []string `json:"-"`
  6585. // NullFields is a list of field names (e.g. "Id") to include in API
  6586. // requests with the JSON null value. By default, fields with empty
  6587. // values are omitted from API requests. However, any field with an
  6588. // empty value appearing in NullFields will be sent to the server as
  6589. // null. It is an error if a field in this list has a non-empty value.
  6590. // This may be used to include null fields in Patch requests.
  6591. NullFields []string `json:"-"`
  6592. }
  6593. func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) {
  6594. type NoMethod ForwardingRuleAggregatedList
  6595. raw := NoMethod(*s)
  6596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6597. }
  6598. // ForwardingRuleAggregatedListWarning: [Output Only] Informational
  6599. // warning message.
  6600. type ForwardingRuleAggregatedListWarning struct {
  6601. // Code: [Output Only] A warning code, if applicable. For example,
  6602. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6603. // the response.
  6604. //
  6605. // Possible values:
  6606. // "CLEANUP_FAILED"
  6607. // "DEPRECATED_RESOURCE_USED"
  6608. // "DEPRECATED_TYPE_USED"
  6609. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6610. // "EXPERIMENTAL_TYPE_USED"
  6611. // "EXTERNAL_API_WARNING"
  6612. // "FIELD_VALUE_OVERRIDEN"
  6613. // "INJECTED_KERNELS_DEPRECATED"
  6614. // "MISSING_TYPE_DEPENDENCY"
  6615. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6616. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6617. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6618. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6619. // "NEXT_HOP_NOT_RUNNING"
  6620. // "NOT_CRITICAL_ERROR"
  6621. // "NO_RESULTS_ON_PAGE"
  6622. // "REQUIRED_TOS_AGREEMENT"
  6623. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6624. // "RESOURCE_NOT_DELETED"
  6625. // "SCHEMA_VALIDATION_IGNORED"
  6626. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6627. // "UNDECLARED_PROPERTIES"
  6628. // "UNREACHABLE"
  6629. Code string `json:"code,omitempty"`
  6630. // Data: [Output Only] Metadata about this warning in key: value format.
  6631. // For example:
  6632. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6633. Data []*ForwardingRuleAggregatedListWarningData `json:"data,omitempty"`
  6634. // Message: [Output Only] A human-readable description of the warning
  6635. // code.
  6636. Message string `json:"message,omitempty"`
  6637. // ForceSendFields is a list of field names (e.g. "Code") to
  6638. // unconditionally include in API requests. By default, fields with
  6639. // empty values are omitted from API requests. However, any non-pointer,
  6640. // non-interface field appearing in ForceSendFields will be sent to the
  6641. // server regardless of whether the field is empty or not. This may be
  6642. // used to include empty fields in Patch requests.
  6643. ForceSendFields []string `json:"-"`
  6644. // NullFields is a list of field names (e.g. "Code") to include in API
  6645. // requests with the JSON null value. By default, fields with empty
  6646. // values are omitted from API requests. However, any field with an
  6647. // empty value appearing in NullFields will be sent to the server as
  6648. // null. It is an error if a field in this list has a non-empty value.
  6649. // This may be used to include null fields in Patch requests.
  6650. NullFields []string `json:"-"`
  6651. }
  6652. func (s *ForwardingRuleAggregatedListWarning) MarshalJSON() ([]byte, error) {
  6653. type NoMethod ForwardingRuleAggregatedListWarning
  6654. raw := NoMethod(*s)
  6655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6656. }
  6657. type ForwardingRuleAggregatedListWarningData struct {
  6658. // Key: [Output Only] A key that provides more detail on the warning
  6659. // being returned. For example, for warnings where there are no results
  6660. // in a list request for a particular zone, this key might be scope and
  6661. // the key value might be the zone name. Other examples might be a key
  6662. // indicating a deprecated resource and a suggested replacement, or a
  6663. // warning about invalid network settings (for example, if an instance
  6664. // attempts to perform IP forwarding but is not enabled for IP
  6665. // forwarding).
  6666. Key string `json:"key,omitempty"`
  6667. // Value: [Output Only] A warning data value corresponding to the key.
  6668. Value string `json:"value,omitempty"`
  6669. // ForceSendFields is a list of field names (e.g. "Key") to
  6670. // unconditionally include in API requests. By default, fields with
  6671. // empty values are omitted from API requests. However, any non-pointer,
  6672. // non-interface field appearing in ForceSendFields will be sent to the
  6673. // server regardless of whether the field is empty or not. This may be
  6674. // used to include empty fields in Patch requests.
  6675. ForceSendFields []string `json:"-"`
  6676. // NullFields is a list of field names (e.g. "Key") to include in API
  6677. // requests with the JSON null value. By default, fields with empty
  6678. // values are omitted from API requests. However, any field with an
  6679. // empty value appearing in NullFields will be sent to the server as
  6680. // null. It is an error if a field in this list has a non-empty value.
  6681. // This may be used to include null fields in Patch requests.
  6682. NullFields []string `json:"-"`
  6683. }
  6684. func (s *ForwardingRuleAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  6685. type NoMethod ForwardingRuleAggregatedListWarningData
  6686. raw := NoMethod(*s)
  6687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6688. }
  6689. // ForwardingRuleList: Contains a list of ForwardingRule resources.
  6690. type ForwardingRuleList struct {
  6691. // Id: [Output Only] Unique identifier for the resource; defined by the
  6692. // server.
  6693. Id string `json:"id,omitempty"`
  6694. // Items: A list of ForwardingRule resources.
  6695. Items []*ForwardingRule `json:"items,omitempty"`
  6696. // Kind: Type of resource.
  6697. Kind string `json:"kind,omitempty"`
  6698. // NextPageToken: [Output Only] This token allows you to get the next
  6699. // page of results for list requests. If the number of results is larger
  6700. // than maxResults, use the nextPageToken as a value for the query
  6701. // parameter pageToken in the next list request. Subsequent list
  6702. // requests will have their own nextPageToken to continue paging through
  6703. // the results.
  6704. NextPageToken string `json:"nextPageToken,omitempty"`
  6705. // SelfLink: [Output Only] Server-defined URL for this resource.
  6706. SelfLink string `json:"selfLink,omitempty"`
  6707. // Warning: [Output Only] Informational warning message.
  6708. Warning *ForwardingRuleListWarning `json:"warning,omitempty"`
  6709. // ServerResponse contains the HTTP response code and headers from the
  6710. // server.
  6711. googleapi.ServerResponse `json:"-"`
  6712. // ForceSendFields is a list of field names (e.g. "Id") to
  6713. // unconditionally include in API requests. By default, fields with
  6714. // empty values are omitted from API requests. However, any non-pointer,
  6715. // non-interface field appearing in ForceSendFields will be sent to the
  6716. // server regardless of whether the field is empty or not. This may be
  6717. // used to include empty fields in Patch requests.
  6718. ForceSendFields []string `json:"-"`
  6719. // NullFields is a list of field names (e.g. "Id") to include in API
  6720. // requests with the JSON null value. By default, fields with empty
  6721. // values are omitted from API requests. However, any field with an
  6722. // empty value appearing in NullFields will be sent to the server as
  6723. // null. It is an error if a field in this list has a non-empty value.
  6724. // This may be used to include null fields in Patch requests.
  6725. NullFields []string `json:"-"`
  6726. }
  6727. func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) {
  6728. type NoMethod ForwardingRuleList
  6729. raw := NoMethod(*s)
  6730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6731. }
  6732. // ForwardingRuleListWarning: [Output Only] Informational warning
  6733. // message.
  6734. type ForwardingRuleListWarning struct {
  6735. // Code: [Output Only] A warning code, if applicable. For example,
  6736. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6737. // the response.
  6738. //
  6739. // Possible values:
  6740. // "CLEANUP_FAILED"
  6741. // "DEPRECATED_RESOURCE_USED"
  6742. // "DEPRECATED_TYPE_USED"
  6743. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6744. // "EXPERIMENTAL_TYPE_USED"
  6745. // "EXTERNAL_API_WARNING"
  6746. // "FIELD_VALUE_OVERRIDEN"
  6747. // "INJECTED_KERNELS_DEPRECATED"
  6748. // "MISSING_TYPE_DEPENDENCY"
  6749. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6750. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6751. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6752. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6753. // "NEXT_HOP_NOT_RUNNING"
  6754. // "NOT_CRITICAL_ERROR"
  6755. // "NO_RESULTS_ON_PAGE"
  6756. // "REQUIRED_TOS_AGREEMENT"
  6757. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6758. // "RESOURCE_NOT_DELETED"
  6759. // "SCHEMA_VALIDATION_IGNORED"
  6760. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6761. // "UNDECLARED_PROPERTIES"
  6762. // "UNREACHABLE"
  6763. Code string `json:"code,omitempty"`
  6764. // Data: [Output Only] Metadata about this warning in key: value format.
  6765. // For example:
  6766. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6767. Data []*ForwardingRuleListWarningData `json:"data,omitempty"`
  6768. // Message: [Output Only] A human-readable description of the warning
  6769. // code.
  6770. Message string `json:"message,omitempty"`
  6771. // ForceSendFields is a list of field names (e.g. "Code") to
  6772. // unconditionally include in API requests. By default, fields with
  6773. // empty values are omitted from API requests. However, any non-pointer,
  6774. // non-interface field appearing in ForceSendFields will be sent to the
  6775. // server regardless of whether the field is empty or not. This may be
  6776. // used to include empty fields in Patch requests.
  6777. ForceSendFields []string `json:"-"`
  6778. // NullFields is a list of field names (e.g. "Code") to include in API
  6779. // requests with the JSON null value. By default, fields with empty
  6780. // values are omitted from API requests. However, any field with an
  6781. // empty value appearing in NullFields will be sent to the server as
  6782. // null. It is an error if a field in this list has a non-empty value.
  6783. // This may be used to include null fields in Patch requests.
  6784. NullFields []string `json:"-"`
  6785. }
  6786. func (s *ForwardingRuleListWarning) MarshalJSON() ([]byte, error) {
  6787. type NoMethod ForwardingRuleListWarning
  6788. raw := NoMethod(*s)
  6789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6790. }
  6791. type ForwardingRuleListWarningData struct {
  6792. // Key: [Output Only] A key that provides more detail on the warning
  6793. // being returned. For example, for warnings where there are no results
  6794. // in a list request for a particular zone, this key might be scope and
  6795. // the key value might be the zone name. Other examples might be a key
  6796. // indicating a deprecated resource and a suggested replacement, or a
  6797. // warning about invalid network settings (for example, if an instance
  6798. // attempts to perform IP forwarding but is not enabled for IP
  6799. // forwarding).
  6800. Key string `json:"key,omitempty"`
  6801. // Value: [Output Only] A warning data value corresponding to the key.
  6802. Value string `json:"value,omitempty"`
  6803. // ForceSendFields is a list of field names (e.g. "Key") to
  6804. // unconditionally include in API requests. By default, fields with
  6805. // empty values are omitted from API requests. However, any non-pointer,
  6806. // non-interface field appearing in ForceSendFields will be sent to the
  6807. // server regardless of whether the field is empty or not. This may be
  6808. // used to include empty fields in Patch requests.
  6809. ForceSendFields []string `json:"-"`
  6810. // NullFields is a list of field names (e.g. "Key") to include in API
  6811. // requests with the JSON null value. By default, fields with empty
  6812. // values are omitted from API requests. However, any field with an
  6813. // empty value appearing in NullFields will be sent to the server as
  6814. // null. It is an error if a field in this list has a non-empty value.
  6815. // This may be used to include null fields in Patch requests.
  6816. NullFields []string `json:"-"`
  6817. }
  6818. func (s *ForwardingRuleListWarningData) MarshalJSON() ([]byte, error) {
  6819. type NoMethod ForwardingRuleListWarningData
  6820. raw := NoMethod(*s)
  6821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6822. }
  6823. type ForwardingRuleReference struct {
  6824. ForwardingRule string `json:"forwardingRule,omitempty"`
  6825. // ForceSendFields is a list of field names (e.g. "ForwardingRule") to
  6826. // unconditionally include in API requests. By default, fields with
  6827. // empty values are omitted from API requests. However, any non-pointer,
  6828. // non-interface field appearing in ForceSendFields will be sent to the
  6829. // server regardless of whether the field is empty or not. This may be
  6830. // used to include empty fields in Patch requests.
  6831. ForceSendFields []string `json:"-"`
  6832. // NullFields is a list of field names (e.g. "ForwardingRule") to
  6833. // include in API requests with the JSON null value. By default, fields
  6834. // with empty values are omitted from API requests. However, any field
  6835. // with an empty value appearing in NullFields will be sent to the
  6836. // server as null. It is an error if a field in this list has a
  6837. // non-empty value. This may be used to include null fields in Patch
  6838. // requests.
  6839. NullFields []string `json:"-"`
  6840. }
  6841. func (s *ForwardingRuleReference) MarshalJSON() ([]byte, error) {
  6842. type NoMethod ForwardingRuleReference
  6843. raw := NoMethod(*s)
  6844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6845. }
  6846. type ForwardingRulesScopedList struct {
  6847. // ForwardingRules: A list of forwarding rules contained in this scope.
  6848. ForwardingRules []*ForwardingRule `json:"forwardingRules,omitempty"`
  6849. // Warning: Informational warning which replaces the list of forwarding
  6850. // rules when the list is empty.
  6851. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"`
  6852. // ForceSendFields is a list of field names (e.g. "ForwardingRules") to
  6853. // unconditionally include in API requests. By default, fields with
  6854. // empty values are omitted from API requests. However, any non-pointer,
  6855. // non-interface field appearing in ForceSendFields will be sent to the
  6856. // server regardless of whether the field is empty or not. This may be
  6857. // used to include empty fields in Patch requests.
  6858. ForceSendFields []string `json:"-"`
  6859. // NullFields is a list of field names (e.g. "ForwardingRules") to
  6860. // include in API requests with the JSON null value. By default, fields
  6861. // with empty values are omitted from API requests. However, any field
  6862. // with an empty value appearing in NullFields will be sent to the
  6863. // server as null. It is an error if a field in this list has a
  6864. // non-empty value. This may be used to include null fields in Patch
  6865. // requests.
  6866. NullFields []string `json:"-"`
  6867. }
  6868. func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) {
  6869. type NoMethod ForwardingRulesScopedList
  6870. raw := NoMethod(*s)
  6871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6872. }
  6873. // ForwardingRulesScopedListWarning: Informational warning which
  6874. // replaces the list of forwarding rules when the list is empty.
  6875. type ForwardingRulesScopedListWarning struct {
  6876. // Code: [Output Only] A warning code, if applicable. For example,
  6877. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  6878. // the response.
  6879. //
  6880. // Possible values:
  6881. // "CLEANUP_FAILED"
  6882. // "DEPRECATED_RESOURCE_USED"
  6883. // "DEPRECATED_TYPE_USED"
  6884. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  6885. // "EXPERIMENTAL_TYPE_USED"
  6886. // "EXTERNAL_API_WARNING"
  6887. // "FIELD_VALUE_OVERRIDEN"
  6888. // "INJECTED_KERNELS_DEPRECATED"
  6889. // "MISSING_TYPE_DEPENDENCY"
  6890. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  6891. // "NEXT_HOP_CANNOT_IP_FORWARD"
  6892. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  6893. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  6894. // "NEXT_HOP_NOT_RUNNING"
  6895. // "NOT_CRITICAL_ERROR"
  6896. // "NO_RESULTS_ON_PAGE"
  6897. // "REQUIRED_TOS_AGREEMENT"
  6898. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  6899. // "RESOURCE_NOT_DELETED"
  6900. // "SCHEMA_VALIDATION_IGNORED"
  6901. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  6902. // "UNDECLARED_PROPERTIES"
  6903. // "UNREACHABLE"
  6904. Code string `json:"code,omitempty"`
  6905. // Data: [Output Only] Metadata about this warning in key: value format.
  6906. // For example:
  6907. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  6908. Data []*ForwardingRulesScopedListWarningData `json:"data,omitempty"`
  6909. // Message: [Output Only] A human-readable description of the warning
  6910. // code.
  6911. Message string `json:"message,omitempty"`
  6912. // ForceSendFields is a list of field names (e.g. "Code") to
  6913. // unconditionally include in API requests. By default, fields with
  6914. // empty values are omitted from API requests. However, any non-pointer,
  6915. // non-interface field appearing in ForceSendFields will be sent to the
  6916. // server regardless of whether the field is empty or not. This may be
  6917. // used to include empty fields in Patch requests.
  6918. ForceSendFields []string `json:"-"`
  6919. // NullFields is a list of field names (e.g. "Code") to include in API
  6920. // requests with the JSON null value. By default, fields with empty
  6921. // values are omitted from API requests. However, any field with an
  6922. // empty value appearing in NullFields will be sent to the server as
  6923. // null. It is an error if a field in this list has a non-empty value.
  6924. // This may be used to include null fields in Patch requests.
  6925. NullFields []string `json:"-"`
  6926. }
  6927. func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) {
  6928. type NoMethod ForwardingRulesScopedListWarning
  6929. raw := NoMethod(*s)
  6930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6931. }
  6932. type ForwardingRulesScopedListWarningData struct {
  6933. // Key: [Output Only] A key that provides more detail on the warning
  6934. // being returned. For example, for warnings where there are no results
  6935. // in a list request for a particular zone, this key might be scope and
  6936. // the key value might be the zone name. Other examples might be a key
  6937. // indicating a deprecated resource and a suggested replacement, or a
  6938. // warning about invalid network settings (for example, if an instance
  6939. // attempts to perform IP forwarding but is not enabled for IP
  6940. // forwarding).
  6941. Key string `json:"key,omitempty"`
  6942. // Value: [Output Only] A warning data value corresponding to the key.
  6943. Value string `json:"value,omitempty"`
  6944. // ForceSendFields is a list of field names (e.g. "Key") to
  6945. // unconditionally include in API requests. By default, fields with
  6946. // empty values are omitted from API requests. However, any non-pointer,
  6947. // non-interface field appearing in ForceSendFields will be sent to the
  6948. // server regardless of whether the field is empty or not. This may be
  6949. // used to include empty fields in Patch requests.
  6950. ForceSendFields []string `json:"-"`
  6951. // NullFields is a list of field names (e.g. "Key") to include in API
  6952. // requests with the JSON null value. By default, fields with empty
  6953. // values are omitted from API requests. However, any field with an
  6954. // empty value appearing in NullFields will be sent to the server as
  6955. // null. It is an error if a field in this list has a non-empty value.
  6956. // This may be used to include null fields in Patch requests.
  6957. NullFields []string `json:"-"`
  6958. }
  6959. func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) {
  6960. type NoMethod ForwardingRulesScopedListWarningData
  6961. raw := NoMethod(*s)
  6962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6963. }
  6964. type GlobalSetLabelsRequest struct {
  6965. // LabelFingerprint: The fingerprint of the previous set of labels for
  6966. // this resource, used to detect conflicts. The fingerprint is initially
  6967. // generated by Compute Engine and changes after every request to modify
  6968. // or update labels. You must always provide an up-to-date fingerprint
  6969. // hash when updating or changing labels, otherwise the request will
  6970. // fail with error 412 conditionNotMet. Make a get() request to the
  6971. // resource to get the latest fingerprint.
  6972. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  6973. // Labels: A list of labels to apply for this resource. Each label key &
  6974. // value must comply with RFC1035. Specifically, the name must be 1-63
  6975. // characters long and match the regular expression
  6976. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  6977. // a lowercase letter, and all following characters must be a dash,
  6978. // lowercase letter, or digit, except the last character, which cannot
  6979. // be a dash. For example, "webserver-frontend": "images". A label value
  6980. // can also be empty (e.g. "my-label": "").
  6981. Labels map[string]string `json:"labels,omitempty"`
  6982. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  6983. // unconditionally include in API requests. By default, fields with
  6984. // empty values are omitted from API requests. However, any non-pointer,
  6985. // non-interface field appearing in ForceSendFields will be sent to the
  6986. // server regardless of whether the field is empty or not. This may be
  6987. // used to include empty fields in Patch requests.
  6988. ForceSendFields []string `json:"-"`
  6989. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  6990. // include in API requests with the JSON null value. By default, fields
  6991. // with empty values are omitted from API requests. However, any field
  6992. // with an empty value appearing in NullFields will be sent to the
  6993. // server as null. It is an error if a field in this list has a
  6994. // non-empty value. This may be used to include null fields in Patch
  6995. // requests.
  6996. NullFields []string `json:"-"`
  6997. }
  6998. func (s *GlobalSetLabelsRequest) MarshalJSON() ([]byte, error) {
  6999. type NoMethod GlobalSetLabelsRequest
  7000. raw := NoMethod(*s)
  7001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7002. }
  7003. type GlobalSetPolicyRequest struct {
  7004. // Bindings: Flatten Policy to create a backward compatible wire-format.
  7005. // Deprecated. Use 'policy' to specify bindings.
  7006. Bindings []*Binding `json:"bindings,omitempty"`
  7007. // Etag: Flatten Policy to create a backward compatible wire-format.
  7008. // Deprecated. Use 'policy' to specify the etag.
  7009. Etag string `json:"etag,omitempty"`
  7010. // Policy: REQUIRED: The complete policy to be applied to the
  7011. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  7012. // empty policy is in general a valid policy but certain services (like
  7013. // Projects) might reject them.
  7014. Policy *Policy `json:"policy,omitempty"`
  7015. // ForceSendFields is a list of field names (e.g. "Bindings") to
  7016. // unconditionally include in API requests. By default, fields with
  7017. // empty values are omitted from API requests. However, any non-pointer,
  7018. // non-interface field appearing in ForceSendFields will be sent to the
  7019. // server regardless of whether the field is empty or not. This may be
  7020. // used to include empty fields in Patch requests.
  7021. ForceSendFields []string `json:"-"`
  7022. // NullFields is a list of field names (e.g. "Bindings") to include in
  7023. // API requests with the JSON null value. By default, fields with empty
  7024. // values are omitted from API requests. However, any field with an
  7025. // empty value appearing in NullFields will be sent to the server as
  7026. // null. It is an error if a field in this list has a non-empty value.
  7027. // This may be used to include null fields in Patch requests.
  7028. NullFields []string `json:"-"`
  7029. }
  7030. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  7031. type NoMethod GlobalSetPolicyRequest
  7032. raw := NoMethod(*s)
  7033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7034. }
  7035. // GuestOsFeature: Guest OS features.
  7036. type GuestOsFeature struct {
  7037. // Type: The ID of a supported feature. Read Enabling guest operating
  7038. // system features to see a list of available options.
  7039. //
  7040. // Possible values:
  7041. // "FEATURE_TYPE_UNSPECIFIED"
  7042. // "MULTI_IP_SUBNET"
  7043. // "SECURE_BOOT"
  7044. // "UEFI_COMPATIBLE"
  7045. // "VIRTIO_SCSI_MULTIQUEUE"
  7046. // "WINDOWS"
  7047. Type string `json:"type,omitempty"`
  7048. // ForceSendFields is a list of field names (e.g. "Type") to
  7049. // unconditionally include in API requests. By default, fields with
  7050. // empty values are omitted from API requests. However, any non-pointer,
  7051. // non-interface field appearing in ForceSendFields will be sent to the
  7052. // server regardless of whether the field is empty or not. This may be
  7053. // used to include empty fields in Patch requests.
  7054. ForceSendFields []string `json:"-"`
  7055. // NullFields is a list of field names (e.g. "Type") to include in API
  7056. // requests with the JSON null value. By default, fields with empty
  7057. // values are omitted from API requests. However, any field with an
  7058. // empty value appearing in NullFields will be sent to the server as
  7059. // null. It is an error if a field in this list has a non-empty value.
  7060. // This may be used to include null fields in Patch requests.
  7061. NullFields []string `json:"-"`
  7062. }
  7063. func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
  7064. type NoMethod GuestOsFeature
  7065. raw := NoMethod(*s)
  7066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7067. }
  7068. type HTTP2HealthCheck struct {
  7069. // Host: The value of the host header in the HTTP/2 health check
  7070. // request. If left empty (default value), the IP on behalf of which
  7071. // this health check is performed will be used.
  7072. Host string `json:"host,omitempty"`
  7073. // Port: The TCP port number for the health check request. The default
  7074. // value is 443. Valid values are 1 through 65535.
  7075. Port int64 `json:"port,omitempty"`
  7076. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7077. // both port and port_name are defined, port takes precedence.
  7078. PortName string `json:"portName,omitempty"`
  7079. // PortSpecification: Specifies how port is selected for health
  7080. // checking, can be one of following values:
  7081. // USE_FIXED_PORT: The port number in
  7082. // port
  7083. // is used for health checking.
  7084. // USE_NAMED_PORT: The
  7085. // portName
  7086. // is used for health checking.
  7087. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7088. // each network endpoint is used for health checking. For other
  7089. // backends, the port or named port specified in the Backend Service is
  7090. // used for health checking.
  7091. //
  7092. //
  7093. // If not specified, HTTP2 health check follows behavior specified
  7094. // in
  7095. // port
  7096. // and
  7097. // portName
  7098. // fields.
  7099. //
  7100. // Possible values:
  7101. // "USE_FIXED_PORT"
  7102. // "USE_NAMED_PORT"
  7103. // "USE_SERVING_PORT"
  7104. PortSpecification string `json:"portSpecification,omitempty"`
  7105. // ProxyHeader: Specifies the type of proxy header to append before
  7106. // sending data to the backend, either NONE or PROXY_V1. The default is
  7107. // NONE.
  7108. //
  7109. // Possible values:
  7110. // "NONE"
  7111. // "PROXY_V1"
  7112. ProxyHeader string `json:"proxyHeader,omitempty"`
  7113. // RequestPath: The request path of the HTTP/2 health check request. The
  7114. // default value is /.
  7115. RequestPath string `json:"requestPath,omitempty"`
  7116. // Response: The string to match anywhere in the first 1024 bytes of the
  7117. // response body. If left empty (the default value), the status code
  7118. // determines health. The response data can only be ASCII.
  7119. Response string `json:"response,omitempty"`
  7120. // ForceSendFields is a list of field names (e.g. "Host") to
  7121. // unconditionally include in API requests. By default, fields with
  7122. // empty values are omitted from API requests. However, any non-pointer,
  7123. // non-interface field appearing in ForceSendFields will be sent to the
  7124. // server regardless of whether the field is empty or not. This may be
  7125. // used to include empty fields in Patch requests.
  7126. ForceSendFields []string `json:"-"`
  7127. // NullFields is a list of field names (e.g. "Host") to include in API
  7128. // requests with the JSON null value. By default, fields with empty
  7129. // values are omitted from API requests. However, any field with an
  7130. // empty value appearing in NullFields will be sent to the server as
  7131. // null. It is an error if a field in this list has a non-empty value.
  7132. // This may be used to include null fields in Patch requests.
  7133. NullFields []string `json:"-"`
  7134. }
  7135. func (s *HTTP2HealthCheck) MarshalJSON() ([]byte, error) {
  7136. type NoMethod HTTP2HealthCheck
  7137. raw := NoMethod(*s)
  7138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7139. }
  7140. type HTTPHealthCheck struct {
  7141. // Host: The value of the host header in the HTTP health check request.
  7142. // If left empty (default value), the IP on behalf of which this health
  7143. // check is performed will be used.
  7144. Host string `json:"host,omitempty"`
  7145. // Port: The TCP port number for the health check request. The default
  7146. // value is 80. Valid values are 1 through 65535.
  7147. Port int64 `json:"port,omitempty"`
  7148. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7149. // both port and port_name are defined, port takes precedence.
  7150. PortName string `json:"portName,omitempty"`
  7151. // PortSpecification: Specifies how port is selected for health
  7152. // checking, can be one of following values:
  7153. // USE_FIXED_PORT: The port number in
  7154. // port
  7155. // is used for health checking.
  7156. // USE_NAMED_PORT: The
  7157. // portName
  7158. // is used for health checking.
  7159. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7160. // each network endpoint is used for health checking. For other
  7161. // backends, the port or named port specified in the Backend Service is
  7162. // used for health checking.
  7163. //
  7164. //
  7165. // If not specified, HTTP health check follows behavior specified
  7166. // in
  7167. // port
  7168. // and
  7169. // portName
  7170. // fields.
  7171. //
  7172. // Possible values:
  7173. // "USE_FIXED_PORT"
  7174. // "USE_NAMED_PORT"
  7175. // "USE_SERVING_PORT"
  7176. PortSpecification string `json:"portSpecification,omitempty"`
  7177. // ProxyHeader: Specifies the type of proxy header to append before
  7178. // sending data to the backend, either NONE or PROXY_V1. The default is
  7179. // NONE.
  7180. //
  7181. // Possible values:
  7182. // "NONE"
  7183. // "PROXY_V1"
  7184. ProxyHeader string `json:"proxyHeader,omitempty"`
  7185. // RequestPath: The request path of the HTTP health check request. The
  7186. // default value is /.
  7187. RequestPath string `json:"requestPath,omitempty"`
  7188. // Response: The string to match anywhere in the first 1024 bytes of the
  7189. // response body. If left empty (the default value), the status code
  7190. // determines health. The response data can only be ASCII.
  7191. Response string `json:"response,omitempty"`
  7192. // ForceSendFields is a list of field names (e.g. "Host") to
  7193. // unconditionally include in API requests. By default, fields with
  7194. // empty values are omitted from API requests. However, any non-pointer,
  7195. // non-interface field appearing in ForceSendFields will be sent to the
  7196. // server regardless of whether the field is empty or not. This may be
  7197. // used to include empty fields in Patch requests.
  7198. ForceSendFields []string `json:"-"`
  7199. // NullFields is a list of field names (e.g. "Host") to include in API
  7200. // requests with the JSON null value. By default, fields with empty
  7201. // values are omitted from API requests. However, any field with an
  7202. // empty value appearing in NullFields will be sent to the server as
  7203. // null. It is an error if a field in this list has a non-empty value.
  7204. // This may be used to include null fields in Patch requests.
  7205. NullFields []string `json:"-"`
  7206. }
  7207. func (s *HTTPHealthCheck) MarshalJSON() ([]byte, error) {
  7208. type NoMethod HTTPHealthCheck
  7209. raw := NoMethod(*s)
  7210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7211. }
  7212. type HTTPSHealthCheck struct {
  7213. // Host: The value of the host header in the HTTPS health check request.
  7214. // If left empty (default value), the IP on behalf of which this health
  7215. // check is performed will be used.
  7216. Host string `json:"host,omitempty"`
  7217. // Port: The TCP port number for the health check request. The default
  7218. // value is 443. Valid values are 1 through 65535.
  7219. Port int64 `json:"port,omitempty"`
  7220. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  7221. // both port and port_name are defined, port takes precedence.
  7222. PortName string `json:"portName,omitempty"`
  7223. // PortSpecification: Specifies how port is selected for health
  7224. // checking, can be one of following values:
  7225. // USE_FIXED_PORT: The port number in
  7226. // port
  7227. // is used for health checking.
  7228. // USE_NAMED_PORT: The
  7229. // portName
  7230. // is used for health checking.
  7231. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  7232. // each network endpoint is used for health checking. For other
  7233. // backends, the port or named port specified in the Backend Service is
  7234. // used for health checking.
  7235. //
  7236. //
  7237. // If not specified, HTTPS health check follows behavior specified
  7238. // in
  7239. // port
  7240. // and
  7241. // portName
  7242. // fields.
  7243. //
  7244. // Possible values:
  7245. // "USE_FIXED_PORT"
  7246. // "USE_NAMED_PORT"
  7247. // "USE_SERVING_PORT"
  7248. PortSpecification string `json:"portSpecification,omitempty"`
  7249. // ProxyHeader: Specifies the type of proxy header to append before
  7250. // sending data to the backend, either NONE or PROXY_V1. The default is
  7251. // NONE.
  7252. //
  7253. // Possible values:
  7254. // "NONE"
  7255. // "PROXY_V1"
  7256. ProxyHeader string `json:"proxyHeader,omitempty"`
  7257. // RequestPath: The request path of the HTTPS health check request. The
  7258. // default value is /.
  7259. RequestPath string `json:"requestPath,omitempty"`
  7260. // Response: The string to match anywhere in the first 1024 bytes of the
  7261. // response body. If left empty (the default value), the status code
  7262. // determines health. The response data can only be ASCII.
  7263. Response string `json:"response,omitempty"`
  7264. // ForceSendFields is a list of field names (e.g. "Host") to
  7265. // unconditionally include in API requests. By default, fields with
  7266. // empty values are omitted from API requests. However, any non-pointer,
  7267. // non-interface field appearing in ForceSendFields will be sent to the
  7268. // server regardless of whether the field is empty or not. This may be
  7269. // used to include empty fields in Patch requests.
  7270. ForceSendFields []string `json:"-"`
  7271. // NullFields is a list of field names (e.g. "Host") to include in API
  7272. // requests with the JSON null value. By default, fields with empty
  7273. // values are omitted from API requests. However, any field with an
  7274. // empty value appearing in NullFields will be sent to the server as
  7275. // null. It is an error if a field in this list has a non-empty value.
  7276. // This may be used to include null fields in Patch requests.
  7277. NullFields []string `json:"-"`
  7278. }
  7279. func (s *HTTPSHealthCheck) MarshalJSON() ([]byte, error) {
  7280. type NoMethod HTTPSHealthCheck
  7281. raw := NoMethod(*s)
  7282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7283. }
  7284. // HealthCheck: An HealthCheck resource. This resource defines a
  7285. // template for how individual virtual machines should be checked for
  7286. // health, via one of the supported protocols.
  7287. type HealthCheck struct {
  7288. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7289. // default value is 5 seconds.
  7290. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7291. // CreationTimestamp: [Output Only] Creation timestamp in 3339 text
  7292. // format.
  7293. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7294. // Description: An optional description of this resource. Provide this
  7295. // property when you create the resource.
  7296. Description string `json:"description,omitempty"`
  7297. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7298. // after this many consecutive successes. The default value is 2.
  7299. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7300. Http2HealthCheck *HTTP2HealthCheck `json:"http2HealthCheck,omitempty"`
  7301. HttpHealthCheck *HTTPHealthCheck `json:"httpHealthCheck,omitempty"`
  7302. HttpsHealthCheck *HTTPSHealthCheck `json:"httpsHealthCheck,omitempty"`
  7303. // Id: [Output Only] The unique identifier for the resource. This
  7304. // identifier is defined by the server.
  7305. Id uint64 `json:"id,omitempty,string"`
  7306. // Kind: Type of the resource.
  7307. Kind string `json:"kind,omitempty"`
  7308. // Name: Name of the resource. Provided by the client when the resource
  7309. // is created. The name must be 1-63 characters long, and comply with
  7310. // RFC1035. Specifically, the name must be 1-63 characters long and
  7311. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7312. // the first character must be a lowercase letter, and all following
  7313. // characters must be a dash, lowercase letter, or digit, except the
  7314. // last character, which cannot be a dash.
  7315. Name string `json:"name,omitempty"`
  7316. // SelfLink: [Output Only] Server-defined URL for the resource.
  7317. SelfLink string `json:"selfLink,omitempty"`
  7318. SslHealthCheck *SSLHealthCheck `json:"sslHealthCheck,omitempty"`
  7319. TcpHealthCheck *TCPHealthCheck `json:"tcpHealthCheck,omitempty"`
  7320. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7321. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7322. // greater value than checkIntervalSec.
  7323. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7324. // Type: Specifies the type of the healthCheck, either TCP, SSL, HTTP,
  7325. // HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of
  7326. // the protocol-specific health check field must be specified, which
  7327. // must match type field.
  7328. //
  7329. // Possible values:
  7330. // "HTTP"
  7331. // "HTTP2"
  7332. // "HTTPS"
  7333. // "INVALID"
  7334. // "SSL"
  7335. // "TCP"
  7336. Type string `json:"type,omitempty"`
  7337. // UnhealthyThreshold: A so-far healthy instance will be marked
  7338. // unhealthy after this many consecutive failures. The default value is
  7339. // 2.
  7340. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7341. // ServerResponse contains the HTTP response code and headers from the
  7342. // server.
  7343. googleapi.ServerResponse `json:"-"`
  7344. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7345. // unconditionally include in API requests. By default, fields with
  7346. // empty values are omitted from API requests. However, any non-pointer,
  7347. // non-interface field appearing in ForceSendFields will be sent to the
  7348. // server regardless of whether the field is empty or not. This may be
  7349. // used to include empty fields in Patch requests.
  7350. ForceSendFields []string `json:"-"`
  7351. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7352. // include in API requests with the JSON null value. By default, fields
  7353. // with empty values are omitted from API requests. However, any field
  7354. // with an empty value appearing in NullFields will be sent to the
  7355. // server as null. It is an error if a field in this list has a
  7356. // non-empty value. This may be used to include null fields in Patch
  7357. // requests.
  7358. NullFields []string `json:"-"`
  7359. }
  7360. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  7361. type NoMethod HealthCheck
  7362. raw := NoMethod(*s)
  7363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7364. }
  7365. // HealthCheckList: Contains a list of HealthCheck resources.
  7366. type HealthCheckList struct {
  7367. // Id: [Output Only] Unique identifier for the resource; defined by the
  7368. // server.
  7369. Id string `json:"id,omitempty"`
  7370. // Items: A list of HealthCheck resources.
  7371. Items []*HealthCheck `json:"items,omitempty"`
  7372. // Kind: Type of resource.
  7373. Kind string `json:"kind,omitempty"`
  7374. // NextPageToken: [Output Only] This token allows you to get the next
  7375. // page of results for list requests. If the number of results is larger
  7376. // than maxResults, use the nextPageToken as a value for the query
  7377. // parameter pageToken in the next list request. Subsequent list
  7378. // requests will have their own nextPageToken to continue paging through
  7379. // the results.
  7380. NextPageToken string `json:"nextPageToken,omitempty"`
  7381. // SelfLink: [Output Only] Server-defined URL for this resource.
  7382. SelfLink string `json:"selfLink,omitempty"`
  7383. // Warning: [Output Only] Informational warning message.
  7384. Warning *HealthCheckListWarning `json:"warning,omitempty"`
  7385. // ServerResponse contains the HTTP response code and headers from the
  7386. // server.
  7387. googleapi.ServerResponse `json:"-"`
  7388. // ForceSendFields is a list of field names (e.g. "Id") to
  7389. // unconditionally include in API requests. By default, fields with
  7390. // empty values are omitted from API requests. However, any non-pointer,
  7391. // non-interface field appearing in ForceSendFields will be sent to the
  7392. // server regardless of whether the field is empty or not. This may be
  7393. // used to include empty fields in Patch requests.
  7394. ForceSendFields []string `json:"-"`
  7395. // NullFields is a list of field names (e.g. "Id") to include in API
  7396. // requests with the JSON null value. By default, fields with empty
  7397. // values are omitted from API requests. However, any field with an
  7398. // empty value appearing in NullFields will be sent to the server as
  7399. // null. It is an error if a field in this list has a non-empty value.
  7400. // This may be used to include null fields in Patch requests.
  7401. NullFields []string `json:"-"`
  7402. }
  7403. func (s *HealthCheckList) MarshalJSON() ([]byte, error) {
  7404. type NoMethod HealthCheckList
  7405. raw := NoMethod(*s)
  7406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7407. }
  7408. // HealthCheckListWarning: [Output Only] Informational warning message.
  7409. type HealthCheckListWarning struct {
  7410. // Code: [Output Only] A warning code, if applicable. For example,
  7411. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7412. // the response.
  7413. //
  7414. // Possible values:
  7415. // "CLEANUP_FAILED"
  7416. // "DEPRECATED_RESOURCE_USED"
  7417. // "DEPRECATED_TYPE_USED"
  7418. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7419. // "EXPERIMENTAL_TYPE_USED"
  7420. // "EXTERNAL_API_WARNING"
  7421. // "FIELD_VALUE_OVERRIDEN"
  7422. // "INJECTED_KERNELS_DEPRECATED"
  7423. // "MISSING_TYPE_DEPENDENCY"
  7424. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7425. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7426. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7427. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7428. // "NEXT_HOP_NOT_RUNNING"
  7429. // "NOT_CRITICAL_ERROR"
  7430. // "NO_RESULTS_ON_PAGE"
  7431. // "REQUIRED_TOS_AGREEMENT"
  7432. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7433. // "RESOURCE_NOT_DELETED"
  7434. // "SCHEMA_VALIDATION_IGNORED"
  7435. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7436. // "UNDECLARED_PROPERTIES"
  7437. // "UNREACHABLE"
  7438. Code string `json:"code,omitempty"`
  7439. // Data: [Output Only] Metadata about this warning in key: value format.
  7440. // For example:
  7441. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7442. Data []*HealthCheckListWarningData `json:"data,omitempty"`
  7443. // Message: [Output Only] A human-readable description of the warning
  7444. // code.
  7445. Message string `json:"message,omitempty"`
  7446. // ForceSendFields is a list of field names (e.g. "Code") to
  7447. // unconditionally include in API requests. By default, fields with
  7448. // empty values are omitted from API requests. However, any non-pointer,
  7449. // non-interface field appearing in ForceSendFields will be sent to the
  7450. // server regardless of whether the field is empty or not. This may be
  7451. // used to include empty fields in Patch requests.
  7452. ForceSendFields []string `json:"-"`
  7453. // NullFields is a list of field names (e.g. "Code") to include in API
  7454. // requests with the JSON null value. By default, fields with empty
  7455. // values are omitted from API requests. However, any field with an
  7456. // empty value appearing in NullFields will be sent to the server as
  7457. // null. It is an error if a field in this list has a non-empty value.
  7458. // This may be used to include null fields in Patch requests.
  7459. NullFields []string `json:"-"`
  7460. }
  7461. func (s *HealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7462. type NoMethod HealthCheckListWarning
  7463. raw := NoMethod(*s)
  7464. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7465. }
  7466. type HealthCheckListWarningData struct {
  7467. // Key: [Output Only] A key that provides more detail on the warning
  7468. // being returned. For example, for warnings where there are no results
  7469. // in a list request for a particular zone, this key might be scope and
  7470. // the key value might be the zone name. Other examples might be a key
  7471. // indicating a deprecated resource and a suggested replacement, or a
  7472. // warning about invalid network settings (for example, if an instance
  7473. // attempts to perform IP forwarding but is not enabled for IP
  7474. // forwarding).
  7475. Key string `json:"key,omitempty"`
  7476. // Value: [Output Only] A warning data value corresponding to the key.
  7477. Value string `json:"value,omitempty"`
  7478. // ForceSendFields is a list of field names (e.g. "Key") to
  7479. // unconditionally include in API requests. By default, fields with
  7480. // empty values are omitted from API requests. However, any non-pointer,
  7481. // non-interface field appearing in ForceSendFields will be sent to the
  7482. // server regardless of whether the field is empty or not. This may be
  7483. // used to include empty fields in Patch requests.
  7484. ForceSendFields []string `json:"-"`
  7485. // NullFields is a list of field names (e.g. "Key") to include in API
  7486. // requests with the JSON null value. By default, fields with empty
  7487. // values are omitted from API requests. However, any field with an
  7488. // empty value appearing in NullFields will be sent to the server as
  7489. // null. It is an error if a field in this list has a non-empty value.
  7490. // This may be used to include null fields in Patch requests.
  7491. NullFields []string `json:"-"`
  7492. }
  7493. func (s *HealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7494. type NoMethod HealthCheckListWarningData
  7495. raw := NoMethod(*s)
  7496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7497. }
  7498. // HealthCheckReference: A full or valid partial URL to a health check.
  7499. // For example, the following are valid URLs:
  7500. // -
  7501. // https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check
  7502. // - projects/project-id/global/httpHealthChecks/health-check
  7503. // - global/httpHealthChecks/health-check
  7504. type HealthCheckReference struct {
  7505. HealthCheck string `json:"healthCheck,omitempty"`
  7506. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  7507. // unconditionally include in API requests. By default, fields with
  7508. // empty values are omitted from API requests. However, any non-pointer,
  7509. // non-interface field appearing in ForceSendFields will be sent to the
  7510. // server regardless of whether the field is empty or not. This may be
  7511. // used to include empty fields in Patch requests.
  7512. ForceSendFields []string `json:"-"`
  7513. // NullFields is a list of field names (e.g. "HealthCheck") to include
  7514. // in API requests with the JSON null value. By default, fields with
  7515. // empty values are omitted from API requests. However, any field with
  7516. // an empty value appearing in NullFields will be sent to the server as
  7517. // null. It is an error if a field in this list has a non-empty value.
  7518. // This may be used to include null fields in Patch requests.
  7519. NullFields []string `json:"-"`
  7520. }
  7521. func (s *HealthCheckReference) MarshalJSON() ([]byte, error) {
  7522. type NoMethod HealthCheckReference
  7523. raw := NoMethod(*s)
  7524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7525. }
  7526. type HealthStatus struct {
  7527. // HealthState: Health state of the instance.
  7528. //
  7529. // Possible values:
  7530. // "HEALTHY"
  7531. // "UNHEALTHY"
  7532. HealthState string `json:"healthState,omitempty"`
  7533. // Instance: URL of the instance resource.
  7534. Instance string `json:"instance,omitempty"`
  7535. // IpAddress: The IP address represented by this resource.
  7536. IpAddress string `json:"ipAddress,omitempty"`
  7537. // Port: The port on the instance.
  7538. Port int64 `json:"port,omitempty"`
  7539. // ForceSendFields is a list of field names (e.g. "HealthState") to
  7540. // unconditionally include in API requests. By default, fields with
  7541. // empty values are omitted from API requests. However, any non-pointer,
  7542. // non-interface field appearing in ForceSendFields will be sent to the
  7543. // server regardless of whether the field is empty or not. This may be
  7544. // used to include empty fields in Patch requests.
  7545. ForceSendFields []string `json:"-"`
  7546. // NullFields is a list of field names (e.g. "HealthState") to include
  7547. // in API requests with the JSON null value. By default, fields with
  7548. // empty values are omitted from API requests. However, any field with
  7549. // an empty value appearing in NullFields will be sent to the server as
  7550. // null. It is an error if a field in this list has a non-empty value.
  7551. // This may be used to include null fields in Patch requests.
  7552. NullFields []string `json:"-"`
  7553. }
  7554. func (s *HealthStatus) MarshalJSON() ([]byte, error) {
  7555. type NoMethod HealthStatus
  7556. raw := NoMethod(*s)
  7557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7558. }
  7559. type HealthStatusForNetworkEndpoint struct {
  7560. // BackendService: URL of the backend service associated with the health
  7561. // state of the network endpoint.
  7562. BackendService *BackendServiceReference `json:"backendService,omitempty"`
  7563. // ForwardingRule: URL of the forwarding rule associated with the health
  7564. // state of the network endpoint.
  7565. ForwardingRule *ForwardingRuleReference `json:"forwardingRule,omitempty"`
  7566. // HealthCheck: URL of the health check associated with the health state
  7567. // of the network endpoint.
  7568. HealthCheck *HealthCheckReference `json:"healthCheck,omitempty"`
  7569. // HealthState: Health state of the network endpoint determined based on
  7570. // the health checks configured.
  7571. //
  7572. // Possible values:
  7573. // "DRAINING"
  7574. // "HEALTHY"
  7575. // "UNHEALTHY"
  7576. // "UNKNOWN"
  7577. HealthState string `json:"healthState,omitempty"`
  7578. // ForceSendFields is a list of field names (e.g. "BackendService") to
  7579. // unconditionally include in API requests. By default, fields with
  7580. // empty values are omitted from API requests. However, any non-pointer,
  7581. // non-interface field appearing in ForceSendFields will be sent to the
  7582. // server regardless of whether the field is empty or not. This may be
  7583. // used to include empty fields in Patch requests.
  7584. ForceSendFields []string `json:"-"`
  7585. // NullFields is a list of field names (e.g. "BackendService") to
  7586. // include in API requests with the JSON null value. By default, fields
  7587. // with empty values are omitted from API requests. However, any field
  7588. // with an empty value appearing in NullFields will be sent to the
  7589. // server as null. It is an error if a field in this list has a
  7590. // non-empty value. This may be used to include null fields in Patch
  7591. // requests.
  7592. NullFields []string `json:"-"`
  7593. }
  7594. func (s *HealthStatusForNetworkEndpoint) MarshalJSON() ([]byte, error) {
  7595. type NoMethod HealthStatusForNetworkEndpoint
  7596. raw := NoMethod(*s)
  7597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7598. }
  7599. // HostRule: UrlMaps A host-matching rule for a URL. If matched, will
  7600. // use the named PathMatcher to select the BackendService.
  7601. type HostRule struct {
  7602. // Description: An optional description of this resource. Provide this
  7603. // property when you create the resource.
  7604. Description string `json:"description,omitempty"`
  7605. // Hosts: The list of host patterns to match. They must be valid
  7606. // hostnames, except * will match any string of ([a-z0-9-.]*). In that
  7607. // case, * must be the first character and must be followed in the
  7608. // pattern by either - or ..
  7609. Hosts []string `json:"hosts,omitempty"`
  7610. // PathMatcher: The name of the PathMatcher to use to match the path
  7611. // portion of the URL if the hostRule matches the URL's host portion.
  7612. PathMatcher string `json:"pathMatcher,omitempty"`
  7613. // ForceSendFields is a list of field names (e.g. "Description") to
  7614. // unconditionally include in API requests. By default, fields with
  7615. // empty values are omitted from API requests. However, any non-pointer,
  7616. // non-interface field appearing in ForceSendFields will be sent to the
  7617. // server regardless of whether the field is empty or not. This may be
  7618. // used to include empty fields in Patch requests.
  7619. ForceSendFields []string `json:"-"`
  7620. // NullFields is a list of field names (e.g. "Description") to include
  7621. // in API requests with the JSON null value. By default, fields with
  7622. // empty values are omitted from API requests. However, any field with
  7623. // an empty value appearing in NullFields will be sent to the server as
  7624. // null. It is an error if a field in this list has a non-empty value.
  7625. // This may be used to include null fields in Patch requests.
  7626. NullFields []string `json:"-"`
  7627. }
  7628. func (s *HostRule) MarshalJSON() ([]byte, error) {
  7629. type NoMethod HostRule
  7630. raw := NoMethod(*s)
  7631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7632. }
  7633. // HttpHealthCheck: An HttpHealthCheck resource. This resource defines a
  7634. // template for how individual instances should be checked for health,
  7635. // via HTTP.
  7636. type HttpHealthCheck struct {
  7637. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7638. // default value is 5 seconds.
  7639. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7640. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7641. // format.
  7642. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7643. // Description: An optional description of this resource. Provide this
  7644. // property when you create the resource.
  7645. Description string `json:"description,omitempty"`
  7646. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7647. // after this many consecutive successes. The default value is 2.
  7648. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7649. // Host: The value of the host header in the HTTP health check request.
  7650. // If left empty (default value), the public IP on behalf of which this
  7651. // health check is performed will be used.
  7652. Host string `json:"host,omitempty"`
  7653. // Id: [Output Only] The unique identifier for the resource. This
  7654. // identifier is defined by the server.
  7655. Id uint64 `json:"id,omitempty,string"`
  7656. // Kind: [Output Only] Type of the resource. Always
  7657. // compute#httpHealthCheck for HTTP health checks.
  7658. Kind string `json:"kind,omitempty"`
  7659. // Name: Name of the resource. Provided by the client when the resource
  7660. // is created. The name must be 1-63 characters long, and comply with
  7661. // RFC1035. Specifically, the name must be 1-63 characters long and
  7662. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7663. // the first character must be a lowercase letter, and all following
  7664. // characters must be a dash, lowercase letter, or digit, except the
  7665. // last character, which cannot be a dash.
  7666. Name string `json:"name,omitempty"`
  7667. // Port: The TCP port number for the HTTP health check request. The
  7668. // default value is 80.
  7669. Port int64 `json:"port,omitempty"`
  7670. // RequestPath: The request path of the HTTP health check request. The
  7671. // default value is /.
  7672. RequestPath string `json:"requestPath,omitempty"`
  7673. // SelfLink: [Output Only] Server-defined URL for the resource.
  7674. SelfLink string `json:"selfLink,omitempty"`
  7675. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7676. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7677. // greater value than checkIntervalSec.
  7678. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7679. // UnhealthyThreshold: A so-far healthy instance will be marked
  7680. // unhealthy after this many consecutive failures. The default value is
  7681. // 2.
  7682. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7683. // ServerResponse contains the HTTP response code and headers from the
  7684. // server.
  7685. googleapi.ServerResponse `json:"-"`
  7686. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7687. // unconditionally include in API requests. By default, fields with
  7688. // empty values are omitted from API requests. However, any non-pointer,
  7689. // non-interface field appearing in ForceSendFields will be sent to the
  7690. // server regardless of whether the field is empty or not. This may be
  7691. // used to include empty fields in Patch requests.
  7692. ForceSendFields []string `json:"-"`
  7693. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7694. // include in API requests with the JSON null value. By default, fields
  7695. // with empty values are omitted from API requests. However, any field
  7696. // with an empty value appearing in NullFields will be sent to the
  7697. // server as null. It is an error if a field in this list has a
  7698. // non-empty value. This may be used to include null fields in Patch
  7699. // requests.
  7700. NullFields []string `json:"-"`
  7701. }
  7702. func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) {
  7703. type NoMethod HttpHealthCheck
  7704. raw := NoMethod(*s)
  7705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7706. }
  7707. // HttpHealthCheckList: Contains a list of HttpHealthCheck resources.
  7708. type HttpHealthCheckList struct {
  7709. // Id: [Output Only] Unique identifier for the resource; defined by the
  7710. // server.
  7711. Id string `json:"id,omitempty"`
  7712. // Items: A list of HttpHealthCheck resources.
  7713. Items []*HttpHealthCheck `json:"items,omitempty"`
  7714. // Kind: Type of resource.
  7715. Kind string `json:"kind,omitempty"`
  7716. // NextPageToken: [Output Only] This token allows you to get the next
  7717. // page of results for list requests. If the number of results is larger
  7718. // than maxResults, use the nextPageToken as a value for the query
  7719. // parameter pageToken in the next list request. Subsequent list
  7720. // requests will have their own nextPageToken to continue paging through
  7721. // the results.
  7722. NextPageToken string `json:"nextPageToken,omitempty"`
  7723. // SelfLink: [Output Only] Server-defined URL for this resource.
  7724. SelfLink string `json:"selfLink,omitempty"`
  7725. // Warning: [Output Only] Informational warning message.
  7726. Warning *HttpHealthCheckListWarning `json:"warning,omitempty"`
  7727. // ServerResponse contains the HTTP response code and headers from the
  7728. // server.
  7729. googleapi.ServerResponse `json:"-"`
  7730. // ForceSendFields is a list of field names (e.g. "Id") to
  7731. // unconditionally include in API requests. By default, fields with
  7732. // empty values are omitted from API requests. However, any non-pointer,
  7733. // non-interface field appearing in ForceSendFields will be sent to the
  7734. // server regardless of whether the field is empty or not. This may be
  7735. // used to include empty fields in Patch requests.
  7736. ForceSendFields []string `json:"-"`
  7737. // NullFields is a list of field names (e.g. "Id") to include in API
  7738. // requests with the JSON null value. By default, fields with empty
  7739. // values are omitted from API requests. However, any field with an
  7740. // empty value appearing in NullFields will be sent to the server as
  7741. // null. It is an error if a field in this list has a non-empty value.
  7742. // This may be used to include null fields in Patch requests.
  7743. NullFields []string `json:"-"`
  7744. }
  7745. func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) {
  7746. type NoMethod HttpHealthCheckList
  7747. raw := NoMethod(*s)
  7748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7749. }
  7750. // HttpHealthCheckListWarning: [Output Only] Informational warning
  7751. // message.
  7752. type HttpHealthCheckListWarning struct {
  7753. // Code: [Output Only] A warning code, if applicable. For example,
  7754. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7755. // the response.
  7756. //
  7757. // Possible values:
  7758. // "CLEANUP_FAILED"
  7759. // "DEPRECATED_RESOURCE_USED"
  7760. // "DEPRECATED_TYPE_USED"
  7761. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7762. // "EXPERIMENTAL_TYPE_USED"
  7763. // "EXTERNAL_API_WARNING"
  7764. // "FIELD_VALUE_OVERRIDEN"
  7765. // "INJECTED_KERNELS_DEPRECATED"
  7766. // "MISSING_TYPE_DEPENDENCY"
  7767. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7768. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7769. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7770. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7771. // "NEXT_HOP_NOT_RUNNING"
  7772. // "NOT_CRITICAL_ERROR"
  7773. // "NO_RESULTS_ON_PAGE"
  7774. // "REQUIRED_TOS_AGREEMENT"
  7775. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7776. // "RESOURCE_NOT_DELETED"
  7777. // "SCHEMA_VALIDATION_IGNORED"
  7778. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7779. // "UNDECLARED_PROPERTIES"
  7780. // "UNREACHABLE"
  7781. Code string `json:"code,omitempty"`
  7782. // Data: [Output Only] Metadata about this warning in key: value format.
  7783. // For example:
  7784. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7785. Data []*HttpHealthCheckListWarningData `json:"data,omitempty"`
  7786. // Message: [Output Only] A human-readable description of the warning
  7787. // code.
  7788. Message string `json:"message,omitempty"`
  7789. // ForceSendFields is a list of field names (e.g. "Code") to
  7790. // unconditionally include in API requests. By default, fields with
  7791. // empty values are omitted from API requests. However, any non-pointer,
  7792. // non-interface field appearing in ForceSendFields will be sent to the
  7793. // server regardless of whether the field is empty or not. This may be
  7794. // used to include empty fields in Patch requests.
  7795. ForceSendFields []string `json:"-"`
  7796. // NullFields is a list of field names (e.g. "Code") to include in API
  7797. // requests with the JSON null value. By default, fields with empty
  7798. // values are omitted from API requests. However, any field with an
  7799. // empty value appearing in NullFields will be sent to the server as
  7800. // null. It is an error if a field in this list has a non-empty value.
  7801. // This may be used to include null fields in Patch requests.
  7802. NullFields []string `json:"-"`
  7803. }
  7804. func (s *HttpHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  7805. type NoMethod HttpHealthCheckListWarning
  7806. raw := NoMethod(*s)
  7807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7808. }
  7809. type HttpHealthCheckListWarningData struct {
  7810. // Key: [Output Only] A key that provides more detail on the warning
  7811. // being returned. For example, for warnings where there are no results
  7812. // in a list request for a particular zone, this key might be scope and
  7813. // the key value might be the zone name. Other examples might be a key
  7814. // indicating a deprecated resource and a suggested replacement, or a
  7815. // warning about invalid network settings (for example, if an instance
  7816. // attempts to perform IP forwarding but is not enabled for IP
  7817. // forwarding).
  7818. Key string `json:"key,omitempty"`
  7819. // Value: [Output Only] A warning data value corresponding to the key.
  7820. Value string `json:"value,omitempty"`
  7821. // ForceSendFields is a list of field names (e.g. "Key") to
  7822. // unconditionally include in API requests. By default, fields with
  7823. // empty values are omitted from API requests. However, any non-pointer,
  7824. // non-interface field appearing in ForceSendFields will be sent to the
  7825. // server regardless of whether the field is empty or not. This may be
  7826. // used to include empty fields in Patch requests.
  7827. ForceSendFields []string `json:"-"`
  7828. // NullFields is a list of field names (e.g. "Key") to include in API
  7829. // requests with the JSON null value. By default, fields with empty
  7830. // values are omitted from API requests. However, any field with an
  7831. // empty value appearing in NullFields will be sent to the server as
  7832. // null. It is an error if a field in this list has a non-empty value.
  7833. // This may be used to include null fields in Patch requests.
  7834. NullFields []string `json:"-"`
  7835. }
  7836. func (s *HttpHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  7837. type NoMethod HttpHealthCheckListWarningData
  7838. raw := NoMethod(*s)
  7839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7840. }
  7841. // HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines
  7842. // a template for how individual instances should be checked for health,
  7843. // via HTTPS.
  7844. type HttpsHealthCheck struct {
  7845. // CheckIntervalSec: How often (in seconds) to send a health check. The
  7846. // default value is 5 seconds.
  7847. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"`
  7848. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  7849. // format.
  7850. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  7851. // Description: An optional description of this resource. Provide this
  7852. // property when you create the resource.
  7853. Description string `json:"description,omitempty"`
  7854. // HealthyThreshold: A so-far unhealthy instance will be marked healthy
  7855. // after this many consecutive successes. The default value is 2.
  7856. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  7857. // Host: The value of the host header in the HTTPS health check request.
  7858. // If left empty (default value), the public IP on behalf of which this
  7859. // health check is performed will be used.
  7860. Host string `json:"host,omitempty"`
  7861. // Id: [Output Only] The unique identifier for the resource. This
  7862. // identifier is defined by the server.
  7863. Id uint64 `json:"id,omitempty,string"`
  7864. // Kind: Type of the resource.
  7865. Kind string `json:"kind,omitempty"`
  7866. // Name: Name of the resource. Provided by the client when the resource
  7867. // is created. The name must be 1-63 characters long, and comply with
  7868. // RFC1035. Specifically, the name must be 1-63 characters long and
  7869. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  7870. // the first character must be a lowercase letter, and all following
  7871. // characters must be a dash, lowercase letter, or digit, except the
  7872. // last character, which cannot be a dash.
  7873. Name string `json:"name,omitempty"`
  7874. // Port: The TCP port number for the HTTPS health check request. The
  7875. // default value is 443.
  7876. Port int64 `json:"port,omitempty"`
  7877. // RequestPath: The request path of the HTTPS health check request. The
  7878. // default value is "/".
  7879. RequestPath string `json:"requestPath,omitempty"`
  7880. // SelfLink: [Output Only] Server-defined URL for the resource.
  7881. SelfLink string `json:"selfLink,omitempty"`
  7882. // TimeoutSec: How long (in seconds) to wait before claiming failure.
  7883. // The default value is 5 seconds. It is invalid for timeoutSec to have
  7884. // a greater value than checkIntervalSec.
  7885. TimeoutSec int64 `json:"timeoutSec,omitempty"`
  7886. // UnhealthyThreshold: A so-far healthy instance will be marked
  7887. // unhealthy after this many consecutive failures. The default value is
  7888. // 2.
  7889. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  7890. // ServerResponse contains the HTTP response code and headers from the
  7891. // server.
  7892. googleapi.ServerResponse `json:"-"`
  7893. // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to
  7894. // unconditionally include in API requests. By default, fields with
  7895. // empty values are omitted from API requests. However, any non-pointer,
  7896. // non-interface field appearing in ForceSendFields will be sent to the
  7897. // server regardless of whether the field is empty or not. This may be
  7898. // used to include empty fields in Patch requests.
  7899. ForceSendFields []string `json:"-"`
  7900. // NullFields is a list of field names (e.g. "CheckIntervalSec") to
  7901. // include in API requests with the JSON null value. By default, fields
  7902. // with empty values are omitted from API requests. However, any field
  7903. // with an empty value appearing in NullFields will be sent to the
  7904. // server as null. It is an error if a field in this list has a
  7905. // non-empty value. This may be used to include null fields in Patch
  7906. // requests.
  7907. NullFields []string `json:"-"`
  7908. }
  7909. func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) {
  7910. type NoMethod HttpsHealthCheck
  7911. raw := NoMethod(*s)
  7912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7913. }
  7914. // HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources.
  7915. type HttpsHealthCheckList struct {
  7916. // Id: [Output Only] Unique identifier for the resource; defined by the
  7917. // server.
  7918. Id string `json:"id,omitempty"`
  7919. // Items: A list of HttpsHealthCheck resources.
  7920. Items []*HttpsHealthCheck `json:"items,omitempty"`
  7921. // Kind: Type of resource.
  7922. Kind string `json:"kind,omitempty"`
  7923. // NextPageToken: [Output Only] This token allows you to get the next
  7924. // page of results for list requests. If the number of results is larger
  7925. // than maxResults, use the nextPageToken as a value for the query
  7926. // parameter pageToken in the next list request. Subsequent list
  7927. // requests will have their own nextPageToken to continue paging through
  7928. // the results.
  7929. NextPageToken string `json:"nextPageToken,omitempty"`
  7930. // SelfLink: [Output Only] Server-defined URL for this resource.
  7931. SelfLink string `json:"selfLink,omitempty"`
  7932. // Warning: [Output Only] Informational warning message.
  7933. Warning *HttpsHealthCheckListWarning `json:"warning,omitempty"`
  7934. // ServerResponse contains the HTTP response code and headers from the
  7935. // server.
  7936. googleapi.ServerResponse `json:"-"`
  7937. // ForceSendFields is a list of field names (e.g. "Id") to
  7938. // unconditionally include in API requests. By default, fields with
  7939. // empty values are omitted from API requests. However, any non-pointer,
  7940. // non-interface field appearing in ForceSendFields will be sent to the
  7941. // server regardless of whether the field is empty or not. This may be
  7942. // used to include empty fields in Patch requests.
  7943. ForceSendFields []string `json:"-"`
  7944. // NullFields is a list of field names (e.g. "Id") to include in API
  7945. // requests with the JSON null value. By default, fields with empty
  7946. // values are omitted from API requests. However, any field with an
  7947. // empty value appearing in NullFields will be sent to the server as
  7948. // null. It is an error if a field in this list has a non-empty value.
  7949. // This may be used to include null fields in Patch requests.
  7950. NullFields []string `json:"-"`
  7951. }
  7952. func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) {
  7953. type NoMethod HttpsHealthCheckList
  7954. raw := NoMethod(*s)
  7955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7956. }
  7957. // HttpsHealthCheckListWarning: [Output Only] Informational warning
  7958. // message.
  7959. type HttpsHealthCheckListWarning struct {
  7960. // Code: [Output Only] A warning code, if applicable. For example,
  7961. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  7962. // the response.
  7963. //
  7964. // Possible values:
  7965. // "CLEANUP_FAILED"
  7966. // "DEPRECATED_RESOURCE_USED"
  7967. // "DEPRECATED_TYPE_USED"
  7968. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  7969. // "EXPERIMENTAL_TYPE_USED"
  7970. // "EXTERNAL_API_WARNING"
  7971. // "FIELD_VALUE_OVERRIDEN"
  7972. // "INJECTED_KERNELS_DEPRECATED"
  7973. // "MISSING_TYPE_DEPENDENCY"
  7974. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  7975. // "NEXT_HOP_CANNOT_IP_FORWARD"
  7976. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  7977. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  7978. // "NEXT_HOP_NOT_RUNNING"
  7979. // "NOT_CRITICAL_ERROR"
  7980. // "NO_RESULTS_ON_PAGE"
  7981. // "REQUIRED_TOS_AGREEMENT"
  7982. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  7983. // "RESOURCE_NOT_DELETED"
  7984. // "SCHEMA_VALIDATION_IGNORED"
  7985. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  7986. // "UNDECLARED_PROPERTIES"
  7987. // "UNREACHABLE"
  7988. Code string `json:"code,omitempty"`
  7989. // Data: [Output Only] Metadata about this warning in key: value format.
  7990. // For example:
  7991. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  7992. Data []*HttpsHealthCheckListWarningData `json:"data,omitempty"`
  7993. // Message: [Output Only] A human-readable description of the warning
  7994. // code.
  7995. Message string `json:"message,omitempty"`
  7996. // ForceSendFields is a list of field names (e.g. "Code") to
  7997. // unconditionally include in API requests. By default, fields with
  7998. // empty values are omitted from API requests. However, any non-pointer,
  7999. // non-interface field appearing in ForceSendFields will be sent to the
  8000. // server regardless of whether the field is empty or not. This may be
  8001. // used to include empty fields in Patch requests.
  8002. ForceSendFields []string `json:"-"`
  8003. // NullFields is a list of field names (e.g. "Code") to include in API
  8004. // requests with the JSON null value. By default, fields with empty
  8005. // values are omitted from API requests. However, any field with an
  8006. // empty value appearing in NullFields will be sent to the server as
  8007. // null. It is an error if a field in this list has a non-empty value.
  8008. // This may be used to include null fields in Patch requests.
  8009. NullFields []string `json:"-"`
  8010. }
  8011. func (s *HttpsHealthCheckListWarning) MarshalJSON() ([]byte, error) {
  8012. type NoMethod HttpsHealthCheckListWarning
  8013. raw := NoMethod(*s)
  8014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8015. }
  8016. type HttpsHealthCheckListWarningData struct {
  8017. // Key: [Output Only] A key that provides more detail on the warning
  8018. // being returned. For example, for warnings where there are no results
  8019. // in a list request for a particular zone, this key might be scope and
  8020. // the key value might be the zone name. Other examples might be a key
  8021. // indicating a deprecated resource and a suggested replacement, or a
  8022. // warning about invalid network settings (for example, if an instance
  8023. // attempts to perform IP forwarding but is not enabled for IP
  8024. // forwarding).
  8025. Key string `json:"key,omitempty"`
  8026. // Value: [Output Only] A warning data value corresponding to the key.
  8027. Value string `json:"value,omitempty"`
  8028. // ForceSendFields is a list of field names (e.g. "Key") to
  8029. // unconditionally include in API requests. By default, fields with
  8030. // empty values are omitted from API requests. However, any non-pointer,
  8031. // non-interface field appearing in ForceSendFields will be sent to the
  8032. // server regardless of whether the field is empty or not. This may be
  8033. // used to include empty fields in Patch requests.
  8034. ForceSendFields []string `json:"-"`
  8035. // NullFields is a list of field names (e.g. "Key") to include in API
  8036. // requests with the JSON null value. By default, fields with empty
  8037. // values are omitted from API requests. However, any field with an
  8038. // empty value appearing in NullFields will be sent to the server as
  8039. // null. It is an error if a field in this list has a non-empty value.
  8040. // This may be used to include null fields in Patch requests.
  8041. NullFields []string `json:"-"`
  8042. }
  8043. func (s *HttpsHealthCheckListWarningData) MarshalJSON() ([]byte, error) {
  8044. type NoMethod HttpsHealthCheckListWarningData
  8045. raw := NoMethod(*s)
  8046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8047. }
  8048. // Image: An Image resource. (== resource_for beta.images ==) (==
  8049. // resource_for v1.images ==)
  8050. type Image struct {
  8051. // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google
  8052. // Cloud Storage (in bytes).
  8053. ArchiveSizeBytes int64 `json:"archiveSizeBytes,omitempty,string"`
  8054. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8055. // format.
  8056. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8057. // Deprecated: The deprecation status associated with this image.
  8058. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  8059. // Description: An optional description of this resource. Provide this
  8060. // property when you create the resource.
  8061. Description string `json:"description,omitempty"`
  8062. // DiskSizeGb: Size of the image when restored onto a persistent disk
  8063. // (in GB).
  8064. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  8065. // Family: The name of the image family to which this image belongs. You
  8066. // can create disks by specifying an image family instead of a specific
  8067. // image name. The image family always returns its latest image that is
  8068. // not deprecated. The name of the image family must comply with
  8069. // RFC1035.
  8070. Family string `json:"family,omitempty"`
  8071. // GuestOsFeatures: A list of features to enable on the guest operating
  8072. // system. Applicable only for bootable images. Read Enabling guest
  8073. // operating system features to see a list of available options.
  8074. GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
  8075. // Id: [Output Only] The unique identifier for the resource. This
  8076. // identifier is defined by the server.
  8077. Id uint64 `json:"id,omitempty,string"`
  8078. // ImageEncryptionKey: Encrypts the image using a customer-supplied
  8079. // encryption key.
  8080. //
  8081. // After you encrypt an image with a customer-supplied key, you must
  8082. // provide the same key if you use the image later (e.g. to create a
  8083. // disk from the image).
  8084. //
  8085. // Customer-supplied encryption keys do not protect access to metadata
  8086. // of the disk.
  8087. //
  8088. // If you do not provide an encryption key when creating the image, then
  8089. // the disk will be encrypted using an automatically generated key and
  8090. // you do not need to provide a key to use the image later.
  8091. ImageEncryptionKey *CustomerEncryptionKey `json:"imageEncryptionKey,omitempty"`
  8092. // Kind: [Output Only] Type of the resource. Always compute#image for
  8093. // images.
  8094. Kind string `json:"kind,omitempty"`
  8095. // LabelFingerprint: A fingerprint for the labels being applied to this
  8096. // image, which is essentially a hash of the labels used for optimistic
  8097. // locking. The fingerprint is initially generated by Compute Engine and
  8098. // changes after every request to modify or update labels. You must
  8099. // always provide an up-to-date fingerprint hash in order to update or
  8100. // change labels, otherwise the request will fail with error 412
  8101. // conditionNotMet.
  8102. //
  8103. // To see the latest fingerprint, make a get() request to retrieve an
  8104. // image.
  8105. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8106. // Labels: Labels to apply to this image. These can be later modified by
  8107. // the setLabels method.
  8108. Labels map[string]string `json:"labels,omitempty"`
  8109. // LicenseCodes: Integer license codes indicating which licenses are
  8110. // attached to this image.
  8111. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  8112. // Licenses: Any applicable license URI.
  8113. Licenses []string `json:"licenses,omitempty"`
  8114. // Name: Name of the resource; provided by the client when the resource
  8115. // is created. The name must be 1-63 characters long, and comply with
  8116. // RFC1035. Specifically, the name must be 1-63 characters long and
  8117. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  8118. // the first character must be a lowercase letter, and all following
  8119. // characters must be a dash, lowercase letter, or digit, except the
  8120. // last character, which cannot be a dash.
  8121. Name string `json:"name,omitempty"`
  8122. // RawDisk: The parameters of the raw disk image.
  8123. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"`
  8124. // SelfLink: [Output Only] Server-defined URL for the resource.
  8125. SelfLink string `json:"selfLink,omitempty"`
  8126. // SourceDisk: URL of the source disk used to create this image. This
  8127. // can be a full or valid partial URL. You must provide either this
  8128. // property or the rawDisk.source property but not both to create an
  8129. // image. For example, the following are valid values:
  8130. // -
  8131. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
  8132. // - projects/project/zones/zone/disks/disk
  8133. // - zones/zone/disks/disk
  8134. SourceDisk string `json:"sourceDisk,omitempty"`
  8135. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  8136. // source disk. Required if the source disk is protected by a
  8137. // customer-supplied encryption key.
  8138. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  8139. // SourceDiskId: [Output Only] The ID value of the disk used to create
  8140. // this image. This value may be used to determine whether the image was
  8141. // taken from the current or a previous instance of a given disk name.
  8142. SourceDiskId string `json:"sourceDiskId,omitempty"`
  8143. // SourceImage: URL of the source image used to create this image. This
  8144. // can be a full or valid partial URL. You must provide exactly one of:
  8145. //
  8146. // - this property, or
  8147. // - the rawDisk.source property, or
  8148. // - the sourceDisk property in order to create an image.
  8149. SourceImage string `json:"sourceImage,omitempty"`
  8150. // SourceImageEncryptionKey: The customer-supplied encryption key of the
  8151. // source image. Required if the source image is protected by a
  8152. // customer-supplied encryption key.
  8153. SourceImageEncryptionKey *CustomerEncryptionKey `json:"sourceImageEncryptionKey,omitempty"`
  8154. // SourceImageId: [Output Only] The ID value of the image used to create
  8155. // this image. This value may be used to determine whether the image was
  8156. // taken from the current or a previous instance of a given image name.
  8157. SourceImageId string `json:"sourceImageId,omitempty"`
  8158. // SourceSnapshot: URL of the source snapshot used to create this image.
  8159. // This can be a full or valid partial URL. You must provide exactly one
  8160. // of:
  8161. // - this property, or
  8162. // - the sourceImage property, or
  8163. // - the rawDisk.source property, or
  8164. // - the sourceDisk property in order to create an image.
  8165. SourceSnapshot string `json:"sourceSnapshot,omitempty"`
  8166. // SourceSnapshotEncryptionKey: The customer-supplied encryption key of
  8167. // the source snapshot. Required if the source snapshot is protected by
  8168. // a customer-supplied encryption key.
  8169. SourceSnapshotEncryptionKey *CustomerEncryptionKey `json:"sourceSnapshotEncryptionKey,omitempty"`
  8170. // SourceSnapshotId: [Output Only] The ID value of the snapshot used to
  8171. // create this image. This value may be used to determine whether the
  8172. // snapshot was taken from the current or a previous instance of a given
  8173. // snapshot name.
  8174. SourceSnapshotId string `json:"sourceSnapshotId,omitempty"`
  8175. // SourceType: The type of the image used to create this disk. The
  8176. // default and only value is RAW
  8177. //
  8178. // Possible values:
  8179. // "RAW" (default)
  8180. SourceType string `json:"sourceType,omitempty"`
  8181. // Status: [Output Only] The status of the image. An image can be used
  8182. // to create other resources, such as instances, only after the image
  8183. // has been successfully created and the status is set to READY.
  8184. // Possible values are FAILED, PENDING, or READY.
  8185. //
  8186. // Possible values:
  8187. // "DELETING"
  8188. // "FAILED"
  8189. // "PENDING"
  8190. // "READY"
  8191. Status string `json:"status,omitempty"`
  8192. // ServerResponse contains the HTTP response code and headers from the
  8193. // server.
  8194. googleapi.ServerResponse `json:"-"`
  8195. // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to
  8196. // unconditionally include in API requests. By default, fields with
  8197. // empty values are omitted from API requests. However, any non-pointer,
  8198. // non-interface field appearing in ForceSendFields will be sent to the
  8199. // server regardless of whether the field is empty or not. This may be
  8200. // used to include empty fields in Patch requests.
  8201. ForceSendFields []string `json:"-"`
  8202. // NullFields is a list of field names (e.g. "ArchiveSizeBytes") to
  8203. // include in API requests with the JSON null value. By default, fields
  8204. // with empty values are omitted from API requests. However, any field
  8205. // with an empty value appearing in NullFields will be sent to the
  8206. // server as null. It is an error if a field in this list has a
  8207. // non-empty value. This may be used to include null fields in Patch
  8208. // requests.
  8209. NullFields []string `json:"-"`
  8210. }
  8211. func (s *Image) MarshalJSON() ([]byte, error) {
  8212. type NoMethod Image
  8213. raw := NoMethod(*s)
  8214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8215. }
  8216. // ImageRawDisk: The parameters of the raw disk image.
  8217. type ImageRawDisk struct {
  8218. // ContainerType: The format used to encode and transmit the block
  8219. // device, which should be TAR. This is just a container and
  8220. // transmission format and not a runtime format. Provided by the client
  8221. // when the disk image is created.
  8222. //
  8223. // Possible values:
  8224. // "TAR"
  8225. ContainerType string `json:"containerType,omitempty"`
  8226. // Sha1Checksum: [Deprecated] This field is deprecated. An optional SHA1
  8227. // checksum of the disk image before unpackaging provided by the client
  8228. // when the disk image is created.
  8229. Sha1Checksum string `json:"sha1Checksum,omitempty"`
  8230. // Source: The full Google Cloud Storage URL where the disk image is
  8231. // stored. You must provide either this property or the sourceDisk
  8232. // property but not both.
  8233. Source string `json:"source,omitempty"`
  8234. // ForceSendFields is a list of field names (e.g. "ContainerType") to
  8235. // unconditionally include in API requests. By default, fields with
  8236. // empty values are omitted from API requests. However, any non-pointer,
  8237. // non-interface field appearing in ForceSendFields will be sent to the
  8238. // server regardless of whether the field is empty or not. This may be
  8239. // used to include empty fields in Patch requests.
  8240. ForceSendFields []string `json:"-"`
  8241. // NullFields is a list of field names (e.g. "ContainerType") to include
  8242. // in API requests with the JSON null value. By default, fields with
  8243. // empty values are omitted from API requests. However, any field with
  8244. // an empty value appearing in NullFields will be sent to the server as
  8245. // null. It is an error if a field in this list has a non-empty value.
  8246. // This may be used to include null fields in Patch requests.
  8247. NullFields []string `json:"-"`
  8248. }
  8249. func (s *ImageRawDisk) MarshalJSON() ([]byte, error) {
  8250. type NoMethod ImageRawDisk
  8251. raw := NoMethod(*s)
  8252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8253. }
  8254. // ImageList: Contains a list of images.
  8255. type ImageList struct {
  8256. // Id: [Output Only] Unique identifier for the resource; defined by the
  8257. // server.
  8258. Id string `json:"id,omitempty"`
  8259. // Items: A list of Image resources.
  8260. Items []*Image `json:"items,omitempty"`
  8261. // Kind: Type of resource.
  8262. Kind string `json:"kind,omitempty"`
  8263. // NextPageToken: [Output Only] This token allows you to get the next
  8264. // page of results for list requests. If the number of results is larger
  8265. // than maxResults, use the nextPageToken as a value for the query
  8266. // parameter pageToken in the next list request. Subsequent list
  8267. // requests will have their own nextPageToken to continue paging through
  8268. // the results.
  8269. NextPageToken string `json:"nextPageToken,omitempty"`
  8270. // SelfLink: [Output Only] Server-defined URL for this resource.
  8271. SelfLink string `json:"selfLink,omitempty"`
  8272. // Warning: [Output Only] Informational warning message.
  8273. Warning *ImageListWarning `json:"warning,omitempty"`
  8274. // ServerResponse contains the HTTP response code and headers from the
  8275. // server.
  8276. googleapi.ServerResponse `json:"-"`
  8277. // ForceSendFields is a list of field names (e.g. "Id") to
  8278. // unconditionally include in API requests. By default, fields with
  8279. // empty values are omitted from API requests. However, any non-pointer,
  8280. // non-interface field appearing in ForceSendFields will be sent to the
  8281. // server regardless of whether the field is empty or not. This may be
  8282. // used to include empty fields in Patch requests.
  8283. ForceSendFields []string `json:"-"`
  8284. // NullFields is a list of field names (e.g. "Id") to include in API
  8285. // requests with the JSON null value. By default, fields with empty
  8286. // values are omitted from API requests. However, any field with an
  8287. // empty value appearing in NullFields will be sent to the server as
  8288. // null. It is an error if a field in this list has a non-empty value.
  8289. // This may be used to include null fields in Patch requests.
  8290. NullFields []string `json:"-"`
  8291. }
  8292. func (s *ImageList) MarshalJSON() ([]byte, error) {
  8293. type NoMethod ImageList
  8294. raw := NoMethod(*s)
  8295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8296. }
  8297. // ImageListWarning: [Output Only] Informational warning message.
  8298. type ImageListWarning struct {
  8299. // Code: [Output Only] A warning code, if applicable. For example,
  8300. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8301. // the response.
  8302. //
  8303. // Possible values:
  8304. // "CLEANUP_FAILED"
  8305. // "DEPRECATED_RESOURCE_USED"
  8306. // "DEPRECATED_TYPE_USED"
  8307. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8308. // "EXPERIMENTAL_TYPE_USED"
  8309. // "EXTERNAL_API_WARNING"
  8310. // "FIELD_VALUE_OVERRIDEN"
  8311. // "INJECTED_KERNELS_DEPRECATED"
  8312. // "MISSING_TYPE_DEPENDENCY"
  8313. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8314. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8315. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8316. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8317. // "NEXT_HOP_NOT_RUNNING"
  8318. // "NOT_CRITICAL_ERROR"
  8319. // "NO_RESULTS_ON_PAGE"
  8320. // "REQUIRED_TOS_AGREEMENT"
  8321. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8322. // "RESOURCE_NOT_DELETED"
  8323. // "SCHEMA_VALIDATION_IGNORED"
  8324. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8325. // "UNDECLARED_PROPERTIES"
  8326. // "UNREACHABLE"
  8327. Code string `json:"code,omitempty"`
  8328. // Data: [Output Only] Metadata about this warning in key: value format.
  8329. // For example:
  8330. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8331. Data []*ImageListWarningData `json:"data,omitempty"`
  8332. // Message: [Output Only] A human-readable description of the warning
  8333. // code.
  8334. Message string `json:"message,omitempty"`
  8335. // ForceSendFields is a list of field names (e.g. "Code") to
  8336. // unconditionally include in API requests. By default, fields with
  8337. // empty values are omitted from API requests. However, any non-pointer,
  8338. // non-interface field appearing in ForceSendFields will be sent to the
  8339. // server regardless of whether the field is empty or not. This may be
  8340. // used to include empty fields in Patch requests.
  8341. ForceSendFields []string `json:"-"`
  8342. // NullFields is a list of field names (e.g. "Code") to include in API
  8343. // requests with the JSON null value. By default, fields with empty
  8344. // values are omitted from API requests. However, any field with an
  8345. // empty value appearing in NullFields will be sent to the server as
  8346. // null. It is an error if a field in this list has a non-empty value.
  8347. // This may be used to include null fields in Patch requests.
  8348. NullFields []string `json:"-"`
  8349. }
  8350. func (s *ImageListWarning) MarshalJSON() ([]byte, error) {
  8351. type NoMethod ImageListWarning
  8352. raw := NoMethod(*s)
  8353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8354. }
  8355. type ImageListWarningData struct {
  8356. // Key: [Output Only] A key that provides more detail on the warning
  8357. // being returned. For example, for warnings where there are no results
  8358. // in a list request for a particular zone, this key might be scope and
  8359. // the key value might be the zone name. Other examples might be a key
  8360. // indicating a deprecated resource and a suggested replacement, or a
  8361. // warning about invalid network settings (for example, if an instance
  8362. // attempts to perform IP forwarding but is not enabled for IP
  8363. // forwarding).
  8364. Key string `json:"key,omitempty"`
  8365. // Value: [Output Only] A warning data value corresponding to the key.
  8366. Value string `json:"value,omitempty"`
  8367. // ForceSendFields is a list of field names (e.g. "Key") to
  8368. // unconditionally include in API requests. By default, fields with
  8369. // empty values are omitted from API requests. However, any non-pointer,
  8370. // non-interface field appearing in ForceSendFields will be sent to the
  8371. // server regardless of whether the field is empty or not. This may be
  8372. // used to include empty fields in Patch requests.
  8373. ForceSendFields []string `json:"-"`
  8374. // NullFields is a list of field names (e.g. "Key") to include in API
  8375. // requests with the JSON null value. By default, fields with empty
  8376. // values are omitted from API requests. However, any field with an
  8377. // empty value appearing in NullFields will be sent to the server as
  8378. // null. It is an error if a field in this list has a non-empty value.
  8379. // This may be used to include null fields in Patch requests.
  8380. NullFields []string `json:"-"`
  8381. }
  8382. func (s *ImageListWarningData) MarshalJSON() ([]byte, error) {
  8383. type NoMethod ImageListWarningData
  8384. raw := NoMethod(*s)
  8385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8386. }
  8387. // Instance: An Instance resource. (== resource_for beta.instances ==)
  8388. // (== resource_for v1.instances ==)
  8389. type Instance struct {
  8390. // CanIpForward: Allows this instance to send and receive packets with
  8391. // non-matching destination or source IPs. This is required if you plan
  8392. // to use this instance to forward routes. For more information, see
  8393. // Enabling IP Forwarding.
  8394. CanIpForward bool `json:"canIpForward,omitempty"`
  8395. // CpuPlatform: [Output Only] The CPU platform used by this instance.
  8396. CpuPlatform string `json:"cpuPlatform,omitempty"`
  8397. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  8398. // format.
  8399. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8400. // DeletionProtection: Whether the resource should be protected against
  8401. // deletion.
  8402. DeletionProtection bool `json:"deletionProtection,omitempty"`
  8403. // Description: An optional description of this resource. Provide this
  8404. // property when you create the resource.
  8405. Description string `json:"description,omitempty"`
  8406. // Disks: Array of disks associated with this instance. Persistent disks
  8407. // must be created before you can assign them.
  8408. Disks []*AttachedDisk `json:"disks,omitempty"`
  8409. // GuestAccelerators: A list of the type and count of accelerator cards
  8410. // attached to the instance.
  8411. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  8412. Hostname string `json:"hostname,omitempty"`
  8413. // Id: [Output Only] The unique identifier for the resource. This
  8414. // identifier is defined by the server.
  8415. Id uint64 `json:"id,omitempty,string"`
  8416. // Kind: [Output Only] Type of the resource. Always compute#instance for
  8417. // instances.
  8418. Kind string `json:"kind,omitempty"`
  8419. // LabelFingerprint: A fingerprint for this request, which is
  8420. // essentially a hash of the label's contents and used for optimistic
  8421. // locking. The fingerprint is initially generated by Compute Engine and
  8422. // changes after every request to modify or update labels. You must
  8423. // always provide an up-to-date fingerprint hash in order to update or
  8424. // change labels.
  8425. //
  8426. // To see the latest fingerprint, make get() request to the instance.
  8427. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  8428. // Labels: Labels to apply to this instance. These can be later modified
  8429. // by the setLabels method.
  8430. Labels map[string]string `json:"labels,omitempty"`
  8431. // MachineType: Full or partial URL of the machine type resource to use
  8432. // for this instance, in the format:
  8433. // zones/zone/machineTypes/machine-type. This is provided by the client
  8434. // when the instance is created. For example, the following is a valid
  8435. // partial url to a predefined machine
  8436. // type:
  8437. // zones/us-central1-f/machineTypes/n1-standard-1
  8438. //
  8439. //
  8440. // To create a custom machine type, provide a URL to a machine type in
  8441. // the following format, where CPUS is 1 or an even number up to 32 (2,
  8442. // 4, 6, ... 24, etc), and MEMORY is the total memory for this instance.
  8443. // Memory must be a multiple of 256 MB and must be supplied in MB (e.g.
  8444. // 5 GB of memory is 5120
  8445. // MB):
  8446. // zones/zone/machineTypes/custom-CPUS-MEMORY
  8447. //
  8448. //
  8449. // For example: zones/us-central1-f/machineTypes/custom-4-5120
  8450. //
  8451. // For a full list of restrictions, read the Specifications for custom
  8452. // machine types.
  8453. MachineType string `json:"machineType,omitempty"`
  8454. // Metadata: The metadata key/value pairs assigned to this instance.
  8455. // This includes custom metadata and predefined keys.
  8456. Metadata *Metadata `json:"metadata,omitempty"`
  8457. // MinCpuPlatform: Specifies a minimum CPU platform for the VM instance.
  8458. // Applicable values are the friendly names of CPU platforms, such as
  8459. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  8460. // Bridge".
  8461. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  8462. // Name: The name of the resource, provided by the client when initially
  8463. // creating the resource. The resource name must be 1-63 characters
  8464. // long, and comply with RFC1035. Specifically, the name must be 1-63
  8465. // characters long and match the regular expression
  8466. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  8467. // a lowercase letter, and all following characters must be a dash,
  8468. // lowercase letter, or digit, except the last character, which cannot
  8469. // be a dash.
  8470. Name string `json:"name,omitempty"`
  8471. // NetworkInterfaces: An array of network configurations for this
  8472. // instance. These specify how interfaces are configured to interact
  8473. // with other network services, such as connecting to the internet.
  8474. // Multiple interfaces are supported per instance.
  8475. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  8476. // Scheduling: Sets the scheduling options for this instance.
  8477. Scheduling *Scheduling `json:"scheduling,omitempty"`
  8478. // SelfLink: [Output Only] Server-defined URL for this resource.
  8479. SelfLink string `json:"selfLink,omitempty"`
  8480. // ServiceAccounts: A list of service accounts, with their specified
  8481. // scopes, authorized for this instance. Only one service account per VM
  8482. // instance is supported.
  8483. //
  8484. // Service accounts generate access tokens that can be accessed through
  8485. // the metadata server and used to authenticate applications on the
  8486. // instance. See Service Accounts for more information.
  8487. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  8488. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  8489. ShieldedInstanceIntegrityPolicy *ShieldedInstanceIntegrityPolicy `json:"shieldedInstanceIntegrityPolicy,omitempty"`
  8490. // StartRestricted: [Output Only] Whether a VM has been restricted for
  8491. // start because Compute Engine has detected suspicious activity.
  8492. StartRestricted bool `json:"startRestricted,omitempty"`
  8493. // Status: [Output Only] The status of the instance. One of the
  8494. // following values: PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED,
  8495. // SUSPENDING, SUSPENDED, and TERMINATED.
  8496. //
  8497. // Possible values:
  8498. // "PROVISIONING"
  8499. // "REPAIRING"
  8500. // "RUNNING"
  8501. // "STAGING"
  8502. // "STOPPED"
  8503. // "STOPPING"
  8504. // "SUSPENDED"
  8505. // "SUSPENDING"
  8506. // "TERMINATED"
  8507. Status string `json:"status,omitempty"`
  8508. // StatusMessage: [Output Only] An optional, human-readable explanation
  8509. // of the status.
  8510. StatusMessage string `json:"statusMessage,omitempty"`
  8511. // Tags: Tags to apply to this instance. Tags are used to identify valid
  8512. // sources or targets for network firewalls and are specified by the
  8513. // client during instance creation. The tags can be later modified by
  8514. // the setTags method. Each tag within the list must comply with
  8515. // RFC1035. Multiple tags can be specified via the 'tags.items' field.
  8516. Tags *Tags `json:"tags,omitempty"`
  8517. // Zone: [Output Only] URL of the zone where the instance resides. You
  8518. // must specify this field as part of the HTTP request URL. It is not
  8519. // settable as a field in the request body.
  8520. Zone string `json:"zone,omitempty"`
  8521. // ServerResponse contains the HTTP response code and headers from the
  8522. // server.
  8523. googleapi.ServerResponse `json:"-"`
  8524. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  8525. // unconditionally include in API requests. By default, fields with
  8526. // empty values are omitted from API requests. However, any non-pointer,
  8527. // non-interface field appearing in ForceSendFields will be sent to the
  8528. // server regardless of whether the field is empty or not. This may be
  8529. // used to include empty fields in Patch requests.
  8530. ForceSendFields []string `json:"-"`
  8531. // NullFields is a list of field names (e.g. "CanIpForward") to include
  8532. // in API requests with the JSON null value. By default, fields with
  8533. // empty values are omitted from API requests. However, any field with
  8534. // an empty value appearing in NullFields will be sent to the server as
  8535. // null. It is an error if a field in this list has a non-empty value.
  8536. // This may be used to include null fields in Patch requests.
  8537. NullFields []string `json:"-"`
  8538. }
  8539. func (s *Instance) MarshalJSON() ([]byte, error) {
  8540. type NoMethod Instance
  8541. raw := NoMethod(*s)
  8542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8543. }
  8544. type InstanceAggregatedList struct {
  8545. // Id: [Output Only] Unique identifier for the resource; defined by the
  8546. // server.
  8547. Id string `json:"id,omitempty"`
  8548. // Items: A list of InstancesScopedList resources.
  8549. Items map[string]InstancesScopedList `json:"items,omitempty"`
  8550. // Kind: [Output Only] Type of resource. Always
  8551. // compute#instanceAggregatedList for aggregated lists of Instance
  8552. // resources.
  8553. Kind string `json:"kind,omitempty"`
  8554. // NextPageToken: [Output Only] This token allows you to get the next
  8555. // page of results for list requests. If the number of results is larger
  8556. // than maxResults, use the nextPageToken as a value for the query
  8557. // parameter pageToken in the next list request. Subsequent list
  8558. // requests will have their own nextPageToken to continue paging through
  8559. // the results.
  8560. NextPageToken string `json:"nextPageToken,omitempty"`
  8561. // SelfLink: [Output Only] Server-defined URL for this resource.
  8562. SelfLink string `json:"selfLink,omitempty"`
  8563. // Warning: [Output Only] Informational warning message.
  8564. Warning *InstanceAggregatedListWarning `json:"warning,omitempty"`
  8565. // ServerResponse contains the HTTP response code and headers from the
  8566. // server.
  8567. googleapi.ServerResponse `json:"-"`
  8568. // ForceSendFields is a list of field names (e.g. "Id") to
  8569. // unconditionally include in API requests. By default, fields with
  8570. // empty values are omitted from API requests. However, any non-pointer,
  8571. // non-interface field appearing in ForceSendFields will be sent to the
  8572. // server regardless of whether the field is empty or not. This may be
  8573. // used to include empty fields in Patch requests.
  8574. ForceSendFields []string `json:"-"`
  8575. // NullFields is a list of field names (e.g. "Id") to include in API
  8576. // requests with the JSON null value. By default, fields with empty
  8577. // values are omitted from API requests. However, any field with an
  8578. // empty value appearing in NullFields will be sent to the server as
  8579. // null. It is an error if a field in this list has a non-empty value.
  8580. // This may be used to include null fields in Patch requests.
  8581. NullFields []string `json:"-"`
  8582. }
  8583. func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) {
  8584. type NoMethod InstanceAggregatedList
  8585. raw := NoMethod(*s)
  8586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8587. }
  8588. // InstanceAggregatedListWarning: [Output Only] Informational warning
  8589. // message.
  8590. type InstanceAggregatedListWarning struct {
  8591. // Code: [Output Only] A warning code, if applicable. For example,
  8592. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8593. // the response.
  8594. //
  8595. // Possible values:
  8596. // "CLEANUP_FAILED"
  8597. // "DEPRECATED_RESOURCE_USED"
  8598. // "DEPRECATED_TYPE_USED"
  8599. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8600. // "EXPERIMENTAL_TYPE_USED"
  8601. // "EXTERNAL_API_WARNING"
  8602. // "FIELD_VALUE_OVERRIDEN"
  8603. // "INJECTED_KERNELS_DEPRECATED"
  8604. // "MISSING_TYPE_DEPENDENCY"
  8605. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8606. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8607. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8608. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8609. // "NEXT_HOP_NOT_RUNNING"
  8610. // "NOT_CRITICAL_ERROR"
  8611. // "NO_RESULTS_ON_PAGE"
  8612. // "REQUIRED_TOS_AGREEMENT"
  8613. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8614. // "RESOURCE_NOT_DELETED"
  8615. // "SCHEMA_VALIDATION_IGNORED"
  8616. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8617. // "UNDECLARED_PROPERTIES"
  8618. // "UNREACHABLE"
  8619. Code string `json:"code,omitempty"`
  8620. // Data: [Output Only] Metadata about this warning in key: value format.
  8621. // For example:
  8622. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8623. Data []*InstanceAggregatedListWarningData `json:"data,omitempty"`
  8624. // Message: [Output Only] A human-readable description of the warning
  8625. // code.
  8626. Message string `json:"message,omitempty"`
  8627. // ForceSendFields is a list of field names (e.g. "Code") to
  8628. // unconditionally include in API requests. By default, fields with
  8629. // empty values are omitted from API requests. However, any non-pointer,
  8630. // non-interface field appearing in ForceSendFields will be sent to the
  8631. // server regardless of whether the field is empty or not. This may be
  8632. // used to include empty fields in Patch requests.
  8633. ForceSendFields []string `json:"-"`
  8634. // NullFields is a list of field names (e.g. "Code") to include in API
  8635. // requests with the JSON null value. By default, fields with empty
  8636. // values are omitted from API requests. However, any field with an
  8637. // empty value appearing in NullFields will be sent to the server as
  8638. // null. It is an error if a field in this list has a non-empty value.
  8639. // This may be used to include null fields in Patch requests.
  8640. NullFields []string `json:"-"`
  8641. }
  8642. func (s *InstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8643. type NoMethod InstanceAggregatedListWarning
  8644. raw := NoMethod(*s)
  8645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8646. }
  8647. type InstanceAggregatedListWarningData struct {
  8648. // Key: [Output Only] A key that provides more detail on the warning
  8649. // being returned. For example, for warnings where there are no results
  8650. // in a list request for a particular zone, this key might be scope and
  8651. // the key value might be the zone name. Other examples might be a key
  8652. // indicating a deprecated resource and a suggested replacement, or a
  8653. // warning about invalid network settings (for example, if an instance
  8654. // attempts to perform IP forwarding but is not enabled for IP
  8655. // forwarding).
  8656. Key string `json:"key,omitempty"`
  8657. // Value: [Output Only] A warning data value corresponding to the key.
  8658. Value string `json:"value,omitempty"`
  8659. // ForceSendFields is a list of field names (e.g. "Key") to
  8660. // unconditionally include in API requests. By default, fields with
  8661. // empty values are omitted from API requests. However, any non-pointer,
  8662. // non-interface field appearing in ForceSendFields will be sent to the
  8663. // server regardless of whether the field is empty or not. This may be
  8664. // used to include empty fields in Patch requests.
  8665. ForceSendFields []string `json:"-"`
  8666. // NullFields is a list of field names (e.g. "Key") to include in API
  8667. // requests with the JSON null value. By default, fields with empty
  8668. // values are omitted from API requests. However, any field with an
  8669. // empty value appearing in NullFields will be sent to the server as
  8670. // null. It is an error if a field in this list has a non-empty value.
  8671. // This may be used to include null fields in Patch requests.
  8672. NullFields []string `json:"-"`
  8673. }
  8674. func (s *InstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8675. type NoMethod InstanceAggregatedListWarningData
  8676. raw := NoMethod(*s)
  8677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8678. }
  8679. // InstanceGroup: InstanceGroups (== resource_for beta.instanceGroups
  8680. // ==) (== resource_for v1.instanceGroups ==) (== resource_for
  8681. // beta.regionInstanceGroups ==) (== resource_for
  8682. // v1.regionInstanceGroups ==)
  8683. type InstanceGroup struct {
  8684. // CreationTimestamp: [Output Only] The creation timestamp for this
  8685. // instance group in RFC3339 text format.
  8686. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  8687. // Description: An optional description of this resource. Provide this
  8688. // property when you create the resource.
  8689. Description string `json:"description,omitempty"`
  8690. // Fingerprint: [Output Only] The fingerprint of the named ports. The
  8691. // system uses this fingerprint to detect conflicts when multiple users
  8692. // change the named ports concurrently.
  8693. Fingerprint string `json:"fingerprint,omitempty"`
  8694. // Id: [Output Only] A unique identifier for this instance group,
  8695. // generated by the server.
  8696. Id uint64 `json:"id,omitempty,string"`
  8697. // Kind: [Output Only] The resource type, which is always
  8698. // compute#instanceGroup for instance groups.
  8699. Kind string `json:"kind,omitempty"`
  8700. // Name: The name of the instance group. The name must be 1-63
  8701. // characters long, and comply with RFC1035.
  8702. Name string `json:"name,omitempty"`
  8703. // NamedPorts: Assigns a name to a port number. For example: {name:
  8704. // "http", port: 80}
  8705. //
  8706. // This allows the system to reference ports by the assigned name
  8707. // instead of a port number. Named ports can also contain multiple
  8708. // ports. For example: [{name: "http", port: 80},{name: "http", port:
  8709. // 8080}]
  8710. //
  8711. // Named ports apply to all instances in this instance group.
  8712. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  8713. // Network: The URL of the network to which all instances in the
  8714. // instance group belong.
  8715. Network string `json:"network,omitempty"`
  8716. // Region: [Output Only] The URL of the region where the instance group
  8717. // is located (for regional resources).
  8718. Region string `json:"region,omitempty"`
  8719. // SelfLink: [Output Only] The URL for this instance group. The server
  8720. // generates this URL.
  8721. SelfLink string `json:"selfLink,omitempty"`
  8722. // Size: [Output Only] The total number of instances in the instance
  8723. // group.
  8724. Size int64 `json:"size,omitempty"`
  8725. // Subnetwork: [Output Only] The URL of the subnetwork to which all
  8726. // instances in the instance group belong.
  8727. Subnetwork string `json:"subnetwork,omitempty"`
  8728. // Zone: [Output Only] The URL of the zone where the instance group is
  8729. // located (for zonal resources).
  8730. Zone string `json:"zone,omitempty"`
  8731. // ServerResponse contains the HTTP response code and headers from the
  8732. // server.
  8733. googleapi.ServerResponse `json:"-"`
  8734. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  8735. // to unconditionally include in API requests. By default, fields with
  8736. // empty values are omitted from API requests. However, any non-pointer,
  8737. // non-interface field appearing in ForceSendFields will be sent to the
  8738. // server regardless of whether the field is empty or not. This may be
  8739. // used to include empty fields in Patch requests.
  8740. ForceSendFields []string `json:"-"`
  8741. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  8742. // include in API requests with the JSON null value. By default, fields
  8743. // with empty values are omitted from API requests. However, any field
  8744. // with an empty value appearing in NullFields will be sent to the
  8745. // server as null. It is an error if a field in this list has a
  8746. // non-empty value. This may be used to include null fields in Patch
  8747. // requests.
  8748. NullFields []string `json:"-"`
  8749. }
  8750. func (s *InstanceGroup) MarshalJSON() ([]byte, error) {
  8751. type NoMethod InstanceGroup
  8752. raw := NoMethod(*s)
  8753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8754. }
  8755. type InstanceGroupAggregatedList struct {
  8756. // Id: [Output Only] Unique identifier for the resource; defined by the
  8757. // server.
  8758. Id string `json:"id,omitempty"`
  8759. // Items: A list of InstanceGroupsScopedList resources.
  8760. Items map[string]InstanceGroupsScopedList `json:"items,omitempty"`
  8761. // Kind: [Output Only] The resource type, which is always
  8762. // compute#instanceGroupAggregatedList for aggregated lists of instance
  8763. // groups.
  8764. Kind string `json:"kind,omitempty"`
  8765. // NextPageToken: [Output Only] This token allows you to get the next
  8766. // page of results for list requests. If the number of results is larger
  8767. // than maxResults, use the nextPageToken as a value for the query
  8768. // parameter pageToken in the next list request. Subsequent list
  8769. // requests will have their own nextPageToken to continue paging through
  8770. // the results.
  8771. NextPageToken string `json:"nextPageToken,omitempty"`
  8772. // SelfLink: [Output Only] Server-defined URL for this resource.
  8773. SelfLink string `json:"selfLink,omitempty"`
  8774. // Warning: [Output Only] Informational warning message.
  8775. Warning *InstanceGroupAggregatedListWarning `json:"warning,omitempty"`
  8776. // ServerResponse contains the HTTP response code and headers from the
  8777. // server.
  8778. googleapi.ServerResponse `json:"-"`
  8779. // ForceSendFields is a list of field names (e.g. "Id") to
  8780. // unconditionally include in API requests. By default, fields with
  8781. // empty values are omitted from API requests. However, any non-pointer,
  8782. // non-interface field appearing in ForceSendFields will be sent to the
  8783. // server regardless of whether the field is empty or not. This may be
  8784. // used to include empty fields in Patch requests.
  8785. ForceSendFields []string `json:"-"`
  8786. // NullFields is a list of field names (e.g. "Id") to include in API
  8787. // requests with the JSON null value. By default, fields with empty
  8788. // values are omitted from API requests. However, any field with an
  8789. // empty value appearing in NullFields will be sent to the server as
  8790. // null. It is an error if a field in this list has a non-empty value.
  8791. // This may be used to include null fields in Patch requests.
  8792. NullFields []string `json:"-"`
  8793. }
  8794. func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) {
  8795. type NoMethod InstanceGroupAggregatedList
  8796. raw := NoMethod(*s)
  8797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8798. }
  8799. // InstanceGroupAggregatedListWarning: [Output Only] Informational
  8800. // warning message.
  8801. type InstanceGroupAggregatedListWarning struct {
  8802. // Code: [Output Only] A warning code, if applicable. For example,
  8803. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8804. // the response.
  8805. //
  8806. // Possible values:
  8807. // "CLEANUP_FAILED"
  8808. // "DEPRECATED_RESOURCE_USED"
  8809. // "DEPRECATED_TYPE_USED"
  8810. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8811. // "EXPERIMENTAL_TYPE_USED"
  8812. // "EXTERNAL_API_WARNING"
  8813. // "FIELD_VALUE_OVERRIDEN"
  8814. // "INJECTED_KERNELS_DEPRECATED"
  8815. // "MISSING_TYPE_DEPENDENCY"
  8816. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8817. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8818. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8819. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8820. // "NEXT_HOP_NOT_RUNNING"
  8821. // "NOT_CRITICAL_ERROR"
  8822. // "NO_RESULTS_ON_PAGE"
  8823. // "REQUIRED_TOS_AGREEMENT"
  8824. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8825. // "RESOURCE_NOT_DELETED"
  8826. // "SCHEMA_VALIDATION_IGNORED"
  8827. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8828. // "UNDECLARED_PROPERTIES"
  8829. // "UNREACHABLE"
  8830. Code string `json:"code,omitempty"`
  8831. // Data: [Output Only] Metadata about this warning in key: value format.
  8832. // For example:
  8833. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8834. Data []*InstanceGroupAggregatedListWarningData `json:"data,omitempty"`
  8835. // Message: [Output Only] A human-readable description of the warning
  8836. // code.
  8837. Message string `json:"message,omitempty"`
  8838. // ForceSendFields is a list of field names (e.g. "Code") to
  8839. // unconditionally include in API requests. By default, fields with
  8840. // empty values are omitted from API requests. However, any non-pointer,
  8841. // non-interface field appearing in ForceSendFields will be sent to the
  8842. // server regardless of whether the field is empty or not. This may be
  8843. // used to include empty fields in Patch requests.
  8844. ForceSendFields []string `json:"-"`
  8845. // NullFields is a list of field names (e.g. "Code") to include in API
  8846. // requests with the JSON null value. By default, fields with empty
  8847. // values are omitted from API requests. However, any field with an
  8848. // empty value appearing in NullFields will be sent to the server as
  8849. // null. It is an error if a field in this list has a non-empty value.
  8850. // This may be used to include null fields in Patch requests.
  8851. NullFields []string `json:"-"`
  8852. }
  8853. func (s *InstanceGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  8854. type NoMethod InstanceGroupAggregatedListWarning
  8855. raw := NoMethod(*s)
  8856. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8857. }
  8858. type InstanceGroupAggregatedListWarningData struct {
  8859. // Key: [Output Only] A key that provides more detail on the warning
  8860. // being returned. For example, for warnings where there are no results
  8861. // in a list request for a particular zone, this key might be scope and
  8862. // the key value might be the zone name. Other examples might be a key
  8863. // indicating a deprecated resource and a suggested replacement, or a
  8864. // warning about invalid network settings (for example, if an instance
  8865. // attempts to perform IP forwarding but is not enabled for IP
  8866. // forwarding).
  8867. Key string `json:"key,omitempty"`
  8868. // Value: [Output Only] A warning data value corresponding to the key.
  8869. Value string `json:"value,omitempty"`
  8870. // ForceSendFields is a list of field names (e.g. "Key") to
  8871. // unconditionally include in API requests. By default, fields with
  8872. // empty values are omitted from API requests. However, any non-pointer,
  8873. // non-interface field appearing in ForceSendFields will be sent to the
  8874. // server regardless of whether the field is empty or not. This may be
  8875. // used to include empty fields in Patch requests.
  8876. ForceSendFields []string `json:"-"`
  8877. // NullFields is a list of field names (e.g. "Key") to include in API
  8878. // requests with the JSON null value. By default, fields with empty
  8879. // values are omitted from API requests. However, any field with an
  8880. // empty value appearing in NullFields will be sent to the server as
  8881. // null. It is an error if a field in this list has a non-empty value.
  8882. // This may be used to include null fields in Patch requests.
  8883. NullFields []string `json:"-"`
  8884. }
  8885. func (s *InstanceGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  8886. type NoMethod InstanceGroupAggregatedListWarningData
  8887. raw := NoMethod(*s)
  8888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8889. }
  8890. // InstanceGroupList: A list of InstanceGroup resources.
  8891. type InstanceGroupList struct {
  8892. // Id: [Output Only] Unique identifier for the resource; defined by the
  8893. // server.
  8894. Id string `json:"id,omitempty"`
  8895. // Items: A list of InstanceGroup resources.
  8896. Items []*InstanceGroup `json:"items,omitempty"`
  8897. // Kind: [Output Only] The resource type, which is always
  8898. // compute#instanceGroupList for instance group lists.
  8899. Kind string `json:"kind,omitempty"`
  8900. // NextPageToken: [Output Only] This token allows you to get the next
  8901. // page of results for list requests. If the number of results is larger
  8902. // than maxResults, use the nextPageToken as a value for the query
  8903. // parameter pageToken in the next list request. Subsequent list
  8904. // requests will have their own nextPageToken to continue paging through
  8905. // the results.
  8906. NextPageToken string `json:"nextPageToken,omitempty"`
  8907. // SelfLink: [Output Only] Server-defined URL for this resource.
  8908. SelfLink string `json:"selfLink,omitempty"`
  8909. // Warning: [Output Only] Informational warning message.
  8910. Warning *InstanceGroupListWarning `json:"warning,omitempty"`
  8911. // ServerResponse contains the HTTP response code and headers from the
  8912. // server.
  8913. googleapi.ServerResponse `json:"-"`
  8914. // ForceSendFields is a list of field names (e.g. "Id") to
  8915. // unconditionally include in API requests. By default, fields with
  8916. // empty values are omitted from API requests. However, any non-pointer,
  8917. // non-interface field appearing in ForceSendFields will be sent to the
  8918. // server regardless of whether the field is empty or not. This may be
  8919. // used to include empty fields in Patch requests.
  8920. ForceSendFields []string `json:"-"`
  8921. // NullFields is a list of field names (e.g. "Id") to include in API
  8922. // requests with the JSON null value. By default, fields with empty
  8923. // values are omitted from API requests. However, any field with an
  8924. // empty value appearing in NullFields will be sent to the server as
  8925. // null. It is an error if a field in this list has a non-empty value.
  8926. // This may be used to include null fields in Patch requests.
  8927. NullFields []string `json:"-"`
  8928. }
  8929. func (s *InstanceGroupList) MarshalJSON() ([]byte, error) {
  8930. type NoMethod InstanceGroupList
  8931. raw := NoMethod(*s)
  8932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8933. }
  8934. // InstanceGroupListWarning: [Output Only] Informational warning
  8935. // message.
  8936. type InstanceGroupListWarning struct {
  8937. // Code: [Output Only] A warning code, if applicable. For example,
  8938. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  8939. // the response.
  8940. //
  8941. // Possible values:
  8942. // "CLEANUP_FAILED"
  8943. // "DEPRECATED_RESOURCE_USED"
  8944. // "DEPRECATED_TYPE_USED"
  8945. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  8946. // "EXPERIMENTAL_TYPE_USED"
  8947. // "EXTERNAL_API_WARNING"
  8948. // "FIELD_VALUE_OVERRIDEN"
  8949. // "INJECTED_KERNELS_DEPRECATED"
  8950. // "MISSING_TYPE_DEPENDENCY"
  8951. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  8952. // "NEXT_HOP_CANNOT_IP_FORWARD"
  8953. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  8954. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  8955. // "NEXT_HOP_NOT_RUNNING"
  8956. // "NOT_CRITICAL_ERROR"
  8957. // "NO_RESULTS_ON_PAGE"
  8958. // "REQUIRED_TOS_AGREEMENT"
  8959. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  8960. // "RESOURCE_NOT_DELETED"
  8961. // "SCHEMA_VALIDATION_IGNORED"
  8962. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  8963. // "UNDECLARED_PROPERTIES"
  8964. // "UNREACHABLE"
  8965. Code string `json:"code,omitempty"`
  8966. // Data: [Output Only] Metadata about this warning in key: value format.
  8967. // For example:
  8968. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  8969. Data []*InstanceGroupListWarningData `json:"data,omitempty"`
  8970. // Message: [Output Only] A human-readable description of the warning
  8971. // code.
  8972. Message string `json:"message,omitempty"`
  8973. // ForceSendFields is a list of field names (e.g. "Code") to
  8974. // unconditionally include in API requests. By default, fields with
  8975. // empty values are omitted from API requests. However, any non-pointer,
  8976. // non-interface field appearing in ForceSendFields will be sent to the
  8977. // server regardless of whether the field is empty or not. This may be
  8978. // used to include empty fields in Patch requests.
  8979. ForceSendFields []string `json:"-"`
  8980. // NullFields is a list of field names (e.g. "Code") to include in API
  8981. // requests with the JSON null value. By default, fields with empty
  8982. // values are omitted from API requests. However, any field with an
  8983. // empty value appearing in NullFields will be sent to the server as
  8984. // null. It is an error if a field in this list has a non-empty value.
  8985. // This may be used to include null fields in Patch requests.
  8986. NullFields []string `json:"-"`
  8987. }
  8988. func (s *InstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  8989. type NoMethod InstanceGroupListWarning
  8990. raw := NoMethod(*s)
  8991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8992. }
  8993. type InstanceGroupListWarningData struct {
  8994. // Key: [Output Only] A key that provides more detail on the warning
  8995. // being returned. For example, for warnings where there are no results
  8996. // in a list request for a particular zone, this key might be scope and
  8997. // the key value might be the zone name. Other examples might be a key
  8998. // indicating a deprecated resource and a suggested replacement, or a
  8999. // warning about invalid network settings (for example, if an instance
  9000. // attempts to perform IP forwarding but is not enabled for IP
  9001. // forwarding).
  9002. Key string `json:"key,omitempty"`
  9003. // Value: [Output Only] A warning data value corresponding to the key.
  9004. Value string `json:"value,omitempty"`
  9005. // ForceSendFields is a list of field names (e.g. "Key") to
  9006. // unconditionally include in API requests. By default, fields with
  9007. // empty values are omitted from API requests. However, any non-pointer,
  9008. // non-interface field appearing in ForceSendFields will be sent to the
  9009. // server regardless of whether the field is empty or not. This may be
  9010. // used to include empty fields in Patch requests.
  9011. ForceSendFields []string `json:"-"`
  9012. // NullFields is a list of field names (e.g. "Key") to include in API
  9013. // requests with the JSON null value. By default, fields with empty
  9014. // values are omitted from API requests. However, any field with an
  9015. // empty value appearing in NullFields will be sent to the server as
  9016. // null. It is an error if a field in this list has a non-empty value.
  9017. // This may be used to include null fields in Patch requests.
  9018. NullFields []string `json:"-"`
  9019. }
  9020. func (s *InstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  9021. type NoMethod InstanceGroupListWarningData
  9022. raw := NoMethod(*s)
  9023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9024. }
  9025. // InstanceGroupManager: An Instance Group Manager resource. (==
  9026. // resource_for beta.instanceGroupManagers ==) (== resource_for
  9027. // v1.instanceGroupManagers ==) (== resource_for
  9028. // beta.regionInstanceGroupManagers ==) (== resource_for
  9029. // v1.regionInstanceGroupManagers ==)
  9030. type InstanceGroupManager struct {
  9031. // AutoHealingPolicies: The autohealing policy for this managed instance
  9032. // group. You can specify only one value.
  9033. AutoHealingPolicies []*InstanceGroupManagerAutoHealingPolicy `json:"autoHealingPolicies,omitempty"`
  9034. // BaseInstanceName: The base instance name to use for instances in this
  9035. // group. The value must be 1-58 characters long. Instances are named by
  9036. // appending a hyphen and a random four-character string to the base
  9037. // instance name. The base instance name must comply with RFC1035.
  9038. BaseInstanceName string `json:"baseInstanceName,omitempty"`
  9039. // CreationTimestamp: [Output Only] The creation timestamp for this
  9040. // managed instance group in RFC3339 text format.
  9041. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  9042. // CurrentActions: [Output Only] The list of instance actions and the
  9043. // number of instances in this managed instance group that are scheduled
  9044. // for each of those actions.
  9045. CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"`
  9046. // Description: An optional description of this resource. Provide this
  9047. // property when you create the resource.
  9048. Description string `json:"description,omitempty"`
  9049. // DistributionPolicy: Policy specifying intended distribution of
  9050. // instances in regional managed instance group.
  9051. DistributionPolicy *DistributionPolicy `json:"distributionPolicy,omitempty"`
  9052. // Fingerprint: Fingerprint of this resource. This field may be used in
  9053. // optimistic locking. It will be ignored when inserting an
  9054. // InstanceGroupManager. An up-to-date fingerprint must be provided in
  9055. // order to update the InstanceGroupManager, otherwise the request will
  9056. // fail with error 412 conditionNotMet.
  9057. //
  9058. // To see the latest fingerprint, make a get() request to retrieve an
  9059. // InstanceGroupManager.
  9060. Fingerprint string `json:"fingerprint,omitempty"`
  9061. // Id: [Output Only] A unique identifier for this resource type. The
  9062. // server generates this identifier.
  9063. Id uint64 `json:"id,omitempty,string"`
  9064. // InstanceGroup: [Output Only] The URL of the Instance Group resource.
  9065. InstanceGroup string `json:"instanceGroup,omitempty"`
  9066. // InstanceTemplate: The URL of the instance template that is specified
  9067. // for this managed instance group. The group uses this template to
  9068. // create all new instances in the managed instance group.
  9069. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9070. // Kind: [Output Only] The resource type, which is always
  9071. // compute#instanceGroupManager for managed instance groups.
  9072. Kind string `json:"kind,omitempty"`
  9073. // Name: The name of the managed instance group. The name must be 1-63
  9074. // characters long, and comply with RFC1035.
  9075. Name string `json:"name,omitempty"`
  9076. // NamedPorts: Named ports configured for the Instance Groups
  9077. // complementary to this Instance Group Manager.
  9078. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  9079. // Region: [Output Only] The URL of the region where the managed
  9080. // instance group resides (for regional resources).
  9081. Region string `json:"region,omitempty"`
  9082. // SelfLink: [Output Only] The URL for this managed instance group. The
  9083. // server defines this URL.
  9084. SelfLink string `json:"selfLink,omitempty"`
  9085. // Status: [Output Only] The status of this managed instance group.
  9086. Status *InstanceGroupManagerStatus `json:"status,omitempty"`
  9087. // TargetPools: The URLs for all TargetPool resources to which instances
  9088. // in the instanceGroup field are added. The target pools automatically
  9089. // apply to all of the instances in the managed instance group.
  9090. TargetPools []string `json:"targetPools,omitempty"`
  9091. // TargetSize: The target number of running instances for this managed
  9092. // instance group. Deleting or abandoning instances reduces this number.
  9093. // Resizing the group changes this number.
  9094. TargetSize int64 `json:"targetSize,omitempty"`
  9095. // UpdatePolicy: The update policy for this managed instance group.
  9096. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"`
  9097. // Versions: Specifies the instance templates used by this managed
  9098. // instance group to create instances.
  9099. //
  9100. // Each version is defined by an instanceTemplate and a name. Every
  9101. // version can appear at most once per instance group. This field
  9102. // overrides the top-level instanceTemplate field. Read more about the
  9103. // relationships between these fields. Exactly one version must leave
  9104. // the targetSize field unset. That version will be applied to all
  9105. // remaining instances. For more information, read about canary updates.
  9106. Versions []*InstanceGroupManagerVersion `json:"versions,omitempty"`
  9107. // Zone: [Output Only] The URL of the zone where the managed instance
  9108. // group is located (for zonal resources).
  9109. Zone string `json:"zone,omitempty"`
  9110. // ServerResponse contains the HTTP response code and headers from the
  9111. // server.
  9112. googleapi.ServerResponse `json:"-"`
  9113. // ForceSendFields is a list of field names (e.g. "AutoHealingPolicies")
  9114. // to unconditionally include in API requests. By default, fields with
  9115. // empty values are omitted from API requests. However, any non-pointer,
  9116. // non-interface field appearing in ForceSendFields will be sent to the
  9117. // server regardless of whether the field is empty or not. This may be
  9118. // used to include empty fields in Patch requests.
  9119. ForceSendFields []string `json:"-"`
  9120. // NullFields is a list of field names (e.g. "AutoHealingPolicies") to
  9121. // include in API requests with the JSON null value. By default, fields
  9122. // with empty values are omitted from API requests. However, any field
  9123. // with an empty value appearing in NullFields will be sent to the
  9124. // server as null. It is an error if a field in this list has a
  9125. // non-empty value. This may be used to include null fields in Patch
  9126. // requests.
  9127. NullFields []string `json:"-"`
  9128. }
  9129. func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) {
  9130. type NoMethod InstanceGroupManager
  9131. raw := NoMethod(*s)
  9132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9133. }
  9134. type InstanceGroupManagerActionsSummary struct {
  9135. // Abandoning: [Output Only] The total number of instances in the
  9136. // managed instance group that are scheduled to be abandoned. Abandoning
  9137. // an instance removes it from the managed instance group without
  9138. // deleting it.
  9139. Abandoning int64 `json:"abandoning,omitempty"`
  9140. // Creating: [Output Only] The number of instances in the managed
  9141. // instance group that are scheduled to be created or are currently
  9142. // being created. If the group fails to create any of these instances,
  9143. // it tries again until it creates the instance successfully.
  9144. //
  9145. // If you have disabled creation retries, this field will not be
  9146. // populated; instead, the creatingWithoutRetries field will be
  9147. // populated.
  9148. Creating int64 `json:"creating,omitempty"`
  9149. // CreatingWithoutRetries: [Output Only] The number of instances that
  9150. // the managed instance group will attempt to create. The group attempts
  9151. // to create each instance only once. If the group fails to create any
  9152. // of these instances, it decreases the group's targetSize value
  9153. // accordingly.
  9154. CreatingWithoutRetries int64 `json:"creatingWithoutRetries,omitempty"`
  9155. // Deleting: [Output Only] The number of instances in the managed
  9156. // instance group that are scheduled to be deleted or are currently
  9157. // being deleted.
  9158. Deleting int64 `json:"deleting,omitempty"`
  9159. // None: [Output Only] The number of instances in the managed instance
  9160. // group that are running and have no scheduled actions.
  9161. None int64 `json:"none,omitempty"`
  9162. // Recreating: [Output Only] The number of instances in the managed
  9163. // instance group that are scheduled to be recreated or are currently
  9164. // being being recreated. Recreating an instance deletes the existing
  9165. // root persistent disk and creates a new disk from the image that is
  9166. // defined in the instance template.
  9167. Recreating int64 `json:"recreating,omitempty"`
  9168. // Refreshing: [Output Only] The number of instances in the managed
  9169. // instance group that are being reconfigured with properties that do
  9170. // not require a restart or a recreate action. For example, setting or
  9171. // removing target pools for the instance.
  9172. Refreshing int64 `json:"refreshing,omitempty"`
  9173. // Restarting: [Output Only] The number of instances in the managed
  9174. // instance group that are scheduled to be restarted or are currently
  9175. // being restarted.
  9176. Restarting int64 `json:"restarting,omitempty"`
  9177. // Verifying: [Output Only] The number of instances in the managed
  9178. // instance group that are being verified. See the
  9179. // managedInstances[].currentAction property in the listManagedInstances
  9180. // method documentation.
  9181. Verifying int64 `json:"verifying,omitempty"`
  9182. // ForceSendFields is a list of field names (e.g. "Abandoning") to
  9183. // unconditionally include in API requests. By default, fields with
  9184. // empty values are omitted from API requests. However, any non-pointer,
  9185. // non-interface field appearing in ForceSendFields will be sent to the
  9186. // server regardless of whether the field is empty or not. This may be
  9187. // used to include empty fields in Patch requests.
  9188. ForceSendFields []string `json:"-"`
  9189. // NullFields is a list of field names (e.g. "Abandoning") to include in
  9190. // API requests with the JSON null value. By default, fields with empty
  9191. // values are omitted from API requests. However, any field with an
  9192. // empty value appearing in NullFields will be sent to the server as
  9193. // null. It is an error if a field in this list has a non-empty value.
  9194. // This may be used to include null fields in Patch requests.
  9195. NullFields []string `json:"-"`
  9196. }
  9197. func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) {
  9198. type NoMethod InstanceGroupManagerActionsSummary
  9199. raw := NoMethod(*s)
  9200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9201. }
  9202. type InstanceGroupManagerAggregatedList struct {
  9203. // Id: [Output Only] Unique identifier for the resource; defined by the
  9204. // server.
  9205. Id string `json:"id,omitempty"`
  9206. // Items: A list of InstanceGroupManagersScopedList resources.
  9207. Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"`
  9208. // Kind: [Output Only] The resource type, which is always
  9209. // compute#instanceGroupManagerAggregatedList for an aggregated list of
  9210. // managed instance groups.
  9211. Kind string `json:"kind,omitempty"`
  9212. // NextPageToken: [Output Only] This token allows you to get the next
  9213. // page of results for list requests. If the number of results is larger
  9214. // than maxResults, use the nextPageToken as a value for the query
  9215. // parameter pageToken in the next list request. Subsequent list
  9216. // requests will have their own nextPageToken to continue paging through
  9217. // the results.
  9218. NextPageToken string `json:"nextPageToken,omitempty"`
  9219. // SelfLink: [Output Only] Server-defined URL for this resource.
  9220. SelfLink string `json:"selfLink,omitempty"`
  9221. // Warning: [Output Only] Informational warning message.
  9222. Warning *InstanceGroupManagerAggregatedListWarning `json:"warning,omitempty"`
  9223. // ServerResponse contains the HTTP response code and headers from the
  9224. // server.
  9225. googleapi.ServerResponse `json:"-"`
  9226. // ForceSendFields is a list of field names (e.g. "Id") to
  9227. // unconditionally include in API requests. By default, fields with
  9228. // empty values are omitted from API requests. However, any non-pointer,
  9229. // non-interface field appearing in ForceSendFields will be sent to the
  9230. // server regardless of whether the field is empty or not. This may be
  9231. // used to include empty fields in Patch requests.
  9232. ForceSendFields []string `json:"-"`
  9233. // NullFields is a list of field names (e.g. "Id") to include in API
  9234. // requests with the JSON null value. By default, fields with empty
  9235. // values are omitted from API requests. However, any field with an
  9236. // empty value appearing in NullFields will be sent to the server as
  9237. // null. It is an error if a field in this list has a non-empty value.
  9238. // This may be used to include null fields in Patch requests.
  9239. NullFields []string `json:"-"`
  9240. }
  9241. func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) {
  9242. type NoMethod InstanceGroupManagerAggregatedList
  9243. raw := NoMethod(*s)
  9244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9245. }
  9246. // InstanceGroupManagerAggregatedListWarning: [Output Only]
  9247. // Informational warning message.
  9248. type InstanceGroupManagerAggregatedListWarning struct {
  9249. // Code: [Output Only] A warning code, if applicable. For example,
  9250. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9251. // the response.
  9252. //
  9253. // Possible values:
  9254. // "CLEANUP_FAILED"
  9255. // "DEPRECATED_RESOURCE_USED"
  9256. // "DEPRECATED_TYPE_USED"
  9257. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9258. // "EXPERIMENTAL_TYPE_USED"
  9259. // "EXTERNAL_API_WARNING"
  9260. // "FIELD_VALUE_OVERRIDEN"
  9261. // "INJECTED_KERNELS_DEPRECATED"
  9262. // "MISSING_TYPE_DEPENDENCY"
  9263. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9264. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9265. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9266. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9267. // "NEXT_HOP_NOT_RUNNING"
  9268. // "NOT_CRITICAL_ERROR"
  9269. // "NO_RESULTS_ON_PAGE"
  9270. // "REQUIRED_TOS_AGREEMENT"
  9271. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9272. // "RESOURCE_NOT_DELETED"
  9273. // "SCHEMA_VALIDATION_IGNORED"
  9274. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9275. // "UNDECLARED_PROPERTIES"
  9276. // "UNREACHABLE"
  9277. Code string `json:"code,omitempty"`
  9278. // Data: [Output Only] Metadata about this warning in key: value format.
  9279. // For example:
  9280. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9281. Data []*InstanceGroupManagerAggregatedListWarningData `json:"data,omitempty"`
  9282. // Message: [Output Only] A human-readable description of the warning
  9283. // code.
  9284. Message string `json:"message,omitempty"`
  9285. // ForceSendFields is a list of field names (e.g. "Code") to
  9286. // unconditionally include in API requests. By default, fields with
  9287. // empty values are omitted from API requests. However, any non-pointer,
  9288. // non-interface field appearing in ForceSendFields will be sent to the
  9289. // server regardless of whether the field is empty or not. This may be
  9290. // used to include empty fields in Patch requests.
  9291. ForceSendFields []string `json:"-"`
  9292. // NullFields is a list of field names (e.g. "Code") to include in API
  9293. // requests with the JSON null value. By default, fields with empty
  9294. // values are omitted from API requests. However, any field with an
  9295. // empty value appearing in NullFields will be sent to the server as
  9296. // null. It is an error if a field in this list has a non-empty value.
  9297. // This may be used to include null fields in Patch requests.
  9298. NullFields []string `json:"-"`
  9299. }
  9300. func (s *InstanceGroupManagerAggregatedListWarning) MarshalJSON() ([]byte, error) {
  9301. type NoMethod InstanceGroupManagerAggregatedListWarning
  9302. raw := NoMethod(*s)
  9303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9304. }
  9305. type InstanceGroupManagerAggregatedListWarningData struct {
  9306. // Key: [Output Only] A key that provides more detail on the warning
  9307. // being returned. For example, for warnings where there are no results
  9308. // in a list request for a particular zone, this key might be scope and
  9309. // the key value might be the zone name. Other examples might be a key
  9310. // indicating a deprecated resource and a suggested replacement, or a
  9311. // warning about invalid network settings (for example, if an instance
  9312. // attempts to perform IP forwarding but is not enabled for IP
  9313. // forwarding).
  9314. Key string `json:"key,omitempty"`
  9315. // Value: [Output Only] A warning data value corresponding to the key.
  9316. Value string `json:"value,omitempty"`
  9317. // ForceSendFields is a list of field names (e.g. "Key") to
  9318. // unconditionally include in API requests. By default, fields with
  9319. // empty values are omitted from API requests. However, any non-pointer,
  9320. // non-interface field appearing in ForceSendFields will be sent to the
  9321. // server regardless of whether the field is empty or not. This may be
  9322. // used to include empty fields in Patch requests.
  9323. ForceSendFields []string `json:"-"`
  9324. // NullFields is a list of field names (e.g. "Key") to include in API
  9325. // requests with the JSON null value. By default, fields with empty
  9326. // values are omitted from API requests. However, any field with an
  9327. // empty value appearing in NullFields will be sent to the server as
  9328. // null. It is an error if a field in this list has a non-empty value.
  9329. // This may be used to include null fields in Patch requests.
  9330. NullFields []string `json:"-"`
  9331. }
  9332. func (s *InstanceGroupManagerAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  9333. type NoMethod InstanceGroupManagerAggregatedListWarningData
  9334. raw := NoMethod(*s)
  9335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9336. }
  9337. type InstanceGroupManagerAutoHealingPolicy struct {
  9338. // HealthCheck: The URL for the health check that signals autohealing.
  9339. HealthCheck string `json:"healthCheck,omitempty"`
  9340. // InitialDelaySec: The number of seconds that the managed instance
  9341. // group waits before it applies autohealing policies to new instances
  9342. // or recently recreated instances. This initial delay allows instances
  9343. // to initialize and run their startup scripts before the instance group
  9344. // determines that they are UNHEALTHY. This prevents the managed
  9345. // instance group from recreating its instances prematurely. This value
  9346. // must be from range [0, 3600].
  9347. InitialDelaySec int64 `json:"initialDelaySec,omitempty"`
  9348. // ForceSendFields is a list of field names (e.g. "HealthCheck") to
  9349. // unconditionally include in API requests. By default, fields with
  9350. // empty values are omitted from API requests. However, any non-pointer,
  9351. // non-interface field appearing in ForceSendFields will be sent to the
  9352. // server regardless of whether the field is empty or not. This may be
  9353. // used to include empty fields in Patch requests.
  9354. ForceSendFields []string `json:"-"`
  9355. // NullFields is a list of field names (e.g. "HealthCheck") to include
  9356. // in API requests with the JSON null value. By default, fields with
  9357. // empty values are omitted from API requests. However, any field with
  9358. // an empty value appearing in NullFields will be sent to the server as
  9359. // null. It is an error if a field in this list has a non-empty value.
  9360. // This may be used to include null fields in Patch requests.
  9361. NullFields []string `json:"-"`
  9362. }
  9363. func (s *InstanceGroupManagerAutoHealingPolicy) MarshalJSON() ([]byte, error) {
  9364. type NoMethod InstanceGroupManagerAutoHealingPolicy
  9365. raw := NoMethod(*s)
  9366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9367. }
  9368. // InstanceGroupManagerList: [Output Only] A list of managed instance
  9369. // groups.
  9370. type InstanceGroupManagerList 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 InstanceGroupManager resources.
  9375. Items []*InstanceGroupManager `json:"items,omitempty"`
  9376. // Kind: [Output Only] The resource type, which is always
  9377. // compute#instanceGroupManagerList for a list of managed instance
  9378. // groups.
  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 *InstanceGroupManagerListWarning `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 *InstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  9410. type NoMethod InstanceGroupManagerList
  9411. raw := NoMethod(*s)
  9412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9413. }
  9414. // InstanceGroupManagerListWarning: [Output Only] Informational warning
  9415. // message.
  9416. type InstanceGroupManagerListWarning 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 []*InstanceGroupManagerListWarningData `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 *InstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  9469. type NoMethod InstanceGroupManagerListWarning
  9470. raw := NoMethod(*s)
  9471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9472. }
  9473. type InstanceGroupManagerListWarningData 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 *InstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  9501. type NoMethod InstanceGroupManagerListWarningData
  9502. raw := NoMethod(*s)
  9503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9504. }
  9505. type InstanceGroupManagerStatus struct {
  9506. // IsStable: [Output Only] A bit indicating whether the managed instance
  9507. // group is in a stable state. A stable state means that: none of the
  9508. // instances in the managed instance group is currently undergoing any
  9509. // type of change (for example, creation, restart, or deletion); no
  9510. // future changes are scheduled for instances in the managed instance
  9511. // group; and the managed instance group itself is not being modified.
  9512. IsStable bool `json:"isStable,omitempty"`
  9513. // ForceSendFields is a list of field names (e.g. "IsStable") to
  9514. // unconditionally include in API requests. By default, fields with
  9515. // empty values are omitted from API requests. However, any non-pointer,
  9516. // non-interface field appearing in ForceSendFields will be sent to the
  9517. // server regardless of whether the field is empty or not. This may be
  9518. // used to include empty fields in Patch requests.
  9519. ForceSendFields []string `json:"-"`
  9520. // NullFields is a list of field names (e.g. "IsStable") to include in
  9521. // API requests with the JSON null value. By default, fields with empty
  9522. // values are omitted from API requests. However, any field with an
  9523. // empty value appearing in NullFields will be sent to the server as
  9524. // null. It is an error if a field in this list has a non-empty value.
  9525. // This may be used to include null fields in Patch requests.
  9526. NullFields []string `json:"-"`
  9527. }
  9528. func (s *InstanceGroupManagerStatus) MarshalJSON() ([]byte, error) {
  9529. type NoMethod InstanceGroupManagerStatus
  9530. raw := NoMethod(*s)
  9531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9532. }
  9533. type InstanceGroupManagerUpdatePolicy struct {
  9534. // MaxSurge: The maximum number of instances that can be created above
  9535. // the specified targetSize during the update process. By default, a
  9536. // fixed value of 1 is used. This value can be either a fixed number or
  9537. // a percentage if the instance group has 10 or more instances. If you
  9538. // set a percentage, the number of instances will be rounded up if
  9539. // necessary.
  9540. //
  9541. // At least one of either maxSurge or maxUnavailable must be greater
  9542. // than 0. Learn more about maxSurge.
  9543. MaxSurge *FixedOrPercent `json:"maxSurge,omitempty"`
  9544. // MaxUnavailable: The maximum number of instances that can be
  9545. // unavailable during the update process. An instance is considered
  9546. // available if all of the following conditions are satisfied:
  9547. //
  9548. //
  9549. // - The instance's status is RUNNING.
  9550. // - If there is a health check on the instance group, the instance's
  9551. // liveness health check result must be HEALTHY at least once. If there
  9552. // is no health check on the group, then the instance only needs to have
  9553. // a status of RUNNING to be considered available. By default, a fixed
  9554. // value of 1 is used. This value can be either a fixed number or a
  9555. // percentage if the instance group has 10 or more instances. If you set
  9556. // a percentage, the number of instances will be rounded up if
  9557. // necessary.
  9558. //
  9559. // At least one of either maxSurge or maxUnavailable must be greater
  9560. // than 0. Learn more about maxUnavailable.
  9561. MaxUnavailable *FixedOrPercent `json:"maxUnavailable,omitempty"`
  9562. // MinimalAction: Minimal action to be taken on an instance. You can
  9563. // specify either RESTART to restart existing instances or REPLACE to
  9564. // delete and create new instances from the target template. If you
  9565. // specify a RESTART, the Updater will attempt to perform that action
  9566. // only. However, if the Updater determines that the minimal action you
  9567. // specify is not enough to perform the update, it might perform a more
  9568. // disruptive action.
  9569. //
  9570. // Possible values:
  9571. // "REPLACE"
  9572. // "RESTART"
  9573. MinimalAction string `json:"minimalAction,omitempty"`
  9574. // Possible values:
  9575. // "OPPORTUNISTIC"
  9576. // "PROACTIVE"
  9577. Type string `json:"type,omitempty"`
  9578. // ForceSendFields is a list of field names (e.g. "MaxSurge") to
  9579. // unconditionally include in API requests. By default, fields with
  9580. // empty values are omitted from API requests. However, any non-pointer,
  9581. // non-interface field appearing in ForceSendFields will be sent to the
  9582. // server regardless of whether the field is empty or not. This may be
  9583. // used to include empty fields in Patch requests.
  9584. ForceSendFields []string `json:"-"`
  9585. // NullFields is a list of field names (e.g. "MaxSurge") to include in
  9586. // API requests with the JSON null value. By default, fields with empty
  9587. // values are omitted from API requests. However, any field with an
  9588. // empty value appearing in NullFields will be sent to the server as
  9589. // null. It is an error if a field in this list has a non-empty value.
  9590. // This may be used to include null fields in Patch requests.
  9591. NullFields []string `json:"-"`
  9592. }
  9593. func (s *InstanceGroupManagerUpdatePolicy) MarshalJSON() ([]byte, error) {
  9594. type NoMethod InstanceGroupManagerUpdatePolicy
  9595. raw := NoMethod(*s)
  9596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9597. }
  9598. type InstanceGroupManagerVersion struct {
  9599. // InstanceTemplate: The URL of the instance template that is specified
  9600. // for this managed instance group. The group uses this template to
  9601. // create new instances in the managed instance group until the
  9602. // `targetSize` for this version is reached.
  9603. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9604. // Name: Name of the version. Unique among all versions in the scope of
  9605. // this managed instance group.
  9606. Name string `json:"name,omitempty"`
  9607. // TargetSize: Specifies the intended number of instances to be created
  9608. // from the instanceTemplate. The final number of instances created from
  9609. // the template will be equal to:
  9610. // - If expressed as a fixed number, the minimum of either
  9611. // targetSize.fixed or instanceGroupManager.targetSize is used.
  9612. // - if expressed as a percent, the targetSize would be
  9613. // (targetSize.percent/100 * InstanceGroupManager.targetSize) If there
  9614. // is a remainder, the number is rounded up. If unset, this version
  9615. // will update any remaining instances not updated by another version.
  9616. // Read Starting a canary update for more information.
  9617. TargetSize *FixedOrPercent `json:"targetSize,omitempty"`
  9618. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  9619. // unconditionally include in API requests. By default, fields with
  9620. // empty values are omitted from API requests. However, any non-pointer,
  9621. // non-interface field appearing in ForceSendFields will be sent to the
  9622. // server regardless of whether the field is empty or not. This may be
  9623. // used to include empty fields in Patch requests.
  9624. ForceSendFields []string `json:"-"`
  9625. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  9626. // include in API requests with the JSON null value. By default, fields
  9627. // with empty values are omitted from API requests. However, any field
  9628. // with an empty value appearing in NullFields will be sent to the
  9629. // server as null. It is an error if a field in this list has a
  9630. // non-empty value. This may be used to include null fields in Patch
  9631. // requests.
  9632. NullFields []string `json:"-"`
  9633. }
  9634. func (s *InstanceGroupManagerVersion) MarshalJSON() ([]byte, error) {
  9635. type NoMethod InstanceGroupManagerVersion
  9636. raw := NoMethod(*s)
  9637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9638. }
  9639. type InstanceGroupManagersAbandonInstancesRequest struct {
  9640. // Instances: The URLs of one or more instances to abandon. This can be
  9641. // a full URL or a partial URL, such as
  9642. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9643. Instances []string `json:"instances,omitempty"`
  9644. // ForceSendFields is a list of field names (e.g. "Instances") to
  9645. // unconditionally include in API requests. By default, fields with
  9646. // empty values are omitted from API requests. However, any non-pointer,
  9647. // non-interface field appearing in ForceSendFields will be sent to the
  9648. // server regardless of whether the field is empty or not. This may be
  9649. // used to include empty fields in Patch requests.
  9650. ForceSendFields []string `json:"-"`
  9651. // NullFields is a list of field names (e.g. "Instances") to include in
  9652. // API requests with the JSON null value. By default, fields with empty
  9653. // values are omitted from API requests. However, any field with an
  9654. // empty value appearing in NullFields will be sent to the server as
  9655. // null. It is an error if a field in this list has a non-empty value.
  9656. // This may be used to include null fields in Patch requests.
  9657. NullFields []string `json:"-"`
  9658. }
  9659. func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  9660. type NoMethod InstanceGroupManagersAbandonInstancesRequest
  9661. raw := NoMethod(*s)
  9662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9663. }
  9664. type InstanceGroupManagersDeleteInstancesRequest struct {
  9665. // Instances: The URLs of one or more instances to delete. This can be a
  9666. // full URL or a partial URL, such as
  9667. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9668. Instances []string `json:"instances,omitempty"`
  9669. // ForceSendFields is a list of field names (e.g. "Instances") to
  9670. // unconditionally include in API requests. By default, fields with
  9671. // empty values are omitted from API requests. However, any non-pointer,
  9672. // non-interface field appearing in ForceSendFields will be sent to the
  9673. // server regardless of whether the field is empty or not. This may be
  9674. // used to include empty fields in Patch requests.
  9675. ForceSendFields []string `json:"-"`
  9676. // NullFields is a list of field names (e.g. "Instances") to include in
  9677. // API requests with the JSON null value. By default, fields with empty
  9678. // values are omitted from API requests. However, any field with an
  9679. // empty value appearing in NullFields will be sent to the server as
  9680. // null. It is an error if a field in this list has a non-empty value.
  9681. // This may be used to include null fields in Patch requests.
  9682. NullFields []string `json:"-"`
  9683. }
  9684. func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  9685. type NoMethod InstanceGroupManagersDeleteInstancesRequest
  9686. raw := NoMethod(*s)
  9687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9688. }
  9689. type InstanceGroupManagersListManagedInstancesResponse struct {
  9690. // ManagedInstances: [Output Only] The list of instances in the managed
  9691. // instance group.
  9692. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  9693. // ServerResponse contains the HTTP response code and headers from the
  9694. // server.
  9695. googleapi.ServerResponse `json:"-"`
  9696. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  9697. // unconditionally include in API requests. By default, fields with
  9698. // empty values are omitted from API requests. However, any non-pointer,
  9699. // non-interface field appearing in ForceSendFields will be sent to the
  9700. // server regardless of whether the field is empty or not. This may be
  9701. // used to include empty fields in Patch requests.
  9702. ForceSendFields []string `json:"-"`
  9703. // NullFields is a list of field names (e.g. "ManagedInstances") to
  9704. // include in API requests with the JSON null value. By default, fields
  9705. // with empty values are omitted from API requests. However, any field
  9706. // with an empty value appearing in NullFields will be sent to the
  9707. // server as null. It is an error if a field in this list has a
  9708. // non-empty value. This may be used to include null fields in Patch
  9709. // requests.
  9710. NullFields []string `json:"-"`
  9711. }
  9712. func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) {
  9713. type NoMethod InstanceGroupManagersListManagedInstancesResponse
  9714. raw := NoMethod(*s)
  9715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9716. }
  9717. type InstanceGroupManagersRecreateInstancesRequest struct {
  9718. // Instances: The URLs of one or more instances to recreate. This can be
  9719. // a full URL or a partial URL, such as
  9720. // zones/[ZONE]/instances/[INSTANCE_NAME].
  9721. Instances []string `json:"instances,omitempty"`
  9722. // ForceSendFields is a list of field names (e.g. "Instances") to
  9723. // unconditionally include in API requests. By default, fields with
  9724. // empty values are omitted from API requests. However, any non-pointer,
  9725. // non-interface field appearing in ForceSendFields will be sent to the
  9726. // server regardless of whether the field is empty or not. This may be
  9727. // used to include empty fields in Patch requests.
  9728. ForceSendFields []string `json:"-"`
  9729. // NullFields is a list of field names (e.g. "Instances") to include in
  9730. // API requests with the JSON null value. By default, fields with empty
  9731. // values are omitted from API requests. However, any field with an
  9732. // empty value appearing in NullFields will be sent to the server as
  9733. // null. It is an error if a field in this list has a non-empty value.
  9734. // This may be used to include null fields in Patch requests.
  9735. NullFields []string `json:"-"`
  9736. }
  9737. func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) {
  9738. type NoMethod InstanceGroupManagersRecreateInstancesRequest
  9739. raw := NoMethod(*s)
  9740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9741. }
  9742. type InstanceGroupManagersScopedList struct {
  9743. // InstanceGroupManagers: [Output Only] The list of managed instance
  9744. // groups that are contained in the specified project and zone.
  9745. InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"`
  9746. // Warning: [Output Only] The warning that replaces the list of managed
  9747. // instance groups when the list is empty.
  9748. Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"`
  9749. // ForceSendFields is a list of field names (e.g.
  9750. // "InstanceGroupManagers") to unconditionally include in API requests.
  9751. // By default, fields with empty values are omitted from API requests.
  9752. // However, any non-pointer, non-interface field appearing in
  9753. // ForceSendFields will be sent to the server regardless of whether the
  9754. // field is empty or not. This may be used to include empty fields in
  9755. // Patch requests.
  9756. ForceSendFields []string `json:"-"`
  9757. // NullFields is a list of field names (e.g. "InstanceGroupManagers") to
  9758. // include in API requests with the JSON null value. By default, fields
  9759. // with empty values are omitted from API requests. However, any field
  9760. // with an empty value appearing in NullFields will be sent to the
  9761. // server as null. It is an error if a field in this list has a
  9762. // non-empty value. This may be used to include null fields in Patch
  9763. // requests.
  9764. NullFields []string `json:"-"`
  9765. }
  9766. func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) {
  9767. type NoMethod InstanceGroupManagersScopedList
  9768. raw := NoMethod(*s)
  9769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9770. }
  9771. // InstanceGroupManagersScopedListWarning: [Output Only] The warning
  9772. // that replaces the list of managed instance groups when the list is
  9773. // empty.
  9774. type InstanceGroupManagersScopedListWarning struct {
  9775. // Code: [Output Only] A warning code, if applicable. For example,
  9776. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9777. // the response.
  9778. //
  9779. // Possible values:
  9780. // "CLEANUP_FAILED"
  9781. // "DEPRECATED_RESOURCE_USED"
  9782. // "DEPRECATED_TYPE_USED"
  9783. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  9784. // "EXPERIMENTAL_TYPE_USED"
  9785. // "EXTERNAL_API_WARNING"
  9786. // "FIELD_VALUE_OVERRIDEN"
  9787. // "INJECTED_KERNELS_DEPRECATED"
  9788. // "MISSING_TYPE_DEPENDENCY"
  9789. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  9790. // "NEXT_HOP_CANNOT_IP_FORWARD"
  9791. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  9792. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  9793. // "NEXT_HOP_NOT_RUNNING"
  9794. // "NOT_CRITICAL_ERROR"
  9795. // "NO_RESULTS_ON_PAGE"
  9796. // "REQUIRED_TOS_AGREEMENT"
  9797. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  9798. // "RESOURCE_NOT_DELETED"
  9799. // "SCHEMA_VALIDATION_IGNORED"
  9800. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  9801. // "UNDECLARED_PROPERTIES"
  9802. // "UNREACHABLE"
  9803. Code string `json:"code,omitempty"`
  9804. // Data: [Output Only] Metadata about this warning in key: value format.
  9805. // For example:
  9806. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  9807. Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"`
  9808. // Message: [Output Only] A human-readable description of the warning
  9809. // code.
  9810. Message string `json:"message,omitempty"`
  9811. // ForceSendFields is a list of field names (e.g. "Code") to
  9812. // unconditionally include in API requests. By default, fields with
  9813. // empty values are omitted from API requests. However, any non-pointer,
  9814. // non-interface field appearing in ForceSendFields will be sent to the
  9815. // server regardless of whether the field is empty or not. This may be
  9816. // used to include empty fields in Patch requests.
  9817. ForceSendFields []string `json:"-"`
  9818. // NullFields is a list of field names (e.g. "Code") to include in API
  9819. // requests with the JSON null value. By default, fields with empty
  9820. // values are omitted from API requests. However, any field with an
  9821. // empty value appearing in NullFields will be sent to the server as
  9822. // null. It is an error if a field in this list has a non-empty value.
  9823. // This may be used to include null fields in Patch requests.
  9824. NullFields []string `json:"-"`
  9825. }
  9826. func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) {
  9827. type NoMethod InstanceGroupManagersScopedListWarning
  9828. raw := NoMethod(*s)
  9829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9830. }
  9831. type InstanceGroupManagersScopedListWarningData struct {
  9832. // Key: [Output Only] A key that provides more detail on the warning
  9833. // being returned. For example, for warnings where there are no results
  9834. // in a list request for a particular zone, this key might be scope and
  9835. // the key value might be the zone name. Other examples might be a key
  9836. // indicating a deprecated resource and a suggested replacement, or a
  9837. // warning about invalid network settings (for example, if an instance
  9838. // attempts to perform IP forwarding but is not enabled for IP
  9839. // forwarding).
  9840. Key string `json:"key,omitempty"`
  9841. // Value: [Output Only] A warning data value corresponding to the key.
  9842. Value string `json:"value,omitempty"`
  9843. // ForceSendFields is a list of field names (e.g. "Key") to
  9844. // unconditionally include in API requests. By default, fields with
  9845. // empty values are omitted from API requests. However, any non-pointer,
  9846. // non-interface field appearing in ForceSendFields will be sent to the
  9847. // server regardless of whether the field is empty or not. This may be
  9848. // used to include empty fields in Patch requests.
  9849. ForceSendFields []string `json:"-"`
  9850. // NullFields is a list of field names (e.g. "Key") to include in API
  9851. // requests with the JSON null value. By default, fields with empty
  9852. // values are omitted from API requests. However, any field with an
  9853. // empty value appearing in NullFields will be sent to the server as
  9854. // null. It is an error if a field in this list has a non-empty value.
  9855. // This may be used to include null fields in Patch requests.
  9856. NullFields []string `json:"-"`
  9857. }
  9858. func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) {
  9859. type NoMethod InstanceGroupManagersScopedListWarningData
  9860. raw := NoMethod(*s)
  9861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9862. }
  9863. type InstanceGroupManagersSetInstanceTemplateRequest struct {
  9864. // InstanceTemplate: The URL of the instance template that is specified
  9865. // for this managed instance group. The group uses this template to
  9866. // create all new instances in the managed instance group.
  9867. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  9868. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") 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. "InstanceTemplate") to
  9876. // include in API requests with the JSON null value. By default, fields
  9877. // with empty values are omitted from API requests. However, any field
  9878. // with an empty value appearing in NullFields will be sent to the
  9879. // server as null. It is an error if a field in this list has a
  9880. // non-empty value. This may be used to include null fields in Patch
  9881. // requests.
  9882. NullFields []string `json:"-"`
  9883. }
  9884. func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) {
  9885. type NoMethod InstanceGroupManagersSetInstanceTemplateRequest
  9886. raw := NoMethod(*s)
  9887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9888. }
  9889. type InstanceGroupManagersSetTargetPoolsRequest struct {
  9890. // Fingerprint: The fingerprint of the target pools information. Use
  9891. // this optional property to prevent conflicts when multiple users
  9892. // change the target pools settings concurrently. Obtain the fingerprint
  9893. // with the instanceGroupManagers.get method. Then, include the
  9894. // fingerprint in your request to ensure that you do not overwrite
  9895. // changes that were applied from another concurrent request.
  9896. Fingerprint string `json:"fingerprint,omitempty"`
  9897. // TargetPools: The list of target pool URLs that instances in this
  9898. // managed instance group belong to. The managed instance group applies
  9899. // these target pools to all of the instances in the group. Existing
  9900. // instances and new instances in the group all receive these target
  9901. // pool settings.
  9902. TargetPools []string `json:"targetPools,omitempty"`
  9903. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  9904. // unconditionally include in API requests. By default, fields with
  9905. // empty values are omitted from API requests. However, any non-pointer,
  9906. // non-interface field appearing in ForceSendFields will be sent to the
  9907. // server regardless of whether the field is empty or not. This may be
  9908. // used to include empty fields in Patch requests.
  9909. ForceSendFields []string `json:"-"`
  9910. // NullFields is a list of field names (e.g. "Fingerprint") to include
  9911. // in API requests with the JSON null value. By default, fields with
  9912. // empty values are omitted from API requests. However, any field with
  9913. // an empty value appearing in NullFields will be sent to the server as
  9914. // null. It is an error if a field in this list has a non-empty value.
  9915. // This may be used to include null fields in Patch requests.
  9916. NullFields []string `json:"-"`
  9917. }
  9918. func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  9919. type NoMethod InstanceGroupManagersSetTargetPoolsRequest
  9920. raw := NoMethod(*s)
  9921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9922. }
  9923. type InstanceGroupsAddInstancesRequest struct {
  9924. // Instances: The list of instances to add to the instance group.
  9925. Instances []*InstanceReference `json:"instances,omitempty"`
  9926. // ForceSendFields is a list of field names (e.g. "Instances") to
  9927. // unconditionally include in API requests. By default, fields with
  9928. // empty values are omitted from API requests. However, any non-pointer,
  9929. // non-interface field appearing in ForceSendFields will be sent to the
  9930. // server regardless of whether the field is empty or not. This may be
  9931. // used to include empty fields in Patch requests.
  9932. ForceSendFields []string `json:"-"`
  9933. // NullFields is a list of field names (e.g. "Instances") to include in
  9934. // API requests with the JSON null value. By default, fields with empty
  9935. // values are omitted from API requests. However, any field with an
  9936. // empty value appearing in NullFields will be sent to the server as
  9937. // null. It is an error if a field in this list has a non-empty value.
  9938. // This may be used to include null fields in Patch requests.
  9939. NullFields []string `json:"-"`
  9940. }
  9941. func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) {
  9942. type NoMethod InstanceGroupsAddInstancesRequest
  9943. raw := NoMethod(*s)
  9944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9945. }
  9946. type InstanceGroupsListInstances struct {
  9947. // Id: [Output Only] Unique identifier for the resource; defined by the
  9948. // server.
  9949. Id string `json:"id,omitempty"`
  9950. // Items: A list of InstanceWithNamedPorts resources.
  9951. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  9952. // Kind: [Output Only] The resource type, which is always
  9953. // compute#instanceGroupsListInstances for the list of instances in the
  9954. // specified instance group.
  9955. Kind string `json:"kind,omitempty"`
  9956. // NextPageToken: [Output Only] This token allows you to get the next
  9957. // page of results for list requests. If the number of results is larger
  9958. // than maxResults, use the nextPageToken as a value for the query
  9959. // parameter pageToken in the next list request. Subsequent list
  9960. // requests will have their own nextPageToken to continue paging through
  9961. // the results.
  9962. NextPageToken string `json:"nextPageToken,omitempty"`
  9963. // SelfLink: [Output Only] Server-defined URL for this resource.
  9964. SelfLink string `json:"selfLink,omitempty"`
  9965. // Warning: [Output Only] Informational warning message.
  9966. Warning *InstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  9967. // ServerResponse contains the HTTP response code and headers from the
  9968. // server.
  9969. googleapi.ServerResponse `json:"-"`
  9970. // ForceSendFields is a list of field names (e.g. "Id") to
  9971. // unconditionally include in API requests. By default, fields with
  9972. // empty values are omitted from API requests. However, any non-pointer,
  9973. // non-interface field appearing in ForceSendFields will be sent to the
  9974. // server regardless of whether the field is empty or not. This may be
  9975. // used to include empty fields in Patch requests.
  9976. ForceSendFields []string `json:"-"`
  9977. // NullFields is a list of field names (e.g. "Id") to include in API
  9978. // requests with the JSON null value. By default, fields with empty
  9979. // values are omitted from API requests. However, any field with an
  9980. // empty value appearing in NullFields will be sent to the server as
  9981. // null. It is an error if a field in this list has a non-empty value.
  9982. // This may be used to include null fields in Patch requests.
  9983. NullFields []string `json:"-"`
  9984. }
  9985. func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  9986. type NoMethod InstanceGroupsListInstances
  9987. raw := NoMethod(*s)
  9988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9989. }
  9990. // InstanceGroupsListInstancesWarning: [Output Only] Informational
  9991. // warning message.
  9992. type InstanceGroupsListInstancesWarning struct {
  9993. // Code: [Output Only] A warning code, if applicable. For example,
  9994. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  9995. // the response.
  9996. //
  9997. // Possible values:
  9998. // "CLEANUP_FAILED"
  9999. // "DEPRECATED_RESOURCE_USED"
  10000. // "DEPRECATED_TYPE_USED"
  10001. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10002. // "EXPERIMENTAL_TYPE_USED"
  10003. // "EXTERNAL_API_WARNING"
  10004. // "FIELD_VALUE_OVERRIDEN"
  10005. // "INJECTED_KERNELS_DEPRECATED"
  10006. // "MISSING_TYPE_DEPENDENCY"
  10007. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10008. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10009. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10010. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10011. // "NEXT_HOP_NOT_RUNNING"
  10012. // "NOT_CRITICAL_ERROR"
  10013. // "NO_RESULTS_ON_PAGE"
  10014. // "REQUIRED_TOS_AGREEMENT"
  10015. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10016. // "RESOURCE_NOT_DELETED"
  10017. // "SCHEMA_VALIDATION_IGNORED"
  10018. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10019. // "UNDECLARED_PROPERTIES"
  10020. // "UNREACHABLE"
  10021. Code string `json:"code,omitempty"`
  10022. // Data: [Output Only] Metadata about this warning in key: value format.
  10023. // For example:
  10024. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10025. Data []*InstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  10026. // Message: [Output Only] A human-readable description of the warning
  10027. // code.
  10028. Message string `json:"message,omitempty"`
  10029. // ForceSendFields is a list of field names (e.g. "Code") to
  10030. // unconditionally include in API requests. By default, fields with
  10031. // empty values are omitted from API requests. However, any non-pointer,
  10032. // non-interface field appearing in ForceSendFields will be sent to the
  10033. // server regardless of whether the field is empty or not. This may be
  10034. // used to include empty fields in Patch requests.
  10035. ForceSendFields []string `json:"-"`
  10036. // NullFields is a list of field names (e.g. "Code") to include in API
  10037. // requests with the JSON null value. By default, fields with empty
  10038. // values are omitted from API requests. However, any field with an
  10039. // empty value appearing in NullFields will be sent to the server as
  10040. // null. It is an error if a field in this list has a non-empty value.
  10041. // This may be used to include null fields in Patch requests.
  10042. NullFields []string `json:"-"`
  10043. }
  10044. func (s *InstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  10045. type NoMethod InstanceGroupsListInstancesWarning
  10046. raw := NoMethod(*s)
  10047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10048. }
  10049. type InstanceGroupsListInstancesWarningData struct {
  10050. // Key: [Output Only] A key that provides more detail on the warning
  10051. // being returned. For example, for warnings where there are no results
  10052. // in a list request for a particular zone, this key might be scope and
  10053. // the key value might be the zone name. Other examples might be a key
  10054. // indicating a deprecated resource and a suggested replacement, or a
  10055. // warning about invalid network settings (for example, if an instance
  10056. // attempts to perform IP forwarding but is not enabled for IP
  10057. // forwarding).
  10058. Key string `json:"key,omitempty"`
  10059. // Value: [Output Only] A warning data value corresponding to the key.
  10060. Value string `json:"value,omitempty"`
  10061. // ForceSendFields is a list of field names (e.g. "Key") to
  10062. // unconditionally include in API requests. By default, fields with
  10063. // empty values are omitted from API requests. However, any non-pointer,
  10064. // non-interface field appearing in ForceSendFields will be sent to the
  10065. // server regardless of whether the field is empty or not. This may be
  10066. // used to include empty fields in Patch requests.
  10067. ForceSendFields []string `json:"-"`
  10068. // NullFields is a list of field names (e.g. "Key") to include in API
  10069. // requests with the JSON null value. By default, fields with empty
  10070. // values are omitted from API requests. However, any field with an
  10071. // empty value appearing in NullFields will be sent to the server as
  10072. // null. It is an error if a field in this list has a non-empty value.
  10073. // This may be used to include null fields in Patch requests.
  10074. NullFields []string `json:"-"`
  10075. }
  10076. func (s *InstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  10077. type NoMethod InstanceGroupsListInstancesWarningData
  10078. raw := NoMethod(*s)
  10079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10080. }
  10081. type InstanceGroupsListInstancesRequest struct {
  10082. // InstanceState: A filter for the state of the instances in the
  10083. // instance group. Valid options are ALL or RUNNING. If you do not
  10084. // specify this parameter the list includes all instances regardless of
  10085. // their state.
  10086. //
  10087. // Possible values:
  10088. // "ALL"
  10089. // "RUNNING"
  10090. InstanceState string `json:"instanceState,omitempty"`
  10091. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  10092. // unconditionally include in API requests. By default, fields with
  10093. // empty values are omitted from API requests. However, any non-pointer,
  10094. // non-interface field appearing in ForceSendFields will be sent to the
  10095. // server regardless of whether the field is empty or not. This may be
  10096. // used to include empty fields in Patch requests.
  10097. ForceSendFields []string `json:"-"`
  10098. // NullFields is a list of field names (e.g. "InstanceState") to include
  10099. // in API requests with the JSON null value. By default, fields with
  10100. // empty values are omitted from API requests. However, any field with
  10101. // an empty value appearing in NullFields will be sent to the server as
  10102. // null. It is an error if a field in this list has a non-empty value.
  10103. // This may be used to include null fields in Patch requests.
  10104. NullFields []string `json:"-"`
  10105. }
  10106. func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  10107. type NoMethod InstanceGroupsListInstancesRequest
  10108. raw := NoMethod(*s)
  10109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10110. }
  10111. type InstanceGroupsRemoveInstancesRequest struct {
  10112. // Instances: The list of instances to remove from the instance group.
  10113. Instances []*InstanceReference `json:"instances,omitempty"`
  10114. // ForceSendFields is a list of field names (e.g. "Instances") to
  10115. // unconditionally include in API requests. By default, fields with
  10116. // empty values are omitted from API requests. However, any non-pointer,
  10117. // non-interface field appearing in ForceSendFields will be sent to the
  10118. // server regardless of whether the field is empty or not. This may be
  10119. // used to include empty fields in Patch requests.
  10120. ForceSendFields []string `json:"-"`
  10121. // NullFields is a list of field names (e.g. "Instances") to include in
  10122. // API requests with the JSON null value. By default, fields with empty
  10123. // values are omitted from API requests. However, any field with an
  10124. // empty value appearing in NullFields will be sent to the server as
  10125. // null. It is an error if a field in this list has a non-empty value.
  10126. // This may be used to include null fields in Patch requests.
  10127. NullFields []string `json:"-"`
  10128. }
  10129. func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) {
  10130. type NoMethod InstanceGroupsRemoveInstancesRequest
  10131. raw := NoMethod(*s)
  10132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10133. }
  10134. type InstanceGroupsScopedList struct {
  10135. // InstanceGroups: [Output Only] The list of instance groups that are
  10136. // contained in this scope.
  10137. InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"`
  10138. // Warning: [Output Only] An informational warning that replaces the
  10139. // list of instance groups when the list is empty.
  10140. Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"`
  10141. // ForceSendFields is a list of field names (e.g. "InstanceGroups") to
  10142. // unconditionally include in API requests. By default, fields with
  10143. // empty values are omitted from API requests. However, any non-pointer,
  10144. // non-interface field appearing in ForceSendFields will be sent to the
  10145. // server regardless of whether the field is empty or not. This may be
  10146. // used to include empty fields in Patch requests.
  10147. ForceSendFields []string `json:"-"`
  10148. // NullFields is a list of field names (e.g. "InstanceGroups") to
  10149. // include in API requests with the JSON null value. By default, fields
  10150. // with empty values are omitted from API requests. However, any field
  10151. // with an empty value appearing in NullFields will be sent to the
  10152. // server as null. It is an error if a field in this list has a
  10153. // non-empty value. This may be used to include null fields in Patch
  10154. // requests.
  10155. NullFields []string `json:"-"`
  10156. }
  10157. func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) {
  10158. type NoMethod InstanceGroupsScopedList
  10159. raw := NoMethod(*s)
  10160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10161. }
  10162. // InstanceGroupsScopedListWarning: [Output Only] An informational
  10163. // warning that replaces the list of instance groups when the list is
  10164. // empty.
  10165. type InstanceGroupsScopedListWarning struct {
  10166. // Code: [Output Only] A warning code, if applicable. For example,
  10167. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10168. // the response.
  10169. //
  10170. // Possible values:
  10171. // "CLEANUP_FAILED"
  10172. // "DEPRECATED_RESOURCE_USED"
  10173. // "DEPRECATED_TYPE_USED"
  10174. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10175. // "EXPERIMENTAL_TYPE_USED"
  10176. // "EXTERNAL_API_WARNING"
  10177. // "FIELD_VALUE_OVERRIDEN"
  10178. // "INJECTED_KERNELS_DEPRECATED"
  10179. // "MISSING_TYPE_DEPENDENCY"
  10180. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10181. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10182. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10183. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10184. // "NEXT_HOP_NOT_RUNNING"
  10185. // "NOT_CRITICAL_ERROR"
  10186. // "NO_RESULTS_ON_PAGE"
  10187. // "REQUIRED_TOS_AGREEMENT"
  10188. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10189. // "RESOURCE_NOT_DELETED"
  10190. // "SCHEMA_VALIDATION_IGNORED"
  10191. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10192. // "UNDECLARED_PROPERTIES"
  10193. // "UNREACHABLE"
  10194. Code string `json:"code,omitempty"`
  10195. // Data: [Output Only] Metadata about this warning in key: value format.
  10196. // For example:
  10197. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10198. Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"`
  10199. // Message: [Output Only] A human-readable description of the warning
  10200. // code.
  10201. Message string `json:"message,omitempty"`
  10202. // ForceSendFields is a list of field names (e.g. "Code") to
  10203. // unconditionally include in API requests. By default, fields with
  10204. // empty values are omitted from API requests. However, any non-pointer,
  10205. // non-interface field appearing in ForceSendFields will be sent to the
  10206. // server regardless of whether the field is empty or not. This may be
  10207. // used to include empty fields in Patch requests.
  10208. ForceSendFields []string `json:"-"`
  10209. // NullFields is a list of field names (e.g. "Code") to include in API
  10210. // requests with the JSON null value. By default, fields with empty
  10211. // values are omitted from API requests. However, any field with an
  10212. // empty value appearing in NullFields will be sent to the server as
  10213. // null. It is an error if a field in this list has a non-empty value.
  10214. // This may be used to include null fields in Patch requests.
  10215. NullFields []string `json:"-"`
  10216. }
  10217. func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  10218. type NoMethod InstanceGroupsScopedListWarning
  10219. raw := NoMethod(*s)
  10220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10221. }
  10222. type InstanceGroupsScopedListWarningData struct {
  10223. // Key: [Output Only] A key that provides more detail on the warning
  10224. // being returned. For example, for warnings where there are no results
  10225. // in a list request for a particular zone, this key might be scope and
  10226. // the key value might be the zone name. Other examples might be a key
  10227. // indicating a deprecated resource and a suggested replacement, or a
  10228. // warning about invalid network settings (for example, if an instance
  10229. // attempts to perform IP forwarding but is not enabled for IP
  10230. // forwarding).
  10231. Key string `json:"key,omitempty"`
  10232. // Value: [Output Only] A warning data value corresponding to the key.
  10233. Value string `json:"value,omitempty"`
  10234. // ForceSendFields is a list of field names (e.g. "Key") to
  10235. // unconditionally include in API requests. By default, fields with
  10236. // empty values are omitted from API requests. However, any non-pointer,
  10237. // non-interface field appearing in ForceSendFields will be sent to the
  10238. // server regardless of whether the field is empty or not. This may be
  10239. // used to include empty fields in Patch requests.
  10240. ForceSendFields []string `json:"-"`
  10241. // NullFields is a list of field names (e.g. "Key") to include in API
  10242. // requests with the JSON null value. By default, fields with empty
  10243. // values are omitted from API requests. However, any field with an
  10244. // empty value appearing in NullFields will be sent to the server as
  10245. // null. It is an error if a field in this list has a non-empty value.
  10246. // This may be used to include null fields in Patch requests.
  10247. NullFields []string `json:"-"`
  10248. }
  10249. func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  10250. type NoMethod InstanceGroupsScopedListWarningData
  10251. raw := NoMethod(*s)
  10252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10253. }
  10254. type InstanceGroupsSetNamedPortsRequest struct {
  10255. // Fingerprint: The fingerprint of the named ports information for this
  10256. // instance group. Use this optional property to prevent conflicts when
  10257. // multiple users change the named ports settings concurrently. Obtain
  10258. // the fingerprint with the instanceGroups.get method. Then, include the
  10259. // fingerprint in your request to ensure that you do not overwrite
  10260. // changes that were applied from another concurrent request. A request
  10261. // with an incorrect fingerprint will fail with error 412
  10262. // conditionNotMet.
  10263. Fingerprint string `json:"fingerprint,omitempty"`
  10264. // NamedPorts: The list of named ports to set for this instance group.
  10265. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10266. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  10267. // unconditionally include in API requests. By default, fields with
  10268. // empty values are omitted from API requests. However, any non-pointer,
  10269. // non-interface field appearing in ForceSendFields will be sent to the
  10270. // server regardless of whether the field is empty or not. This may be
  10271. // used to include empty fields in Patch requests.
  10272. ForceSendFields []string `json:"-"`
  10273. // NullFields is a list of field names (e.g. "Fingerprint") to include
  10274. // in API requests with the JSON null value. By default, fields with
  10275. // empty values are omitted from API requests. However, any field with
  10276. // an empty value appearing in NullFields will be sent to the server as
  10277. // null. It is an error if a field in this list has a non-empty value.
  10278. // This may be used to include null fields in Patch requests.
  10279. NullFields []string `json:"-"`
  10280. }
  10281. func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  10282. type NoMethod InstanceGroupsSetNamedPortsRequest
  10283. raw := NoMethod(*s)
  10284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10285. }
  10286. // InstanceList: Contains a list of instances.
  10287. type InstanceList struct {
  10288. // Id: [Output Only] Unique identifier for the resource; defined by the
  10289. // server.
  10290. Id string `json:"id,omitempty"`
  10291. // Items: A list of Instance resources.
  10292. Items []*Instance `json:"items,omitempty"`
  10293. // Kind: [Output Only] Type of resource. Always compute#instanceList for
  10294. // lists of Instance resources.
  10295. Kind string `json:"kind,omitempty"`
  10296. // NextPageToken: [Output Only] This token allows you to get the next
  10297. // page of results for list requests. If the number of results is larger
  10298. // than maxResults, use the nextPageToken as a value for the query
  10299. // parameter pageToken in the next list request. Subsequent list
  10300. // requests will have their own nextPageToken to continue paging through
  10301. // the results.
  10302. NextPageToken string `json:"nextPageToken,omitempty"`
  10303. // SelfLink: [Output Only] Server-defined URL for this resource.
  10304. SelfLink string `json:"selfLink,omitempty"`
  10305. // Warning: [Output Only] Informational warning message.
  10306. Warning *InstanceListWarning `json:"warning,omitempty"`
  10307. // ServerResponse contains the HTTP response code and headers from the
  10308. // server.
  10309. googleapi.ServerResponse `json:"-"`
  10310. // ForceSendFields is a list of field names (e.g. "Id") to
  10311. // unconditionally include in API requests. By default, fields with
  10312. // empty values are omitted from API requests. However, any non-pointer,
  10313. // non-interface field appearing in ForceSendFields will be sent to the
  10314. // server regardless of whether the field is empty or not. This may be
  10315. // used to include empty fields in Patch requests.
  10316. ForceSendFields []string `json:"-"`
  10317. // NullFields is a list of field names (e.g. "Id") to include in API
  10318. // requests with the JSON null value. By default, fields with empty
  10319. // values are omitted from API requests. However, any field with an
  10320. // empty value appearing in NullFields will be sent to the server as
  10321. // null. It is an error if a field in this list has a non-empty value.
  10322. // This may be used to include null fields in Patch requests.
  10323. NullFields []string `json:"-"`
  10324. }
  10325. func (s *InstanceList) MarshalJSON() ([]byte, error) {
  10326. type NoMethod InstanceList
  10327. raw := NoMethod(*s)
  10328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10329. }
  10330. // InstanceListWarning: [Output Only] Informational warning message.
  10331. type InstanceListWarning struct {
  10332. // Code: [Output Only] A warning code, if applicable. For example,
  10333. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10334. // the response.
  10335. //
  10336. // Possible values:
  10337. // "CLEANUP_FAILED"
  10338. // "DEPRECATED_RESOURCE_USED"
  10339. // "DEPRECATED_TYPE_USED"
  10340. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10341. // "EXPERIMENTAL_TYPE_USED"
  10342. // "EXTERNAL_API_WARNING"
  10343. // "FIELD_VALUE_OVERRIDEN"
  10344. // "INJECTED_KERNELS_DEPRECATED"
  10345. // "MISSING_TYPE_DEPENDENCY"
  10346. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10347. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10348. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10349. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10350. // "NEXT_HOP_NOT_RUNNING"
  10351. // "NOT_CRITICAL_ERROR"
  10352. // "NO_RESULTS_ON_PAGE"
  10353. // "REQUIRED_TOS_AGREEMENT"
  10354. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10355. // "RESOURCE_NOT_DELETED"
  10356. // "SCHEMA_VALIDATION_IGNORED"
  10357. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10358. // "UNDECLARED_PROPERTIES"
  10359. // "UNREACHABLE"
  10360. Code string `json:"code,omitempty"`
  10361. // Data: [Output Only] Metadata about this warning in key: value format.
  10362. // For example:
  10363. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10364. Data []*InstanceListWarningData `json:"data,omitempty"`
  10365. // Message: [Output Only] A human-readable description of the warning
  10366. // code.
  10367. Message string `json:"message,omitempty"`
  10368. // ForceSendFields is a list of field names (e.g. "Code") to
  10369. // unconditionally include in API requests. By default, fields with
  10370. // empty values are omitted from API requests. However, any non-pointer,
  10371. // non-interface field appearing in ForceSendFields will be sent to the
  10372. // server regardless of whether the field is empty or not. This may be
  10373. // used to include empty fields in Patch requests.
  10374. ForceSendFields []string `json:"-"`
  10375. // NullFields is a list of field names (e.g. "Code") to include in API
  10376. // requests with the JSON null value. By default, fields with empty
  10377. // values are omitted from API requests. However, any field with an
  10378. // empty value appearing in NullFields will be sent to the server as
  10379. // null. It is an error if a field in this list has a non-empty value.
  10380. // This may be used to include null fields in Patch requests.
  10381. NullFields []string `json:"-"`
  10382. }
  10383. func (s *InstanceListWarning) MarshalJSON() ([]byte, error) {
  10384. type NoMethod InstanceListWarning
  10385. raw := NoMethod(*s)
  10386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10387. }
  10388. type InstanceListWarningData struct {
  10389. // Key: [Output Only] A key that provides more detail on the warning
  10390. // being returned. For example, for warnings where there are no results
  10391. // in a list request for a particular zone, this key might be scope and
  10392. // the key value might be the zone name. Other examples might be a key
  10393. // indicating a deprecated resource and a suggested replacement, or a
  10394. // warning about invalid network settings (for example, if an instance
  10395. // attempts to perform IP forwarding but is not enabled for IP
  10396. // forwarding).
  10397. Key string `json:"key,omitempty"`
  10398. // Value: [Output Only] A warning data value corresponding to the key.
  10399. Value string `json:"value,omitempty"`
  10400. // ForceSendFields is a list of field names (e.g. "Key") to
  10401. // unconditionally include in API requests. By default, fields with
  10402. // empty values are omitted from API requests. However, any non-pointer,
  10403. // non-interface field appearing in ForceSendFields will be sent to the
  10404. // server regardless of whether the field is empty or not. This may be
  10405. // used to include empty fields in Patch requests.
  10406. ForceSendFields []string `json:"-"`
  10407. // NullFields is a list of field names (e.g. "Key") to include in API
  10408. // requests with the JSON null value. By default, fields with empty
  10409. // values are omitted from API requests. However, any field with an
  10410. // empty value appearing in NullFields will be sent to the server as
  10411. // null. It is an error if a field in this list has a non-empty value.
  10412. // This may be used to include null fields in Patch requests.
  10413. NullFields []string `json:"-"`
  10414. }
  10415. func (s *InstanceListWarningData) MarshalJSON() ([]byte, error) {
  10416. type NoMethod InstanceListWarningData
  10417. raw := NoMethod(*s)
  10418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10419. }
  10420. // InstanceListReferrers: Contains a list of instance referrers.
  10421. type InstanceListReferrers struct {
  10422. // Id: [Output Only] Unique identifier for the resource; defined by the
  10423. // server.
  10424. Id string `json:"id,omitempty"`
  10425. // Items: A list of Reference resources.
  10426. Items []*Reference `json:"items,omitempty"`
  10427. // Kind: [Output Only] Type of resource. Always
  10428. // compute#instanceListReferrers for lists of Instance referrers.
  10429. Kind string `json:"kind,omitempty"`
  10430. // NextPageToken: [Output Only] This token allows you to get the next
  10431. // page of results for list requests. If the number of results is larger
  10432. // than maxResults, use the nextPageToken as a value for the query
  10433. // parameter pageToken in the next list request. Subsequent list
  10434. // requests will have their own nextPageToken to continue paging through
  10435. // the results.
  10436. NextPageToken string `json:"nextPageToken,omitempty"`
  10437. // SelfLink: [Output Only] Server-defined URL for this resource.
  10438. SelfLink string `json:"selfLink,omitempty"`
  10439. // Warning: [Output Only] Informational warning message.
  10440. Warning *InstanceListReferrersWarning `json:"warning,omitempty"`
  10441. // ServerResponse contains the HTTP response code and headers from the
  10442. // server.
  10443. googleapi.ServerResponse `json:"-"`
  10444. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") 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 *InstanceListReferrers) MarshalJSON() ([]byte, error) {
  10460. type NoMethod InstanceListReferrers
  10461. raw := NoMethod(*s)
  10462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10463. }
  10464. // InstanceListReferrersWarning: [Output Only] Informational warning
  10465. // message.
  10466. type InstanceListReferrersWarning struct {
  10467. // Code: [Output Only] A warning code, if applicable. For example,
  10468. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10469. // the response.
  10470. //
  10471. // Possible values:
  10472. // "CLEANUP_FAILED"
  10473. // "DEPRECATED_RESOURCE_USED"
  10474. // "DEPRECATED_TYPE_USED"
  10475. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10476. // "EXPERIMENTAL_TYPE_USED"
  10477. // "EXTERNAL_API_WARNING"
  10478. // "FIELD_VALUE_OVERRIDEN"
  10479. // "INJECTED_KERNELS_DEPRECATED"
  10480. // "MISSING_TYPE_DEPENDENCY"
  10481. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10482. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10483. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10484. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10485. // "NEXT_HOP_NOT_RUNNING"
  10486. // "NOT_CRITICAL_ERROR"
  10487. // "NO_RESULTS_ON_PAGE"
  10488. // "REQUIRED_TOS_AGREEMENT"
  10489. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10490. // "RESOURCE_NOT_DELETED"
  10491. // "SCHEMA_VALIDATION_IGNORED"
  10492. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10493. // "UNDECLARED_PROPERTIES"
  10494. // "UNREACHABLE"
  10495. Code string `json:"code,omitempty"`
  10496. // Data: [Output Only] Metadata about this warning in key: value format.
  10497. // For example:
  10498. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10499. Data []*InstanceListReferrersWarningData `json:"data,omitempty"`
  10500. // Message: [Output Only] A human-readable description of the warning
  10501. // code.
  10502. Message string `json:"message,omitempty"`
  10503. // ForceSendFields is a list of field names (e.g. "Code") to
  10504. // unconditionally include in API requests. By default, fields with
  10505. // empty values are omitted from API requests. However, any non-pointer,
  10506. // non-interface field appearing in ForceSendFields will be sent to the
  10507. // server regardless of whether the field is empty or not. This may be
  10508. // used to include empty fields in Patch requests.
  10509. ForceSendFields []string `json:"-"`
  10510. // NullFields is a list of field names (e.g. "Code") to include in API
  10511. // requests with the JSON null value. By default, fields with empty
  10512. // values are omitted from API requests. However, any field with an
  10513. // empty value appearing in NullFields will be sent to the server as
  10514. // null. It is an error if a field in this list has a non-empty value.
  10515. // This may be used to include null fields in Patch requests.
  10516. NullFields []string `json:"-"`
  10517. }
  10518. func (s *InstanceListReferrersWarning) MarshalJSON() ([]byte, error) {
  10519. type NoMethod InstanceListReferrersWarning
  10520. raw := NoMethod(*s)
  10521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10522. }
  10523. type InstanceListReferrersWarningData struct {
  10524. // Key: [Output Only] A key that provides more detail on the warning
  10525. // being returned. For example, for warnings where there are no results
  10526. // in a list request for a particular zone, this key might be scope and
  10527. // the key value might be the zone name. Other examples might be a key
  10528. // indicating a deprecated resource and a suggested replacement, or a
  10529. // warning about invalid network settings (for example, if an instance
  10530. // attempts to perform IP forwarding but is not enabled for IP
  10531. // forwarding).
  10532. Key string `json:"key,omitempty"`
  10533. // Value: [Output Only] A warning data value corresponding to the key.
  10534. Value string `json:"value,omitempty"`
  10535. // ForceSendFields is a list of field names (e.g. "Key") to
  10536. // unconditionally include in API requests. By default, fields with
  10537. // empty values are omitted from API requests. However, any non-pointer,
  10538. // non-interface field appearing in ForceSendFields will be sent to the
  10539. // server regardless of whether the field is empty or not. This may be
  10540. // used to include empty fields in Patch requests.
  10541. ForceSendFields []string `json:"-"`
  10542. // NullFields is a list of field names (e.g. "Key") to include in API
  10543. // requests with the JSON null value. By default, fields with empty
  10544. // values are omitted from API requests. However, any field with an
  10545. // empty value appearing in NullFields will be sent to the server as
  10546. // null. It is an error if a field in this list has a non-empty value.
  10547. // This may be used to include null fields in Patch requests.
  10548. NullFields []string `json:"-"`
  10549. }
  10550. func (s *InstanceListReferrersWarningData) MarshalJSON() ([]byte, error) {
  10551. type NoMethod InstanceListReferrersWarningData
  10552. raw := NoMethod(*s)
  10553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10554. }
  10555. type InstanceMoveRequest struct {
  10556. // DestinationZone: The URL of the destination zone to move the
  10557. // instance. This can be a full or partial URL. For example, the
  10558. // following are all valid URLs to a zone:
  10559. // - https://www.googleapis.com/compute/v1/projects/project/zones/zone
  10560. //
  10561. // - projects/project/zones/zone
  10562. // - zones/zone
  10563. DestinationZone string `json:"destinationZone,omitempty"`
  10564. // TargetInstance: The URL of the target instance to move. This can be a
  10565. // full or partial URL. For example, the following are all valid URLs to
  10566. // an instance:
  10567. // -
  10568. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  10569. // - projects/project/zones/zone/instances/instance
  10570. // - zones/zone/instances/instance
  10571. TargetInstance string `json:"targetInstance,omitempty"`
  10572. // ForceSendFields is a list of field names (e.g. "DestinationZone") 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. "DestinationZone") to
  10580. // include in API requests with the JSON null value. By default, fields
  10581. // with empty values are omitted from API requests. However, any field
  10582. // with an empty value appearing in NullFields will be sent to the
  10583. // server as null. It is an error if a field in this list has a
  10584. // non-empty value. This may be used to include null fields in Patch
  10585. // requests.
  10586. NullFields []string `json:"-"`
  10587. }
  10588. func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) {
  10589. type NoMethod InstanceMoveRequest
  10590. raw := NoMethod(*s)
  10591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10592. }
  10593. type InstanceProperties struct {
  10594. // CanIpForward: Enables instances created based on this template to
  10595. // send packets with source IP addresses other than their own and
  10596. // receive packets with destination IP addresses other than their own.
  10597. // If these instances will be used as an IP gateway or it will be set as
  10598. // the next-hop in a Route resource, specify true. If unsure, leave this
  10599. // set to false. See the Enable IP forwarding documentation for more
  10600. // information.
  10601. CanIpForward bool `json:"canIpForward,omitempty"`
  10602. // Description: An optional text description for the instances that are
  10603. // created from this instance template.
  10604. Description string `json:"description,omitempty"`
  10605. // Disks: An array of disks that are associated with the instances that
  10606. // are created from this template.
  10607. Disks []*AttachedDisk `json:"disks,omitempty"`
  10608. // GuestAccelerators: A list of guest accelerator cards' type and count
  10609. // to use for instances created from the instance template.
  10610. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  10611. // Labels: Labels to apply to instances that are created from this
  10612. // template.
  10613. Labels map[string]string `json:"labels,omitempty"`
  10614. // MachineType: The machine type to use for instances that are created
  10615. // from this template.
  10616. MachineType string `json:"machineType,omitempty"`
  10617. // Metadata: The metadata key/value pairs to assign to instances that
  10618. // are created from this template. These pairs can consist of custom
  10619. // metadata or predefined keys. See Project and instance metadata for
  10620. // more information.
  10621. Metadata *Metadata `json:"metadata,omitempty"`
  10622. // MinCpuPlatform: Minimum cpu/platform to be used by this instance. The
  10623. // instance may be scheduled on the specified or newer cpu/platform.
  10624. // Applicable values are the friendly names of CPU platforms, such as
  10625. // minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy
  10626. // Bridge". For more information, read Specifying a Minimum CPU
  10627. // Platform.
  10628. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  10629. // NetworkInterfaces: An array of network access configurations for this
  10630. // interface.
  10631. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
  10632. // Scheduling: Specifies the scheduling options for the instances that
  10633. // are created from this template.
  10634. Scheduling *Scheduling `json:"scheduling,omitempty"`
  10635. // ServiceAccounts: A list of service accounts with specified scopes.
  10636. // Access tokens for these service accounts are available to the
  10637. // instances that are created from this template. Use metadata queries
  10638. // to obtain the access tokens for these instances.
  10639. ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
  10640. ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  10641. // Tags: A list of tags to apply to the instances that are created from
  10642. // this template. The tags identify valid sources or targets for network
  10643. // firewalls. The setTags method can modify this list of tags. Each tag
  10644. // within the list must comply with RFC1035.
  10645. Tags *Tags `json:"tags,omitempty"`
  10646. // ForceSendFields is a list of field names (e.g. "CanIpForward") to
  10647. // unconditionally include in API requests. By default, fields with
  10648. // empty values are omitted from API requests. However, any non-pointer,
  10649. // non-interface field appearing in ForceSendFields will be sent to the
  10650. // server regardless of whether the field is empty or not. This may be
  10651. // used to include empty fields in Patch requests.
  10652. ForceSendFields []string `json:"-"`
  10653. // NullFields is a list of field names (e.g. "CanIpForward") to include
  10654. // in API requests with the JSON null value. By default, fields with
  10655. // empty values are omitted from API requests. However, any field with
  10656. // an empty value appearing in NullFields will be sent to the server as
  10657. // null. It is an error if a field in this list has a non-empty value.
  10658. // This may be used to include null fields in Patch requests.
  10659. NullFields []string `json:"-"`
  10660. }
  10661. func (s *InstanceProperties) MarshalJSON() ([]byte, error) {
  10662. type NoMethod InstanceProperties
  10663. raw := NoMethod(*s)
  10664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10665. }
  10666. type InstanceReference struct {
  10667. // Instance: The URL for a specific instance.
  10668. Instance string `json:"instance,omitempty"`
  10669. // ForceSendFields is a list of field names (e.g. "Instance") to
  10670. // unconditionally include in API requests. By default, fields with
  10671. // empty values are omitted from API requests. However, any non-pointer,
  10672. // non-interface field appearing in ForceSendFields will be sent to the
  10673. // server regardless of whether the field is empty or not. This may be
  10674. // used to include empty fields in Patch requests.
  10675. ForceSendFields []string `json:"-"`
  10676. // NullFields is a list of field names (e.g. "Instance") to include in
  10677. // API requests with the JSON null value. By default, fields with empty
  10678. // values are omitted from API requests. However, any field with an
  10679. // empty value appearing in NullFields will be sent to the server as
  10680. // null. It is an error if a field in this list has a non-empty value.
  10681. // This may be used to include null fields in Patch requests.
  10682. NullFields []string `json:"-"`
  10683. }
  10684. func (s *InstanceReference) MarshalJSON() ([]byte, error) {
  10685. type NoMethod InstanceReference
  10686. raw := NoMethod(*s)
  10687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10688. }
  10689. // InstanceTemplate: An Instance Template resource. (== resource_for
  10690. // beta.instanceTemplates ==) (== resource_for v1.instanceTemplates ==)
  10691. type InstanceTemplate struct {
  10692. // CreationTimestamp: [Output Only] The creation timestamp for this
  10693. // instance template in RFC3339 text format.
  10694. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  10695. // Description: An optional description of this resource. Provide this
  10696. // property when you create the resource.
  10697. Description string `json:"description,omitempty"`
  10698. // Id: [Output Only] A unique identifier for this instance template. The
  10699. // server defines this identifier.
  10700. Id uint64 `json:"id,omitempty,string"`
  10701. // Kind: [Output Only] The resource type, which is always
  10702. // compute#instanceTemplate for instance templates.
  10703. Kind string `json:"kind,omitempty"`
  10704. // Name: Name of the resource; provided by the client when the resource
  10705. // is created. The name must be 1-63 characters long, and comply with
  10706. // RFC1035. Specifically, the name must be 1-63 characters long and
  10707. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  10708. // the first character must be a lowercase letter, and all following
  10709. // characters must be a dash, lowercase letter, or digit, except the
  10710. // last character, which cannot be a dash.
  10711. Name string `json:"name,omitempty"`
  10712. // Properties: The instance properties for this instance template.
  10713. Properties *InstanceProperties `json:"properties,omitempty"`
  10714. // SelfLink: [Output Only] The URL for this instance template. The
  10715. // server defines this URL.
  10716. SelfLink string `json:"selfLink,omitempty"`
  10717. // SourceInstance: The source instance used to create the template. You
  10718. // can provide this as a partial or full URL to the resource. For
  10719. // example, the following are valid values:
  10720. // -
  10721. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  10722. // - projects/project/zones/zone/instances/instance
  10723. SourceInstance string `json:"sourceInstance,omitempty"`
  10724. // SourceInstanceParams: The source instance params to use to create
  10725. // this instance template.
  10726. SourceInstanceParams *SourceInstanceParams `json:"sourceInstanceParams,omitempty"`
  10727. // ServerResponse contains the HTTP response code and headers from the
  10728. // server.
  10729. googleapi.ServerResponse `json:"-"`
  10730. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  10731. // to unconditionally include in API requests. By default, fields with
  10732. // empty values are omitted from API requests. However, any non-pointer,
  10733. // non-interface field appearing in ForceSendFields will be sent to the
  10734. // server regardless of whether the field is empty or not. This may be
  10735. // used to include empty fields in Patch requests.
  10736. ForceSendFields []string `json:"-"`
  10737. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  10738. // include in API requests with the JSON null value. By default, fields
  10739. // with empty values are omitted from API requests. However, any field
  10740. // with an empty value appearing in NullFields will be sent to the
  10741. // server as null. It is an error if a field in this list has a
  10742. // non-empty value. This may be used to include null fields in Patch
  10743. // requests.
  10744. NullFields []string `json:"-"`
  10745. }
  10746. func (s *InstanceTemplate) MarshalJSON() ([]byte, error) {
  10747. type NoMethod InstanceTemplate
  10748. raw := NoMethod(*s)
  10749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10750. }
  10751. // InstanceTemplateList: A list of instance templates.
  10752. type InstanceTemplateList struct {
  10753. // Id: [Output Only] Unique identifier for the resource; defined by the
  10754. // server.
  10755. Id string `json:"id,omitempty"`
  10756. // Items: A list of InstanceTemplate resources.
  10757. Items []*InstanceTemplate `json:"items,omitempty"`
  10758. // Kind: [Output Only] The resource type, which is always
  10759. // compute#instanceTemplatesListResponse for instance template lists.
  10760. Kind string `json:"kind,omitempty"`
  10761. // NextPageToken: [Output Only] This token allows you to get the next
  10762. // page of results for list requests. If the number of results is larger
  10763. // than maxResults, use the nextPageToken as a value for the query
  10764. // parameter pageToken in the next list request. Subsequent list
  10765. // requests will have their own nextPageToken to continue paging through
  10766. // the results.
  10767. NextPageToken string `json:"nextPageToken,omitempty"`
  10768. // SelfLink: [Output Only] Server-defined URL for this resource.
  10769. SelfLink string `json:"selfLink,omitempty"`
  10770. // Warning: [Output Only] Informational warning message.
  10771. Warning *InstanceTemplateListWarning `json:"warning,omitempty"`
  10772. // ServerResponse contains the HTTP response code and headers from the
  10773. // server.
  10774. googleapi.ServerResponse `json:"-"`
  10775. // ForceSendFields is a list of field names (e.g. "Id") to
  10776. // unconditionally include in API requests. By default, fields with
  10777. // empty values are omitted from API requests. However, any non-pointer,
  10778. // non-interface field appearing in ForceSendFields will be sent to the
  10779. // server regardless of whether the field is empty or not. This may be
  10780. // used to include empty fields in Patch requests.
  10781. ForceSendFields []string `json:"-"`
  10782. // NullFields is a list of field names (e.g. "Id") to include in API
  10783. // requests with the JSON null value. By default, fields with empty
  10784. // values are omitted from API requests. However, any field with an
  10785. // empty value appearing in NullFields will be sent to the server as
  10786. // null. It is an error if a field in this list has a non-empty value.
  10787. // This may be used to include null fields in Patch requests.
  10788. NullFields []string `json:"-"`
  10789. }
  10790. func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) {
  10791. type NoMethod InstanceTemplateList
  10792. raw := NoMethod(*s)
  10793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10794. }
  10795. // InstanceTemplateListWarning: [Output Only] Informational warning
  10796. // message.
  10797. type InstanceTemplateListWarning struct {
  10798. // Code: [Output Only] A warning code, if applicable. For example,
  10799. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10800. // the response.
  10801. //
  10802. // Possible values:
  10803. // "CLEANUP_FAILED"
  10804. // "DEPRECATED_RESOURCE_USED"
  10805. // "DEPRECATED_TYPE_USED"
  10806. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10807. // "EXPERIMENTAL_TYPE_USED"
  10808. // "EXTERNAL_API_WARNING"
  10809. // "FIELD_VALUE_OVERRIDEN"
  10810. // "INJECTED_KERNELS_DEPRECATED"
  10811. // "MISSING_TYPE_DEPENDENCY"
  10812. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10813. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10814. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10815. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10816. // "NEXT_HOP_NOT_RUNNING"
  10817. // "NOT_CRITICAL_ERROR"
  10818. // "NO_RESULTS_ON_PAGE"
  10819. // "REQUIRED_TOS_AGREEMENT"
  10820. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10821. // "RESOURCE_NOT_DELETED"
  10822. // "SCHEMA_VALIDATION_IGNORED"
  10823. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10824. // "UNDECLARED_PROPERTIES"
  10825. // "UNREACHABLE"
  10826. Code string `json:"code,omitempty"`
  10827. // Data: [Output Only] Metadata about this warning in key: value format.
  10828. // For example:
  10829. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10830. Data []*InstanceTemplateListWarningData `json:"data,omitempty"`
  10831. // Message: [Output Only] A human-readable description of the warning
  10832. // code.
  10833. Message string `json:"message,omitempty"`
  10834. // ForceSendFields is a list of field names (e.g. "Code") to
  10835. // unconditionally include in API requests. By default, fields with
  10836. // empty values are omitted from API requests. However, any non-pointer,
  10837. // non-interface field appearing in ForceSendFields will be sent to the
  10838. // server regardless of whether the field is empty or not. This may be
  10839. // used to include empty fields in Patch requests.
  10840. ForceSendFields []string `json:"-"`
  10841. // NullFields is a list of field names (e.g. "Code") to include in API
  10842. // requests with the JSON null value. By default, fields with empty
  10843. // values are omitted from API requests. However, any field with an
  10844. // empty value appearing in NullFields will be sent to the server as
  10845. // null. It is an error if a field in this list has a non-empty value.
  10846. // This may be used to include null fields in Patch requests.
  10847. NullFields []string `json:"-"`
  10848. }
  10849. func (s *InstanceTemplateListWarning) MarshalJSON() ([]byte, error) {
  10850. type NoMethod InstanceTemplateListWarning
  10851. raw := NoMethod(*s)
  10852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10853. }
  10854. type InstanceTemplateListWarningData struct {
  10855. // Key: [Output Only] A key that provides more detail on the warning
  10856. // being returned. For example, for warnings where there are no results
  10857. // in a list request for a particular zone, this key might be scope and
  10858. // the key value might be the zone name. Other examples might be a key
  10859. // indicating a deprecated resource and a suggested replacement, or a
  10860. // warning about invalid network settings (for example, if an instance
  10861. // attempts to perform IP forwarding but is not enabled for IP
  10862. // forwarding).
  10863. Key string `json:"key,omitempty"`
  10864. // Value: [Output Only] A warning data value corresponding to the key.
  10865. Value string `json:"value,omitempty"`
  10866. // ForceSendFields is a list of field names (e.g. "Key") to
  10867. // unconditionally include in API requests. By default, fields with
  10868. // empty values are omitted from API requests. However, any non-pointer,
  10869. // non-interface field appearing in ForceSendFields will be sent to the
  10870. // server regardless of whether the field is empty or not. This may be
  10871. // used to include empty fields in Patch requests.
  10872. ForceSendFields []string `json:"-"`
  10873. // NullFields is a list of field names (e.g. "Key") to include in API
  10874. // requests with the JSON null value. By default, fields with empty
  10875. // values are omitted from API requests. However, any field with an
  10876. // empty value appearing in NullFields will be sent to the server as
  10877. // null. It is an error if a field in this list has a non-empty value.
  10878. // This may be used to include null fields in Patch requests.
  10879. NullFields []string `json:"-"`
  10880. }
  10881. func (s *InstanceTemplateListWarningData) MarshalJSON() ([]byte, error) {
  10882. type NoMethod InstanceTemplateListWarningData
  10883. raw := NoMethod(*s)
  10884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10885. }
  10886. type InstanceWithNamedPorts struct {
  10887. // Instance: [Output Only] The URL of the instance.
  10888. Instance string `json:"instance,omitempty"`
  10889. // NamedPorts: [Output Only] The named ports that belong to this
  10890. // instance group.
  10891. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  10892. // Status: [Output Only] The status of the instance.
  10893. //
  10894. // Possible values:
  10895. // "PROVISIONING"
  10896. // "REPAIRING"
  10897. // "RUNNING"
  10898. // "STAGING"
  10899. // "STOPPED"
  10900. // "STOPPING"
  10901. // "SUSPENDED"
  10902. // "SUSPENDING"
  10903. // "TERMINATED"
  10904. Status string `json:"status,omitempty"`
  10905. // ForceSendFields is a list of field names (e.g. "Instance") to
  10906. // unconditionally include in API requests. By default, fields with
  10907. // empty values are omitted from API requests. However, any non-pointer,
  10908. // non-interface field appearing in ForceSendFields will be sent to the
  10909. // server regardless of whether the field is empty or not. This may be
  10910. // used to include empty fields in Patch requests.
  10911. ForceSendFields []string `json:"-"`
  10912. // NullFields is a list of field names (e.g. "Instance") to include in
  10913. // API requests with the JSON null value. By default, fields with empty
  10914. // values are omitted from API requests. However, any field with an
  10915. // empty value appearing in NullFields will be sent to the server as
  10916. // null. It is an error if a field in this list has a non-empty value.
  10917. // This may be used to include null fields in Patch requests.
  10918. NullFields []string `json:"-"`
  10919. }
  10920. func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) {
  10921. type NoMethod InstanceWithNamedPorts
  10922. raw := NoMethod(*s)
  10923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10924. }
  10925. type InstancesScopedList struct {
  10926. // Instances: [Output Only] A list of instances contained in this scope.
  10927. Instances []*Instance `json:"instances,omitempty"`
  10928. // Warning: [Output Only] Informational warning which replaces the list
  10929. // of instances when the list is empty.
  10930. Warning *InstancesScopedListWarning `json:"warning,omitempty"`
  10931. // ForceSendFields is a list of field names (e.g. "Instances") to
  10932. // unconditionally include in API requests. By default, fields with
  10933. // empty values are omitted from API requests. However, any non-pointer,
  10934. // non-interface field appearing in ForceSendFields will be sent to the
  10935. // server regardless of whether the field is empty or not. This may be
  10936. // used to include empty fields in Patch requests.
  10937. ForceSendFields []string `json:"-"`
  10938. // NullFields is a list of field names (e.g. "Instances") to include in
  10939. // API requests with the JSON null value. By default, fields with empty
  10940. // values are omitted from API requests. However, any field with an
  10941. // empty value appearing in NullFields will be sent to the server as
  10942. // null. It is an error if a field in this list has a non-empty value.
  10943. // This may be used to include null fields in Patch requests.
  10944. NullFields []string `json:"-"`
  10945. }
  10946. func (s *InstancesScopedList) MarshalJSON() ([]byte, error) {
  10947. type NoMethod InstancesScopedList
  10948. raw := NoMethod(*s)
  10949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10950. }
  10951. // InstancesScopedListWarning: [Output Only] Informational warning which
  10952. // replaces the list of instances when the list is empty.
  10953. type InstancesScopedListWarning struct {
  10954. // Code: [Output Only] A warning code, if applicable. For example,
  10955. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  10956. // the response.
  10957. //
  10958. // Possible values:
  10959. // "CLEANUP_FAILED"
  10960. // "DEPRECATED_RESOURCE_USED"
  10961. // "DEPRECATED_TYPE_USED"
  10962. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  10963. // "EXPERIMENTAL_TYPE_USED"
  10964. // "EXTERNAL_API_WARNING"
  10965. // "FIELD_VALUE_OVERRIDEN"
  10966. // "INJECTED_KERNELS_DEPRECATED"
  10967. // "MISSING_TYPE_DEPENDENCY"
  10968. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  10969. // "NEXT_HOP_CANNOT_IP_FORWARD"
  10970. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  10971. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  10972. // "NEXT_HOP_NOT_RUNNING"
  10973. // "NOT_CRITICAL_ERROR"
  10974. // "NO_RESULTS_ON_PAGE"
  10975. // "REQUIRED_TOS_AGREEMENT"
  10976. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  10977. // "RESOURCE_NOT_DELETED"
  10978. // "SCHEMA_VALIDATION_IGNORED"
  10979. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  10980. // "UNDECLARED_PROPERTIES"
  10981. // "UNREACHABLE"
  10982. Code string `json:"code,omitempty"`
  10983. // Data: [Output Only] Metadata about this warning in key: value format.
  10984. // For example:
  10985. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  10986. Data []*InstancesScopedListWarningData `json:"data,omitempty"`
  10987. // Message: [Output Only] A human-readable description of the warning
  10988. // code.
  10989. Message string `json:"message,omitempty"`
  10990. // ForceSendFields is a list of field names (e.g. "Code") to
  10991. // unconditionally include in API requests. By default, fields with
  10992. // empty values are omitted from API requests. However, any non-pointer,
  10993. // non-interface field appearing in ForceSendFields will be sent to the
  10994. // server regardless of whether the field is empty or not. This may be
  10995. // used to include empty fields in Patch requests.
  10996. ForceSendFields []string `json:"-"`
  10997. // NullFields is a list of field names (e.g. "Code") to include in API
  10998. // requests with the JSON null value. By default, fields with empty
  10999. // values are omitted from API requests. However, any field with an
  11000. // empty value appearing in NullFields will be sent to the server as
  11001. // null. It is an error if a field in this list has a non-empty value.
  11002. // This may be used to include null fields in Patch requests.
  11003. NullFields []string `json:"-"`
  11004. }
  11005. func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  11006. type NoMethod InstancesScopedListWarning
  11007. raw := NoMethod(*s)
  11008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11009. }
  11010. type InstancesScopedListWarningData struct {
  11011. // Key: [Output Only] A key that provides more detail on the warning
  11012. // being returned. For example, for warnings where there are no results
  11013. // in a list request for a particular zone, this key might be scope and
  11014. // the key value might be the zone name. Other examples might be a key
  11015. // indicating a deprecated resource and a suggested replacement, or a
  11016. // warning about invalid network settings (for example, if an instance
  11017. // attempts to perform IP forwarding but is not enabled for IP
  11018. // forwarding).
  11019. Key string `json:"key,omitempty"`
  11020. // Value: [Output Only] A warning data value corresponding to the key.
  11021. Value string `json:"value,omitempty"`
  11022. // ForceSendFields is a list of field names (e.g. "Key") to
  11023. // unconditionally include in API requests. By default, fields with
  11024. // empty values are omitted from API requests. However, any non-pointer,
  11025. // non-interface field appearing in ForceSendFields will be sent to the
  11026. // server regardless of whether the field is empty or not. This may be
  11027. // used to include empty fields in Patch requests.
  11028. ForceSendFields []string `json:"-"`
  11029. // NullFields is a list of field names (e.g. "Key") to include in API
  11030. // requests with the JSON null value. By default, fields with empty
  11031. // values are omitted from API requests. However, any field with an
  11032. // empty value appearing in NullFields will be sent to the server as
  11033. // null. It is an error if a field in this list has a non-empty value.
  11034. // This may be used to include null fields in Patch requests.
  11035. NullFields []string `json:"-"`
  11036. }
  11037. func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  11038. type NoMethod InstancesScopedListWarningData
  11039. raw := NoMethod(*s)
  11040. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11041. }
  11042. type InstancesSetLabelsRequest struct {
  11043. // LabelFingerprint: Fingerprint of the previous set of labels for this
  11044. // resource, used to prevent conflicts. Provide the latest fingerprint
  11045. // value when making a request to add or change labels.
  11046. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  11047. Labels map[string]string `json:"labels,omitempty"`
  11048. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  11049. // unconditionally include in API requests. By default, fields with
  11050. // empty values are omitted from API requests. However, any non-pointer,
  11051. // non-interface field appearing in ForceSendFields will be sent to the
  11052. // server regardless of whether the field is empty or not. This may be
  11053. // used to include empty fields in Patch requests.
  11054. ForceSendFields []string `json:"-"`
  11055. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  11056. // include in API requests with the JSON null value. By default, fields
  11057. // with empty values are omitted from API requests. However, any field
  11058. // with an empty value appearing in NullFields will be sent to the
  11059. // server as null. It is an error if a field in this list has a
  11060. // non-empty value. This may be used to include null fields in Patch
  11061. // requests.
  11062. NullFields []string `json:"-"`
  11063. }
  11064. func (s *InstancesSetLabelsRequest) MarshalJSON() ([]byte, error) {
  11065. type NoMethod InstancesSetLabelsRequest
  11066. raw := NoMethod(*s)
  11067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11068. }
  11069. type InstancesSetMachineResourcesRequest struct {
  11070. // GuestAccelerators: A list of the type and count of accelerator cards
  11071. // attached to the instance.
  11072. GuestAccelerators []*AcceleratorConfig `json:"guestAccelerators,omitempty"`
  11073. // ForceSendFields is a list of field names (e.g. "GuestAccelerators")
  11074. // to unconditionally include in API requests. By default, fields with
  11075. // empty values are omitted from API requests. However, any non-pointer,
  11076. // non-interface field appearing in ForceSendFields will be sent to the
  11077. // server regardless of whether the field is empty or not. This may be
  11078. // used to include empty fields in Patch requests.
  11079. ForceSendFields []string `json:"-"`
  11080. // NullFields is a list of field names (e.g. "GuestAccelerators") to
  11081. // include in API requests with the JSON null value. By default, fields
  11082. // with empty values are omitted from API requests. However, any field
  11083. // with an empty value appearing in NullFields will be sent to the
  11084. // server as null. It is an error if a field in this list has a
  11085. // non-empty value. This may be used to include null fields in Patch
  11086. // requests.
  11087. NullFields []string `json:"-"`
  11088. }
  11089. func (s *InstancesSetMachineResourcesRequest) MarshalJSON() ([]byte, error) {
  11090. type NoMethod InstancesSetMachineResourcesRequest
  11091. raw := NoMethod(*s)
  11092. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11093. }
  11094. type InstancesSetMachineTypeRequest struct {
  11095. // MachineType: Full or partial URL of the machine type resource. See
  11096. // Machine Types for a full list of machine types. For example:
  11097. // zones/us-central1-f/machineTypes/n1-standard-1
  11098. MachineType string `json:"machineType,omitempty"`
  11099. // ForceSendFields is a list of field names (e.g. "MachineType") to
  11100. // unconditionally include in API requests. By default, fields with
  11101. // empty values are omitted from API requests. However, any non-pointer,
  11102. // non-interface field appearing in ForceSendFields will be sent to the
  11103. // server regardless of whether the field is empty or not. This may be
  11104. // used to include empty fields in Patch requests.
  11105. ForceSendFields []string `json:"-"`
  11106. // NullFields is a list of field names (e.g. "MachineType") to include
  11107. // in API requests with the JSON null value. By default, fields with
  11108. // empty values are omitted from API requests. However, any field with
  11109. // an empty value appearing in NullFields will be sent to the server as
  11110. // null. It is an error if a field in this list has a non-empty value.
  11111. // This may be used to include null fields in Patch requests.
  11112. NullFields []string `json:"-"`
  11113. }
  11114. func (s *InstancesSetMachineTypeRequest) MarshalJSON() ([]byte, error) {
  11115. type NoMethod InstancesSetMachineTypeRequest
  11116. raw := NoMethod(*s)
  11117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11118. }
  11119. type InstancesSetMinCpuPlatformRequest struct {
  11120. // MinCpuPlatform: Minimum cpu/platform this instance should be started
  11121. // at.
  11122. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  11123. // ForceSendFields is a list of field names (e.g. "MinCpuPlatform") to
  11124. // unconditionally include in API requests. By default, fields with
  11125. // empty values are omitted from API requests. However, any non-pointer,
  11126. // non-interface field appearing in ForceSendFields will be sent to the
  11127. // server regardless of whether the field is empty or not. This may be
  11128. // used to include empty fields in Patch requests.
  11129. ForceSendFields []string `json:"-"`
  11130. // NullFields is a list of field names (e.g. "MinCpuPlatform") to
  11131. // include in API requests with the JSON null value. By default, fields
  11132. // with empty values are omitted from API requests. However, any field
  11133. // with an empty value appearing in NullFields will be sent to the
  11134. // server as null. It is an error if a field in this list has a
  11135. // non-empty value. This may be used to include null fields in Patch
  11136. // requests.
  11137. NullFields []string `json:"-"`
  11138. }
  11139. func (s *InstancesSetMinCpuPlatformRequest) MarshalJSON() ([]byte, error) {
  11140. type NoMethod InstancesSetMinCpuPlatformRequest
  11141. raw := NoMethod(*s)
  11142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11143. }
  11144. type InstancesSetServiceAccountRequest struct {
  11145. // Email: Email address of the service account.
  11146. Email string `json:"email,omitempty"`
  11147. // Scopes: The list of scopes to be made available for this service
  11148. // account.
  11149. Scopes []string `json:"scopes,omitempty"`
  11150. // ForceSendFields is a list of field names (e.g. "Email") to
  11151. // unconditionally include in API requests. By default, fields with
  11152. // empty values are omitted from API requests. However, any non-pointer,
  11153. // non-interface field appearing in ForceSendFields will be sent to the
  11154. // server regardless of whether the field is empty or not. This may be
  11155. // used to include empty fields in Patch requests.
  11156. ForceSendFields []string `json:"-"`
  11157. // NullFields is a list of field names (e.g. "Email") to include in API
  11158. // requests with the JSON null value. By default, fields with empty
  11159. // values are omitted from API requests. However, any field with an
  11160. // empty value appearing in NullFields will be sent to the server as
  11161. // null. It is an error if a field in this list has a non-empty value.
  11162. // This may be used to include null fields in Patch requests.
  11163. NullFields []string `json:"-"`
  11164. }
  11165. func (s *InstancesSetServiceAccountRequest) MarshalJSON() ([]byte, error) {
  11166. type NoMethod InstancesSetServiceAccountRequest
  11167. raw := NoMethod(*s)
  11168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11169. }
  11170. type InstancesStartWithEncryptionKeyRequest struct {
  11171. // Disks: Array of disks associated with this instance that are
  11172. // protected with a customer-supplied encryption key.
  11173. //
  11174. // In order to start the instance, the disk url and its corresponding
  11175. // key must be provided.
  11176. //
  11177. // If the disk is not protected with a customer-supplied encryption key
  11178. // it should not be specified.
  11179. Disks []*CustomerEncryptionKeyProtectedDisk `json:"disks,omitempty"`
  11180. // ForceSendFields is a list of field names (e.g. "Disks") to
  11181. // unconditionally include in API requests. By default, fields with
  11182. // empty values are omitted from API requests. However, any non-pointer,
  11183. // non-interface field appearing in ForceSendFields will be sent to the
  11184. // server regardless of whether the field is empty or not. This may be
  11185. // used to include empty fields in Patch requests.
  11186. ForceSendFields []string `json:"-"`
  11187. // NullFields is a list of field names (e.g. "Disks") to include in API
  11188. // requests with the JSON null value. By default, fields with empty
  11189. // values are omitted from API requests. However, any field with an
  11190. // empty value appearing in NullFields will be sent to the server as
  11191. // null. It is an error if a field in this list has a non-empty value.
  11192. // This may be used to include null fields in Patch requests.
  11193. NullFields []string `json:"-"`
  11194. }
  11195. func (s *InstancesStartWithEncryptionKeyRequest) MarshalJSON() ([]byte, error) {
  11196. type NoMethod InstancesStartWithEncryptionKeyRequest
  11197. raw := NoMethod(*s)
  11198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11199. }
  11200. // Interconnect: Represents an Interconnects resource. The Interconnects
  11201. // resource is a dedicated connection between Google's network and your
  11202. // on-premises network. For more information, see the Dedicated
  11203. // overview page. (== resource_for v1.interconnects ==) (== resource_for
  11204. // beta.interconnects ==)
  11205. type Interconnect struct {
  11206. // AdminEnabled: Administrative status of the interconnect. When this is
  11207. // set to true, the Interconnect is functional and can carry traffic.
  11208. // When set to false, no packets can be carried over the interconnect
  11209. // and no BGP routes are exchanged over it. By default, the status is
  11210. // set to true.
  11211. AdminEnabled bool `json:"adminEnabled,omitempty"`
  11212. // CircuitInfos: [Output Only] A list of CircuitInfo objects, that
  11213. // describe the individual circuits in this LAG.
  11214. CircuitInfos []*InterconnectCircuitInfo `json:"circuitInfos,omitempty"`
  11215. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11216. // format.
  11217. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11218. // CustomerName: Customer name, to put in the Letter of Authorization as
  11219. // the party authorized to request a crossconnect.
  11220. CustomerName string `json:"customerName,omitempty"`
  11221. // Description: An optional description of this resource. Provide this
  11222. // property when you create the resource.
  11223. Description string `json:"description,omitempty"`
  11224. // ExpectedOutages: [Output Only] A list of outages expected for this
  11225. // Interconnect.
  11226. ExpectedOutages []*InterconnectOutageNotification `json:"expectedOutages,omitempty"`
  11227. // GoogleIpAddress: [Output Only] IP address configured on the Google
  11228. // side of the Interconnect link. This can be used only for ping tests.
  11229. GoogleIpAddress string `json:"googleIpAddress,omitempty"`
  11230. // GoogleReferenceId: [Output Only] Google reference ID to be used when
  11231. // raising support tickets with Google or otherwise to debug backend
  11232. // connectivity issues.
  11233. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  11234. // Id: [Output Only] The unique identifier for the resource. This
  11235. // identifier is defined by the server.
  11236. Id uint64 `json:"id,omitempty,string"`
  11237. // InterconnectAttachments: [Output Only] A list of the URLs of all
  11238. // InterconnectAttachments configured to use this Interconnect.
  11239. InterconnectAttachments []string `json:"interconnectAttachments,omitempty"`
  11240. // InterconnectType: Type of interconnect, which can take one of the
  11241. // following values:
  11242. // - PARTNER: A partner-managed interconnection shared between customers
  11243. // though a partner.
  11244. // - DEDICATED: A dedicated physical interconnection with the customer.
  11245. // Note that a value IT_PRIVATE has been deprecated in favor of
  11246. // DEDICATED.
  11247. //
  11248. // Possible values:
  11249. // "DEDICATED"
  11250. // "IT_PRIVATE"
  11251. // "PARTNER"
  11252. InterconnectType string `json:"interconnectType,omitempty"`
  11253. // Kind: [Output Only] Type of the resource. Always compute#interconnect
  11254. // for interconnects.
  11255. Kind string `json:"kind,omitempty"`
  11256. // LinkType: Type of link requested, which can take one of the following
  11257. // values:
  11258. // - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics
  11259. // - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note
  11260. // that this field indicates the speed of each of the links in the
  11261. // bundle, not the speed of the entire bundle.
  11262. //
  11263. // Possible values:
  11264. // "LINK_TYPE_ETHERNET_10G_LR"
  11265. LinkType string `json:"linkType,omitempty"`
  11266. // Location: URL of the InterconnectLocation object that represents
  11267. // where this connection is to be provisioned.
  11268. Location string `json:"location,omitempty"`
  11269. // Name: Name of the resource. Provided by the client when the resource
  11270. // is created. The name must be 1-63 characters long, and comply with
  11271. // RFC1035. Specifically, the name must be 1-63 characters long and
  11272. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11273. // the first character must be a lowercase letter, and all following
  11274. // characters must be a dash, lowercase letter, or digit, except the
  11275. // last character, which cannot be a dash.
  11276. Name string `json:"name,omitempty"`
  11277. // NocContactEmail: Email address to contact the customer NOC for
  11278. // operations and maintenance notifications regarding this Interconnect.
  11279. // If specified, this will be used for notifications in addition to all
  11280. // other forms described, such as Stackdriver logs alerting and Cloud
  11281. // Notifications.
  11282. NocContactEmail string `json:"nocContactEmail,omitempty"`
  11283. // OperationalStatus: [Output Only] The current status of this
  11284. // Interconnect's functionality, which can take one of the following
  11285. // values:
  11286. // - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to
  11287. // use. Attachments may be provisioned on this Interconnect.
  11288. // - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No
  11289. // attachments may be provisioned on this Interconnect.
  11290. // - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal
  11291. // maintenance. No attachments may be provisioned or updated on this
  11292. // Interconnect.
  11293. //
  11294. // Possible values:
  11295. // "OS_ACTIVE"
  11296. // "OS_UNPROVISIONED"
  11297. OperationalStatus string `json:"operationalStatus,omitempty"`
  11298. // PeerIpAddress: [Output Only] IP address configured on the customer
  11299. // side of the Interconnect link. The customer should configure this IP
  11300. // address during turnup when prompted by Google NOC. This can be used
  11301. // only for ping tests.
  11302. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  11303. // ProvisionedLinkCount: [Output Only] Number of links actually
  11304. // provisioned in this interconnect.
  11305. ProvisionedLinkCount int64 `json:"provisionedLinkCount,omitempty"`
  11306. // RequestedLinkCount: Target number of physical links in the link
  11307. // bundle, as requested by the customer.
  11308. RequestedLinkCount int64 `json:"requestedLinkCount,omitempty"`
  11309. // SelfLink: [Output Only] Server-defined URL for the resource.
  11310. SelfLink string `json:"selfLink,omitempty"`
  11311. // State: [Output Only] The current state of Interconnect functionality,
  11312. // which can take one of the following values:
  11313. // - ACTIVE: The Interconnect is valid, turned up and ready to use.
  11314. // Attachments may be provisioned on this Interconnect.
  11315. // - UNPROVISIONED: The Interconnect has not completed turnup. No
  11316. // attachments may be provisioned on this Interconnect.
  11317. // - UNDER_MAINTENANCE: The Interconnect is undergoing internal
  11318. // maintenance. No attachments may be provisioned or updated on this
  11319. // Interconnect.
  11320. //
  11321. // Possible values:
  11322. // "ACTIVE"
  11323. // "UNPROVISIONED"
  11324. State string `json:"state,omitempty"`
  11325. // ServerResponse contains the HTTP response code and headers from the
  11326. // server.
  11327. googleapi.ServerResponse `json:"-"`
  11328. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  11329. // unconditionally include in API requests. By default, fields with
  11330. // empty values are omitted from API requests. However, any non-pointer,
  11331. // non-interface field appearing in ForceSendFields will be sent to the
  11332. // server regardless of whether the field is empty or not. This may be
  11333. // used to include empty fields in Patch requests.
  11334. ForceSendFields []string `json:"-"`
  11335. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  11336. // in API requests with the JSON null value. By default, fields with
  11337. // empty values are omitted from API requests. However, any field with
  11338. // an empty value appearing in NullFields will be sent to the server as
  11339. // null. It is an error if a field in this list has a non-empty value.
  11340. // This may be used to include null fields in Patch requests.
  11341. NullFields []string `json:"-"`
  11342. }
  11343. func (s *Interconnect) MarshalJSON() ([]byte, error) {
  11344. type NoMethod Interconnect
  11345. raw := NoMethod(*s)
  11346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11347. }
  11348. // InterconnectAttachment: Represents an InterconnectAttachment (VLAN
  11349. // attachment) resource. For more information, see Creating VLAN
  11350. // Attachments. (== resource_for beta.interconnectAttachments ==) (==
  11351. // resource_for v1.interconnectAttachments ==)
  11352. type InterconnectAttachment struct {
  11353. // AdminEnabled: Determines whether this Attachment will carry packets.
  11354. // Not present for PARTNER_PROVIDER.
  11355. AdminEnabled bool `json:"adminEnabled,omitempty"`
  11356. // Bandwidth: Provisioned bandwidth capacity for the interconnect
  11357. // attachment. For attachments of type DEDICATED, the user can set the
  11358. // bandwidth. For attachments of type PARTNER, the Google Partner that
  11359. // is operating the interconnect must set the bandwidth. Output only for
  11360. // PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can
  11361. // take one of the following values:
  11362. // - BPS_50M: 50 Mbit/s
  11363. // - BPS_100M: 100 Mbit/s
  11364. // - BPS_200M: 200 Mbit/s
  11365. // - BPS_300M: 300 Mbit/s
  11366. // - BPS_400M: 400 Mbit/s
  11367. // - BPS_500M: 500 Mbit/s
  11368. // - BPS_1G: 1 Gbit/s
  11369. // - BPS_2G: 2 Gbit/s
  11370. // - BPS_5G: 5 Gbit/s
  11371. // - BPS_10G: 10 Gbit/s
  11372. //
  11373. // Possible values:
  11374. // "BPS_100M"
  11375. // "BPS_10G"
  11376. // "BPS_1G"
  11377. // "BPS_200M"
  11378. // "BPS_2G"
  11379. // "BPS_300M"
  11380. // "BPS_400M"
  11381. // "BPS_500M"
  11382. // "BPS_50M"
  11383. // "BPS_5G"
  11384. Bandwidth string `json:"bandwidth,omitempty"`
  11385. // CandidateSubnets: Up to 16 candidate prefixes that can be used to
  11386. // restrict the allocation of cloudRouterIpAddress and
  11387. // customerRouterIpAddress for this attachment. All prefixes must be
  11388. // within link-local address space (169.254.0.0/16) and must be /29 or
  11389. // shorter (/28, /27, etc). Google will attempt to select an unused /29
  11390. // from the supplied candidate prefix(es). The request will fail if all
  11391. // possible /29s are in use on Google?s edge. If not supplied, Google
  11392. // will randomly select an unused /29 from all of link-local space.
  11393. CandidateSubnets []string `json:"candidateSubnets,omitempty"`
  11394. // CloudRouterIpAddress: [Output Only] IPv4 address + prefix length to
  11395. // be configured on Cloud Router Interface for this interconnect
  11396. // attachment.
  11397. CloudRouterIpAddress string `json:"cloudRouterIpAddress,omitempty"`
  11398. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  11399. // format.
  11400. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  11401. // CustomerRouterIpAddress: [Output Only] IPv4 address + prefix length
  11402. // to be configured on the customer router subinterface for this
  11403. // interconnect attachment.
  11404. CustomerRouterIpAddress string `json:"customerRouterIpAddress,omitempty"`
  11405. // Description: An optional description of this resource.
  11406. Description string `json:"description,omitempty"`
  11407. // EdgeAvailabilityDomain: Desired availability domain for the
  11408. // attachment. Only available for type PARTNER, at creation time, and
  11409. // can take one of the following values:
  11410. // - AVAILABILITY_DOMAIN_ANY
  11411. // - AVAILABILITY_DOMAIN_1
  11412. // - AVAILABILITY_DOMAIN_2 For improved reliability, customers should
  11413. // configure a pair of attachments, one per availability domain. The
  11414. // selected availability domain will be provided to the Partner via the
  11415. // pairing key, so that the provisioned circuit will lie in the
  11416. // specified domain. If not specified, the value will default to
  11417. // AVAILABILITY_DOMAIN_ANY.
  11418. //
  11419. // Possible values:
  11420. // "AVAILABILITY_DOMAIN_1"
  11421. // "AVAILABILITY_DOMAIN_2"
  11422. // "AVAILABILITY_DOMAIN_ANY"
  11423. EdgeAvailabilityDomain string `json:"edgeAvailabilityDomain,omitempty"`
  11424. // GoogleReferenceId: [Output Only] Google reference ID, to be used when
  11425. // raising support tickets with Google or otherwise to debug backend
  11426. // connectivity issues.
  11427. GoogleReferenceId string `json:"googleReferenceId,omitempty"`
  11428. // Id: [Output Only] The unique identifier for the resource. This
  11429. // identifier is defined by the server.
  11430. Id uint64 `json:"id,omitempty,string"`
  11431. // Interconnect: URL of the underlying Interconnect object that this
  11432. // attachment's traffic will traverse through.
  11433. Interconnect string `json:"interconnect,omitempty"`
  11434. // Kind: [Output Only] Type of the resource. Always
  11435. // compute#interconnectAttachment for interconnect attachments.
  11436. Kind string `json:"kind,omitempty"`
  11437. // Name: Name of the resource. Provided by the client when the resource
  11438. // is created. The name must be 1-63 characters long, and comply with
  11439. // RFC1035. Specifically, the name must be 1-63 characters long and
  11440. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  11441. // the first character must be a lowercase letter, and all following
  11442. // characters must be a dash, lowercase letter, or digit, except the
  11443. // last character, which cannot be a dash.
  11444. Name string `json:"name,omitempty"`
  11445. // OperationalStatus: [Output Only] The current status of whether or not
  11446. // this interconnect attachment is functional, which can take one of the
  11447. // following values:
  11448. // - OS_ACTIVE: The attachment has been turned up and is ready to use.
  11449. //
  11450. // - OS_UNPROVISIONED: The attachment is not ready to use yet, because
  11451. // turnup is not complete.
  11452. //
  11453. // Possible values:
  11454. // "OS_ACTIVE"
  11455. // "OS_UNPROVISIONED"
  11456. OperationalStatus string `json:"operationalStatus,omitempty"`
  11457. // PairingKey: [Output only for type PARTNER. Input only for
  11458. // PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier
  11459. // of an PARTNER attachment used to initiate provisioning with a
  11460. // selected partner. Of the form "XXXXX/region/domain"
  11461. PairingKey string `json:"pairingKey,omitempty"`
  11462. // PartnerAsn: Optional BGP ASN for the router supplied by a Layer 3
  11463. // Partner if they configured BGP on behalf of the customer. Output only
  11464. // for PARTNER type, input only for PARTNER_PROVIDER, not available for
  11465. // DEDICATED.
  11466. PartnerAsn int64 `json:"partnerAsn,omitempty,string"`
  11467. // PartnerMetadata: Informational metadata about Partner attachments
  11468. // from Partners to display to customers. Output only for for PARTNER
  11469. // type, mutable for PARTNER_PROVIDER, not available for DEDICATED.
  11470. PartnerMetadata *InterconnectAttachmentPartnerMetadata `json:"partnerMetadata,omitempty"`
  11471. // PrivateInterconnectInfo: [Output Only] Information specific to an
  11472. // InterconnectAttachment. This property is populated if the
  11473. // interconnect that this is attached to is of type DEDICATED.
  11474. PrivateInterconnectInfo *InterconnectAttachmentPrivateInfo `json:"privateInterconnectInfo,omitempty"`
  11475. // Region: [Output Only] URL of the region where the regional
  11476. // interconnect attachment resides. You must specify this field as part
  11477. // of the HTTP request URL. It is not settable as a field in the request
  11478. // body.
  11479. Region string `json:"region,omitempty"`
  11480. // Router: URL of the Cloud Router to be used for dynamic routing. This
  11481. // router must be in the same region as this InterconnectAttachment. The
  11482. // InterconnectAttachment will automatically connect the Interconnect to
  11483. // the network & region within which the Cloud Router is configured.
  11484. Router string `json:"router,omitempty"`
  11485. // SelfLink: [Output Only] Server-defined URL for the resource.
  11486. SelfLink string `json:"selfLink,omitempty"`
  11487. // State: [Output Only] The current state of this attachment's
  11488. // functionality. Enum values ACTIVE and UNPROVISIONED are shared by
  11489. // DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect
  11490. // attachments, while enum values PENDING_PARTNER,
  11491. // PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only
  11492. // PARTNER and PARTNER_PROVIDER interconnect attachments. This state can
  11493. // take one of the following values:
  11494. // - ACTIVE: The attachment has been turned up and is ready to use.
  11495. // - UNPROVISIONED: The attachment is not ready to use yet, because
  11496. // turnup is not complete.
  11497. // - PENDING_PARTNER: A newly-created PARTNER attachment that has not
  11498. // yet been configured on the Partner side.
  11499. // - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of
  11500. // provisioning after a PARTNER_PROVIDER attachment was created that
  11501. // references it.
  11502. // - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is
  11503. // waiting for a customer to activate it.
  11504. // - DEFUNCT: The attachment was deleted externally and is no longer
  11505. // functional. This could be because the associated Interconnect was
  11506. // removed, or because the other side of a Partner attachment was
  11507. // deleted.
  11508. //
  11509. // Possible values:
  11510. // "ACTIVE"
  11511. // "DEFUNCT"
  11512. // "PARTNER_REQUEST_RECEIVED"
  11513. // "PENDING_CUSTOMER"
  11514. // "PENDING_PARTNER"
  11515. // "STATE_UNSPECIFIED"
  11516. // "UNPROVISIONED"
  11517. State string `json:"state,omitempty"`
  11518. // Type: The type of interconnect attachment this is, which can take one
  11519. // of the following values:
  11520. // - DEDICATED: an attachment to a Dedicated Interconnect.
  11521. // - PARTNER: an attachment to a Partner Interconnect, created by the
  11522. // customer.
  11523. // - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created
  11524. // by the partner.
  11525. //
  11526. // Possible values:
  11527. // "DEDICATED"
  11528. // "PARTNER"
  11529. // "PARTNER_PROVIDER"
  11530. Type string `json:"type,omitempty"`
  11531. // VlanTag8021q: The IEEE 802.1Q VLAN tag for this attachment, in the
  11532. // range 2-4094. Only specified at creation time.
  11533. VlanTag8021q int64 `json:"vlanTag8021q,omitempty"`
  11534. // ServerResponse contains the HTTP response code and headers from the
  11535. // server.
  11536. googleapi.ServerResponse `json:"-"`
  11537. // ForceSendFields is a list of field names (e.g. "AdminEnabled") to
  11538. // unconditionally include in API requests. By default, fields with
  11539. // empty values are omitted from API requests. However, any non-pointer,
  11540. // non-interface field appearing in ForceSendFields will be sent to the
  11541. // server regardless of whether the field is empty or not. This may be
  11542. // used to include empty fields in Patch requests.
  11543. ForceSendFields []string `json:"-"`
  11544. // NullFields is a list of field names (e.g. "AdminEnabled") to include
  11545. // in API requests with the JSON null value. By default, fields with
  11546. // empty values are omitted from API requests. However, any field with
  11547. // an empty value appearing in NullFields will be sent to the server as
  11548. // null. It is an error if a field in this list has a non-empty value.
  11549. // This may be used to include null fields in Patch requests.
  11550. NullFields []string `json:"-"`
  11551. }
  11552. func (s *InterconnectAttachment) MarshalJSON() ([]byte, error) {
  11553. type NoMethod InterconnectAttachment
  11554. raw := NoMethod(*s)
  11555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11556. }
  11557. type InterconnectAttachmentAggregatedList struct {
  11558. // Id: [Output Only] Unique identifier for the resource; defined by the
  11559. // server.
  11560. Id string `json:"id,omitempty"`
  11561. // Items: A list of InterconnectAttachmentsScopedList resources.
  11562. Items map[string]InterconnectAttachmentsScopedList `json:"items,omitempty"`
  11563. // Kind: [Output Only] Type of resource. Always
  11564. // compute#interconnectAttachmentAggregatedList for aggregated lists of
  11565. // interconnect attachments.
  11566. Kind string `json:"kind,omitempty"`
  11567. // NextPageToken: [Output Only] This token allows you to get the next
  11568. // page of results for list requests. If the number of results is larger
  11569. // than maxResults, use the nextPageToken as a value for the query
  11570. // parameter pageToken in the next list request. Subsequent list
  11571. // requests will have their own nextPageToken to continue paging through
  11572. // the results.
  11573. NextPageToken string `json:"nextPageToken,omitempty"`
  11574. // SelfLink: [Output Only] Server-defined URL for this resource.
  11575. SelfLink string `json:"selfLink,omitempty"`
  11576. // Warning: [Output Only] Informational warning message.
  11577. Warning *InterconnectAttachmentAggregatedListWarning `json:"warning,omitempty"`
  11578. // ServerResponse contains the HTTP response code and headers from the
  11579. // server.
  11580. googleapi.ServerResponse `json:"-"`
  11581. // ForceSendFields is a list of field names (e.g. "Id") to
  11582. // unconditionally include in API requests. By default, fields with
  11583. // empty values are omitted from API requests. However, any non-pointer,
  11584. // non-interface field appearing in ForceSendFields will be sent to the
  11585. // server regardless of whether the field is empty or not. This may be
  11586. // used to include empty fields in Patch requests.
  11587. ForceSendFields []string `json:"-"`
  11588. // NullFields is a list of field names (e.g. "Id") to include in API
  11589. // requests with the JSON null value. By default, fields with empty
  11590. // values are omitted from API requests. However, any field with an
  11591. // empty value appearing in NullFields will be sent to the server as
  11592. // null. It is an error if a field in this list has a non-empty value.
  11593. // This may be used to include null fields in Patch requests.
  11594. NullFields []string `json:"-"`
  11595. }
  11596. func (s *InterconnectAttachmentAggregatedList) MarshalJSON() ([]byte, error) {
  11597. type NoMethod InterconnectAttachmentAggregatedList
  11598. raw := NoMethod(*s)
  11599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11600. }
  11601. // InterconnectAttachmentAggregatedListWarning: [Output Only]
  11602. // Informational warning message.
  11603. type InterconnectAttachmentAggregatedListWarning struct {
  11604. // Code: [Output Only] A warning code, if applicable. For example,
  11605. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11606. // the response.
  11607. //
  11608. // Possible values:
  11609. // "CLEANUP_FAILED"
  11610. // "DEPRECATED_RESOURCE_USED"
  11611. // "DEPRECATED_TYPE_USED"
  11612. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11613. // "EXPERIMENTAL_TYPE_USED"
  11614. // "EXTERNAL_API_WARNING"
  11615. // "FIELD_VALUE_OVERRIDEN"
  11616. // "INJECTED_KERNELS_DEPRECATED"
  11617. // "MISSING_TYPE_DEPENDENCY"
  11618. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11619. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11620. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11621. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11622. // "NEXT_HOP_NOT_RUNNING"
  11623. // "NOT_CRITICAL_ERROR"
  11624. // "NO_RESULTS_ON_PAGE"
  11625. // "REQUIRED_TOS_AGREEMENT"
  11626. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11627. // "RESOURCE_NOT_DELETED"
  11628. // "SCHEMA_VALIDATION_IGNORED"
  11629. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11630. // "UNDECLARED_PROPERTIES"
  11631. // "UNREACHABLE"
  11632. Code string `json:"code,omitempty"`
  11633. // Data: [Output Only] Metadata about this warning in key: value format.
  11634. // For example:
  11635. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11636. Data []*InterconnectAttachmentAggregatedListWarningData `json:"data,omitempty"`
  11637. // Message: [Output Only] A human-readable description of the warning
  11638. // code.
  11639. Message string `json:"message,omitempty"`
  11640. // ForceSendFields is a list of field names (e.g. "Code") to
  11641. // unconditionally include in API requests. By default, fields with
  11642. // empty values are omitted from API requests. However, any non-pointer,
  11643. // non-interface field appearing in ForceSendFields will be sent to the
  11644. // server regardless of whether the field is empty or not. This may be
  11645. // used to include empty fields in Patch requests.
  11646. ForceSendFields []string `json:"-"`
  11647. // NullFields is a list of field names (e.g. "Code") to include in API
  11648. // requests with the JSON null value. By default, fields with empty
  11649. // values are omitted from API requests. However, any field with an
  11650. // empty value appearing in NullFields will be sent to the server as
  11651. // null. It is an error if a field in this list has a non-empty value.
  11652. // This may be used to include null fields in Patch requests.
  11653. NullFields []string `json:"-"`
  11654. }
  11655. func (s *InterconnectAttachmentAggregatedListWarning) MarshalJSON() ([]byte, error) {
  11656. type NoMethod InterconnectAttachmentAggregatedListWarning
  11657. raw := NoMethod(*s)
  11658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11659. }
  11660. type InterconnectAttachmentAggregatedListWarningData struct {
  11661. // Key: [Output Only] A key that provides more detail on the warning
  11662. // being returned. For example, for warnings where there are no results
  11663. // in a list request for a particular zone, this key might be scope and
  11664. // the key value might be the zone name. Other examples might be a key
  11665. // indicating a deprecated resource and a suggested replacement, or a
  11666. // warning about invalid network settings (for example, if an instance
  11667. // attempts to perform IP forwarding but is not enabled for IP
  11668. // forwarding).
  11669. Key string `json:"key,omitempty"`
  11670. // Value: [Output Only] A warning data value corresponding to the key.
  11671. Value string `json:"value,omitempty"`
  11672. // ForceSendFields is a list of field names (e.g. "Key") to
  11673. // unconditionally include in API requests. By default, fields with
  11674. // empty values are omitted from API requests. However, any non-pointer,
  11675. // non-interface field appearing in ForceSendFields will be sent to the
  11676. // server regardless of whether the field is empty or not. This may be
  11677. // used to include empty fields in Patch requests.
  11678. ForceSendFields []string `json:"-"`
  11679. // NullFields is a list of field names (e.g. "Key") to include in API
  11680. // requests with the JSON null value. By default, fields with empty
  11681. // values are omitted from API requests. However, any field with an
  11682. // empty value appearing in NullFields will be sent to the server as
  11683. // null. It is an error if a field in this list has a non-empty value.
  11684. // This may be used to include null fields in Patch requests.
  11685. NullFields []string `json:"-"`
  11686. }
  11687. func (s *InterconnectAttachmentAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  11688. type NoMethod InterconnectAttachmentAggregatedListWarningData
  11689. raw := NoMethod(*s)
  11690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11691. }
  11692. // InterconnectAttachmentList: Response to the list request, and
  11693. // contains a list of interconnect attachments.
  11694. type InterconnectAttachmentList struct {
  11695. // Id: [Output Only] Unique identifier for the resource; defined by the
  11696. // server.
  11697. Id string `json:"id,omitempty"`
  11698. // Items: A list of InterconnectAttachment resources.
  11699. Items []*InterconnectAttachment `json:"items,omitempty"`
  11700. // Kind: [Output Only] Type of resource. Always
  11701. // compute#interconnectAttachmentList for lists of interconnect
  11702. // attachments.
  11703. Kind string `json:"kind,omitempty"`
  11704. // NextPageToken: [Output Only] This token allows you to get the next
  11705. // page of results for list requests. If the number of results is larger
  11706. // than maxResults, use the nextPageToken as a value for the query
  11707. // parameter pageToken in the next list request. Subsequent list
  11708. // requests will have their own nextPageToken to continue paging through
  11709. // the results.
  11710. NextPageToken string `json:"nextPageToken,omitempty"`
  11711. // SelfLink: [Output Only] Server-defined URL for this resource.
  11712. SelfLink string `json:"selfLink,omitempty"`
  11713. // Warning: [Output Only] Informational warning message.
  11714. Warning *InterconnectAttachmentListWarning `json:"warning,omitempty"`
  11715. // ServerResponse contains the HTTP response code and headers from the
  11716. // server.
  11717. googleapi.ServerResponse `json:"-"`
  11718. // ForceSendFields is a list of field names (e.g. "Id") to
  11719. // unconditionally include in API requests. By default, fields with
  11720. // empty values are omitted from API requests. However, any non-pointer,
  11721. // non-interface field appearing in ForceSendFields will be sent to the
  11722. // server regardless of whether the field is empty or not. This may be
  11723. // used to include empty fields in Patch requests.
  11724. ForceSendFields []string `json:"-"`
  11725. // NullFields is a list of field names (e.g. "Id") to include in API
  11726. // requests with the JSON null value. By default, fields with empty
  11727. // values are omitted from API requests. However, any field with an
  11728. // empty value appearing in NullFields will be sent to the server as
  11729. // null. It is an error if a field in this list has a non-empty value.
  11730. // This may be used to include null fields in Patch requests.
  11731. NullFields []string `json:"-"`
  11732. }
  11733. func (s *InterconnectAttachmentList) MarshalJSON() ([]byte, error) {
  11734. type NoMethod InterconnectAttachmentList
  11735. raw := NoMethod(*s)
  11736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11737. }
  11738. // InterconnectAttachmentListWarning: [Output Only] Informational
  11739. // warning message.
  11740. type InterconnectAttachmentListWarning struct {
  11741. // Code: [Output Only] A warning code, if applicable. For example,
  11742. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11743. // the response.
  11744. //
  11745. // Possible values:
  11746. // "CLEANUP_FAILED"
  11747. // "DEPRECATED_RESOURCE_USED"
  11748. // "DEPRECATED_TYPE_USED"
  11749. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11750. // "EXPERIMENTAL_TYPE_USED"
  11751. // "EXTERNAL_API_WARNING"
  11752. // "FIELD_VALUE_OVERRIDEN"
  11753. // "INJECTED_KERNELS_DEPRECATED"
  11754. // "MISSING_TYPE_DEPENDENCY"
  11755. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11756. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11757. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11758. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11759. // "NEXT_HOP_NOT_RUNNING"
  11760. // "NOT_CRITICAL_ERROR"
  11761. // "NO_RESULTS_ON_PAGE"
  11762. // "REQUIRED_TOS_AGREEMENT"
  11763. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11764. // "RESOURCE_NOT_DELETED"
  11765. // "SCHEMA_VALIDATION_IGNORED"
  11766. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11767. // "UNDECLARED_PROPERTIES"
  11768. // "UNREACHABLE"
  11769. Code string `json:"code,omitempty"`
  11770. // Data: [Output Only] Metadata about this warning in key: value format.
  11771. // For example:
  11772. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11773. Data []*InterconnectAttachmentListWarningData `json:"data,omitempty"`
  11774. // Message: [Output Only] A human-readable description of the warning
  11775. // code.
  11776. Message string `json:"message,omitempty"`
  11777. // ForceSendFields is a list of field names (e.g. "Code") to
  11778. // unconditionally include in API requests. By default, fields with
  11779. // empty values are omitted from API requests. However, any non-pointer,
  11780. // non-interface field appearing in ForceSendFields will be sent to the
  11781. // server regardless of whether the field is empty or not. This may be
  11782. // used to include empty fields in Patch requests.
  11783. ForceSendFields []string `json:"-"`
  11784. // NullFields is a list of field names (e.g. "Code") to include in API
  11785. // requests with the JSON null value. By default, fields with empty
  11786. // values are omitted from API requests. However, any field with an
  11787. // empty value appearing in NullFields will be sent to the server as
  11788. // null. It is an error if a field in this list has a non-empty value.
  11789. // This may be used to include null fields in Patch requests.
  11790. NullFields []string `json:"-"`
  11791. }
  11792. func (s *InterconnectAttachmentListWarning) MarshalJSON() ([]byte, error) {
  11793. type NoMethod InterconnectAttachmentListWarning
  11794. raw := NoMethod(*s)
  11795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11796. }
  11797. type InterconnectAttachmentListWarningData struct {
  11798. // Key: [Output Only] A key that provides more detail on the warning
  11799. // being returned. For example, for warnings where there are no results
  11800. // in a list request for a particular zone, this key might be scope and
  11801. // the key value might be the zone name. Other examples might be a key
  11802. // indicating a deprecated resource and a suggested replacement, or a
  11803. // warning about invalid network settings (for example, if an instance
  11804. // attempts to perform IP forwarding but is not enabled for IP
  11805. // forwarding).
  11806. Key string `json:"key,omitempty"`
  11807. // Value: [Output Only] A warning data value corresponding to the key.
  11808. Value string `json:"value,omitempty"`
  11809. // ForceSendFields is a list of field names (e.g. "Key") to
  11810. // unconditionally include in API requests. By default, fields with
  11811. // empty values are omitted from API requests. However, any non-pointer,
  11812. // non-interface field appearing in ForceSendFields will be sent to the
  11813. // server regardless of whether the field is empty or not. This may be
  11814. // used to include empty fields in Patch requests.
  11815. ForceSendFields []string `json:"-"`
  11816. // NullFields is a list of field names (e.g. "Key") to include in API
  11817. // requests with the JSON null value. By default, fields with empty
  11818. // values are omitted from API requests. However, any field with an
  11819. // empty value appearing in NullFields will be sent to the server as
  11820. // null. It is an error if a field in this list has a non-empty value.
  11821. // This may be used to include null fields in Patch requests.
  11822. NullFields []string `json:"-"`
  11823. }
  11824. func (s *InterconnectAttachmentListWarningData) MarshalJSON() ([]byte, error) {
  11825. type NoMethod InterconnectAttachmentListWarningData
  11826. raw := NoMethod(*s)
  11827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11828. }
  11829. // InterconnectAttachmentPartnerMetadata: Informational metadata about
  11830. // Partner attachments from Partners to display to customers. These
  11831. // fields are propagated from PARTNER_PROVIDER attachments to their
  11832. // corresponding PARTNER attachments.
  11833. type InterconnectAttachmentPartnerMetadata struct {
  11834. // InterconnectName: Plain text name of the Interconnect this attachment
  11835. // is connected to, as displayed in the Partner?s portal. For instance
  11836. // "Chicago 1". This value may be validated to match approved Partner
  11837. // values.
  11838. InterconnectName string `json:"interconnectName,omitempty"`
  11839. // PartnerName: Plain text name of the Partner providing this
  11840. // attachment. This value may be validated to match approved Partner
  11841. // values.
  11842. PartnerName string `json:"partnerName,omitempty"`
  11843. // PortalUrl: URL of the Partner?s portal for this Attachment. Partners
  11844. // may customise this to be a deep link to the specific resource on the
  11845. // Partner portal. This value may be validated to match approved Partner
  11846. // values.
  11847. PortalUrl string `json:"portalUrl,omitempty"`
  11848. // ForceSendFields is a list of field names (e.g. "InterconnectName") to
  11849. // unconditionally include in API requests. By default, fields with
  11850. // empty values are omitted from API requests. However, any non-pointer,
  11851. // non-interface field appearing in ForceSendFields will be sent to the
  11852. // server regardless of whether the field is empty or not. This may be
  11853. // used to include empty fields in Patch requests.
  11854. ForceSendFields []string `json:"-"`
  11855. // NullFields is a list of field names (e.g. "InterconnectName") to
  11856. // include in API requests with the JSON null value. By default, fields
  11857. // with empty values are omitted from API requests. However, any field
  11858. // with an empty value appearing in NullFields will be sent to the
  11859. // server as null. It is an error if a field in this list has a
  11860. // non-empty value. This may be used to include null fields in Patch
  11861. // requests.
  11862. NullFields []string `json:"-"`
  11863. }
  11864. func (s *InterconnectAttachmentPartnerMetadata) MarshalJSON() ([]byte, error) {
  11865. type NoMethod InterconnectAttachmentPartnerMetadata
  11866. raw := NoMethod(*s)
  11867. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11868. }
  11869. // InterconnectAttachmentPrivateInfo: Information for an interconnect
  11870. // attachment when this belongs to an interconnect of type DEDICATED.
  11871. type InterconnectAttachmentPrivateInfo struct {
  11872. // Tag8021q: [Output Only] 802.1q encapsulation tag to be used for
  11873. // traffic between Google and the customer, going to and from this
  11874. // network and region.
  11875. Tag8021q int64 `json:"tag8021q,omitempty"`
  11876. // ForceSendFields is a list of field names (e.g. "Tag8021q") to
  11877. // unconditionally include in API requests. By default, fields with
  11878. // empty values are omitted from API requests. However, any non-pointer,
  11879. // non-interface field appearing in ForceSendFields will be sent to the
  11880. // server regardless of whether the field is empty or not. This may be
  11881. // used to include empty fields in Patch requests.
  11882. ForceSendFields []string `json:"-"`
  11883. // NullFields is a list of field names (e.g. "Tag8021q") to include in
  11884. // API requests with the JSON null value. By default, fields with empty
  11885. // values are omitted from API requests. However, any field with an
  11886. // empty value appearing in NullFields will be sent to the server as
  11887. // null. It is an error if a field in this list has a non-empty value.
  11888. // This may be used to include null fields in Patch requests.
  11889. NullFields []string `json:"-"`
  11890. }
  11891. func (s *InterconnectAttachmentPrivateInfo) MarshalJSON() ([]byte, error) {
  11892. type NoMethod InterconnectAttachmentPrivateInfo
  11893. raw := NoMethod(*s)
  11894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11895. }
  11896. type InterconnectAttachmentsScopedList struct {
  11897. // InterconnectAttachments: A list of interconnect attachments contained
  11898. // in this scope.
  11899. InterconnectAttachments []*InterconnectAttachment `json:"interconnectAttachments,omitempty"`
  11900. // Warning: Informational warning which replaces the list of addresses
  11901. // when the list is empty.
  11902. Warning *InterconnectAttachmentsScopedListWarning `json:"warning,omitempty"`
  11903. // ForceSendFields is a list of field names (e.g.
  11904. // "InterconnectAttachments") to unconditionally include in API
  11905. // requests. By default, fields with empty values are omitted from API
  11906. // requests. However, any non-pointer, non-interface field appearing in
  11907. // ForceSendFields will be sent to the server regardless of whether the
  11908. // field is empty or not. This may be used to include empty fields in
  11909. // Patch requests.
  11910. ForceSendFields []string `json:"-"`
  11911. // NullFields is a list of field names (e.g. "InterconnectAttachments")
  11912. // to include in API requests with the JSON null value. By default,
  11913. // fields with empty values are omitted from API requests. However, any
  11914. // field with an empty value appearing in NullFields will be sent to the
  11915. // server as null. It is an error if a field in this list has a
  11916. // non-empty value. This may be used to include null fields in Patch
  11917. // requests.
  11918. NullFields []string `json:"-"`
  11919. }
  11920. func (s *InterconnectAttachmentsScopedList) MarshalJSON() ([]byte, error) {
  11921. type NoMethod InterconnectAttachmentsScopedList
  11922. raw := NoMethod(*s)
  11923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11924. }
  11925. // InterconnectAttachmentsScopedListWarning: Informational warning which
  11926. // replaces the list of addresses when the list is empty.
  11927. type InterconnectAttachmentsScopedListWarning struct {
  11928. // Code: [Output Only] A warning code, if applicable. For example,
  11929. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  11930. // the response.
  11931. //
  11932. // Possible values:
  11933. // "CLEANUP_FAILED"
  11934. // "DEPRECATED_RESOURCE_USED"
  11935. // "DEPRECATED_TYPE_USED"
  11936. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  11937. // "EXPERIMENTAL_TYPE_USED"
  11938. // "EXTERNAL_API_WARNING"
  11939. // "FIELD_VALUE_OVERRIDEN"
  11940. // "INJECTED_KERNELS_DEPRECATED"
  11941. // "MISSING_TYPE_DEPENDENCY"
  11942. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  11943. // "NEXT_HOP_CANNOT_IP_FORWARD"
  11944. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  11945. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  11946. // "NEXT_HOP_NOT_RUNNING"
  11947. // "NOT_CRITICAL_ERROR"
  11948. // "NO_RESULTS_ON_PAGE"
  11949. // "REQUIRED_TOS_AGREEMENT"
  11950. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  11951. // "RESOURCE_NOT_DELETED"
  11952. // "SCHEMA_VALIDATION_IGNORED"
  11953. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  11954. // "UNDECLARED_PROPERTIES"
  11955. // "UNREACHABLE"
  11956. Code string `json:"code,omitempty"`
  11957. // Data: [Output Only] Metadata about this warning in key: value format.
  11958. // For example:
  11959. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  11960. Data []*InterconnectAttachmentsScopedListWarningData `json:"data,omitempty"`
  11961. // Message: [Output Only] A human-readable description of the warning
  11962. // code.
  11963. Message string `json:"message,omitempty"`
  11964. // ForceSendFields is a list of field names (e.g. "Code") to
  11965. // unconditionally include in API requests. By default, fields with
  11966. // empty values are omitted from API requests. However, any non-pointer,
  11967. // non-interface field appearing in ForceSendFields will be sent to the
  11968. // server regardless of whether the field is empty or not. This may be
  11969. // used to include empty fields in Patch requests.
  11970. ForceSendFields []string `json:"-"`
  11971. // NullFields is a list of field names (e.g. "Code") to include in API
  11972. // requests with the JSON null value. By default, fields with empty
  11973. // values are omitted from API requests. However, any field with an
  11974. // empty value appearing in NullFields will be sent to the server as
  11975. // null. It is an error if a field in this list has a non-empty value.
  11976. // This may be used to include null fields in Patch requests.
  11977. NullFields []string `json:"-"`
  11978. }
  11979. func (s *InterconnectAttachmentsScopedListWarning) MarshalJSON() ([]byte, error) {
  11980. type NoMethod InterconnectAttachmentsScopedListWarning
  11981. raw := NoMethod(*s)
  11982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11983. }
  11984. type InterconnectAttachmentsScopedListWarningData struct {
  11985. // Key: [Output Only] A key that provides more detail on the warning
  11986. // being returned. For example, for warnings where there are no results
  11987. // in a list request for a particular zone, this key might be scope and
  11988. // the key value might be the zone name. Other examples might be a key
  11989. // indicating a deprecated resource and a suggested replacement, or a
  11990. // warning about invalid network settings (for example, if an instance
  11991. // attempts to perform IP forwarding but is not enabled for IP
  11992. // forwarding).
  11993. Key string `json:"key,omitempty"`
  11994. // Value: [Output Only] A warning data value corresponding to the key.
  11995. Value string `json:"value,omitempty"`
  11996. // ForceSendFields is a list of field names (e.g. "Key") to
  11997. // unconditionally include in API requests. By default, fields with
  11998. // empty values are omitted from API requests. However, any non-pointer,
  11999. // non-interface field appearing in ForceSendFields will be sent to the
  12000. // server regardless of whether the field is empty or not. This may be
  12001. // used to include empty fields in Patch requests.
  12002. ForceSendFields []string `json:"-"`
  12003. // NullFields is a list of field names (e.g. "Key") to include in API
  12004. // requests with the JSON null value. By default, fields with empty
  12005. // values are omitted from API requests. However, any field with an
  12006. // empty value appearing in NullFields will be sent to the server as
  12007. // null. It is an error if a field in this list has a non-empty value.
  12008. // This may be used to include null fields in Patch requests.
  12009. NullFields []string `json:"-"`
  12010. }
  12011. func (s *InterconnectAttachmentsScopedListWarningData) MarshalJSON() ([]byte, error) {
  12012. type NoMethod InterconnectAttachmentsScopedListWarningData
  12013. raw := NoMethod(*s)
  12014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12015. }
  12016. // InterconnectCircuitInfo: Describes a single physical circuit between
  12017. // the Customer and Google. CircuitInfo objects are created by Google,
  12018. // so all fields are output only. Next id: 4
  12019. type InterconnectCircuitInfo struct {
  12020. // CustomerDemarcId: Customer-side demarc ID for this circuit.
  12021. CustomerDemarcId string `json:"customerDemarcId,omitempty"`
  12022. // GoogleCircuitId: Google-assigned unique ID for this circuit. Assigned
  12023. // at circuit turn-up.
  12024. GoogleCircuitId string `json:"googleCircuitId,omitempty"`
  12025. // GoogleDemarcId: Google-side demarc ID for this circuit. Assigned at
  12026. // circuit turn-up and provided by Google to the customer in the LOA.
  12027. GoogleDemarcId string `json:"googleDemarcId,omitempty"`
  12028. // ForceSendFields is a list of field names (e.g. "CustomerDemarcId") to
  12029. // unconditionally include in API requests. By default, fields with
  12030. // empty values are omitted from API requests. However, any non-pointer,
  12031. // non-interface field appearing in ForceSendFields will be sent to the
  12032. // server regardless of whether the field is empty or not. This may be
  12033. // used to include empty fields in Patch requests.
  12034. ForceSendFields []string `json:"-"`
  12035. // NullFields is a list of field names (e.g. "CustomerDemarcId") to
  12036. // include in API requests with the JSON null value. By default, fields
  12037. // with empty values are omitted from API requests. However, any field
  12038. // with an empty value appearing in NullFields will be sent to the
  12039. // server as null. It is an error if a field in this list has a
  12040. // non-empty value. This may be used to include null fields in Patch
  12041. // requests.
  12042. NullFields []string `json:"-"`
  12043. }
  12044. func (s *InterconnectCircuitInfo) MarshalJSON() ([]byte, error) {
  12045. type NoMethod InterconnectCircuitInfo
  12046. raw := NoMethod(*s)
  12047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12048. }
  12049. // InterconnectDiagnostics: Diagnostics information about interconnect,
  12050. // contains detailed and current technical information about Google?s
  12051. // side of the connection.
  12052. type InterconnectDiagnostics struct {
  12053. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  12054. // describing individual neighbors currently seen by the Google router
  12055. // in the ARP cache for the Interconnect. This will be empty when the
  12056. // Interconnect is not bundled.
  12057. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  12058. // Links: A list of InterconnectDiagnostics.LinkStatus objects,
  12059. // describing the status for each link on the Interconnect.
  12060. Links []*InterconnectDiagnosticsLinkStatus `json:"links,omitempty"`
  12061. // MacAddress: The MAC address of the Interconnect's bundle interface.
  12062. MacAddress string `json:"macAddress,omitempty"`
  12063. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  12064. // unconditionally include in API requests. By default, fields with
  12065. // empty values are omitted from API requests. However, any non-pointer,
  12066. // non-interface field appearing in ForceSendFields will be sent to the
  12067. // server regardless of whether the field is empty or not. This may be
  12068. // used to include empty fields in Patch requests.
  12069. ForceSendFields []string `json:"-"`
  12070. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  12071. // API requests with the JSON null value. By default, fields with empty
  12072. // values are omitted from API requests. However, any field with an
  12073. // empty value appearing in NullFields will be sent to the server as
  12074. // null. It is an error if a field in this list has a non-empty value.
  12075. // This may be used to include null fields in Patch requests.
  12076. NullFields []string `json:"-"`
  12077. }
  12078. func (s *InterconnectDiagnostics) MarshalJSON() ([]byte, error) {
  12079. type NoMethod InterconnectDiagnostics
  12080. raw := NoMethod(*s)
  12081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12082. }
  12083. // InterconnectDiagnosticsARPEntry: Describing the ARP neighbor entries
  12084. // seen on this link
  12085. type InterconnectDiagnosticsARPEntry struct {
  12086. // IpAddress: The IP address of this ARP neighbor.
  12087. IpAddress string `json:"ipAddress,omitempty"`
  12088. // MacAddress: The MAC address of this ARP neighbor.
  12089. MacAddress string `json:"macAddress,omitempty"`
  12090. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  12091. // unconditionally include in API requests. By default, fields with
  12092. // empty values are omitted from API requests. However, any non-pointer,
  12093. // non-interface field appearing in ForceSendFields will be sent to the
  12094. // server regardless of whether the field is empty or not. This may be
  12095. // used to include empty fields in Patch requests.
  12096. ForceSendFields []string `json:"-"`
  12097. // NullFields is a list of field names (e.g. "IpAddress") to include in
  12098. // API requests with the JSON null value. By default, fields with empty
  12099. // values are omitted from API requests. However, any field with an
  12100. // empty value appearing in NullFields will be sent to the server as
  12101. // null. It is an error if a field in this list has a non-empty value.
  12102. // This may be used to include null fields in Patch requests.
  12103. NullFields []string `json:"-"`
  12104. }
  12105. func (s *InterconnectDiagnosticsARPEntry) MarshalJSON() ([]byte, error) {
  12106. type NoMethod InterconnectDiagnosticsARPEntry
  12107. raw := NoMethod(*s)
  12108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12109. }
  12110. type InterconnectDiagnosticsLinkLACPStatus struct {
  12111. // GoogleSystemId: System ID of the port on Google?s side of the LACP
  12112. // exchange.
  12113. GoogleSystemId string `json:"googleSystemId,omitempty"`
  12114. // NeighborSystemId: System ID of the port on the neighbor?s side of the
  12115. // LACP exchange.
  12116. NeighborSystemId string `json:"neighborSystemId,omitempty"`
  12117. // State: The state of a LACP link, which can take one of the following
  12118. // values:
  12119. // - ACTIVE: The link is configured and active within the bundle.
  12120. // - DETACHED: The link is not configured within the bundle. This means
  12121. // that the rest of the object should be empty.
  12122. //
  12123. // Possible values:
  12124. // "ACTIVE"
  12125. // "DETACHED"
  12126. State string `json:"state,omitempty"`
  12127. // ForceSendFields is a list of field names (e.g. "GoogleSystemId") to
  12128. // unconditionally include in API requests. By default, fields with
  12129. // empty values are omitted from API requests. However, any non-pointer,
  12130. // non-interface field appearing in ForceSendFields will be sent to the
  12131. // server regardless of whether the field is empty or not. This may be
  12132. // used to include empty fields in Patch requests.
  12133. ForceSendFields []string `json:"-"`
  12134. // NullFields is a list of field names (e.g. "GoogleSystemId") to
  12135. // include in API requests with the JSON null value. By default, fields
  12136. // with empty values are omitted from API requests. However, any field
  12137. // with an empty value appearing in NullFields will be sent to the
  12138. // server as null. It is an error if a field in this list has a
  12139. // non-empty value. This may be used to include null fields in Patch
  12140. // requests.
  12141. NullFields []string `json:"-"`
  12142. }
  12143. func (s *InterconnectDiagnosticsLinkLACPStatus) MarshalJSON() ([]byte, error) {
  12144. type NoMethod InterconnectDiagnosticsLinkLACPStatus
  12145. raw := NoMethod(*s)
  12146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12147. }
  12148. type InterconnectDiagnosticsLinkOpticalPower struct {
  12149. // State: The status of the current value when compared to the warning
  12150. // and alarm levels for the receiving or transmitting transceiver.
  12151. // Possible states include:
  12152. // - OK: The value has not crossed a warning threshold.
  12153. // - LOW_WARNING: The value has crossed below the low warning threshold.
  12154. //
  12155. // - HIGH_WARNING: The value has crossed above the high warning
  12156. // threshold.
  12157. // - LOW_ALARM: The value has crossed below the low alarm threshold.
  12158. // - HIGH_ALARM: The value has crossed above the high alarm threshold.
  12159. //
  12160. // Possible values:
  12161. // "HIGH_ALARM"
  12162. // "HIGH_WARNING"
  12163. // "LOW_ALARM"
  12164. // "LOW_WARNING"
  12165. // "OK"
  12166. State string `json:"state,omitempty"`
  12167. // Value: Value of the current receiving or transmitting optical power,
  12168. // read in dBm. Take a known good optical value, give it a 10% margin
  12169. // and trigger warnings relative to that value. In general, a -7dBm
  12170. // warning and a -11dBm alarm are good optical value estimates for most
  12171. // links.
  12172. Value float64 `json:"value,omitempty"`
  12173. // ForceSendFields is a list of field names (e.g. "State") to
  12174. // unconditionally include in API requests. By default, fields with
  12175. // empty values are omitted from API requests. However, any non-pointer,
  12176. // non-interface field appearing in ForceSendFields will be sent to the
  12177. // server regardless of whether the field is empty or not. This may be
  12178. // used to include empty fields in Patch requests.
  12179. ForceSendFields []string `json:"-"`
  12180. // NullFields is a list of field names (e.g. "State") to include in API
  12181. // requests with the JSON null value. By default, fields with empty
  12182. // values are omitted from API requests. However, any field with an
  12183. // empty value appearing in NullFields will be sent to the server as
  12184. // null. It is an error if a field in this list has a non-empty value.
  12185. // This may be used to include null fields in Patch requests.
  12186. NullFields []string `json:"-"`
  12187. }
  12188. func (s *InterconnectDiagnosticsLinkOpticalPower) MarshalJSON() ([]byte, error) {
  12189. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  12190. raw := NoMethod(*s)
  12191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12192. }
  12193. func (s *InterconnectDiagnosticsLinkOpticalPower) UnmarshalJSON(data []byte) error {
  12194. type NoMethod InterconnectDiagnosticsLinkOpticalPower
  12195. var s1 struct {
  12196. Value gensupport.JSONFloat64 `json:"value"`
  12197. *NoMethod
  12198. }
  12199. s1.NoMethod = (*NoMethod)(s)
  12200. if err := json.Unmarshal(data, &s1); err != nil {
  12201. return err
  12202. }
  12203. s.Value = float64(s1.Value)
  12204. return nil
  12205. }
  12206. type InterconnectDiagnosticsLinkStatus struct {
  12207. // ArpCaches: A list of InterconnectDiagnostics.ARPEntry objects,
  12208. // describing the ARP neighbor entries seen on this link. This will be
  12209. // empty if the link is bundled
  12210. ArpCaches []*InterconnectDiagnosticsARPEntry `json:"arpCaches,omitempty"`
  12211. // CircuitId: The unique ID for this link assigned during turn up by
  12212. // Google.
  12213. CircuitId string `json:"circuitId,omitempty"`
  12214. // GoogleDemarc: The Demarc address assigned by Google and provided in
  12215. // the LoA.
  12216. GoogleDemarc string `json:"googleDemarc,omitempty"`
  12217. LacpStatus *InterconnectDiagnosticsLinkLACPStatus `json:"lacpStatus,omitempty"`
  12218. // ReceivingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  12219. // object, describing the current value and status of the received light
  12220. // level.
  12221. ReceivingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"receivingOpticalPower,omitempty"`
  12222. // TransmittingOpticalPower: An InterconnectDiagnostics.LinkOpticalPower
  12223. // object, describing the current value and status of the transmitted
  12224. // light level.
  12225. TransmittingOpticalPower *InterconnectDiagnosticsLinkOpticalPower `json:"transmittingOpticalPower,omitempty"`
  12226. // ForceSendFields is a list of field names (e.g. "ArpCaches") to
  12227. // unconditionally include in API requests. By default, fields with
  12228. // empty values are omitted from API requests. However, any non-pointer,
  12229. // non-interface field appearing in ForceSendFields will be sent to the
  12230. // server regardless of whether the field is empty or not. This may be
  12231. // used to include empty fields in Patch requests.
  12232. ForceSendFields []string `json:"-"`
  12233. // NullFields is a list of field names (e.g. "ArpCaches") to include in
  12234. // API requests with the JSON null value. By default, fields with empty
  12235. // values are omitted from API requests. However, any field with an
  12236. // empty value appearing in NullFields will be sent to the server as
  12237. // null. It is an error if a field in this list has a non-empty value.
  12238. // This may be used to include null fields in Patch requests.
  12239. NullFields []string `json:"-"`
  12240. }
  12241. func (s *InterconnectDiagnosticsLinkStatus) MarshalJSON() ([]byte, error) {
  12242. type NoMethod InterconnectDiagnosticsLinkStatus
  12243. raw := NoMethod(*s)
  12244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12245. }
  12246. // InterconnectList: Response to the list request, and contains a list
  12247. // of interconnects.
  12248. type InterconnectList struct {
  12249. // Id: [Output Only] Unique identifier for the resource; defined by the
  12250. // server.
  12251. Id string `json:"id,omitempty"`
  12252. // Items: A list of Interconnect resources.
  12253. Items []*Interconnect `json:"items,omitempty"`
  12254. // Kind: [Output Only] Type of resource. Always compute#interconnectList
  12255. // for lists of interconnects.
  12256. Kind string `json:"kind,omitempty"`
  12257. // NextPageToken: [Output Only] This token allows you to get the next
  12258. // page of results for list requests. If the number of results is larger
  12259. // than maxResults, use the nextPageToken as a value for the query
  12260. // parameter pageToken in the next list request. Subsequent list
  12261. // requests will have their own nextPageToken to continue paging through
  12262. // the results.
  12263. NextPageToken string `json:"nextPageToken,omitempty"`
  12264. // SelfLink: [Output Only] Server-defined URL for this resource.
  12265. SelfLink string `json:"selfLink,omitempty"`
  12266. // Warning: [Output Only] Informational warning message.
  12267. Warning *InterconnectListWarning `json:"warning,omitempty"`
  12268. // ServerResponse contains the HTTP response code and headers from the
  12269. // server.
  12270. googleapi.ServerResponse `json:"-"`
  12271. // ForceSendFields is a list of field names (e.g. "Id") to
  12272. // unconditionally include in API requests. By default, fields with
  12273. // empty values are omitted from API requests. However, any non-pointer,
  12274. // non-interface field appearing in ForceSendFields will be sent to the
  12275. // server regardless of whether the field is empty or not. This may be
  12276. // used to include empty fields in Patch requests.
  12277. ForceSendFields []string `json:"-"`
  12278. // NullFields is a list of field names (e.g. "Id") to include in API
  12279. // requests with the JSON null value. By default, fields with empty
  12280. // values are omitted from API requests. However, any field with an
  12281. // empty value appearing in NullFields will be sent to the server as
  12282. // null. It is an error if a field in this list has a non-empty value.
  12283. // This may be used to include null fields in Patch requests.
  12284. NullFields []string `json:"-"`
  12285. }
  12286. func (s *InterconnectList) MarshalJSON() ([]byte, error) {
  12287. type NoMethod InterconnectList
  12288. raw := NoMethod(*s)
  12289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12290. }
  12291. // InterconnectListWarning: [Output Only] Informational warning message.
  12292. type InterconnectListWarning struct {
  12293. // Code: [Output Only] A warning code, if applicable. For example,
  12294. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12295. // the response.
  12296. //
  12297. // Possible values:
  12298. // "CLEANUP_FAILED"
  12299. // "DEPRECATED_RESOURCE_USED"
  12300. // "DEPRECATED_TYPE_USED"
  12301. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12302. // "EXPERIMENTAL_TYPE_USED"
  12303. // "EXTERNAL_API_WARNING"
  12304. // "FIELD_VALUE_OVERRIDEN"
  12305. // "INJECTED_KERNELS_DEPRECATED"
  12306. // "MISSING_TYPE_DEPENDENCY"
  12307. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12308. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12309. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12310. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12311. // "NEXT_HOP_NOT_RUNNING"
  12312. // "NOT_CRITICAL_ERROR"
  12313. // "NO_RESULTS_ON_PAGE"
  12314. // "REQUIRED_TOS_AGREEMENT"
  12315. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12316. // "RESOURCE_NOT_DELETED"
  12317. // "SCHEMA_VALIDATION_IGNORED"
  12318. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12319. // "UNDECLARED_PROPERTIES"
  12320. // "UNREACHABLE"
  12321. Code string `json:"code,omitempty"`
  12322. // Data: [Output Only] Metadata about this warning in key: value format.
  12323. // For example:
  12324. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12325. Data []*InterconnectListWarningData `json:"data,omitempty"`
  12326. // Message: [Output Only] A human-readable description of the warning
  12327. // code.
  12328. Message string `json:"message,omitempty"`
  12329. // ForceSendFields is a list of field names (e.g. "Code") to
  12330. // unconditionally include in API requests. By default, fields with
  12331. // empty values are omitted from API requests. However, any non-pointer,
  12332. // non-interface field appearing in ForceSendFields will be sent to the
  12333. // server regardless of whether the field is empty or not. This may be
  12334. // used to include empty fields in Patch requests.
  12335. ForceSendFields []string `json:"-"`
  12336. // NullFields is a list of field names (e.g. "Code") to include in API
  12337. // requests with the JSON null value. By default, fields with empty
  12338. // values are omitted from API requests. However, any field with an
  12339. // empty value appearing in NullFields will be sent to the server as
  12340. // null. It is an error if a field in this list has a non-empty value.
  12341. // This may be used to include null fields in Patch requests.
  12342. NullFields []string `json:"-"`
  12343. }
  12344. func (s *InterconnectListWarning) MarshalJSON() ([]byte, error) {
  12345. type NoMethod InterconnectListWarning
  12346. raw := NoMethod(*s)
  12347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12348. }
  12349. type InterconnectListWarningData struct {
  12350. // Key: [Output Only] A key that provides more detail on the warning
  12351. // being returned. For example, for warnings where there are no results
  12352. // in a list request for a particular zone, this key might be scope and
  12353. // the key value might be the zone name. Other examples might be a key
  12354. // indicating a deprecated resource and a suggested replacement, or a
  12355. // warning about invalid network settings (for example, if an instance
  12356. // attempts to perform IP forwarding but is not enabled for IP
  12357. // forwarding).
  12358. Key string `json:"key,omitempty"`
  12359. // Value: [Output Only] A warning data value corresponding to the key.
  12360. Value string `json:"value,omitempty"`
  12361. // ForceSendFields is a list of field names (e.g. "Key") to
  12362. // unconditionally include in API requests. By default, fields with
  12363. // empty values are omitted from API requests. However, any non-pointer,
  12364. // non-interface field appearing in ForceSendFields will be sent to the
  12365. // server regardless of whether the field is empty or not. This may be
  12366. // used to include empty fields in Patch requests.
  12367. ForceSendFields []string `json:"-"`
  12368. // NullFields is a list of field names (e.g. "Key") to include in API
  12369. // requests with the JSON null value. By default, fields with empty
  12370. // values are omitted from API requests. However, any field with an
  12371. // empty value appearing in NullFields will be sent to the server as
  12372. // null. It is an error if a field in this list has a non-empty value.
  12373. // This may be used to include null fields in Patch requests.
  12374. NullFields []string `json:"-"`
  12375. }
  12376. func (s *InterconnectListWarningData) MarshalJSON() ([]byte, error) {
  12377. type NoMethod InterconnectListWarningData
  12378. raw := NoMethod(*s)
  12379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12380. }
  12381. // InterconnectLocation: Represents an InterconnectLocations resource.
  12382. // The InterconnectLocations resource describes the locations where you
  12383. // can connect to Google's networks. For more information, see
  12384. // Colocation Facilities.
  12385. type InterconnectLocation struct {
  12386. // Address: [Output Only] The postal address of the Point of Presence,
  12387. // each line in the address is separated by a newline character.
  12388. Address string `json:"address,omitempty"`
  12389. // AvailabilityZone: [Output Only] Availability zone for this
  12390. // InterconnectLocation. Within a metropolitan area (metro), maintenance
  12391. // will not be simultaneously scheduled in more than one availability
  12392. // zone. Example: "zone1" or "zone2".
  12393. AvailabilityZone string `json:"availabilityZone,omitempty"`
  12394. // City: [Output Only] Metropolitan area designator that indicates which
  12395. // city an interconnect is located. For example: "Chicago, IL",
  12396. // "Amsterdam, Netherlands".
  12397. City string `json:"city,omitempty"`
  12398. // Continent: [Output Only] Continent for this location, which can take
  12399. // one of the following values:
  12400. // - AFRICA
  12401. // - ASIA_PAC
  12402. // - EUROPE
  12403. // - NORTH_AMERICA
  12404. // - SOUTH_AMERICA
  12405. //
  12406. // Possible values:
  12407. // "AFRICA"
  12408. // "ASIA_PAC"
  12409. // "C_AFRICA"
  12410. // "C_ASIA_PAC"
  12411. // "C_EUROPE"
  12412. // "C_NORTH_AMERICA"
  12413. // "C_SOUTH_AMERICA"
  12414. // "EUROPE"
  12415. // "NORTH_AMERICA"
  12416. // "SOUTH_AMERICA"
  12417. Continent string `json:"continent,omitempty"`
  12418. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12419. // format.
  12420. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12421. // Description: [Output Only] An optional description of the resource.
  12422. Description string `json:"description,omitempty"`
  12423. // FacilityProvider: [Output Only] The name of the provider for this
  12424. // facility (e.g., EQUINIX).
  12425. FacilityProvider string `json:"facilityProvider,omitempty"`
  12426. // FacilityProviderFacilityId: [Output Only] A provider-assigned
  12427. // Identifier for this facility (e.g., Ashburn-DC1).
  12428. FacilityProviderFacilityId string `json:"facilityProviderFacilityId,omitempty"`
  12429. // Id: [Output Only] The unique identifier for the resource. This
  12430. // identifier is defined by the server.
  12431. Id uint64 `json:"id,omitempty,string"`
  12432. // Kind: [Output Only] Type of the resource. Always
  12433. // compute#interconnectLocation for interconnect locations.
  12434. Kind string `json:"kind,omitempty"`
  12435. // Name: [Output Only] Name of the resource.
  12436. Name string `json:"name,omitempty"`
  12437. // PeeringdbFacilityId: [Output Only] The peeringdb identifier for this
  12438. // facility (corresponding with a netfac type in peeringdb).
  12439. PeeringdbFacilityId string `json:"peeringdbFacilityId,omitempty"`
  12440. // RegionInfos: [Output Only] A list of InterconnectLocation.RegionInfo
  12441. // objects, that describe parameters pertaining to the relation between
  12442. // this InterconnectLocation and various Google Cloud regions.
  12443. RegionInfos []*InterconnectLocationRegionInfo `json:"regionInfos,omitempty"`
  12444. // SelfLink: [Output Only] Server-defined URL for the resource.
  12445. SelfLink string `json:"selfLink,omitempty"`
  12446. // Status: [Output Only] The status of this InterconnectLocation, which
  12447. // can take one of the following values:
  12448. // - CLOSED: The InterconnectLocation is closed and is unavailable for
  12449. // provisioning new Interconnects.
  12450. // - AVAILABLE: The InterconnectLocation is available for provisioning
  12451. // new Interconnects.
  12452. //
  12453. // Possible values:
  12454. // "AVAILABLE"
  12455. // "CLOSED"
  12456. Status string `json:"status,omitempty"`
  12457. // ServerResponse contains the HTTP response code and headers from the
  12458. // server.
  12459. googleapi.ServerResponse `json:"-"`
  12460. // ForceSendFields is a list of field names (e.g. "Address") to
  12461. // unconditionally include in API requests. By default, fields with
  12462. // empty values are omitted from API requests. However, any non-pointer,
  12463. // non-interface field appearing in ForceSendFields will be sent to the
  12464. // server regardless of whether the field is empty or not. This may be
  12465. // used to include empty fields in Patch requests.
  12466. ForceSendFields []string `json:"-"`
  12467. // NullFields is a list of field names (e.g. "Address") to include in
  12468. // API requests with the JSON null value. By default, fields with empty
  12469. // values are omitted from API requests. However, any field with an
  12470. // empty value appearing in NullFields will be sent to the server as
  12471. // null. It is an error if a field in this list has a non-empty value.
  12472. // This may be used to include null fields in Patch requests.
  12473. NullFields []string `json:"-"`
  12474. }
  12475. func (s *InterconnectLocation) MarshalJSON() ([]byte, error) {
  12476. type NoMethod InterconnectLocation
  12477. raw := NoMethod(*s)
  12478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12479. }
  12480. // InterconnectLocationList: Response to the list request, and contains
  12481. // a list of interconnect locations.
  12482. type InterconnectLocationList struct {
  12483. // Id: [Output Only] Unique identifier for the resource; defined by the
  12484. // server.
  12485. Id string `json:"id,omitempty"`
  12486. // Items: A list of InterconnectLocation resources.
  12487. Items []*InterconnectLocation `json:"items,omitempty"`
  12488. // Kind: [Output Only] Type of resource. Always
  12489. // compute#interconnectLocationList for lists of interconnect locations.
  12490. Kind string `json:"kind,omitempty"`
  12491. // NextPageToken: [Output Only] This token allows you to get the next
  12492. // page of results for list requests. If the number of results is larger
  12493. // than maxResults, use the nextPageToken as a value for the query
  12494. // parameter pageToken in the next list request. Subsequent list
  12495. // requests will have their own nextPageToken to continue paging through
  12496. // the results.
  12497. NextPageToken string `json:"nextPageToken,omitempty"`
  12498. // SelfLink: [Output Only] Server-defined URL for this resource.
  12499. SelfLink string `json:"selfLink,omitempty"`
  12500. // Warning: [Output Only] Informational warning message.
  12501. Warning *InterconnectLocationListWarning `json:"warning,omitempty"`
  12502. // ServerResponse contains the HTTP response code and headers from the
  12503. // server.
  12504. googleapi.ServerResponse `json:"-"`
  12505. // ForceSendFields is a list of field names (e.g. "Id") to
  12506. // unconditionally include in API requests. By default, fields with
  12507. // empty values are omitted from API requests. However, any non-pointer,
  12508. // non-interface field appearing in ForceSendFields will be sent to the
  12509. // server regardless of whether the field is empty or not. This may be
  12510. // used to include empty fields in Patch requests.
  12511. ForceSendFields []string `json:"-"`
  12512. // NullFields is a list of field names (e.g. "Id") to include in API
  12513. // requests with the JSON null value. By default, fields with empty
  12514. // values are omitted from API requests. However, any field with an
  12515. // empty value appearing in NullFields will be sent to the server as
  12516. // null. It is an error if a field in this list has a non-empty value.
  12517. // This may be used to include null fields in Patch requests.
  12518. NullFields []string `json:"-"`
  12519. }
  12520. func (s *InterconnectLocationList) MarshalJSON() ([]byte, error) {
  12521. type NoMethod InterconnectLocationList
  12522. raw := NoMethod(*s)
  12523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12524. }
  12525. // InterconnectLocationListWarning: [Output Only] Informational warning
  12526. // message.
  12527. type InterconnectLocationListWarning struct {
  12528. // Code: [Output Only] A warning code, if applicable. For example,
  12529. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12530. // the response.
  12531. //
  12532. // Possible values:
  12533. // "CLEANUP_FAILED"
  12534. // "DEPRECATED_RESOURCE_USED"
  12535. // "DEPRECATED_TYPE_USED"
  12536. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12537. // "EXPERIMENTAL_TYPE_USED"
  12538. // "EXTERNAL_API_WARNING"
  12539. // "FIELD_VALUE_OVERRIDEN"
  12540. // "INJECTED_KERNELS_DEPRECATED"
  12541. // "MISSING_TYPE_DEPENDENCY"
  12542. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12543. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12544. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12545. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12546. // "NEXT_HOP_NOT_RUNNING"
  12547. // "NOT_CRITICAL_ERROR"
  12548. // "NO_RESULTS_ON_PAGE"
  12549. // "REQUIRED_TOS_AGREEMENT"
  12550. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12551. // "RESOURCE_NOT_DELETED"
  12552. // "SCHEMA_VALIDATION_IGNORED"
  12553. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12554. // "UNDECLARED_PROPERTIES"
  12555. // "UNREACHABLE"
  12556. Code string `json:"code,omitempty"`
  12557. // Data: [Output Only] Metadata about this warning in key: value format.
  12558. // For example:
  12559. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12560. Data []*InterconnectLocationListWarningData `json:"data,omitempty"`
  12561. // Message: [Output Only] A human-readable description of the warning
  12562. // code.
  12563. Message string `json:"message,omitempty"`
  12564. // ForceSendFields is a list of field names (e.g. "Code") to
  12565. // unconditionally include in API requests. By default, fields with
  12566. // empty values are omitted from API requests. However, any non-pointer,
  12567. // non-interface field appearing in ForceSendFields will be sent to the
  12568. // server regardless of whether the field is empty or not. This may be
  12569. // used to include empty fields in Patch requests.
  12570. ForceSendFields []string `json:"-"`
  12571. // NullFields is a list of field names (e.g. "Code") to include in API
  12572. // requests with the JSON null value. By default, fields with empty
  12573. // values are omitted from API requests. However, any field with an
  12574. // empty value appearing in NullFields will be sent to the server as
  12575. // null. It is an error if a field in this list has a non-empty value.
  12576. // This may be used to include null fields in Patch requests.
  12577. NullFields []string `json:"-"`
  12578. }
  12579. func (s *InterconnectLocationListWarning) MarshalJSON() ([]byte, error) {
  12580. type NoMethod InterconnectLocationListWarning
  12581. raw := NoMethod(*s)
  12582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12583. }
  12584. type InterconnectLocationListWarningData struct {
  12585. // Key: [Output Only] A key that provides more detail on the warning
  12586. // being returned. For example, for warnings where there are no results
  12587. // in a list request for a particular zone, this key might be scope and
  12588. // the key value might be the zone name. Other examples might be a key
  12589. // indicating a deprecated resource and a suggested replacement, or a
  12590. // warning about invalid network settings (for example, if an instance
  12591. // attempts to perform IP forwarding but is not enabled for IP
  12592. // forwarding).
  12593. Key string `json:"key,omitempty"`
  12594. // Value: [Output Only] A warning data value corresponding to the key.
  12595. Value string `json:"value,omitempty"`
  12596. // ForceSendFields is a list of field names (e.g. "Key") to
  12597. // unconditionally include in API requests. By default, fields with
  12598. // empty values are omitted from API requests. However, any non-pointer,
  12599. // non-interface field appearing in ForceSendFields will be sent to the
  12600. // server regardless of whether the field is empty or not. This may be
  12601. // used to include empty fields in Patch requests.
  12602. ForceSendFields []string `json:"-"`
  12603. // NullFields is a list of field names (e.g. "Key") to include in API
  12604. // requests with the JSON null value. By default, fields with empty
  12605. // values are omitted from API requests. However, any field with an
  12606. // empty value appearing in NullFields will be sent to the server as
  12607. // null. It is an error if a field in this list has a non-empty value.
  12608. // This may be used to include null fields in Patch requests.
  12609. NullFields []string `json:"-"`
  12610. }
  12611. func (s *InterconnectLocationListWarningData) MarshalJSON() ([]byte, error) {
  12612. type NoMethod InterconnectLocationListWarningData
  12613. raw := NoMethod(*s)
  12614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12615. }
  12616. // InterconnectLocationRegionInfo: Information about any potential
  12617. // InterconnectAttachments between an Interconnect at a specific
  12618. // InterconnectLocation, and a specific Cloud Region.
  12619. type InterconnectLocationRegionInfo struct {
  12620. // ExpectedRttMs: Expected round-trip time in milliseconds, from this
  12621. // InterconnectLocation to a VM in this region.
  12622. ExpectedRttMs int64 `json:"expectedRttMs,omitempty,string"`
  12623. // LocationPresence: Identifies the network presence of this location.
  12624. //
  12625. // Possible values:
  12626. // "GLOBAL"
  12627. // "LOCAL_REGION"
  12628. // "LP_GLOBAL"
  12629. // "LP_LOCAL_REGION"
  12630. LocationPresence string `json:"locationPresence,omitempty"`
  12631. // Region: URL for the region of this location.
  12632. Region string `json:"region,omitempty"`
  12633. // ForceSendFields is a list of field names (e.g. "ExpectedRttMs") to
  12634. // unconditionally include in API requests. By default, fields with
  12635. // empty values are omitted from API requests. However, any non-pointer,
  12636. // non-interface field appearing in ForceSendFields will be sent to the
  12637. // server regardless of whether the field is empty or not. This may be
  12638. // used to include empty fields in Patch requests.
  12639. ForceSendFields []string `json:"-"`
  12640. // NullFields is a list of field names (e.g. "ExpectedRttMs") to include
  12641. // in API requests with the JSON null value. By default, fields with
  12642. // empty values are omitted from API requests. However, any field with
  12643. // an empty value appearing in NullFields will be sent to the server as
  12644. // null. It is an error if a field in this list has a non-empty value.
  12645. // This may be used to include null fields in Patch requests.
  12646. NullFields []string `json:"-"`
  12647. }
  12648. func (s *InterconnectLocationRegionInfo) MarshalJSON() ([]byte, error) {
  12649. type NoMethod InterconnectLocationRegionInfo
  12650. raw := NoMethod(*s)
  12651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12652. }
  12653. // InterconnectOutageNotification: Description of a planned outage on
  12654. // this Interconnect. Next id: 9
  12655. type InterconnectOutageNotification struct {
  12656. // AffectedCircuits: If issue_type is IT_PARTIAL_OUTAGE, a list of the
  12657. // Google-side circuit IDs that will be affected.
  12658. AffectedCircuits []string `json:"affectedCircuits,omitempty"`
  12659. // Description: A description about the purpose of the outage.
  12660. Description string `json:"description,omitempty"`
  12661. // EndTime: Scheduled end time for the outage (milliseconds since Unix
  12662. // epoch).
  12663. EndTime int64 `json:"endTime,omitempty,string"`
  12664. // IssueType: Form this outage is expected to take, which can take one
  12665. // of the following values:
  12666. // - OUTAGE: The Interconnect may be completely out of service for some
  12667. // or all of the specified window.
  12668. // - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a
  12669. // whole should remain up, but with reduced bandwidth. Note that the
  12670. // versions of this enum prefixed with "IT_" have been deprecated in
  12671. // favor of the unprefixed values.
  12672. //
  12673. // Possible values:
  12674. // "IT_OUTAGE"
  12675. // "IT_PARTIAL_OUTAGE"
  12676. // "OUTAGE"
  12677. // "PARTIAL_OUTAGE"
  12678. IssueType string `json:"issueType,omitempty"`
  12679. // Name: Unique identifier for this outage notification.
  12680. Name string `json:"name,omitempty"`
  12681. // Source: The party that generated this notification, which can take
  12682. // the following value:
  12683. // - GOOGLE: this notification as generated by Google. Note that the
  12684. // value of NSRC_GOOGLE has been deprecated in favor of GOOGLE.
  12685. //
  12686. // Possible values:
  12687. // "GOOGLE"
  12688. // "NSRC_GOOGLE"
  12689. Source string `json:"source,omitempty"`
  12690. // StartTime: Scheduled start time for the outage (milliseconds since
  12691. // Unix epoch).
  12692. StartTime int64 `json:"startTime,omitempty,string"`
  12693. // State: State of this notification, which can take one of the
  12694. // following values:
  12695. // - ACTIVE: This outage notification is active. The event could be in
  12696. // the past, present, or future. See start_time and end_time for
  12697. // scheduling.
  12698. // - CANCELLED: The outage associated with this notification was
  12699. // cancelled before the outage was due to start. Note that the versions
  12700. // of this enum prefixed with "NS_" have been deprecated in favor of the
  12701. // unprefixed values.
  12702. //
  12703. // Possible values:
  12704. // "ACTIVE"
  12705. // "CANCELLED"
  12706. // "NS_ACTIVE"
  12707. // "NS_CANCELED"
  12708. State string `json:"state,omitempty"`
  12709. // ForceSendFields is a list of field names (e.g. "AffectedCircuits") to
  12710. // unconditionally include in API requests. By default, fields with
  12711. // empty values are omitted from API requests. However, any non-pointer,
  12712. // non-interface field appearing in ForceSendFields will be sent to the
  12713. // server regardless of whether the field is empty or not. This may be
  12714. // used to include empty fields in Patch requests.
  12715. ForceSendFields []string `json:"-"`
  12716. // NullFields is a list of field names (e.g. "AffectedCircuits") to
  12717. // include in API requests with the JSON null value. By default, fields
  12718. // with empty values are omitted from API requests. However, any field
  12719. // with an empty value appearing in NullFields will be sent to the
  12720. // server as null. It is an error if a field in this list has a
  12721. // non-empty value. This may be used to include null fields in Patch
  12722. // requests.
  12723. NullFields []string `json:"-"`
  12724. }
  12725. func (s *InterconnectOutageNotification) MarshalJSON() ([]byte, error) {
  12726. type NoMethod InterconnectOutageNotification
  12727. raw := NoMethod(*s)
  12728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12729. }
  12730. // InterconnectsGetDiagnosticsResponse: Response for the
  12731. // InterconnectsGetDiagnosticsRequest.
  12732. type InterconnectsGetDiagnosticsResponse struct {
  12733. Result *InterconnectDiagnostics `json:"result,omitempty"`
  12734. // ServerResponse contains the HTTP response code and headers from the
  12735. // server.
  12736. googleapi.ServerResponse `json:"-"`
  12737. // ForceSendFields is a list of field names (e.g. "Result") to
  12738. // unconditionally include in API requests. By default, fields with
  12739. // empty values are omitted from API requests. However, any non-pointer,
  12740. // non-interface field appearing in ForceSendFields will be sent to the
  12741. // server regardless of whether the field is empty or not. This may be
  12742. // used to include empty fields in Patch requests.
  12743. ForceSendFields []string `json:"-"`
  12744. // NullFields is a list of field names (e.g. "Result") to include in API
  12745. // requests with the JSON null value. By default, fields with empty
  12746. // values are omitted from API requests. However, any field with an
  12747. // empty value appearing in NullFields will be sent to the server as
  12748. // null. It is an error if a field in this list has a non-empty value.
  12749. // This may be used to include null fields in Patch requests.
  12750. NullFields []string `json:"-"`
  12751. }
  12752. func (s *InterconnectsGetDiagnosticsResponse) MarshalJSON() ([]byte, error) {
  12753. type NoMethod InterconnectsGetDiagnosticsResponse
  12754. raw := NoMethod(*s)
  12755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12756. }
  12757. // License: A license resource.
  12758. type License struct {
  12759. // ChargesUseFee: [Output Only] Deprecated. This field no longer
  12760. // reflects whether a license charges a usage fee.
  12761. ChargesUseFee bool `json:"chargesUseFee,omitempty"`
  12762. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12763. // format.
  12764. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12765. // Description: An optional textual description of the resource;
  12766. // provided by the client when the resource is created.
  12767. Description string `json:"description,omitempty"`
  12768. // Id: [Output Only] The unique identifier for the resource. This
  12769. // identifier is defined by the server.
  12770. Id uint64 `json:"id,omitempty,string"`
  12771. // Kind: [Output Only] Type of resource. Always compute#license for
  12772. // licenses.
  12773. Kind string `json:"kind,omitempty"`
  12774. // LicenseCode: [Output Only] The unique code used to attach this
  12775. // license to images, snapshots, and disks.
  12776. LicenseCode uint64 `json:"licenseCode,omitempty,string"`
  12777. // Name: Name of the resource. The name must be 1-63 characters long and
  12778. // comply with RFC1035.
  12779. Name string `json:"name,omitempty"`
  12780. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"`
  12781. // SelfLink: [Output Only] Server-defined URL for the resource.
  12782. SelfLink string `json:"selfLink,omitempty"`
  12783. // Transferable: If false, licenses will not be copied from the source
  12784. // resource when creating an image from a disk, disk from snapshot, or
  12785. // snapshot from disk.
  12786. Transferable bool `json:"transferable,omitempty"`
  12787. // ServerResponse contains the HTTP response code and headers from the
  12788. // server.
  12789. googleapi.ServerResponse `json:"-"`
  12790. // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to
  12791. // unconditionally include in API requests. By default, fields with
  12792. // empty values are omitted from API requests. However, any non-pointer,
  12793. // non-interface field appearing in ForceSendFields will be sent to the
  12794. // server regardless of whether the field is empty or not. This may be
  12795. // used to include empty fields in Patch requests.
  12796. ForceSendFields []string `json:"-"`
  12797. // NullFields is a list of field names (e.g. "ChargesUseFee") to include
  12798. // in API requests with the JSON null value. By default, fields with
  12799. // empty values are omitted from API requests. However, any field with
  12800. // an empty value appearing in NullFields will be sent to the server as
  12801. // null. It is an error if a field in this list has a non-empty value.
  12802. // This may be used to include null fields in Patch requests.
  12803. NullFields []string `json:"-"`
  12804. }
  12805. func (s *License) MarshalJSON() ([]byte, error) {
  12806. type NoMethod License
  12807. raw := NoMethod(*s)
  12808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12809. }
  12810. type LicenseCode struct {
  12811. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  12812. // format.
  12813. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  12814. // Description: [Output Only] Description of this License Code.
  12815. Description string `json:"description,omitempty"`
  12816. // Id: [Output Only] The unique identifier for the resource. This
  12817. // identifier is defined by the server.
  12818. Id uint64 `json:"id,omitempty,string"`
  12819. // Kind: [Output Only] Type of resource. Always compute#licenseCode for
  12820. // licenses.
  12821. Kind string `json:"kind,omitempty"`
  12822. // LicenseAlias: [Output Only] URL and description aliases of Licenses
  12823. // with the same License Code.
  12824. LicenseAlias []*LicenseCodeLicenseAlias `json:"licenseAlias,omitempty"`
  12825. // Name: [Output Only] Name of the resource. The name is 1-20 characters
  12826. // long and must be a valid 64 bit integer.
  12827. Name string `json:"name,omitempty"`
  12828. // SelfLink: [Output Only] Server-defined URL for the resource.
  12829. SelfLink string `json:"selfLink,omitempty"`
  12830. // State: [Output Only] Current state of this License Code.
  12831. //
  12832. // Possible values:
  12833. // "DISABLED"
  12834. // "ENABLED"
  12835. // "RESTRICTED"
  12836. // "STATE_UNSPECIFIED"
  12837. // "TERMINATED"
  12838. State string `json:"state,omitempty"`
  12839. // Transferable: [Output Only] If true, the license will remain attached
  12840. // when creating images or snapshots from disks. Otherwise, the license
  12841. // is not transferred.
  12842. Transferable bool `json:"transferable,omitempty"`
  12843. // ServerResponse contains the HTTP response code and headers from the
  12844. // server.
  12845. googleapi.ServerResponse `json:"-"`
  12846. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  12847. // to unconditionally include in API requests. By default, fields with
  12848. // empty values are omitted from API requests. However, any non-pointer,
  12849. // non-interface field appearing in ForceSendFields will be sent to the
  12850. // server regardless of whether the field is empty or not. This may be
  12851. // used to include empty fields in Patch requests.
  12852. ForceSendFields []string `json:"-"`
  12853. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  12854. // include in API requests with the JSON null value. By default, fields
  12855. // with empty values are omitted from API requests. However, any field
  12856. // with an empty value appearing in NullFields will be sent to the
  12857. // server as null. It is an error if a field in this list has a
  12858. // non-empty value. This may be used to include null fields in Patch
  12859. // requests.
  12860. NullFields []string `json:"-"`
  12861. }
  12862. func (s *LicenseCode) MarshalJSON() ([]byte, error) {
  12863. type NoMethod LicenseCode
  12864. raw := NoMethod(*s)
  12865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12866. }
  12867. type LicenseCodeLicenseAlias struct {
  12868. // Description: [Output Only] Description of this License Code.
  12869. Description string `json:"description,omitempty"`
  12870. // SelfLink: [Output Only] URL of license corresponding to this License
  12871. // Code.
  12872. SelfLink string `json:"selfLink,omitempty"`
  12873. // ForceSendFields is a list of field names (e.g. "Description") to
  12874. // unconditionally include in API requests. By default, fields with
  12875. // empty values are omitted from API requests. However, any non-pointer,
  12876. // non-interface field appearing in ForceSendFields will be sent to the
  12877. // server regardless of whether the field is empty or not. This may be
  12878. // used to include empty fields in Patch requests.
  12879. ForceSendFields []string `json:"-"`
  12880. // NullFields is a list of field names (e.g. "Description") to include
  12881. // in API requests with the JSON null value. By default, fields with
  12882. // empty values are omitted from API requests. However, any field with
  12883. // an empty value appearing in NullFields will be sent to the server as
  12884. // null. It is an error if a field in this list has a non-empty value.
  12885. // This may be used to include null fields in Patch requests.
  12886. NullFields []string `json:"-"`
  12887. }
  12888. func (s *LicenseCodeLicenseAlias) MarshalJSON() ([]byte, error) {
  12889. type NoMethod LicenseCodeLicenseAlias
  12890. raw := NoMethod(*s)
  12891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12892. }
  12893. type LicenseResourceRequirements struct {
  12894. // MinGuestCpuCount: Minimum number of guest cpus required to use the
  12895. // Instance. Enforced at Instance creation and Instance start.
  12896. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"`
  12897. // MinMemoryMb: Minimum memory required to use the Instance. Enforced at
  12898. // Instance creation and Instance start.
  12899. MinMemoryMb int64 `json:"minMemoryMb,omitempty"`
  12900. // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to
  12901. // unconditionally include in API requests. By default, fields with
  12902. // empty values are omitted from API requests. However, any non-pointer,
  12903. // non-interface field appearing in ForceSendFields will be sent to the
  12904. // server regardless of whether the field is empty or not. This may be
  12905. // used to include empty fields in Patch requests.
  12906. ForceSendFields []string `json:"-"`
  12907. // NullFields is a list of field names (e.g. "MinGuestCpuCount") to
  12908. // include in API requests with the JSON null value. By default, fields
  12909. // with empty values are omitted from API requests. However, any field
  12910. // with an empty value appearing in NullFields will be sent to the
  12911. // server as null. It is an error if a field in this list has a
  12912. // non-empty value. This may be used to include null fields in Patch
  12913. // requests.
  12914. NullFields []string `json:"-"`
  12915. }
  12916. func (s *LicenseResourceRequirements) MarshalJSON() ([]byte, error) {
  12917. type NoMethod LicenseResourceRequirements
  12918. raw := NoMethod(*s)
  12919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12920. }
  12921. type LicensesListResponse struct {
  12922. // Id: [Output Only] Unique identifier for the resource; defined by the
  12923. // server.
  12924. Id string `json:"id,omitempty"`
  12925. // Items: A list of License resources.
  12926. Items []*License `json:"items,omitempty"`
  12927. // NextPageToken: [Output Only] This token allows you to get the next
  12928. // page of results for list requests. If the number of results is larger
  12929. // than maxResults, use the nextPageToken as a value for the query
  12930. // parameter pageToken in the next list request. Subsequent list
  12931. // requests will have their own nextPageToken to continue paging through
  12932. // the results.
  12933. NextPageToken string `json:"nextPageToken,omitempty"`
  12934. // SelfLink: [Output Only] Server-defined URL for this resource.
  12935. SelfLink string `json:"selfLink,omitempty"`
  12936. // Warning: [Output Only] Informational warning message.
  12937. Warning *LicensesListResponseWarning `json:"warning,omitempty"`
  12938. // ServerResponse contains the HTTP response code and headers from the
  12939. // server.
  12940. googleapi.ServerResponse `json:"-"`
  12941. // ForceSendFields is a list of field names (e.g. "Id") to
  12942. // unconditionally include in API requests. By default, fields with
  12943. // empty values are omitted from API requests. However, any non-pointer,
  12944. // non-interface field appearing in ForceSendFields will be sent to the
  12945. // server regardless of whether the field is empty or not. This may be
  12946. // used to include empty fields in Patch requests.
  12947. ForceSendFields []string `json:"-"`
  12948. // NullFields is a list of field names (e.g. "Id") to include in API
  12949. // requests with the JSON null value. By default, fields with empty
  12950. // values are omitted from API requests. However, any field with an
  12951. // empty value appearing in NullFields will be sent to the server as
  12952. // null. It is an error if a field in this list has a non-empty value.
  12953. // This may be used to include null fields in Patch requests.
  12954. NullFields []string `json:"-"`
  12955. }
  12956. func (s *LicensesListResponse) MarshalJSON() ([]byte, error) {
  12957. type NoMethod LicensesListResponse
  12958. raw := NoMethod(*s)
  12959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  12960. }
  12961. // LicensesListResponseWarning: [Output Only] Informational warning
  12962. // message.
  12963. type LicensesListResponseWarning struct {
  12964. // Code: [Output Only] A warning code, if applicable. For example,
  12965. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  12966. // the response.
  12967. //
  12968. // Possible values:
  12969. // "CLEANUP_FAILED"
  12970. // "DEPRECATED_RESOURCE_USED"
  12971. // "DEPRECATED_TYPE_USED"
  12972. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  12973. // "EXPERIMENTAL_TYPE_USED"
  12974. // "EXTERNAL_API_WARNING"
  12975. // "FIELD_VALUE_OVERRIDEN"
  12976. // "INJECTED_KERNELS_DEPRECATED"
  12977. // "MISSING_TYPE_DEPENDENCY"
  12978. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  12979. // "NEXT_HOP_CANNOT_IP_FORWARD"
  12980. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  12981. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  12982. // "NEXT_HOP_NOT_RUNNING"
  12983. // "NOT_CRITICAL_ERROR"
  12984. // "NO_RESULTS_ON_PAGE"
  12985. // "REQUIRED_TOS_AGREEMENT"
  12986. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  12987. // "RESOURCE_NOT_DELETED"
  12988. // "SCHEMA_VALIDATION_IGNORED"
  12989. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  12990. // "UNDECLARED_PROPERTIES"
  12991. // "UNREACHABLE"
  12992. Code string `json:"code,omitempty"`
  12993. // Data: [Output Only] Metadata about this warning in key: value format.
  12994. // For example:
  12995. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  12996. Data []*LicensesListResponseWarningData `json:"data,omitempty"`
  12997. // Message: [Output Only] A human-readable description of the warning
  12998. // code.
  12999. Message string `json:"message,omitempty"`
  13000. // ForceSendFields is a list of field names (e.g. "Code") to
  13001. // unconditionally include in API requests. By default, fields with
  13002. // empty values are omitted from API requests. However, any non-pointer,
  13003. // non-interface field appearing in ForceSendFields will be sent to the
  13004. // server regardless of whether the field is empty or not. This may be
  13005. // used to include empty fields in Patch requests.
  13006. ForceSendFields []string `json:"-"`
  13007. // NullFields is a list of field names (e.g. "Code") to include in API
  13008. // requests with the JSON null value. By default, fields with empty
  13009. // values are omitted from API requests. However, any field with an
  13010. // empty value appearing in NullFields will be sent to the server as
  13011. // null. It is an error if a field in this list has a non-empty value.
  13012. // This may be used to include null fields in Patch requests.
  13013. NullFields []string `json:"-"`
  13014. }
  13015. func (s *LicensesListResponseWarning) MarshalJSON() ([]byte, error) {
  13016. type NoMethod LicensesListResponseWarning
  13017. raw := NoMethod(*s)
  13018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13019. }
  13020. type LicensesListResponseWarningData struct {
  13021. // Key: [Output Only] A key that provides more detail on the warning
  13022. // being returned. For example, for warnings where there are no results
  13023. // in a list request for a particular zone, this key might be scope and
  13024. // the key value might be the zone name. Other examples might be a key
  13025. // indicating a deprecated resource and a suggested replacement, or a
  13026. // warning about invalid network settings (for example, if an instance
  13027. // attempts to perform IP forwarding but is not enabled for IP
  13028. // forwarding).
  13029. Key string `json:"key,omitempty"`
  13030. // Value: [Output Only] A warning data value corresponding to the key.
  13031. Value string `json:"value,omitempty"`
  13032. // ForceSendFields is a list of field names (e.g. "Key") to
  13033. // unconditionally include in API requests. By default, fields with
  13034. // empty values are omitted from API requests. However, any non-pointer,
  13035. // non-interface field appearing in ForceSendFields will be sent to the
  13036. // server regardless of whether the field is empty or not. This may be
  13037. // used to include empty fields in Patch requests.
  13038. ForceSendFields []string `json:"-"`
  13039. // NullFields is a list of field names (e.g. "Key") to include in API
  13040. // requests with the JSON null value. By default, fields with empty
  13041. // values are omitted from API requests. However, any field with an
  13042. // empty value appearing in NullFields will be sent to the server as
  13043. // null. It is an error if a field in this list has a non-empty value.
  13044. // This may be used to include null fields in Patch requests.
  13045. NullFields []string `json:"-"`
  13046. }
  13047. func (s *LicensesListResponseWarningData) MarshalJSON() ([]byte, error) {
  13048. type NoMethod LicensesListResponseWarningData
  13049. raw := NoMethod(*s)
  13050. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13051. }
  13052. // LogConfig: Specifies what kind of log the caller must write
  13053. type LogConfig struct {
  13054. // CloudAudit: Cloud audit options.
  13055. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  13056. // Counter: Counter options.
  13057. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  13058. // DataAccess: Data access options.
  13059. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  13060. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  13061. // unconditionally include in API requests. By default, fields with
  13062. // empty values are omitted from API requests. However, any non-pointer,
  13063. // non-interface field appearing in ForceSendFields will be sent to the
  13064. // server regardless of whether the field is empty or not. This may be
  13065. // used to include empty fields in Patch requests.
  13066. ForceSendFields []string `json:"-"`
  13067. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  13068. // API requests with the JSON null value. By default, fields with empty
  13069. // values are omitted from API requests. However, any field with an
  13070. // empty value appearing in NullFields will be sent to the server as
  13071. // null. It is an error if a field in this list has a non-empty value.
  13072. // This may be used to include null fields in Patch requests.
  13073. NullFields []string `json:"-"`
  13074. }
  13075. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  13076. type NoMethod LogConfig
  13077. raw := NoMethod(*s)
  13078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13079. }
  13080. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  13081. type LogConfigCloudAuditOptions struct {
  13082. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  13083. // Logging pipeline.
  13084. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  13085. // LogName: The log_name to populate in the Cloud Audit Record.
  13086. //
  13087. // Possible values:
  13088. // "ADMIN_ACTIVITY"
  13089. // "DATA_ACCESS"
  13090. // "UNSPECIFIED_LOG_NAME"
  13091. LogName string `json:"logName,omitempty"`
  13092. // ForceSendFields is a list of field names (e.g.
  13093. // "AuthorizationLoggingOptions") to unconditionally include in API
  13094. // requests. By default, fields with empty values are omitted from API
  13095. // requests. However, any non-pointer, non-interface field appearing in
  13096. // ForceSendFields will be sent to the server regardless of whether the
  13097. // field is empty or not. This may be used to include empty fields in
  13098. // Patch requests.
  13099. ForceSendFields []string `json:"-"`
  13100. // NullFields is a list of field names (e.g.
  13101. // "AuthorizationLoggingOptions") to include in API requests with the
  13102. // JSON null value. By default, fields with empty values are omitted
  13103. // from API requests. However, any field with an empty value appearing
  13104. // in NullFields will be sent to the server as null. It is an error if a
  13105. // field in this list has a non-empty value. This may be used to include
  13106. // null fields in Patch requests.
  13107. NullFields []string `json:"-"`
  13108. }
  13109. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  13110. type NoMethod LogConfigCloudAuditOptions
  13111. raw := NoMethod(*s)
  13112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13113. }
  13114. // LogConfigCounterOptions: Increment a streamz counter with the
  13115. // specified metric and field names.
  13116. //
  13117. // Metric names should start with a '/', generally be lowercase-only,
  13118. // and end in "_count". Field names should not contain an initial slash.
  13119. // The actual exported metric names will have "/iam/policy"
  13120. // prepended.
  13121. //
  13122. // Field names correspond to IAM request parameters and field values are
  13123. // their respective values.
  13124. //
  13125. // Supported field names: - "authority", which is "[token]" if
  13126. // IAMContext.token is present, otherwise the value of
  13127. // IAMContext.authority_selector if present, and otherwise a
  13128. // representation of IAMContext.principal; or - "iam_principal", a
  13129. // representation of IAMContext.principal even if a token or authority
  13130. // selector is present; or - "" (empty string), resulting in a counter
  13131. // with no fields.
  13132. //
  13133. // Examples: counter { metric: "/debug_access_count" field:
  13134. // "iam_principal" } ==> increment counter
  13135. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  13136. // IAMContext.principal]}
  13137. //
  13138. // At this time we do not support multiple field names (though this may
  13139. // be supported in the future).
  13140. type LogConfigCounterOptions struct {
  13141. // Field: The field value to attribute.
  13142. Field string `json:"field,omitempty"`
  13143. // Metric: The metric to update.
  13144. Metric string `json:"metric,omitempty"`
  13145. // ForceSendFields is a list of field names (e.g. "Field") to
  13146. // unconditionally include in API requests. By default, fields with
  13147. // empty values are omitted from API requests. However, any non-pointer,
  13148. // non-interface field appearing in ForceSendFields will be sent to the
  13149. // server regardless of whether the field is empty or not. This may be
  13150. // used to include empty fields in Patch requests.
  13151. ForceSendFields []string `json:"-"`
  13152. // NullFields is a list of field names (e.g. "Field") to include in API
  13153. // requests with the JSON null value. By default, fields with empty
  13154. // values are omitted from API requests. However, any field with an
  13155. // empty value appearing in NullFields will be sent to the server as
  13156. // null. It is an error if a field in this list has a non-empty value.
  13157. // This may be used to include null fields in Patch requests.
  13158. NullFields []string `json:"-"`
  13159. }
  13160. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  13161. type NoMethod LogConfigCounterOptions
  13162. raw := NoMethod(*s)
  13163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13164. }
  13165. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  13166. type LogConfigDataAccessOptions struct {
  13167. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  13168. // the caller. This is relevant only in the LocalIAM implementation, for
  13169. // now.
  13170. //
  13171. // Possible values:
  13172. // "LOG_FAIL_CLOSED"
  13173. // "LOG_MODE_UNSPECIFIED"
  13174. LogMode string `json:"logMode,omitempty"`
  13175. // ForceSendFields is a list of field names (e.g. "LogMode") to
  13176. // unconditionally include in API requests. By default, fields with
  13177. // empty values are omitted from API requests. However, any non-pointer,
  13178. // non-interface field appearing in ForceSendFields will be sent to the
  13179. // server regardless of whether the field is empty or not. This may be
  13180. // used to include empty fields in Patch requests.
  13181. ForceSendFields []string `json:"-"`
  13182. // NullFields is a list of field names (e.g. "LogMode") to include in
  13183. // API requests with the JSON null value. By default, fields with empty
  13184. // values are omitted from API requests. However, any field with an
  13185. // empty value appearing in NullFields will be sent to the server as
  13186. // null. It is an error if a field in this list has a non-empty value.
  13187. // This may be used to include null fields in Patch requests.
  13188. NullFields []string `json:"-"`
  13189. }
  13190. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  13191. type NoMethod LogConfigDataAccessOptions
  13192. raw := NoMethod(*s)
  13193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13194. }
  13195. // MachineType: A Machine Type resource. (== resource_for
  13196. // v1.machineTypes ==) (== resource_for beta.machineTypes ==)
  13197. type MachineType struct {
  13198. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13199. // format.
  13200. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13201. // Deprecated: [Output Only] The deprecation status associated with this
  13202. // machine type.
  13203. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  13204. // Description: [Output Only] An optional textual description of the
  13205. // resource.
  13206. Description string `json:"description,omitempty"`
  13207. // GuestCpus: [Output Only] The number of virtual CPUs that are
  13208. // available to the instance.
  13209. GuestCpus int64 `json:"guestCpus,omitempty"`
  13210. // Id: [Output Only] The unique identifier for the resource. This
  13211. // identifier is defined by the server.
  13212. Id uint64 `json:"id,omitempty,string"`
  13213. // ImageSpaceGb: [Deprecated] This property is deprecated and will never
  13214. // be populated with any relevant values.
  13215. ImageSpaceGb int64 `json:"imageSpaceGb,omitempty"`
  13216. // IsSharedCpu: [Output Only] Whether this machine type has a shared
  13217. // CPU. See Shared-core machine types for more information.
  13218. IsSharedCpu bool `json:"isSharedCpu,omitempty"`
  13219. // Kind: [Output Only] The type of the resource. Always
  13220. // compute#machineType for machine types.
  13221. Kind string `json:"kind,omitempty"`
  13222. // MaximumPersistentDisks: [Output Only] Maximum persistent disks
  13223. // allowed.
  13224. MaximumPersistentDisks int64 `json:"maximumPersistentDisks,omitempty"`
  13225. // MaximumPersistentDisksSizeGb: [Output Only] Maximum total persistent
  13226. // disks size (GB) allowed.
  13227. MaximumPersistentDisksSizeGb int64 `json:"maximumPersistentDisksSizeGb,omitempty,string"`
  13228. // MemoryMb: [Output Only] The amount of physical memory available to
  13229. // the instance, defined in MB.
  13230. MemoryMb int64 `json:"memoryMb,omitempty"`
  13231. // Name: [Output Only] Name of the resource.
  13232. Name string `json:"name,omitempty"`
  13233. // ScratchDisks: [Output Only] A list of extended scratch disks assigned
  13234. // to the instance.
  13235. ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"`
  13236. // SelfLink: [Output Only] Server-defined URL for the resource.
  13237. SelfLink string `json:"selfLink,omitempty"`
  13238. // Zone: [Output Only] The name of the zone where the machine type
  13239. // resides, such as us-central1-a.
  13240. Zone string `json:"zone,omitempty"`
  13241. // ServerResponse contains the HTTP response code and headers from the
  13242. // server.
  13243. googleapi.ServerResponse `json:"-"`
  13244. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  13245. // to unconditionally include in API requests. By default, fields with
  13246. // empty values are omitted from API requests. However, any non-pointer,
  13247. // non-interface field appearing in ForceSendFields will be sent to the
  13248. // server regardless of whether the field is empty or not. This may be
  13249. // used to include empty fields in Patch requests.
  13250. ForceSendFields []string `json:"-"`
  13251. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  13252. // include in API requests with the JSON null value. By default, fields
  13253. // with empty values are omitted from API requests. However, any field
  13254. // with an empty value appearing in NullFields will be sent to the
  13255. // server as null. It is an error if a field in this list has a
  13256. // non-empty value. This may be used to include null fields in Patch
  13257. // requests.
  13258. NullFields []string `json:"-"`
  13259. }
  13260. func (s *MachineType) MarshalJSON() ([]byte, error) {
  13261. type NoMethod MachineType
  13262. raw := NoMethod(*s)
  13263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13264. }
  13265. type MachineTypeScratchDisks struct {
  13266. // DiskGb: Size of the scratch disk, defined in GB.
  13267. DiskGb int64 `json:"diskGb,omitempty"`
  13268. // ForceSendFields is a list of field names (e.g. "DiskGb") to
  13269. // unconditionally include in API requests. By default, fields with
  13270. // empty values are omitted from API requests. However, any non-pointer,
  13271. // non-interface field appearing in ForceSendFields will be sent to the
  13272. // server regardless of whether the field is empty or not. This may be
  13273. // used to include empty fields in Patch requests.
  13274. ForceSendFields []string `json:"-"`
  13275. // NullFields is a list of field names (e.g. "DiskGb") to include in API
  13276. // requests with the JSON null value. By default, fields with empty
  13277. // values are omitted from API requests. However, any field with an
  13278. // empty value appearing in NullFields will be sent to the server as
  13279. // null. It is an error if a field in this list has a non-empty value.
  13280. // This may be used to include null fields in Patch requests.
  13281. NullFields []string `json:"-"`
  13282. }
  13283. func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) {
  13284. type NoMethod MachineTypeScratchDisks
  13285. raw := NoMethod(*s)
  13286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13287. }
  13288. type MachineTypeAggregatedList struct {
  13289. // Id: [Output Only] Unique identifier for the resource; defined by the
  13290. // server.
  13291. Id string `json:"id,omitempty"`
  13292. // Items: A list of MachineTypesScopedList resources.
  13293. Items map[string]MachineTypesScopedList `json:"items,omitempty"`
  13294. // Kind: [Output Only] Type of resource. Always
  13295. // compute#machineTypeAggregatedList for aggregated lists of machine
  13296. // types.
  13297. Kind string `json:"kind,omitempty"`
  13298. // NextPageToken: [Output Only] This token allows you to get the next
  13299. // page of results for list requests. If the number of results is larger
  13300. // than maxResults, use the nextPageToken as a value for the query
  13301. // parameter pageToken in the next list request. Subsequent list
  13302. // requests will have their own nextPageToken to continue paging through
  13303. // the results.
  13304. NextPageToken string `json:"nextPageToken,omitempty"`
  13305. // SelfLink: [Output Only] Server-defined URL for this resource.
  13306. SelfLink string `json:"selfLink,omitempty"`
  13307. // Warning: [Output Only] Informational warning message.
  13308. Warning *MachineTypeAggregatedListWarning `json:"warning,omitempty"`
  13309. // ServerResponse contains the HTTP response code and headers from the
  13310. // server.
  13311. googleapi.ServerResponse `json:"-"`
  13312. // ForceSendFields is a list of field names (e.g. "Id") to
  13313. // unconditionally include in API requests. By default, fields with
  13314. // empty values are omitted from API requests. However, any non-pointer,
  13315. // non-interface field appearing in ForceSendFields will be sent to the
  13316. // server regardless of whether the field is empty or not. This may be
  13317. // used to include empty fields in Patch requests.
  13318. ForceSendFields []string `json:"-"`
  13319. // NullFields is a list of field names (e.g. "Id") to include in API
  13320. // requests with the JSON null value. By default, fields with empty
  13321. // values are omitted from API requests. However, any field with an
  13322. // empty value appearing in NullFields will be sent to the server as
  13323. // null. It is an error if a field in this list has a non-empty value.
  13324. // This may be used to include null fields in Patch requests.
  13325. NullFields []string `json:"-"`
  13326. }
  13327. func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) {
  13328. type NoMethod MachineTypeAggregatedList
  13329. raw := NoMethod(*s)
  13330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13331. }
  13332. // MachineTypeAggregatedListWarning: [Output Only] Informational warning
  13333. // message.
  13334. type MachineTypeAggregatedListWarning struct {
  13335. // Code: [Output Only] A warning code, if applicable. For example,
  13336. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13337. // the response.
  13338. //
  13339. // Possible values:
  13340. // "CLEANUP_FAILED"
  13341. // "DEPRECATED_RESOURCE_USED"
  13342. // "DEPRECATED_TYPE_USED"
  13343. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13344. // "EXPERIMENTAL_TYPE_USED"
  13345. // "EXTERNAL_API_WARNING"
  13346. // "FIELD_VALUE_OVERRIDEN"
  13347. // "INJECTED_KERNELS_DEPRECATED"
  13348. // "MISSING_TYPE_DEPENDENCY"
  13349. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13350. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13351. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13352. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13353. // "NEXT_HOP_NOT_RUNNING"
  13354. // "NOT_CRITICAL_ERROR"
  13355. // "NO_RESULTS_ON_PAGE"
  13356. // "REQUIRED_TOS_AGREEMENT"
  13357. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13358. // "RESOURCE_NOT_DELETED"
  13359. // "SCHEMA_VALIDATION_IGNORED"
  13360. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13361. // "UNDECLARED_PROPERTIES"
  13362. // "UNREACHABLE"
  13363. Code string `json:"code,omitempty"`
  13364. // Data: [Output Only] Metadata about this warning in key: value format.
  13365. // For example:
  13366. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13367. Data []*MachineTypeAggregatedListWarningData `json:"data,omitempty"`
  13368. // Message: [Output Only] A human-readable description of the warning
  13369. // code.
  13370. Message string `json:"message,omitempty"`
  13371. // ForceSendFields is a list of field names (e.g. "Code") to
  13372. // unconditionally include in API requests. By default, fields with
  13373. // empty values are omitted from API requests. However, any non-pointer,
  13374. // non-interface field appearing in ForceSendFields will be sent to the
  13375. // server regardless of whether the field is empty or not. This may be
  13376. // used to include empty fields in Patch requests.
  13377. ForceSendFields []string `json:"-"`
  13378. // NullFields is a list of field names (e.g. "Code") to include in API
  13379. // requests with the JSON null value. By default, fields with empty
  13380. // values are omitted from API requests. However, any field with an
  13381. // empty value appearing in NullFields will be sent to the server as
  13382. // null. It is an error if a field in this list has a non-empty value.
  13383. // This may be used to include null fields in Patch requests.
  13384. NullFields []string `json:"-"`
  13385. }
  13386. func (s *MachineTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  13387. type NoMethod MachineTypeAggregatedListWarning
  13388. raw := NoMethod(*s)
  13389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13390. }
  13391. type MachineTypeAggregatedListWarningData struct {
  13392. // Key: [Output Only] A key that provides more detail on the warning
  13393. // being returned. For example, for warnings where there are no results
  13394. // in a list request for a particular zone, this key might be scope and
  13395. // the key value might be the zone name. Other examples might be a key
  13396. // indicating a deprecated resource and a suggested replacement, or a
  13397. // warning about invalid network settings (for example, if an instance
  13398. // attempts to perform IP forwarding but is not enabled for IP
  13399. // forwarding).
  13400. Key string `json:"key,omitempty"`
  13401. // Value: [Output Only] A warning data value corresponding to the key.
  13402. Value string `json:"value,omitempty"`
  13403. // ForceSendFields is a list of field names (e.g. "Key") to
  13404. // unconditionally include in API requests. By default, fields with
  13405. // empty values are omitted from API requests. However, any non-pointer,
  13406. // non-interface field appearing in ForceSendFields will be sent to the
  13407. // server regardless of whether the field is empty or not. This may be
  13408. // used to include empty fields in Patch requests.
  13409. ForceSendFields []string `json:"-"`
  13410. // NullFields is a list of field names (e.g. "Key") to include in API
  13411. // requests with the JSON null value. By default, fields with empty
  13412. // values are omitted from API requests. However, any field with an
  13413. // empty value appearing in NullFields will be sent to the server as
  13414. // null. It is an error if a field in this list has a non-empty value.
  13415. // This may be used to include null fields in Patch requests.
  13416. NullFields []string `json:"-"`
  13417. }
  13418. func (s *MachineTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  13419. type NoMethod MachineTypeAggregatedListWarningData
  13420. raw := NoMethod(*s)
  13421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13422. }
  13423. // MachineTypeList: Contains a list of machine types.
  13424. type MachineTypeList struct {
  13425. // Id: [Output Only] Unique identifier for the resource; defined by the
  13426. // server.
  13427. Id string `json:"id,omitempty"`
  13428. // Items: A list of MachineType resources.
  13429. Items []*MachineType `json:"items,omitempty"`
  13430. // Kind: [Output Only] Type of resource. Always compute#machineTypeList
  13431. // for lists of machine types.
  13432. Kind string `json:"kind,omitempty"`
  13433. // NextPageToken: [Output Only] This token allows you to get the next
  13434. // page of results for list requests. If the number of results is larger
  13435. // than maxResults, use the nextPageToken as a value for the query
  13436. // parameter pageToken in the next list request. Subsequent list
  13437. // requests will have their own nextPageToken to continue paging through
  13438. // the results.
  13439. NextPageToken string `json:"nextPageToken,omitempty"`
  13440. // SelfLink: [Output Only] Server-defined URL for this resource.
  13441. SelfLink string `json:"selfLink,omitempty"`
  13442. // Warning: [Output Only] Informational warning message.
  13443. Warning *MachineTypeListWarning `json:"warning,omitempty"`
  13444. // ServerResponse contains the HTTP response code and headers from the
  13445. // server.
  13446. googleapi.ServerResponse `json:"-"`
  13447. // ForceSendFields is a list of field names (e.g. "Id") to
  13448. // unconditionally include in API requests. By default, fields with
  13449. // empty values are omitted from API requests. However, any non-pointer,
  13450. // non-interface field appearing in ForceSendFields will be sent to the
  13451. // server regardless of whether the field is empty or not. This may be
  13452. // used to include empty fields in Patch requests.
  13453. ForceSendFields []string `json:"-"`
  13454. // NullFields is a list of field names (e.g. "Id") to include in API
  13455. // requests with the JSON null value. By default, fields with empty
  13456. // values are omitted from API requests. However, any field with an
  13457. // empty value appearing in NullFields will be sent to the server as
  13458. // null. It is an error if a field in this list has a non-empty value.
  13459. // This may be used to include null fields in Patch requests.
  13460. NullFields []string `json:"-"`
  13461. }
  13462. func (s *MachineTypeList) MarshalJSON() ([]byte, error) {
  13463. type NoMethod MachineTypeList
  13464. raw := NoMethod(*s)
  13465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13466. }
  13467. // MachineTypeListWarning: [Output Only] Informational warning message.
  13468. type MachineTypeListWarning struct {
  13469. // Code: [Output Only] A warning code, if applicable. For example,
  13470. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13471. // the response.
  13472. //
  13473. // Possible values:
  13474. // "CLEANUP_FAILED"
  13475. // "DEPRECATED_RESOURCE_USED"
  13476. // "DEPRECATED_TYPE_USED"
  13477. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13478. // "EXPERIMENTAL_TYPE_USED"
  13479. // "EXTERNAL_API_WARNING"
  13480. // "FIELD_VALUE_OVERRIDEN"
  13481. // "INJECTED_KERNELS_DEPRECATED"
  13482. // "MISSING_TYPE_DEPENDENCY"
  13483. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13484. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13485. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13486. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13487. // "NEXT_HOP_NOT_RUNNING"
  13488. // "NOT_CRITICAL_ERROR"
  13489. // "NO_RESULTS_ON_PAGE"
  13490. // "REQUIRED_TOS_AGREEMENT"
  13491. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13492. // "RESOURCE_NOT_DELETED"
  13493. // "SCHEMA_VALIDATION_IGNORED"
  13494. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13495. // "UNDECLARED_PROPERTIES"
  13496. // "UNREACHABLE"
  13497. Code string `json:"code,omitempty"`
  13498. // Data: [Output Only] Metadata about this warning in key: value format.
  13499. // For example:
  13500. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13501. Data []*MachineTypeListWarningData `json:"data,omitempty"`
  13502. // Message: [Output Only] A human-readable description of the warning
  13503. // code.
  13504. Message string `json:"message,omitempty"`
  13505. // ForceSendFields is a list of field names (e.g. "Code") to
  13506. // unconditionally include in API requests. By default, fields with
  13507. // empty values are omitted from API requests. However, any non-pointer,
  13508. // non-interface field appearing in ForceSendFields will be sent to the
  13509. // server regardless of whether the field is empty or not. This may be
  13510. // used to include empty fields in Patch requests.
  13511. ForceSendFields []string `json:"-"`
  13512. // NullFields is a list of field names (e.g. "Code") to include in API
  13513. // requests with the JSON null value. By default, fields with empty
  13514. // values are omitted from API requests. However, any field with an
  13515. // empty value appearing in NullFields will be sent to the server as
  13516. // null. It is an error if a field in this list has a non-empty value.
  13517. // This may be used to include null fields in Patch requests.
  13518. NullFields []string `json:"-"`
  13519. }
  13520. func (s *MachineTypeListWarning) MarshalJSON() ([]byte, error) {
  13521. type NoMethod MachineTypeListWarning
  13522. raw := NoMethod(*s)
  13523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13524. }
  13525. type MachineTypeListWarningData struct {
  13526. // Key: [Output Only] A key that provides more detail on the warning
  13527. // being returned. For example, for warnings where there are no results
  13528. // in a list request for a particular zone, this key might be scope and
  13529. // the key value might be the zone name. Other examples might be a key
  13530. // indicating a deprecated resource and a suggested replacement, or a
  13531. // warning about invalid network settings (for example, if an instance
  13532. // attempts to perform IP forwarding but is not enabled for IP
  13533. // forwarding).
  13534. Key string `json:"key,omitempty"`
  13535. // Value: [Output Only] A warning data value corresponding to the key.
  13536. Value string `json:"value,omitempty"`
  13537. // ForceSendFields is a list of field names (e.g. "Key") to
  13538. // unconditionally include in API requests. By default, fields with
  13539. // empty values are omitted from API requests. However, any non-pointer,
  13540. // non-interface field appearing in ForceSendFields will be sent to the
  13541. // server regardless of whether the field is empty or not. This may be
  13542. // used to include empty fields in Patch requests.
  13543. ForceSendFields []string `json:"-"`
  13544. // NullFields is a list of field names (e.g. "Key") to include in API
  13545. // requests with the JSON null value. By default, fields with empty
  13546. // values are omitted from API requests. However, any field with an
  13547. // empty value appearing in NullFields will be sent to the server as
  13548. // null. It is an error if a field in this list has a non-empty value.
  13549. // This may be used to include null fields in Patch requests.
  13550. NullFields []string `json:"-"`
  13551. }
  13552. func (s *MachineTypeListWarningData) MarshalJSON() ([]byte, error) {
  13553. type NoMethod MachineTypeListWarningData
  13554. raw := NoMethod(*s)
  13555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13556. }
  13557. type MachineTypesScopedList struct {
  13558. // MachineTypes: [Output Only] A list of machine types contained in this
  13559. // scope.
  13560. MachineTypes []*MachineType `json:"machineTypes,omitempty"`
  13561. // Warning: [Output Only] An informational warning that appears when the
  13562. // machine types list is empty.
  13563. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"`
  13564. // ForceSendFields is a list of field names (e.g. "MachineTypes") to
  13565. // unconditionally include in API requests. By default, fields with
  13566. // empty values are omitted from API requests. However, any non-pointer,
  13567. // non-interface field appearing in ForceSendFields will be sent to the
  13568. // server regardless of whether the field is empty or not. This may be
  13569. // used to include empty fields in Patch requests.
  13570. ForceSendFields []string `json:"-"`
  13571. // NullFields is a list of field names (e.g. "MachineTypes") to include
  13572. // in API requests with the JSON null value. By default, fields with
  13573. // empty values are omitted from API requests. However, any field with
  13574. // an empty value appearing in NullFields will be sent to the server as
  13575. // null. It is an error if a field in this list has a non-empty value.
  13576. // This may be used to include null fields in Patch requests.
  13577. NullFields []string `json:"-"`
  13578. }
  13579. func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) {
  13580. type NoMethod MachineTypesScopedList
  13581. raw := NoMethod(*s)
  13582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13583. }
  13584. // MachineTypesScopedListWarning: [Output Only] An informational warning
  13585. // that appears when the machine types list is empty.
  13586. type MachineTypesScopedListWarning struct {
  13587. // Code: [Output Only] A warning code, if applicable. For example,
  13588. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  13589. // the response.
  13590. //
  13591. // Possible values:
  13592. // "CLEANUP_FAILED"
  13593. // "DEPRECATED_RESOURCE_USED"
  13594. // "DEPRECATED_TYPE_USED"
  13595. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  13596. // "EXPERIMENTAL_TYPE_USED"
  13597. // "EXTERNAL_API_WARNING"
  13598. // "FIELD_VALUE_OVERRIDEN"
  13599. // "INJECTED_KERNELS_DEPRECATED"
  13600. // "MISSING_TYPE_DEPENDENCY"
  13601. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  13602. // "NEXT_HOP_CANNOT_IP_FORWARD"
  13603. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  13604. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  13605. // "NEXT_HOP_NOT_RUNNING"
  13606. // "NOT_CRITICAL_ERROR"
  13607. // "NO_RESULTS_ON_PAGE"
  13608. // "REQUIRED_TOS_AGREEMENT"
  13609. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  13610. // "RESOURCE_NOT_DELETED"
  13611. // "SCHEMA_VALIDATION_IGNORED"
  13612. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  13613. // "UNDECLARED_PROPERTIES"
  13614. // "UNREACHABLE"
  13615. Code string `json:"code,omitempty"`
  13616. // Data: [Output Only] Metadata about this warning in key: value format.
  13617. // For example:
  13618. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  13619. Data []*MachineTypesScopedListWarningData `json:"data,omitempty"`
  13620. // Message: [Output Only] A human-readable description of the warning
  13621. // code.
  13622. Message string `json:"message,omitempty"`
  13623. // ForceSendFields is a list of field names (e.g. "Code") to
  13624. // unconditionally include in API requests. By default, fields with
  13625. // empty values are omitted from API requests. However, any non-pointer,
  13626. // non-interface field appearing in ForceSendFields will be sent to the
  13627. // server regardless of whether the field is empty or not. This may be
  13628. // used to include empty fields in Patch requests.
  13629. ForceSendFields []string `json:"-"`
  13630. // NullFields is a list of field names (e.g. "Code") to include in API
  13631. // requests with the JSON null value. By default, fields with empty
  13632. // values are omitted from API requests. However, any field with an
  13633. // empty value appearing in NullFields will be sent to the server as
  13634. // null. It is an error if a field in this list has a non-empty value.
  13635. // This may be used to include null fields in Patch requests.
  13636. NullFields []string `json:"-"`
  13637. }
  13638. func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  13639. type NoMethod MachineTypesScopedListWarning
  13640. raw := NoMethod(*s)
  13641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13642. }
  13643. type MachineTypesScopedListWarningData struct {
  13644. // Key: [Output Only] A key that provides more detail on the warning
  13645. // being returned. For example, for warnings where there are no results
  13646. // in a list request for a particular zone, this key might be scope and
  13647. // the key value might be the zone name. Other examples might be a key
  13648. // indicating a deprecated resource and a suggested replacement, or a
  13649. // warning about invalid network settings (for example, if an instance
  13650. // attempts to perform IP forwarding but is not enabled for IP
  13651. // forwarding).
  13652. Key string `json:"key,omitempty"`
  13653. // Value: [Output Only] A warning data value corresponding to the key.
  13654. Value string `json:"value,omitempty"`
  13655. // ForceSendFields is a list of field names (e.g. "Key") to
  13656. // unconditionally include in API requests. By default, fields with
  13657. // empty values are omitted from API requests. However, any non-pointer,
  13658. // non-interface field appearing in ForceSendFields will be sent to the
  13659. // server regardless of whether the field is empty or not. This may be
  13660. // used to include empty fields in Patch requests.
  13661. ForceSendFields []string `json:"-"`
  13662. // NullFields is a list of field names (e.g. "Key") to include in API
  13663. // requests with the JSON null value. By default, fields with empty
  13664. // values are omitted from API requests. However, any field with an
  13665. // empty value appearing in NullFields will be sent to the server as
  13666. // null. It is an error if a field in this list has a non-empty value.
  13667. // This may be used to include null fields in Patch requests.
  13668. NullFields []string `json:"-"`
  13669. }
  13670. func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  13671. type NoMethod MachineTypesScopedListWarningData
  13672. raw := NoMethod(*s)
  13673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13674. }
  13675. // ManagedInstance: A Managed Instance resource.
  13676. type ManagedInstance struct {
  13677. // CurrentAction: [Output Only] The current action that the managed
  13678. // instance group has scheduled for the instance. Possible values:
  13679. // - NONE The instance is running, and the managed instance group does
  13680. // not have any scheduled actions for this instance.
  13681. // - CREATING The managed instance group is creating this instance. If
  13682. // the group fails to create this instance, it will try again until it
  13683. // is successful.
  13684. // - CREATING_WITHOUT_RETRIES The managed instance group is attempting
  13685. // to create this instance only once. If the group fails to create this
  13686. // instance, it does not try again and the group's targetSize value is
  13687. // decreased instead.
  13688. // - RECREATING The managed instance group is recreating this instance.
  13689. //
  13690. // - DELETING The managed instance group is permanently deleting this
  13691. // instance.
  13692. // - ABANDONING The managed instance group is abandoning this instance.
  13693. // The instance will be removed from the instance group and from any
  13694. // target pools that are associated with this group.
  13695. // - RESTARTING The managed instance group is restarting the instance.
  13696. //
  13697. // - REFRESHING The managed instance group is applying configuration
  13698. // changes to the instance without stopping it. For example, the group
  13699. // can update the target pool list for an instance without stopping that
  13700. // instance.
  13701. // - VERIFYING The managed instance group has created the instance and
  13702. // it is in the process of being verified.
  13703. //
  13704. // Possible values:
  13705. // "ABANDONING"
  13706. // "CREATING"
  13707. // "CREATING_WITHOUT_RETRIES"
  13708. // "DELETING"
  13709. // "NONE"
  13710. // "RECREATING"
  13711. // "REFRESHING"
  13712. // "RESTARTING"
  13713. // "VERIFYING"
  13714. CurrentAction string `json:"currentAction,omitempty"`
  13715. // Id: [Output only] The unique identifier for this resource. This field
  13716. // is empty when instance does not exist.
  13717. Id uint64 `json:"id,omitempty,string"`
  13718. // Instance: [Output Only] The URL of the instance. The URL can exist
  13719. // even if the instance has not yet been created.
  13720. Instance string `json:"instance,omitempty"`
  13721. // InstanceStatus: [Output Only] The status of the instance. This field
  13722. // is empty when the instance does not exist.
  13723. //
  13724. // Possible values:
  13725. // "PROVISIONING"
  13726. // "REPAIRING"
  13727. // "RUNNING"
  13728. // "STAGING"
  13729. // "STOPPED"
  13730. // "STOPPING"
  13731. // "SUSPENDED"
  13732. // "SUSPENDING"
  13733. // "TERMINATED"
  13734. InstanceStatus string `json:"instanceStatus,omitempty"`
  13735. // LastAttempt: [Output Only] Information about the last attempt to
  13736. // create or delete the instance.
  13737. LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"`
  13738. // Version: [Output Only] Intended version of this instance.
  13739. Version *ManagedInstanceVersion `json:"version,omitempty"`
  13740. // ForceSendFields is a list of field names (e.g. "CurrentAction") to
  13741. // unconditionally include in API requests. By default, fields with
  13742. // empty values are omitted from API requests. However, any non-pointer,
  13743. // non-interface field appearing in ForceSendFields will be sent to the
  13744. // server regardless of whether the field is empty or not. This may be
  13745. // used to include empty fields in Patch requests.
  13746. ForceSendFields []string `json:"-"`
  13747. // NullFields is a list of field names (e.g. "CurrentAction") to include
  13748. // in API requests with the JSON null value. By default, fields with
  13749. // empty values are omitted from API requests. However, any field with
  13750. // an empty value appearing in NullFields will be sent to the server as
  13751. // null. It is an error if a field in this list has a non-empty value.
  13752. // This may be used to include null fields in Patch requests.
  13753. NullFields []string `json:"-"`
  13754. }
  13755. func (s *ManagedInstance) MarshalJSON() ([]byte, error) {
  13756. type NoMethod ManagedInstance
  13757. raw := NoMethod(*s)
  13758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13759. }
  13760. type ManagedInstanceLastAttempt struct {
  13761. // Errors: [Output Only] Encountered errors during the last attempt to
  13762. // create or delete the instance.
  13763. Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"`
  13764. // ForceSendFields is a list of field names (e.g. "Errors") to
  13765. // unconditionally include in API requests. By default, fields with
  13766. // empty values are omitted from API requests. However, any non-pointer,
  13767. // non-interface field appearing in ForceSendFields will be sent to the
  13768. // server regardless of whether the field is empty or not. This may be
  13769. // used to include empty fields in Patch requests.
  13770. ForceSendFields []string `json:"-"`
  13771. // NullFields is a list of field names (e.g. "Errors") to include in API
  13772. // requests with the JSON null value. By default, fields with empty
  13773. // values are omitted from API requests. However, any field with an
  13774. // empty value appearing in NullFields will be sent to the server as
  13775. // null. It is an error if a field in this list has a non-empty value.
  13776. // This may be used to include null fields in Patch requests.
  13777. NullFields []string `json:"-"`
  13778. }
  13779. func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) {
  13780. type NoMethod ManagedInstanceLastAttempt
  13781. raw := NoMethod(*s)
  13782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13783. }
  13784. // ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors
  13785. // during the last attempt to create or delete the instance.
  13786. type ManagedInstanceLastAttemptErrors struct {
  13787. // Errors: [Output Only] The array of errors encountered while
  13788. // processing this operation.
  13789. Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"`
  13790. // ForceSendFields is a list of field names (e.g. "Errors") to
  13791. // unconditionally include in API requests. By default, fields with
  13792. // empty values are omitted from API requests. However, any non-pointer,
  13793. // non-interface field appearing in ForceSendFields will be sent to the
  13794. // server regardless of whether the field is empty or not. This may be
  13795. // used to include empty fields in Patch requests.
  13796. ForceSendFields []string `json:"-"`
  13797. // NullFields is a list of field names (e.g. "Errors") to include in API
  13798. // requests with the JSON null value. By default, fields with empty
  13799. // values are omitted from API requests. However, any field with an
  13800. // empty value appearing in NullFields will be sent to the server as
  13801. // null. It is an error if a field in this list has a non-empty value.
  13802. // This may be used to include null fields in Patch requests.
  13803. NullFields []string `json:"-"`
  13804. }
  13805. func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) {
  13806. type NoMethod ManagedInstanceLastAttemptErrors
  13807. raw := NoMethod(*s)
  13808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13809. }
  13810. type ManagedInstanceLastAttemptErrorsErrors struct {
  13811. // Code: [Output Only] The error type identifier for this error.
  13812. Code string `json:"code,omitempty"`
  13813. // Location: [Output Only] Indicates the field in the request that
  13814. // caused the error. This property is optional.
  13815. Location string `json:"location,omitempty"`
  13816. // Message: [Output Only] An optional, human-readable error message.
  13817. Message string `json:"message,omitempty"`
  13818. // ForceSendFields is a list of field names (e.g. "Code") to
  13819. // unconditionally include in API requests. By default, fields with
  13820. // empty values are omitted from API requests. However, any non-pointer,
  13821. // non-interface field appearing in ForceSendFields will be sent to the
  13822. // server regardless of whether the field is empty or not. This may be
  13823. // used to include empty fields in Patch requests.
  13824. ForceSendFields []string `json:"-"`
  13825. // NullFields is a list of field names (e.g. "Code") to include in API
  13826. // requests with the JSON null value. By default, fields with empty
  13827. // values are omitted from API requests. However, any field with an
  13828. // empty value appearing in NullFields will be sent to the server as
  13829. // null. It is an error if a field in this list has a non-empty value.
  13830. // This may be used to include null fields in Patch requests.
  13831. NullFields []string `json:"-"`
  13832. }
  13833. func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) {
  13834. type NoMethod ManagedInstanceLastAttemptErrorsErrors
  13835. raw := NoMethod(*s)
  13836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13837. }
  13838. type ManagedInstanceVersion struct {
  13839. // InstanceTemplate: [Output Only] The intended template of the
  13840. // instance. This field is empty when current_action is one of {
  13841. // DELETING, ABANDONING }.
  13842. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  13843. // Name: [Output Only] Name of the version.
  13844. Name string `json:"name,omitempty"`
  13845. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  13846. // unconditionally include in API requests. By default, fields with
  13847. // empty values are omitted from API requests. However, any non-pointer,
  13848. // non-interface field appearing in ForceSendFields will be sent to the
  13849. // server regardless of whether the field is empty or not. This may be
  13850. // used to include empty fields in Patch requests.
  13851. ForceSendFields []string `json:"-"`
  13852. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  13853. // include in API requests with the JSON null value. By default, fields
  13854. // with empty values are omitted from API requests. However, any field
  13855. // with an empty value appearing in NullFields will be sent to the
  13856. // server as null. It is an error if a field in this list has a
  13857. // non-empty value. This may be used to include null fields in Patch
  13858. // requests.
  13859. NullFields []string `json:"-"`
  13860. }
  13861. func (s *ManagedInstanceVersion) MarshalJSON() ([]byte, error) {
  13862. type NoMethod ManagedInstanceVersion
  13863. raw := NoMethod(*s)
  13864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13865. }
  13866. // Metadata: A metadata key/value entry.
  13867. type Metadata struct {
  13868. // Fingerprint: Specifies a fingerprint for this request, which is
  13869. // essentially a hash of the metadata's contents and used for optimistic
  13870. // locking. The fingerprint is initially generated by Compute Engine and
  13871. // changes after every request to modify or update metadata. You must
  13872. // always provide an up-to-date fingerprint hash in order to update or
  13873. // change metadata, otherwise the request will fail with error 412
  13874. // conditionNotMet.
  13875. //
  13876. // To see the latest fingerprint, make a get() request to retrieve the
  13877. // resource.
  13878. Fingerprint string `json:"fingerprint,omitempty"`
  13879. // Items: Array of key/value pairs. The total size of all keys and
  13880. // values must be less than 512 KB.
  13881. Items []*MetadataItems `json:"items,omitempty"`
  13882. // Kind: [Output Only] Type of the resource. Always compute#metadata for
  13883. // metadata.
  13884. Kind string `json:"kind,omitempty"`
  13885. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  13886. // unconditionally include in API requests. By default, fields with
  13887. // empty values are omitted from API requests. However, any non-pointer,
  13888. // non-interface field appearing in ForceSendFields will be sent to the
  13889. // server regardless of whether the field is empty or not. This may be
  13890. // used to include empty fields in Patch requests.
  13891. ForceSendFields []string `json:"-"`
  13892. // NullFields is a list of field names (e.g. "Fingerprint") to include
  13893. // in API requests with the JSON null value. By default, fields with
  13894. // empty values are omitted from API requests. However, any field with
  13895. // an empty value appearing in NullFields will be sent to the server as
  13896. // null. It is an error if a field in this list has a non-empty value.
  13897. // This may be used to include null fields in Patch requests.
  13898. NullFields []string `json:"-"`
  13899. }
  13900. func (s *Metadata) MarshalJSON() ([]byte, error) {
  13901. type NoMethod Metadata
  13902. raw := NoMethod(*s)
  13903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13904. }
  13905. type MetadataItems struct {
  13906. // Key: Key for the metadata entry. Keys must conform to the following
  13907. // regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is
  13908. // reflected as part of a URL in the metadata server. Additionally, to
  13909. // avoid ambiguity, keys must not conflict with any other metadata keys
  13910. // for the project.
  13911. Key string `json:"key,omitempty"`
  13912. // Value: Value for the metadata entry. These are free-form strings, and
  13913. // only have meaning as interpreted by the image running in the
  13914. // instance. The only restriction placed on values is that their size
  13915. // must be less than or equal to 262144 bytes (256 KiB).
  13916. Value *string `json:"value,omitempty"`
  13917. // ForceSendFields is a list of field names (e.g. "Key") to
  13918. // unconditionally include in API requests. By default, fields with
  13919. // empty values are omitted from API requests. However, any non-pointer,
  13920. // non-interface field appearing in ForceSendFields will be sent to the
  13921. // server regardless of whether the field is empty or not. This may be
  13922. // used to include empty fields in Patch requests.
  13923. ForceSendFields []string `json:"-"`
  13924. // NullFields is a list of field names (e.g. "Key") to include in API
  13925. // requests with the JSON null value. By default, fields with empty
  13926. // values are omitted from API requests. However, any field with an
  13927. // empty value appearing in NullFields will be sent to the server as
  13928. // null. It is an error if a field in this list has a non-empty value.
  13929. // This may be used to include null fields in Patch requests.
  13930. NullFields []string `json:"-"`
  13931. }
  13932. func (s *MetadataItems) MarshalJSON() ([]byte, error) {
  13933. type NoMethod MetadataItems
  13934. raw := NoMethod(*s)
  13935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13936. }
  13937. // NamedPort: The named port. For example: .
  13938. type NamedPort struct {
  13939. // Name: The name for this named port. The name must be 1-63 characters
  13940. // long, and comply with RFC1035.
  13941. Name string `json:"name,omitempty"`
  13942. // Port: The port number, which can be a value between 1 and 65535.
  13943. Port int64 `json:"port,omitempty"`
  13944. // ForceSendFields is a list of field names (e.g. "Name") to
  13945. // unconditionally include in API requests. By default, fields with
  13946. // empty values are omitted from API requests. However, any non-pointer,
  13947. // non-interface field appearing in ForceSendFields will be sent to the
  13948. // server regardless of whether the field is empty or not. This may be
  13949. // used to include empty fields in Patch requests.
  13950. ForceSendFields []string `json:"-"`
  13951. // NullFields is a list of field names (e.g. "Name") to include in API
  13952. // requests with the JSON null value. By default, fields with empty
  13953. // values are omitted from API requests. However, any field with an
  13954. // empty value appearing in NullFields will be sent to the server as
  13955. // null. It is an error if a field in this list has a non-empty value.
  13956. // This may be used to include null fields in Patch requests.
  13957. NullFields []string `json:"-"`
  13958. }
  13959. func (s *NamedPort) MarshalJSON() ([]byte, error) {
  13960. type NoMethod NamedPort
  13961. raw := NoMethod(*s)
  13962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  13963. }
  13964. // Network: Represents a Network resource. Read Virtual Private Cloud
  13965. // (VPC) Network Overview for more information. (== resource_for
  13966. // v1.networks ==) (== resource_for beta.networks ==)
  13967. type Network struct {
  13968. // IPv4Range: Deprecated in favor of subnet mode networks. The range of
  13969. // internal addresses that are legal on this network. This range is a
  13970. // CIDR specification, for example: 192.168.0.0/16. Provided by the
  13971. // client when the network is created.
  13972. IPv4Range string `json:"IPv4Range,omitempty"`
  13973. // AutoCreateSubnetworks: When set to true, the VPC network is created
  13974. // in "auto" mode. When set to false, the VPC network is created in
  13975. // "custom" mode.
  13976. //
  13977. // An auto mode VPC network starts with one subnet per region. Each
  13978. // subnet has a predetermined range as described in Auto mode VPC
  13979. // network IP ranges.
  13980. AutoCreateSubnetworks bool `json:"autoCreateSubnetworks,omitempty"`
  13981. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  13982. // format.
  13983. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  13984. // Description: An optional description of this resource. Provide this
  13985. // property when you create the resource.
  13986. Description string `json:"description,omitempty"`
  13987. // GatewayIPv4: [Output Only] The gateway address for default routing
  13988. // out of the network. This value is read only and is selected by GCP.
  13989. GatewayIPv4 string `json:"gatewayIPv4,omitempty"`
  13990. // Id: [Output Only] The unique identifier for the resource. This
  13991. // identifier is defined by the server.
  13992. Id uint64 `json:"id,omitempty,string"`
  13993. // Kind: [Output Only] Type of the resource. Always compute#network for
  13994. // networks.
  13995. Kind string `json:"kind,omitempty"`
  13996. // Name: Name of the resource. Provided by the client when the resource
  13997. // is created. The name must be 1-63 characters long, and comply with
  13998. // RFC1035. Specifically, the name must be 1-63 characters long and
  13999. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  14000. // the first character must be a lowercase letter, and all following
  14001. // characters must be a dash, lowercase letter, or digit, except the
  14002. // last character, which cannot be a dash.
  14003. Name string `json:"name,omitempty"`
  14004. // Peerings: [Output Only] A list of network peerings for the resource.
  14005. Peerings []*NetworkPeering `json:"peerings,omitempty"`
  14006. // RoutingConfig: The network-level routing configuration for this
  14007. // network. Used by Cloud Router to determine what type of network-wide
  14008. // routing behavior to enforce.
  14009. RoutingConfig *NetworkRoutingConfig `json:"routingConfig,omitempty"`
  14010. // SelfLink: [Output Only] Server-defined URL for the resource.
  14011. SelfLink string `json:"selfLink,omitempty"`
  14012. // Subnetworks: [Output Only] Server-defined fully-qualified URLs for
  14013. // all subnetworks in this VPC network.
  14014. Subnetworks []string `json:"subnetworks,omitempty"`
  14015. // ServerResponse contains the HTTP response code and headers from the
  14016. // server.
  14017. googleapi.ServerResponse `json:"-"`
  14018. // ForceSendFields is a list of field names (e.g. "IPv4Range") to
  14019. // unconditionally include in API requests. By default, fields with
  14020. // empty values are omitted from API requests. However, any non-pointer,
  14021. // non-interface field appearing in ForceSendFields will be sent to the
  14022. // server regardless of whether the field is empty or not. This may be
  14023. // used to include empty fields in Patch requests.
  14024. ForceSendFields []string `json:"-"`
  14025. // NullFields is a list of field names (e.g. "IPv4Range") to include in
  14026. // API requests with the JSON null value. By default, fields with empty
  14027. // values are omitted from API requests. However, any field with an
  14028. // empty value appearing in NullFields will be sent to the server as
  14029. // null. It is an error if a field in this list has a non-empty value.
  14030. // This may be used to include null fields in Patch requests.
  14031. NullFields []string `json:"-"`
  14032. }
  14033. func (s *Network) MarshalJSON() ([]byte, error) {
  14034. type NoMethod Network
  14035. raw := NoMethod(*s)
  14036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14037. }
  14038. // NetworkEndpoint: The network endpoint.
  14039. type NetworkEndpoint struct {
  14040. // Instance: The name for a specific VM instance that the IP address
  14041. // belongs to. This is required for network endpoints of type
  14042. // GCE_VM_IP_PORT. The instance must be in the same zone of network
  14043. // endpoint group.
  14044. //
  14045. // The name must be 1-63 characters long, and comply with RFC1035.
  14046. Instance string `json:"instance,omitempty"`
  14047. // IpAddress: Optional IPv4 address of network endpoint. The IP address
  14048. // must belong to a VM in GCE (either the primary IP or as part of an
  14049. // aliased IP range). If the IP address is not specified, then the
  14050. // primary IP address for the VM instance in the network that the
  14051. // network endpoint group belongs to will be used.
  14052. IpAddress string `json:"ipAddress,omitempty"`
  14053. // Port: Optional port number of network endpoint. If not specified and
  14054. // the NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the
  14055. // defaultPort for the network endpoint group will be used.
  14056. Port int64 `json:"port,omitempty"`
  14057. // ForceSendFields is a list of field names (e.g. "Instance") to
  14058. // unconditionally include in API requests. By default, fields with
  14059. // empty values are omitted from API requests. However, any non-pointer,
  14060. // non-interface field appearing in ForceSendFields will be sent to the
  14061. // server regardless of whether the field is empty or not. This may be
  14062. // used to include empty fields in Patch requests.
  14063. ForceSendFields []string `json:"-"`
  14064. // NullFields is a list of field names (e.g. "Instance") to include in
  14065. // API requests with the JSON null value. By default, fields with empty
  14066. // values are omitted from API requests. However, any field with an
  14067. // empty value appearing in NullFields will be sent to the server as
  14068. // null. It is an error if a field in this list has a non-empty value.
  14069. // This may be used to include null fields in Patch requests.
  14070. NullFields []string `json:"-"`
  14071. }
  14072. func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  14073. type NoMethod NetworkEndpoint
  14074. raw := NoMethod(*s)
  14075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14076. }
  14077. // NetworkEndpointGroup: Represents a collection of network endpoints.
  14078. type NetworkEndpointGroup struct {
  14079. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  14080. // format.
  14081. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  14082. // DefaultPort: The default port used if the port number is not
  14083. // specified in the network endpoint.
  14084. DefaultPort int64 `json:"defaultPort,omitempty"`
  14085. // Description: An optional description of this resource. Provide this
  14086. // property when you create the resource.
  14087. Description string `json:"description,omitempty"`
  14088. // Id: [Output Only] The unique identifier for the resource. This
  14089. // identifier is defined by the server.
  14090. Id uint64 `json:"id,omitempty,string"`
  14091. // Kind: [Output Only] Type of the resource. Always
  14092. // compute#networkEndpointGroup for network endpoint group.
  14093. Kind string `json:"kind,omitempty"`
  14094. // Name: Name of the resource; provided by the client when the resource
  14095. // is created. The name must be 1-63 characters long, and comply with
  14096. // RFC1035. Specifically, the name must be 1-63 characters long and
  14097. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  14098. // the first character must be a lowercase letter, and all following
  14099. // characters must be a dash, lowercase letter, or digit, except the
  14100. // last character, which cannot be a dash.
  14101. Name string `json:"name,omitempty"`
  14102. // Network: The URL of the network to which all network endpoints in the
  14103. // NEG belong. Uses "default" project network if unspecified.
  14104. Network string `json:"network,omitempty"`
  14105. // NetworkEndpointType: Type of network endpoints in this network
  14106. // endpoint group. Currently the only supported value is GCE_VM_IP_PORT.
  14107. //
  14108. // Possible values:
  14109. // "GCE_VM_IP_PORT"
  14110. NetworkEndpointType string `json:"networkEndpointType,omitempty"`
  14111. // SelfLink: [Output Only] Server-defined URL for the resource.
  14112. SelfLink string `json:"selfLink,omitempty"`
  14113. // Size: [Output only] Number of network endpoints in the network
  14114. // endpoint group.
  14115. Size int64 `json:"size,omitempty"`
  14116. // Subnetwork: Optional URL of the subnetwork to which all network
  14117. // endpoints in the NEG belong.
  14118. Subnetwork string `json:"subnetwork,omitempty"`
  14119. // Zone: [Output Only] The URL of the zone where the network endpoint
  14120. // group is located.
  14121. Zone string `json:"zone,omitempty"`
  14122. // ServerResponse contains the HTTP response code and headers from the
  14123. // server.
  14124. googleapi.ServerResponse `json:"-"`
  14125. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  14126. // to unconditionally include in API requests. By default, fields with
  14127. // empty values are omitted from API requests. However, any non-pointer,
  14128. // non-interface field appearing in ForceSendFields will be sent to the
  14129. // server regardless of whether the field is empty or not. This may be
  14130. // used to include empty fields in Patch requests.
  14131. ForceSendFields []string `json:"-"`
  14132. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  14133. // include in API requests with the JSON null value. By default, fields
  14134. // with empty values are omitted from API requests. However, any field
  14135. // with an empty value appearing in NullFields will be sent to the
  14136. // server as null. It is an error if a field in this list has a
  14137. // non-empty value. This may be used to include null fields in Patch
  14138. // requests.
  14139. NullFields []string `json:"-"`
  14140. }
  14141. func (s *NetworkEndpointGroup) MarshalJSON() ([]byte, error) {
  14142. type NoMethod NetworkEndpointGroup
  14143. raw := NoMethod(*s)
  14144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14145. }
  14146. type NetworkEndpointGroupAggregatedList struct {
  14147. // Id: [Output Only] Unique identifier for the resource; defined by the
  14148. // server.
  14149. Id string `json:"id,omitempty"`
  14150. // Items: A list of NetworkEndpointGroupsScopedList resources.
  14151. Items map[string]NetworkEndpointGroupsScopedList `json:"items,omitempty"`
  14152. // Kind: [Output Only] The resource type, which is always
  14153. // compute#networkEndpointGroupAggregatedList for aggregated lists of
  14154. // network endpoint groups.
  14155. Kind string `json:"kind,omitempty"`
  14156. // NextPageToken: [Output Only] This token allows you to get the next
  14157. // page of results for list requests. If the number of results is larger
  14158. // than maxResults, use the nextPageToken as a value for the query
  14159. // parameter pageToken in the next list request. Subsequent list
  14160. // requests will have their own nextPageToken to continue paging through
  14161. // the results.
  14162. NextPageToken string `json:"nextPageToken,omitempty"`
  14163. // SelfLink: [Output Only] Server-defined URL for this resource.
  14164. SelfLink string `json:"selfLink,omitempty"`
  14165. // Warning: [Output Only] Informational warning message.
  14166. Warning *NetworkEndpointGroupAggregatedListWarning `json:"warning,omitempty"`
  14167. // ServerResponse contains the HTTP response code and headers from the
  14168. // server.
  14169. googleapi.ServerResponse `json:"-"`
  14170. // ForceSendFields is a list of field names (e.g. "Id") to
  14171. // unconditionally include in API requests. By default, fields with
  14172. // empty values are omitted from API requests. However, any non-pointer,
  14173. // non-interface field appearing in ForceSendFields will be sent to the
  14174. // server regardless of whether the field is empty or not. This may be
  14175. // used to include empty fields in Patch requests.
  14176. ForceSendFields []string `json:"-"`
  14177. // NullFields is a list of field names (e.g. "Id") to include in API
  14178. // requests with the JSON null value. By default, fields with empty
  14179. // values are omitted from API requests. However, any field with an
  14180. // empty value appearing in NullFields will be sent to the server as
  14181. // null. It is an error if a field in this list has a non-empty value.
  14182. // This may be used to include null fields in Patch requests.
  14183. NullFields []string `json:"-"`
  14184. }
  14185. func (s *NetworkEndpointGroupAggregatedList) MarshalJSON() ([]byte, error) {
  14186. type NoMethod NetworkEndpointGroupAggregatedList
  14187. raw := NoMethod(*s)
  14188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14189. }
  14190. // NetworkEndpointGroupAggregatedListWarning: [Output Only]
  14191. // Informational warning message.
  14192. type NetworkEndpointGroupAggregatedListWarning struct {
  14193. // Code: [Output Only] A warning code, if applicable. For example,
  14194. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14195. // the response.
  14196. //
  14197. // Possible values:
  14198. // "CLEANUP_FAILED"
  14199. // "DEPRECATED_RESOURCE_USED"
  14200. // "DEPRECATED_TYPE_USED"
  14201. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14202. // "EXPERIMENTAL_TYPE_USED"
  14203. // "EXTERNAL_API_WARNING"
  14204. // "FIELD_VALUE_OVERRIDEN"
  14205. // "INJECTED_KERNELS_DEPRECATED"
  14206. // "MISSING_TYPE_DEPENDENCY"
  14207. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14208. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14209. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14210. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14211. // "NEXT_HOP_NOT_RUNNING"
  14212. // "NOT_CRITICAL_ERROR"
  14213. // "NO_RESULTS_ON_PAGE"
  14214. // "REQUIRED_TOS_AGREEMENT"
  14215. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14216. // "RESOURCE_NOT_DELETED"
  14217. // "SCHEMA_VALIDATION_IGNORED"
  14218. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14219. // "UNDECLARED_PROPERTIES"
  14220. // "UNREACHABLE"
  14221. Code string `json:"code,omitempty"`
  14222. // Data: [Output Only] Metadata about this warning in key: value format.
  14223. // For example:
  14224. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14225. Data []*NetworkEndpointGroupAggregatedListWarningData `json:"data,omitempty"`
  14226. // Message: [Output Only] A human-readable description of the warning
  14227. // code.
  14228. Message string `json:"message,omitempty"`
  14229. // ForceSendFields is a list of field names (e.g. "Code") to
  14230. // unconditionally include in API requests. By default, fields with
  14231. // empty values are omitted from API requests. However, any non-pointer,
  14232. // non-interface field appearing in ForceSendFields will be sent to the
  14233. // server regardless of whether the field is empty or not. This may be
  14234. // used to include empty fields in Patch requests.
  14235. ForceSendFields []string `json:"-"`
  14236. // NullFields is a list of field names (e.g. "Code") to include in API
  14237. // requests with the JSON null value. By default, fields with empty
  14238. // values are omitted from API requests. However, any field with an
  14239. // empty value appearing in NullFields will be sent to the server as
  14240. // null. It is an error if a field in this list has a non-empty value.
  14241. // This may be used to include null fields in Patch requests.
  14242. NullFields []string `json:"-"`
  14243. }
  14244. func (s *NetworkEndpointGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  14245. type NoMethod NetworkEndpointGroupAggregatedListWarning
  14246. raw := NoMethod(*s)
  14247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14248. }
  14249. type NetworkEndpointGroupAggregatedListWarningData struct {
  14250. // Key: [Output Only] A key that provides more detail on the warning
  14251. // being returned. For example, for warnings where there are no results
  14252. // in a list request for a particular zone, this key might be scope and
  14253. // the key value might be the zone name. Other examples might be a key
  14254. // indicating a deprecated resource and a suggested replacement, or a
  14255. // warning about invalid network settings (for example, if an instance
  14256. // attempts to perform IP forwarding but is not enabled for IP
  14257. // forwarding).
  14258. Key string `json:"key,omitempty"`
  14259. // Value: [Output Only] A warning data value corresponding to the key.
  14260. Value string `json:"value,omitempty"`
  14261. // ForceSendFields is a list of field names (e.g. "Key") to
  14262. // unconditionally include in API requests. By default, fields with
  14263. // empty values are omitted from API requests. However, any non-pointer,
  14264. // non-interface field appearing in ForceSendFields will be sent to the
  14265. // server regardless of whether the field is empty or not. This may be
  14266. // used to include empty fields in Patch requests.
  14267. ForceSendFields []string `json:"-"`
  14268. // NullFields is a list of field names (e.g. "Key") to include in API
  14269. // requests with the JSON null value. By default, fields with empty
  14270. // values are omitted from API requests. However, any field with an
  14271. // empty value appearing in NullFields will be sent to the server as
  14272. // null. It is an error if a field in this list has a non-empty value.
  14273. // This may be used to include null fields in Patch requests.
  14274. NullFields []string `json:"-"`
  14275. }
  14276. func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  14277. type NoMethod NetworkEndpointGroupAggregatedListWarningData
  14278. raw := NoMethod(*s)
  14279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14280. }
  14281. type NetworkEndpointGroupList struct {
  14282. // Id: [Output Only] Unique identifier for the resource; defined by the
  14283. // server.
  14284. Id string `json:"id,omitempty"`
  14285. // Items: A list of NetworkEndpointGroup resources.
  14286. Items []*NetworkEndpointGroup `json:"items,omitempty"`
  14287. // Kind: [Output Only] The resource type, which is always
  14288. // compute#networkEndpointGroupList for network endpoint group lists.
  14289. Kind string `json:"kind,omitempty"`
  14290. // NextPageToken: [Output Only] This token allows you to get the next
  14291. // page of results for list requests. If the number of results is larger
  14292. // than maxResults, use the nextPageToken as a value for the query
  14293. // parameter pageToken in the next list request. Subsequent list
  14294. // requests will have their own nextPageToken to continue paging through
  14295. // the results.
  14296. NextPageToken string `json:"nextPageToken,omitempty"`
  14297. // SelfLink: [Output Only] Server-defined URL for this resource.
  14298. SelfLink string `json:"selfLink,omitempty"`
  14299. // Warning: [Output Only] Informational warning message.
  14300. Warning *NetworkEndpointGroupListWarning `json:"warning,omitempty"`
  14301. // ServerResponse contains the HTTP response code and headers from the
  14302. // server.
  14303. googleapi.ServerResponse `json:"-"`
  14304. // ForceSendFields is a list of field names (e.g. "Id") to
  14305. // unconditionally include in API requests. By default, fields with
  14306. // empty values are omitted from API requests. However, any non-pointer,
  14307. // non-interface field appearing in ForceSendFields will be sent to the
  14308. // server regardless of whether the field is empty or not. This may be
  14309. // used to include empty fields in Patch requests.
  14310. ForceSendFields []string `json:"-"`
  14311. // NullFields is a list of field names (e.g. "Id") to include in API
  14312. // requests with the JSON null value. By default, fields with empty
  14313. // values are omitted from API requests. However, any field with an
  14314. // empty value appearing in NullFields will be sent to the server as
  14315. // null. It is an error if a field in this list has a non-empty value.
  14316. // This may be used to include null fields in Patch requests.
  14317. NullFields []string `json:"-"`
  14318. }
  14319. func (s *NetworkEndpointGroupList) MarshalJSON() ([]byte, error) {
  14320. type NoMethod NetworkEndpointGroupList
  14321. raw := NoMethod(*s)
  14322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14323. }
  14324. // NetworkEndpointGroupListWarning: [Output Only] Informational warning
  14325. // message.
  14326. type NetworkEndpointGroupListWarning struct {
  14327. // Code: [Output Only] A warning code, if applicable. For example,
  14328. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14329. // the response.
  14330. //
  14331. // Possible values:
  14332. // "CLEANUP_FAILED"
  14333. // "DEPRECATED_RESOURCE_USED"
  14334. // "DEPRECATED_TYPE_USED"
  14335. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14336. // "EXPERIMENTAL_TYPE_USED"
  14337. // "EXTERNAL_API_WARNING"
  14338. // "FIELD_VALUE_OVERRIDEN"
  14339. // "INJECTED_KERNELS_DEPRECATED"
  14340. // "MISSING_TYPE_DEPENDENCY"
  14341. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14342. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14343. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14344. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14345. // "NEXT_HOP_NOT_RUNNING"
  14346. // "NOT_CRITICAL_ERROR"
  14347. // "NO_RESULTS_ON_PAGE"
  14348. // "REQUIRED_TOS_AGREEMENT"
  14349. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14350. // "RESOURCE_NOT_DELETED"
  14351. // "SCHEMA_VALIDATION_IGNORED"
  14352. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14353. // "UNDECLARED_PROPERTIES"
  14354. // "UNREACHABLE"
  14355. Code string `json:"code,omitempty"`
  14356. // Data: [Output Only] Metadata about this warning in key: value format.
  14357. // For example:
  14358. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14359. Data []*NetworkEndpointGroupListWarningData `json:"data,omitempty"`
  14360. // Message: [Output Only] A human-readable description of the warning
  14361. // code.
  14362. Message string `json:"message,omitempty"`
  14363. // ForceSendFields is a list of field names (e.g. "Code") to
  14364. // unconditionally include in API requests. By default, fields with
  14365. // empty values are omitted from API requests. However, any non-pointer,
  14366. // non-interface field appearing in ForceSendFields will be sent to the
  14367. // server regardless of whether the field is empty or not. This may be
  14368. // used to include empty fields in Patch requests.
  14369. ForceSendFields []string `json:"-"`
  14370. // NullFields is a list of field names (e.g. "Code") to include in API
  14371. // requests with the JSON null value. By default, fields with empty
  14372. // values are omitted from API requests. However, any field with an
  14373. // empty value appearing in NullFields will be sent to the server as
  14374. // null. It is an error if a field in this list has a non-empty value.
  14375. // This may be used to include null fields in Patch requests.
  14376. NullFields []string `json:"-"`
  14377. }
  14378. func (s *NetworkEndpointGroupListWarning) MarshalJSON() ([]byte, error) {
  14379. type NoMethod NetworkEndpointGroupListWarning
  14380. raw := NoMethod(*s)
  14381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14382. }
  14383. type NetworkEndpointGroupListWarningData struct {
  14384. // Key: [Output Only] A key that provides more detail on the warning
  14385. // being returned. For example, for warnings where there are no results
  14386. // in a list request for a particular zone, this key might be scope and
  14387. // the key value might be the zone name. Other examples might be a key
  14388. // indicating a deprecated resource and a suggested replacement, or a
  14389. // warning about invalid network settings (for example, if an instance
  14390. // attempts to perform IP forwarding but is not enabled for IP
  14391. // forwarding).
  14392. Key string `json:"key,omitempty"`
  14393. // Value: [Output Only] A warning data value corresponding to the key.
  14394. Value string `json:"value,omitempty"`
  14395. // ForceSendFields is a list of field names (e.g. "Key") to
  14396. // unconditionally include in API requests. By default, fields with
  14397. // empty values are omitted from API requests. However, any non-pointer,
  14398. // non-interface field appearing in ForceSendFields will be sent to the
  14399. // server regardless of whether the field is empty or not. This may be
  14400. // used to include empty fields in Patch requests.
  14401. ForceSendFields []string `json:"-"`
  14402. // NullFields is a list of field names (e.g. "Key") to include in API
  14403. // requests with the JSON null value. By default, fields with empty
  14404. // values are omitted from API requests. However, any field with an
  14405. // empty value appearing in NullFields will be sent to the server as
  14406. // null. It is an error if a field in this list has a non-empty value.
  14407. // This may be used to include null fields in Patch requests.
  14408. NullFields []string `json:"-"`
  14409. }
  14410. func (s *NetworkEndpointGroupListWarningData) MarshalJSON() ([]byte, error) {
  14411. type NoMethod NetworkEndpointGroupListWarningData
  14412. raw := NoMethod(*s)
  14413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14414. }
  14415. type NetworkEndpointGroupsAttachEndpointsRequest struct {
  14416. // NetworkEndpoints: The list of network endpoints to be attached.
  14417. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  14418. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  14419. // unconditionally include in API requests. By default, fields with
  14420. // empty values are omitted from API requests. However, any non-pointer,
  14421. // non-interface field appearing in ForceSendFields will be sent to the
  14422. // server regardless of whether the field is empty or not. This may be
  14423. // used to include empty fields in Patch requests.
  14424. ForceSendFields []string `json:"-"`
  14425. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  14426. // include in API requests with the JSON null value. By default, fields
  14427. // with empty values are omitted from API requests. However, any field
  14428. // with an empty value appearing in NullFields will be sent to the
  14429. // server as null. It is an error if a field in this list has a
  14430. // non-empty value. This may be used to include null fields in Patch
  14431. // requests.
  14432. NullFields []string `json:"-"`
  14433. }
  14434. func (s *NetworkEndpointGroupsAttachEndpointsRequest) MarshalJSON() ([]byte, error) {
  14435. type NoMethod NetworkEndpointGroupsAttachEndpointsRequest
  14436. raw := NoMethod(*s)
  14437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14438. }
  14439. type NetworkEndpointGroupsDetachEndpointsRequest struct {
  14440. // NetworkEndpoints: The list of network endpoints to be detached.
  14441. NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  14442. // ForceSendFields is a list of field names (e.g. "NetworkEndpoints") to
  14443. // unconditionally include in API requests. By default, fields with
  14444. // empty values are omitted from API requests. However, any non-pointer,
  14445. // non-interface field appearing in ForceSendFields will be sent to the
  14446. // server regardless of whether the field is empty or not. This may be
  14447. // used to include empty fields in Patch requests.
  14448. ForceSendFields []string `json:"-"`
  14449. // NullFields is a list of field names (e.g. "NetworkEndpoints") to
  14450. // include in API requests with the JSON null value. By default, fields
  14451. // with empty values are omitted from API requests. However, any field
  14452. // with an empty value appearing in NullFields will be sent to the
  14453. // server as null. It is an error if a field in this list has a
  14454. // non-empty value. This may be used to include null fields in Patch
  14455. // requests.
  14456. NullFields []string `json:"-"`
  14457. }
  14458. func (s *NetworkEndpointGroupsDetachEndpointsRequest) MarshalJSON() ([]byte, error) {
  14459. type NoMethod NetworkEndpointGroupsDetachEndpointsRequest
  14460. raw := NoMethod(*s)
  14461. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14462. }
  14463. type NetworkEndpointGroupsListEndpointsRequest struct {
  14464. // HealthStatus: Optional query parameter for showing the health status
  14465. // of each network endpoint. Valid options are SKIP or SHOW. If you
  14466. // don't specifiy this parameter, the health status of network endpoints
  14467. // will not be provided.
  14468. //
  14469. // Possible values:
  14470. // "SHOW"
  14471. // "SKIP"
  14472. HealthStatus string `json:"healthStatus,omitempty"`
  14473. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  14474. // unconditionally include in API requests. By default, fields with
  14475. // empty values are omitted from API requests. However, any non-pointer,
  14476. // non-interface field appearing in ForceSendFields will be sent to the
  14477. // server regardless of whether the field is empty or not. This may be
  14478. // used to include empty fields in Patch requests.
  14479. ForceSendFields []string `json:"-"`
  14480. // NullFields is a list of field names (e.g. "HealthStatus") to include
  14481. // in API requests with the JSON null value. By default, fields with
  14482. // empty values are omitted from API requests. However, any field with
  14483. // an empty value appearing in NullFields will be sent to the server as
  14484. // null. It is an error if a field in this list has a non-empty value.
  14485. // This may be used to include null fields in Patch requests.
  14486. NullFields []string `json:"-"`
  14487. }
  14488. func (s *NetworkEndpointGroupsListEndpointsRequest) MarshalJSON() ([]byte, error) {
  14489. type NoMethod NetworkEndpointGroupsListEndpointsRequest
  14490. raw := NoMethod(*s)
  14491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14492. }
  14493. type NetworkEndpointGroupsListNetworkEndpoints struct {
  14494. // Id: [Output Only] Unique identifier for the resource; defined by the
  14495. // server.
  14496. Id string `json:"id,omitempty"`
  14497. // Items: A list of NetworkEndpointWithHealthStatus resources.
  14498. Items []*NetworkEndpointWithHealthStatus `json:"items,omitempty"`
  14499. // Kind: [Output Only] The resource type, which is always
  14500. // compute#networkEndpointGroupsListNetworkEndpoints for the list of
  14501. // network endpoints in the specified network endpoint group.
  14502. Kind string `json:"kind,omitempty"`
  14503. // NextPageToken: [Output Only] This token allows you to get the next
  14504. // page of results for list requests. If the number of results is larger
  14505. // than maxResults, use the nextPageToken as a value for the query
  14506. // parameter pageToken in the next list request. Subsequent list
  14507. // requests will have their own nextPageToken to continue paging through
  14508. // the results.
  14509. NextPageToken string `json:"nextPageToken,omitempty"`
  14510. // Warning: [Output Only] Informational warning message.
  14511. Warning *NetworkEndpointGroupsListNetworkEndpointsWarning `json:"warning,omitempty"`
  14512. // ServerResponse contains the HTTP response code and headers from the
  14513. // server.
  14514. googleapi.ServerResponse `json:"-"`
  14515. // ForceSendFields is a list of field names (e.g. "Id") to
  14516. // unconditionally include in API requests. By default, fields with
  14517. // empty values are omitted from API requests. However, any non-pointer,
  14518. // non-interface field appearing in ForceSendFields will be sent to the
  14519. // server regardless of whether the field is empty or not. This may be
  14520. // used to include empty fields in Patch requests.
  14521. ForceSendFields []string `json:"-"`
  14522. // NullFields is a list of field names (e.g. "Id") to include in API
  14523. // requests with the JSON null value. By default, fields with empty
  14524. // values are omitted from API requests. However, any field with an
  14525. // empty value appearing in NullFields will be sent to the server as
  14526. // null. It is an error if a field in this list has a non-empty value.
  14527. // This may be used to include null fields in Patch requests.
  14528. NullFields []string `json:"-"`
  14529. }
  14530. func (s *NetworkEndpointGroupsListNetworkEndpoints) MarshalJSON() ([]byte, error) {
  14531. type NoMethod NetworkEndpointGroupsListNetworkEndpoints
  14532. raw := NoMethod(*s)
  14533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14534. }
  14535. // NetworkEndpointGroupsListNetworkEndpointsWarning: [Output Only]
  14536. // Informational warning message.
  14537. type NetworkEndpointGroupsListNetworkEndpointsWarning struct {
  14538. // Code: [Output Only] A warning code, if applicable. For example,
  14539. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14540. // the response.
  14541. //
  14542. // Possible values:
  14543. // "CLEANUP_FAILED"
  14544. // "DEPRECATED_RESOURCE_USED"
  14545. // "DEPRECATED_TYPE_USED"
  14546. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14547. // "EXPERIMENTAL_TYPE_USED"
  14548. // "EXTERNAL_API_WARNING"
  14549. // "FIELD_VALUE_OVERRIDEN"
  14550. // "INJECTED_KERNELS_DEPRECATED"
  14551. // "MISSING_TYPE_DEPENDENCY"
  14552. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14553. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14554. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14555. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14556. // "NEXT_HOP_NOT_RUNNING"
  14557. // "NOT_CRITICAL_ERROR"
  14558. // "NO_RESULTS_ON_PAGE"
  14559. // "REQUIRED_TOS_AGREEMENT"
  14560. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14561. // "RESOURCE_NOT_DELETED"
  14562. // "SCHEMA_VALIDATION_IGNORED"
  14563. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14564. // "UNDECLARED_PROPERTIES"
  14565. // "UNREACHABLE"
  14566. Code string `json:"code,omitempty"`
  14567. // Data: [Output Only] Metadata about this warning in key: value format.
  14568. // For example:
  14569. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14570. Data []*NetworkEndpointGroupsListNetworkEndpointsWarningData `json:"data,omitempty"`
  14571. // Message: [Output Only] A human-readable description of the warning
  14572. // code.
  14573. Message string `json:"message,omitempty"`
  14574. // ForceSendFields is a list of field names (e.g. "Code") to
  14575. // unconditionally include in API requests. By default, fields with
  14576. // empty values are omitted from API requests. However, any non-pointer,
  14577. // non-interface field appearing in ForceSendFields will be sent to the
  14578. // server regardless of whether the field is empty or not. This may be
  14579. // used to include empty fields in Patch requests.
  14580. ForceSendFields []string `json:"-"`
  14581. // NullFields is a list of field names (e.g. "Code") to include in API
  14582. // requests with the JSON null value. By default, fields with empty
  14583. // values are omitted from API requests. However, any field with an
  14584. // empty value appearing in NullFields will be sent to the server as
  14585. // null. It is an error if a field in this list has a non-empty value.
  14586. // This may be used to include null fields in Patch requests.
  14587. NullFields []string `json:"-"`
  14588. }
  14589. func (s *NetworkEndpointGroupsListNetworkEndpointsWarning) MarshalJSON() ([]byte, error) {
  14590. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarning
  14591. raw := NoMethod(*s)
  14592. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14593. }
  14594. type NetworkEndpointGroupsListNetworkEndpointsWarningData struct {
  14595. // Key: [Output Only] A key that provides more detail on the warning
  14596. // being returned. For example, for warnings where there are no results
  14597. // in a list request for a particular zone, this key might be scope and
  14598. // the key value might be the zone name. Other examples might be a key
  14599. // indicating a deprecated resource and a suggested replacement, or a
  14600. // warning about invalid network settings (for example, if an instance
  14601. // attempts to perform IP forwarding but is not enabled for IP
  14602. // forwarding).
  14603. Key string `json:"key,omitempty"`
  14604. // Value: [Output Only] A warning data value corresponding to the key.
  14605. Value string `json:"value,omitempty"`
  14606. // ForceSendFields is a list of field names (e.g. "Key") to
  14607. // unconditionally include in API requests. By default, fields with
  14608. // empty values are omitted from API requests. However, any non-pointer,
  14609. // non-interface field appearing in ForceSendFields will be sent to the
  14610. // server regardless of whether the field is empty or not. This may be
  14611. // used to include empty fields in Patch requests.
  14612. ForceSendFields []string `json:"-"`
  14613. // NullFields is a list of field names (e.g. "Key") to include in API
  14614. // requests with the JSON null value. By default, fields with empty
  14615. // values are omitted from API requests. However, any field with an
  14616. // empty value appearing in NullFields will be sent to the server as
  14617. // null. It is an error if a field in this list has a non-empty value.
  14618. // This may be used to include null fields in Patch requests.
  14619. NullFields []string `json:"-"`
  14620. }
  14621. func (s *NetworkEndpointGroupsListNetworkEndpointsWarningData) MarshalJSON() ([]byte, error) {
  14622. type NoMethod NetworkEndpointGroupsListNetworkEndpointsWarningData
  14623. raw := NoMethod(*s)
  14624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14625. }
  14626. type NetworkEndpointGroupsScopedList struct {
  14627. // NetworkEndpointGroups: [Output Only] The list of network endpoint
  14628. // groups that are contained in this scope.
  14629. NetworkEndpointGroups []*NetworkEndpointGroup `json:"networkEndpointGroups,omitempty"`
  14630. // Warning: [Output Only] An informational warning that replaces the
  14631. // list of network endpoint groups when the list is empty.
  14632. Warning *NetworkEndpointGroupsScopedListWarning `json:"warning,omitempty"`
  14633. // ForceSendFields is a list of field names (e.g.
  14634. // "NetworkEndpointGroups") to unconditionally include in API requests.
  14635. // By default, fields with empty values are omitted from API requests.
  14636. // However, any non-pointer, non-interface field appearing in
  14637. // ForceSendFields will be sent to the server regardless of whether the
  14638. // field is empty or not. This may be used to include empty fields in
  14639. // Patch requests.
  14640. ForceSendFields []string `json:"-"`
  14641. // NullFields is a list of field names (e.g. "NetworkEndpointGroups") to
  14642. // include in API requests with the JSON null value. By default, fields
  14643. // with empty values are omitted from API requests. However, any field
  14644. // with an empty value appearing in NullFields will be sent to the
  14645. // server as null. It is an error if a field in this list has a
  14646. // non-empty value. This may be used to include null fields in Patch
  14647. // requests.
  14648. NullFields []string `json:"-"`
  14649. }
  14650. func (s *NetworkEndpointGroupsScopedList) MarshalJSON() ([]byte, error) {
  14651. type NoMethod NetworkEndpointGroupsScopedList
  14652. raw := NoMethod(*s)
  14653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14654. }
  14655. // NetworkEndpointGroupsScopedListWarning: [Output Only] An
  14656. // informational warning that replaces the list of network endpoint
  14657. // groups when the list is empty.
  14658. type NetworkEndpointGroupsScopedListWarning struct {
  14659. // Code: [Output Only] A warning code, if applicable. For example,
  14660. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14661. // the response.
  14662. //
  14663. // Possible values:
  14664. // "CLEANUP_FAILED"
  14665. // "DEPRECATED_RESOURCE_USED"
  14666. // "DEPRECATED_TYPE_USED"
  14667. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14668. // "EXPERIMENTAL_TYPE_USED"
  14669. // "EXTERNAL_API_WARNING"
  14670. // "FIELD_VALUE_OVERRIDEN"
  14671. // "INJECTED_KERNELS_DEPRECATED"
  14672. // "MISSING_TYPE_DEPENDENCY"
  14673. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14674. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14675. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14676. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14677. // "NEXT_HOP_NOT_RUNNING"
  14678. // "NOT_CRITICAL_ERROR"
  14679. // "NO_RESULTS_ON_PAGE"
  14680. // "REQUIRED_TOS_AGREEMENT"
  14681. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14682. // "RESOURCE_NOT_DELETED"
  14683. // "SCHEMA_VALIDATION_IGNORED"
  14684. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14685. // "UNDECLARED_PROPERTIES"
  14686. // "UNREACHABLE"
  14687. Code string `json:"code,omitempty"`
  14688. // Data: [Output Only] Metadata about this warning in key: value format.
  14689. // For example:
  14690. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14691. Data []*NetworkEndpointGroupsScopedListWarningData `json:"data,omitempty"`
  14692. // Message: [Output Only] A human-readable description of the warning
  14693. // code.
  14694. Message string `json:"message,omitempty"`
  14695. // ForceSendFields is a list of field names (e.g. "Code") to
  14696. // unconditionally include in API requests. By default, fields with
  14697. // empty values are omitted from API requests. However, any non-pointer,
  14698. // non-interface field appearing in ForceSendFields will be sent to the
  14699. // server regardless of whether the field is empty or not. This may be
  14700. // used to include empty fields in Patch requests.
  14701. ForceSendFields []string `json:"-"`
  14702. // NullFields is a list of field names (e.g. "Code") to include in API
  14703. // requests with the JSON null value. By default, fields with empty
  14704. // values are omitted from API requests. However, any field with an
  14705. // empty value appearing in NullFields will be sent to the server as
  14706. // null. It is an error if a field in this list has a non-empty value.
  14707. // This may be used to include null fields in Patch requests.
  14708. NullFields []string `json:"-"`
  14709. }
  14710. func (s *NetworkEndpointGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  14711. type NoMethod NetworkEndpointGroupsScopedListWarning
  14712. raw := NoMethod(*s)
  14713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14714. }
  14715. type NetworkEndpointGroupsScopedListWarningData struct {
  14716. // Key: [Output Only] A key that provides more detail on the warning
  14717. // being returned. For example, for warnings where there are no results
  14718. // in a list request for a particular zone, this key might be scope and
  14719. // the key value might be the zone name. Other examples might be a key
  14720. // indicating a deprecated resource and a suggested replacement, or a
  14721. // warning about invalid network settings (for example, if an instance
  14722. // attempts to perform IP forwarding but is not enabled for IP
  14723. // forwarding).
  14724. Key string `json:"key,omitempty"`
  14725. // Value: [Output Only] A warning data value corresponding to the key.
  14726. Value string `json:"value,omitempty"`
  14727. // ForceSendFields is a list of field names (e.g. "Key") to
  14728. // unconditionally include in API requests. By default, fields with
  14729. // empty values are omitted from API requests. However, any non-pointer,
  14730. // non-interface field appearing in ForceSendFields will be sent to the
  14731. // server regardless of whether the field is empty or not. This may be
  14732. // used to include empty fields in Patch requests.
  14733. ForceSendFields []string `json:"-"`
  14734. // NullFields is a list of field names (e.g. "Key") to include in API
  14735. // requests with the JSON null value. By default, fields with empty
  14736. // values are omitted from API requests. However, any field with an
  14737. // empty value appearing in NullFields will be sent to the server as
  14738. // null. It is an error if a field in this list has a non-empty value.
  14739. // This may be used to include null fields in Patch requests.
  14740. NullFields []string `json:"-"`
  14741. }
  14742. func (s *NetworkEndpointGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  14743. type NoMethod NetworkEndpointGroupsScopedListWarningData
  14744. raw := NoMethod(*s)
  14745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14746. }
  14747. type NetworkEndpointWithHealthStatus struct {
  14748. // Healths: [Output only] The health status of network endpoint;
  14749. Healths []*HealthStatusForNetworkEndpoint `json:"healths,omitempty"`
  14750. // NetworkEndpoint: [Output only] The network endpoint;
  14751. NetworkEndpoint *NetworkEndpoint `json:"networkEndpoint,omitempty"`
  14752. // ForceSendFields is a list of field names (e.g. "Healths") to
  14753. // unconditionally include in API requests. By default, fields with
  14754. // empty values are omitted from API requests. However, any non-pointer,
  14755. // non-interface field appearing in ForceSendFields will be sent to the
  14756. // server regardless of whether the field is empty or not. This may be
  14757. // used to include empty fields in Patch requests.
  14758. ForceSendFields []string `json:"-"`
  14759. // NullFields is a list of field names (e.g. "Healths") to include in
  14760. // API requests with the JSON null value. By default, fields with empty
  14761. // values are omitted from API requests. However, any field with an
  14762. // empty value appearing in NullFields will be sent to the server as
  14763. // null. It is an error if a field in this list has a non-empty value.
  14764. // This may be used to include null fields in Patch requests.
  14765. NullFields []string `json:"-"`
  14766. }
  14767. func (s *NetworkEndpointWithHealthStatus) MarshalJSON() ([]byte, error) {
  14768. type NoMethod NetworkEndpointWithHealthStatus
  14769. raw := NoMethod(*s)
  14770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14771. }
  14772. // NetworkInterface: A network interface resource attached to an
  14773. // instance.
  14774. type NetworkInterface struct {
  14775. // AccessConfigs: An array of configurations for this interface.
  14776. // Currently, only one access config, ONE_TO_ONE_NAT, is supported. If
  14777. // there are no accessConfigs specified, then this instance will have no
  14778. // external internet access.
  14779. AccessConfigs []*AccessConfig `json:"accessConfigs,omitempty"`
  14780. // AliasIpRanges: An array of alias IP ranges for this network
  14781. // interface. Can only be specified for network interfaces on
  14782. // subnet-mode networks.
  14783. AliasIpRanges []*AliasIpRange `json:"aliasIpRanges,omitempty"`
  14784. // Fingerprint: Fingerprint hash of contents stored in this network
  14785. // interface. This field will be ignored when inserting an Instance or
  14786. // adding a NetworkInterface. An up-to-date fingerprint must be provided
  14787. // in order to update the NetworkInterface, otherwise the request will
  14788. // fail with error 412 conditionNotMet.
  14789. Fingerprint string `json:"fingerprint,omitempty"`
  14790. // Kind: [Output Only] Type of the resource. Always
  14791. // compute#networkInterface for network interfaces.
  14792. Kind string `json:"kind,omitempty"`
  14793. // Name: [Output Only] The name of the network interface, generated by
  14794. // the server. For network devices, these are eth0, eth1, etc.
  14795. Name string `json:"name,omitempty"`
  14796. // Network: URL of the network resource for this instance. When creating
  14797. // an instance, if neither the network nor the subnetwork is specified,
  14798. // the default network global/networks/default is used; if the network
  14799. // is not specified but the subnetwork is specified, the network is
  14800. // inferred.
  14801. //
  14802. // This field is optional when creating a firewall rule. If not
  14803. // specified when creating a firewall rule, the default network
  14804. // global/networks/default is used.
  14805. //
  14806. // If you specify this property, you can specify the network as a full
  14807. // or partial URL. For example, the following are all valid URLs:
  14808. // -
  14809. // https://www.googleapis.com/compute/v1/projects/project/global/networks/network
  14810. // - projects/project/global/networks/network
  14811. // - global/networks/default
  14812. Network string `json:"network,omitempty"`
  14813. // NetworkIP: An IPv4 internal network address to assign to the instance
  14814. // for this network interface. If not specified by the user, an unused
  14815. // internal IP is assigned by the system.
  14816. NetworkIP string `json:"networkIP,omitempty"`
  14817. // Subnetwork: The URL of the Subnetwork resource for this instance. If
  14818. // the network resource is in legacy mode, do not provide this property.
  14819. // If the network is in auto subnet mode, providing the subnetwork is
  14820. // optional. If the network is in custom subnet mode, then this field
  14821. // should be specified. If you specify this property, you can specify
  14822. // the subnetwork as a full or partial URL. For example, the following
  14823. // are all valid URLs:
  14824. // -
  14825. // https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
  14826. // - regions/region/subnetworks/subnetwork
  14827. Subnetwork string `json:"subnetwork,omitempty"`
  14828. // ForceSendFields is a list of field names (e.g. "AccessConfigs") to
  14829. // unconditionally include in API requests. By default, fields with
  14830. // empty values are omitted from API requests. However, any non-pointer,
  14831. // non-interface field appearing in ForceSendFields will be sent to the
  14832. // server regardless of whether the field is empty or not. This may be
  14833. // used to include empty fields in Patch requests.
  14834. ForceSendFields []string `json:"-"`
  14835. // NullFields is a list of field names (e.g. "AccessConfigs") to include
  14836. // in API requests with the JSON null value. By default, fields with
  14837. // empty values are omitted from API requests. However, any field with
  14838. // an empty value appearing in NullFields will be sent to the server as
  14839. // null. It is an error if a field in this list has a non-empty value.
  14840. // This may be used to include null fields in Patch requests.
  14841. NullFields []string `json:"-"`
  14842. }
  14843. func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  14844. type NoMethod NetworkInterface
  14845. raw := NoMethod(*s)
  14846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14847. }
  14848. // NetworkList: Contains a list of networks.
  14849. type NetworkList struct {
  14850. // Id: [Output Only] Unique identifier for the resource; defined by the
  14851. // server.
  14852. Id string `json:"id,omitempty"`
  14853. // Items: A list of Network resources.
  14854. Items []*Network `json:"items,omitempty"`
  14855. // Kind: [Output Only] Type of resource. Always compute#networkList for
  14856. // lists of networks.
  14857. Kind string `json:"kind,omitempty"`
  14858. // NextPageToken: [Output Only] This token allows you to get the next
  14859. // page of results for list requests. If the number of results is larger
  14860. // than maxResults, use the nextPageToken as a value for the query
  14861. // parameter pageToken in the next list request. Subsequent list
  14862. // requests will have their own nextPageToken to continue paging through
  14863. // the results.
  14864. NextPageToken string `json:"nextPageToken,omitempty"`
  14865. // SelfLink: [Output Only] Server-defined URL for this resource.
  14866. SelfLink string `json:"selfLink,omitempty"`
  14867. // Warning: [Output Only] Informational warning message.
  14868. Warning *NetworkListWarning `json:"warning,omitempty"`
  14869. // ServerResponse contains the HTTP response code and headers from the
  14870. // server.
  14871. googleapi.ServerResponse `json:"-"`
  14872. // ForceSendFields is a list of field names (e.g. "Id") to
  14873. // unconditionally include in API requests. By default, fields with
  14874. // empty values are omitted from API requests. However, any non-pointer,
  14875. // non-interface field appearing in ForceSendFields will be sent to the
  14876. // server regardless of whether the field is empty or not. This may be
  14877. // used to include empty fields in Patch requests.
  14878. ForceSendFields []string `json:"-"`
  14879. // NullFields is a list of field names (e.g. "Id") to include in API
  14880. // requests with the JSON null value. By default, fields with empty
  14881. // values are omitted from API requests. However, any field with an
  14882. // empty value appearing in NullFields will be sent to the server as
  14883. // null. It is an error if a field in this list has a non-empty value.
  14884. // This may be used to include null fields in Patch requests.
  14885. NullFields []string `json:"-"`
  14886. }
  14887. func (s *NetworkList) MarshalJSON() ([]byte, error) {
  14888. type NoMethod NetworkList
  14889. raw := NoMethod(*s)
  14890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14891. }
  14892. // NetworkListWarning: [Output Only] Informational warning message.
  14893. type NetworkListWarning struct {
  14894. // Code: [Output Only] A warning code, if applicable. For example,
  14895. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  14896. // the response.
  14897. //
  14898. // Possible values:
  14899. // "CLEANUP_FAILED"
  14900. // "DEPRECATED_RESOURCE_USED"
  14901. // "DEPRECATED_TYPE_USED"
  14902. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  14903. // "EXPERIMENTAL_TYPE_USED"
  14904. // "EXTERNAL_API_WARNING"
  14905. // "FIELD_VALUE_OVERRIDEN"
  14906. // "INJECTED_KERNELS_DEPRECATED"
  14907. // "MISSING_TYPE_DEPENDENCY"
  14908. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  14909. // "NEXT_HOP_CANNOT_IP_FORWARD"
  14910. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  14911. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  14912. // "NEXT_HOP_NOT_RUNNING"
  14913. // "NOT_CRITICAL_ERROR"
  14914. // "NO_RESULTS_ON_PAGE"
  14915. // "REQUIRED_TOS_AGREEMENT"
  14916. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  14917. // "RESOURCE_NOT_DELETED"
  14918. // "SCHEMA_VALIDATION_IGNORED"
  14919. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  14920. // "UNDECLARED_PROPERTIES"
  14921. // "UNREACHABLE"
  14922. Code string `json:"code,omitempty"`
  14923. // Data: [Output Only] Metadata about this warning in key: value format.
  14924. // For example:
  14925. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  14926. Data []*NetworkListWarningData `json:"data,omitempty"`
  14927. // Message: [Output Only] A human-readable description of the warning
  14928. // code.
  14929. Message string `json:"message,omitempty"`
  14930. // ForceSendFields is a list of field names (e.g. "Code") to
  14931. // unconditionally include in API requests. By default, fields with
  14932. // empty values are omitted from API requests. However, any non-pointer,
  14933. // non-interface field appearing in ForceSendFields will be sent to the
  14934. // server regardless of whether the field is empty or not. This may be
  14935. // used to include empty fields in Patch requests.
  14936. ForceSendFields []string `json:"-"`
  14937. // NullFields is a list of field names (e.g. "Code") to include in API
  14938. // requests with the JSON null value. By default, fields with empty
  14939. // values are omitted from API requests. However, any field with an
  14940. // empty value appearing in NullFields will be sent to the server as
  14941. // null. It is an error if a field in this list has a non-empty value.
  14942. // This may be used to include null fields in Patch requests.
  14943. NullFields []string `json:"-"`
  14944. }
  14945. func (s *NetworkListWarning) MarshalJSON() ([]byte, error) {
  14946. type NoMethod NetworkListWarning
  14947. raw := NoMethod(*s)
  14948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14949. }
  14950. type NetworkListWarningData struct {
  14951. // Key: [Output Only] A key that provides more detail on the warning
  14952. // being returned. For example, for warnings where there are no results
  14953. // in a list request for a particular zone, this key might be scope and
  14954. // the key value might be the zone name. Other examples might be a key
  14955. // indicating a deprecated resource and a suggested replacement, or a
  14956. // warning about invalid network settings (for example, if an instance
  14957. // attempts to perform IP forwarding but is not enabled for IP
  14958. // forwarding).
  14959. Key string `json:"key,omitempty"`
  14960. // Value: [Output Only] A warning data value corresponding to the key.
  14961. Value string `json:"value,omitempty"`
  14962. // ForceSendFields is a list of field names (e.g. "Key") to
  14963. // unconditionally include in API requests. By default, fields with
  14964. // empty values are omitted from API requests. However, any non-pointer,
  14965. // non-interface field appearing in ForceSendFields will be sent to the
  14966. // server regardless of whether the field is empty or not. This may be
  14967. // used to include empty fields in Patch requests.
  14968. ForceSendFields []string `json:"-"`
  14969. // NullFields is a list of field names (e.g. "Key") to include in API
  14970. // requests with the JSON null value. By default, fields with empty
  14971. // values are omitted from API requests. However, any field with an
  14972. // empty value appearing in NullFields will be sent to the server as
  14973. // null. It is an error if a field in this list has a non-empty value.
  14974. // This may be used to include null fields in Patch requests.
  14975. NullFields []string `json:"-"`
  14976. }
  14977. func (s *NetworkListWarningData) MarshalJSON() ([]byte, error) {
  14978. type NoMethod NetworkListWarningData
  14979. raw := NoMethod(*s)
  14980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  14981. }
  14982. // NetworkPeering: A network peering attached to a network resource. The
  14983. // message includes the peering name, peer network, peering state, and a
  14984. // flag indicating whether Google Compute Engine should automatically
  14985. // create routes for the peering.
  14986. type NetworkPeering struct {
  14987. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  14988. // exchange_subnet_routes instead. Indicates whether full mesh
  14989. // connectivity is created and managed automatically. When it is set to
  14990. // true, Google Compute Engine will automatically create and manage the
  14991. // routes between two networks when the state is ACTIVE. Otherwise, user
  14992. // needs to create routes manually to route packets to peer network.
  14993. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  14994. // ExchangeSubnetRoutes: Whether full mesh connectivity is created and
  14995. // managed automatically. When it is set to true, Google Compute Engine
  14996. // will automatically create and manage the routes between two networks
  14997. // when the peering state is ACTIVE. Otherwise, user needs to create
  14998. // routes manually to route packets to peer network.
  14999. ExchangeSubnetRoutes bool `json:"exchangeSubnetRoutes,omitempty"`
  15000. // Name: Name of this peering. Provided by the client when the peering
  15001. // is created. The name must comply with RFC1035. Specifically, the name
  15002. // must be 1-63 characters long and match regular expression
  15003. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  15004. // a lowercase letter, and all the following characters must be a dash,
  15005. // lowercase letter, or digit, except the last character, which cannot
  15006. // be a dash.
  15007. Name string `json:"name,omitempty"`
  15008. // Network: The URL of the peer network. It can be either full URL or
  15009. // partial URL. The peer network may belong to a different project. If
  15010. // the partial URL does not contain project, it is assumed that the peer
  15011. // network is in the same project as the current network.
  15012. Network string `json:"network,omitempty"`
  15013. // State: [Output Only] State for the peering.
  15014. //
  15015. // Possible values:
  15016. // "ACTIVE"
  15017. // "INACTIVE"
  15018. State string `json:"state,omitempty"`
  15019. // StateDetails: [Output Only] Details about the current state of the
  15020. // peering.
  15021. StateDetails string `json:"stateDetails,omitempty"`
  15022. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  15023. // unconditionally include in API requests. By default, fields with
  15024. // empty values are omitted from API requests. However, any non-pointer,
  15025. // non-interface field appearing in ForceSendFields will be sent to the
  15026. // server regardless of whether the field is empty or not. This may be
  15027. // used to include empty fields in Patch requests.
  15028. ForceSendFields []string `json:"-"`
  15029. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  15030. // include in API requests with the JSON null value. By default, fields
  15031. // with empty values are omitted from API requests. However, any field
  15032. // with an empty value appearing in NullFields will be sent to the
  15033. // server as null. It is an error if a field in this list has a
  15034. // non-empty value. This may be used to include null fields in Patch
  15035. // requests.
  15036. NullFields []string `json:"-"`
  15037. }
  15038. func (s *NetworkPeering) MarshalJSON() ([]byte, error) {
  15039. type NoMethod NetworkPeering
  15040. raw := NoMethod(*s)
  15041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15042. }
  15043. // NetworkRoutingConfig: A routing configuration attached to a network
  15044. // resource. The message includes the list of routers associated with
  15045. // the network, and a flag indicating the type of routing behavior to
  15046. // enforce network-wide.
  15047. type NetworkRoutingConfig struct {
  15048. // RoutingMode: The network-wide routing mode to use. If set to
  15049. // REGIONAL, this network's cloud routers will only advertise routes
  15050. // with subnets of this network in the same region as the router. If set
  15051. // to GLOBAL, this network's cloud routers will advertise routes with
  15052. // all subnets of this network, across regions.
  15053. //
  15054. // Possible values:
  15055. // "GLOBAL"
  15056. // "REGIONAL"
  15057. RoutingMode string `json:"routingMode,omitempty"`
  15058. // ForceSendFields is a list of field names (e.g. "RoutingMode") to
  15059. // unconditionally include in API requests. By default, fields with
  15060. // empty values are omitted from API requests. However, any non-pointer,
  15061. // non-interface field appearing in ForceSendFields will be sent to the
  15062. // server regardless of whether the field is empty or not. This may be
  15063. // used to include empty fields in Patch requests.
  15064. ForceSendFields []string `json:"-"`
  15065. // NullFields is a list of field names (e.g. "RoutingMode") to include
  15066. // in API requests with the JSON null value. By default, fields with
  15067. // empty values are omitted from API requests. However, any field with
  15068. // an empty value appearing in NullFields will be sent to the server as
  15069. // null. It is an error if a field in this list has a non-empty value.
  15070. // This may be used to include null fields in Patch requests.
  15071. NullFields []string `json:"-"`
  15072. }
  15073. func (s *NetworkRoutingConfig) MarshalJSON() ([]byte, error) {
  15074. type NoMethod NetworkRoutingConfig
  15075. raw := NoMethod(*s)
  15076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15077. }
  15078. type NetworksAddPeeringRequest struct {
  15079. // AutoCreateRoutes: This field will be deprecated soon. Prefer using
  15080. // exchange_subnet_routes in network_peering instead. Whether Google
  15081. // Compute Engine manages the routes automatically.
  15082. AutoCreateRoutes bool `json:"autoCreateRoutes,omitempty"`
  15083. // Name: Name of the peering, which should conform to RFC1035.
  15084. Name string `json:"name,omitempty"`
  15085. // NetworkPeering: Network peering parameters. In order to specify route
  15086. // policies for peering using import/export custom routes, you will have
  15087. // to fill all peering related parameters (name, peer network,
  15088. // exchange_subnet_routes) in network_peeringfield. Corresponding fields
  15089. // in NetworksAddPeeringRequest will be deprecated soon.
  15090. NetworkPeering *NetworkPeering `json:"networkPeering,omitempty"`
  15091. // PeerNetwork: URL of the peer network. It can be either full URL or
  15092. // partial URL. The peer network may belong to a different project. If
  15093. // the partial URL does not contain project, it is assumed that the peer
  15094. // network is in the same project as the current network.
  15095. PeerNetwork string `json:"peerNetwork,omitempty"`
  15096. // ForceSendFields is a list of field names (e.g. "AutoCreateRoutes") to
  15097. // unconditionally include in API requests. By default, fields with
  15098. // empty values are omitted from API requests. However, any non-pointer,
  15099. // non-interface field appearing in ForceSendFields will be sent to the
  15100. // server regardless of whether the field is empty or not. This may be
  15101. // used to include empty fields in Patch requests.
  15102. ForceSendFields []string `json:"-"`
  15103. // NullFields is a list of field names (e.g. "AutoCreateRoutes") to
  15104. // include in API requests with the JSON null value. By default, fields
  15105. // with empty values are omitted from API requests. However, any field
  15106. // with an empty value appearing in NullFields will be sent to the
  15107. // server as null. It is an error if a field in this list has a
  15108. // non-empty value. This may be used to include null fields in Patch
  15109. // requests.
  15110. NullFields []string `json:"-"`
  15111. }
  15112. func (s *NetworksAddPeeringRequest) MarshalJSON() ([]byte, error) {
  15113. type NoMethod NetworksAddPeeringRequest
  15114. raw := NoMethod(*s)
  15115. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15116. }
  15117. type NetworksRemovePeeringRequest struct {
  15118. // Name: Name of the peering, which should conform to RFC1035.
  15119. Name string `json:"name,omitempty"`
  15120. // ForceSendFields is a list of field names (e.g. "Name") to
  15121. // unconditionally include in API requests. By default, fields with
  15122. // empty values are omitted from API requests. However, any non-pointer,
  15123. // non-interface field appearing in ForceSendFields will be sent to the
  15124. // server regardless of whether the field is empty or not. This may be
  15125. // used to include empty fields in Patch requests.
  15126. ForceSendFields []string `json:"-"`
  15127. // NullFields is a list of field names (e.g. "Name") to include in API
  15128. // requests with the JSON null value. By default, fields with empty
  15129. // values are omitted from API requests. However, any field with an
  15130. // empty value appearing in NullFields will be sent to the server as
  15131. // null. It is an error if a field in this list has a non-empty value.
  15132. // This may be used to include null fields in Patch requests.
  15133. NullFields []string `json:"-"`
  15134. }
  15135. func (s *NetworksRemovePeeringRequest) MarshalJSON() ([]byte, error) {
  15136. type NoMethod NetworksRemovePeeringRequest
  15137. raw := NoMethod(*s)
  15138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15139. }
  15140. // NodeGroup: A NodeGroup resource. To create a node group, you must
  15141. // first create a node templates. To learn more about node groups and
  15142. // sole-tenant nodes, read the Sole-tenant nodes documentation. (==
  15143. // resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==)
  15144. type NodeGroup struct {
  15145. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15146. // format.
  15147. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15148. // Description: An optional description of this resource. Provide this
  15149. // property when you create the resource.
  15150. Description string `json:"description,omitempty"`
  15151. // Id: [Output Only] The unique identifier for the resource. This
  15152. // identifier is defined by the server.
  15153. Id uint64 `json:"id,omitempty,string"`
  15154. // Kind: [Output Only] The type of the resource. Always
  15155. // compute#nodeGroup for node group.
  15156. Kind string `json:"kind,omitempty"`
  15157. // Name: The name of the resource, provided by the client when initially
  15158. // creating the resource. The resource name must be 1-63 characters
  15159. // long, and comply with RFC1035. Specifically, the name must be 1-63
  15160. // characters long and match the regular expression
  15161. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  15162. // a lowercase letter, and all following characters must be a dash,
  15163. // lowercase letter, or digit, except the last character, which cannot
  15164. // be a dash.
  15165. Name string `json:"name,omitempty"`
  15166. // NodeTemplate: The URL of the node template to which this node group
  15167. // belongs.
  15168. NodeTemplate string `json:"nodeTemplate,omitempty"`
  15169. // SelfLink: [Output Only] Server-defined URL for the resource.
  15170. SelfLink string `json:"selfLink,omitempty"`
  15171. // Size: [Output Only] The total number of nodes in the node group.
  15172. Size int64 `json:"size,omitempty"`
  15173. // Possible values:
  15174. // "CREATING"
  15175. // "DELETING"
  15176. // "INVALID"
  15177. // "READY"
  15178. Status string `json:"status,omitempty"`
  15179. // Zone: [Output Only] The name of the zone where the node group
  15180. // resides, such as us-central1-a.
  15181. Zone string `json:"zone,omitempty"`
  15182. // ServerResponse contains the HTTP response code and headers from the
  15183. // server.
  15184. googleapi.ServerResponse `json:"-"`
  15185. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15186. // to unconditionally include in API requests. By default, fields with
  15187. // empty values are omitted from API requests. However, any non-pointer,
  15188. // non-interface field appearing in ForceSendFields will be sent to the
  15189. // server regardless of whether the field is empty or not. This may be
  15190. // used to include empty fields in Patch requests.
  15191. ForceSendFields []string `json:"-"`
  15192. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15193. // include in API requests with the JSON null value. By default, fields
  15194. // with empty values are omitted from API requests. However, any field
  15195. // with an empty value appearing in NullFields will be sent to the
  15196. // server as null. It is an error if a field in this list has a
  15197. // non-empty value. This may be used to include null fields in Patch
  15198. // requests.
  15199. NullFields []string `json:"-"`
  15200. }
  15201. func (s *NodeGroup) MarshalJSON() ([]byte, error) {
  15202. type NoMethod NodeGroup
  15203. raw := NoMethod(*s)
  15204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15205. }
  15206. type NodeGroupAggregatedList struct {
  15207. // Id: [Output Only] Unique identifier for the resource; defined by the
  15208. // server.
  15209. Id string `json:"id,omitempty"`
  15210. // Items: A list of NodeGroupsScopedList resources.
  15211. Items map[string]NodeGroupsScopedList `json:"items,omitempty"`
  15212. // Kind: [Output Only] Type of resource.Always
  15213. // compute#nodeGroupAggregatedList for aggregated lists of node groups.
  15214. Kind string `json:"kind,omitempty"`
  15215. // NextPageToken: [Output Only] This token allows you to get the next
  15216. // page of results for list requests. If the number of results is larger
  15217. // than maxResults, use the nextPageToken as a value for the query
  15218. // parameter pageToken in the next list request. Subsequent list
  15219. // requests will have their own nextPageToken to continue paging through
  15220. // the results.
  15221. NextPageToken string `json:"nextPageToken,omitempty"`
  15222. // SelfLink: [Output Only] Server-defined URL for this resource.
  15223. SelfLink string `json:"selfLink,omitempty"`
  15224. // Warning: [Output Only] Informational warning message.
  15225. Warning *NodeGroupAggregatedListWarning `json:"warning,omitempty"`
  15226. // ServerResponse contains the HTTP response code and headers from the
  15227. // server.
  15228. googleapi.ServerResponse `json:"-"`
  15229. // ForceSendFields is a list of field names (e.g. "Id") to
  15230. // unconditionally include in API requests. By default, fields with
  15231. // empty values are omitted from API requests. However, any non-pointer,
  15232. // non-interface field appearing in ForceSendFields will be sent to the
  15233. // server regardless of whether the field is empty or not. This may be
  15234. // used to include empty fields in Patch requests.
  15235. ForceSendFields []string `json:"-"`
  15236. // NullFields is a list of field names (e.g. "Id") to include in API
  15237. // requests with the JSON null value. By default, fields with empty
  15238. // values are omitted from API requests. However, any field with an
  15239. // empty value appearing in NullFields will be sent to the server as
  15240. // null. It is an error if a field in this list has a non-empty value.
  15241. // This may be used to include null fields in Patch requests.
  15242. NullFields []string `json:"-"`
  15243. }
  15244. func (s *NodeGroupAggregatedList) MarshalJSON() ([]byte, error) {
  15245. type NoMethod NodeGroupAggregatedList
  15246. raw := NoMethod(*s)
  15247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15248. }
  15249. // NodeGroupAggregatedListWarning: [Output Only] Informational warning
  15250. // message.
  15251. type NodeGroupAggregatedListWarning struct {
  15252. // Code: [Output Only] A warning code, if applicable. For example,
  15253. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15254. // the response.
  15255. //
  15256. // Possible values:
  15257. // "CLEANUP_FAILED"
  15258. // "DEPRECATED_RESOURCE_USED"
  15259. // "DEPRECATED_TYPE_USED"
  15260. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15261. // "EXPERIMENTAL_TYPE_USED"
  15262. // "EXTERNAL_API_WARNING"
  15263. // "FIELD_VALUE_OVERRIDEN"
  15264. // "INJECTED_KERNELS_DEPRECATED"
  15265. // "MISSING_TYPE_DEPENDENCY"
  15266. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15267. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15268. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15269. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15270. // "NEXT_HOP_NOT_RUNNING"
  15271. // "NOT_CRITICAL_ERROR"
  15272. // "NO_RESULTS_ON_PAGE"
  15273. // "REQUIRED_TOS_AGREEMENT"
  15274. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15275. // "RESOURCE_NOT_DELETED"
  15276. // "SCHEMA_VALIDATION_IGNORED"
  15277. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15278. // "UNDECLARED_PROPERTIES"
  15279. // "UNREACHABLE"
  15280. Code string `json:"code,omitempty"`
  15281. // Data: [Output Only] Metadata about this warning in key: value format.
  15282. // For example:
  15283. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15284. Data []*NodeGroupAggregatedListWarningData `json:"data,omitempty"`
  15285. // Message: [Output Only] A human-readable description of the warning
  15286. // code.
  15287. Message string `json:"message,omitempty"`
  15288. // ForceSendFields is a list of field names (e.g. "Code") to
  15289. // unconditionally include in API requests. By default, fields with
  15290. // empty values are omitted from API requests. However, any non-pointer,
  15291. // non-interface field appearing in ForceSendFields will be sent to the
  15292. // server regardless of whether the field is empty or not. This may be
  15293. // used to include empty fields in Patch requests.
  15294. ForceSendFields []string `json:"-"`
  15295. // NullFields is a list of field names (e.g. "Code") to include in API
  15296. // requests with the JSON null value. By default, fields with empty
  15297. // values are omitted from API requests. However, any field with an
  15298. // empty value appearing in NullFields will be sent to the server as
  15299. // null. It is an error if a field in this list has a non-empty value.
  15300. // This may be used to include null fields in Patch requests.
  15301. NullFields []string `json:"-"`
  15302. }
  15303. func (s *NodeGroupAggregatedListWarning) MarshalJSON() ([]byte, error) {
  15304. type NoMethod NodeGroupAggregatedListWarning
  15305. raw := NoMethod(*s)
  15306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15307. }
  15308. type NodeGroupAggregatedListWarningData struct {
  15309. // Key: [Output Only] A key that provides more detail on the warning
  15310. // being returned. For example, for warnings where there are no results
  15311. // in a list request for a particular zone, this key might be scope and
  15312. // the key value might be the zone name. Other examples might be a key
  15313. // indicating a deprecated resource and a suggested replacement, or a
  15314. // warning about invalid network settings (for example, if an instance
  15315. // attempts to perform IP forwarding but is not enabled for IP
  15316. // forwarding).
  15317. Key string `json:"key,omitempty"`
  15318. // Value: [Output Only] A warning data value corresponding to the key.
  15319. Value string `json:"value,omitempty"`
  15320. // ForceSendFields is a list of field names (e.g. "Key") to
  15321. // unconditionally include in API requests. By default, fields with
  15322. // empty values are omitted from API requests. However, any non-pointer,
  15323. // non-interface field appearing in ForceSendFields will be sent to the
  15324. // server regardless of whether the field is empty or not. This may be
  15325. // used to include empty fields in Patch requests.
  15326. ForceSendFields []string `json:"-"`
  15327. // NullFields is a list of field names (e.g. "Key") to include in API
  15328. // requests with the JSON null value. By default, fields with empty
  15329. // values are omitted from API requests. However, any field with an
  15330. // empty value appearing in NullFields will be sent to the server as
  15331. // null. It is an error if a field in this list has a non-empty value.
  15332. // This may be used to include null fields in Patch requests.
  15333. NullFields []string `json:"-"`
  15334. }
  15335. func (s *NodeGroupAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  15336. type NoMethod NodeGroupAggregatedListWarningData
  15337. raw := NoMethod(*s)
  15338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15339. }
  15340. // NodeGroupList: Contains a list of nodeGroups.
  15341. type NodeGroupList struct {
  15342. // Id: [Output Only] Unique identifier for the resource; defined by the
  15343. // server.
  15344. Id string `json:"id,omitempty"`
  15345. // Items: A list of NodeGroup resources.
  15346. Items []*NodeGroup `json:"items,omitempty"`
  15347. // Kind: [Output Only] Type of resource.Always compute#nodeGroupList for
  15348. // lists of node groups.
  15349. Kind string `json:"kind,omitempty"`
  15350. // NextPageToken: [Output Only] This token allows you to get the next
  15351. // page of results for list requests. If the number of results is larger
  15352. // than maxResults, use the nextPageToken as a value for the query
  15353. // parameter pageToken in the next list request. Subsequent list
  15354. // requests will have their own nextPageToken to continue paging through
  15355. // the results.
  15356. NextPageToken string `json:"nextPageToken,omitempty"`
  15357. // SelfLink: [Output Only] Server-defined URL for this resource.
  15358. SelfLink string `json:"selfLink,omitempty"`
  15359. // Warning: [Output Only] Informational warning message.
  15360. Warning *NodeGroupListWarning `json:"warning,omitempty"`
  15361. // ServerResponse contains the HTTP response code and headers from the
  15362. // server.
  15363. googleapi.ServerResponse `json:"-"`
  15364. // ForceSendFields is a list of field names (e.g. "Id") to
  15365. // unconditionally include in API requests. By default, fields with
  15366. // empty values are omitted from API requests. However, any non-pointer,
  15367. // non-interface field appearing in ForceSendFields will be sent to the
  15368. // server regardless of whether the field is empty or not. This may be
  15369. // used to include empty fields in Patch requests.
  15370. ForceSendFields []string `json:"-"`
  15371. // NullFields is a list of field names (e.g. "Id") to include in API
  15372. // requests with the JSON null value. By default, fields with empty
  15373. // values are omitted from API requests. However, any field with an
  15374. // empty value appearing in NullFields will be sent to the server as
  15375. // null. It is an error if a field in this list has a non-empty value.
  15376. // This may be used to include null fields in Patch requests.
  15377. NullFields []string `json:"-"`
  15378. }
  15379. func (s *NodeGroupList) MarshalJSON() ([]byte, error) {
  15380. type NoMethod NodeGroupList
  15381. raw := NoMethod(*s)
  15382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15383. }
  15384. // NodeGroupListWarning: [Output Only] Informational warning message.
  15385. type NodeGroupListWarning struct {
  15386. // Code: [Output Only] A warning code, if applicable. For example,
  15387. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15388. // the response.
  15389. //
  15390. // Possible values:
  15391. // "CLEANUP_FAILED"
  15392. // "DEPRECATED_RESOURCE_USED"
  15393. // "DEPRECATED_TYPE_USED"
  15394. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15395. // "EXPERIMENTAL_TYPE_USED"
  15396. // "EXTERNAL_API_WARNING"
  15397. // "FIELD_VALUE_OVERRIDEN"
  15398. // "INJECTED_KERNELS_DEPRECATED"
  15399. // "MISSING_TYPE_DEPENDENCY"
  15400. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15401. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15402. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15403. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15404. // "NEXT_HOP_NOT_RUNNING"
  15405. // "NOT_CRITICAL_ERROR"
  15406. // "NO_RESULTS_ON_PAGE"
  15407. // "REQUIRED_TOS_AGREEMENT"
  15408. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15409. // "RESOURCE_NOT_DELETED"
  15410. // "SCHEMA_VALIDATION_IGNORED"
  15411. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15412. // "UNDECLARED_PROPERTIES"
  15413. // "UNREACHABLE"
  15414. Code string `json:"code,omitempty"`
  15415. // Data: [Output Only] Metadata about this warning in key: value format.
  15416. // For example:
  15417. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15418. Data []*NodeGroupListWarningData `json:"data,omitempty"`
  15419. // Message: [Output Only] A human-readable description of the warning
  15420. // code.
  15421. Message string `json:"message,omitempty"`
  15422. // ForceSendFields is a list of field names (e.g. "Code") to
  15423. // unconditionally include in API requests. By default, fields with
  15424. // empty values are omitted from API requests. However, any non-pointer,
  15425. // non-interface field appearing in ForceSendFields will be sent to the
  15426. // server regardless of whether the field is empty or not. This may be
  15427. // used to include empty fields in Patch requests.
  15428. ForceSendFields []string `json:"-"`
  15429. // NullFields is a list of field names (e.g. "Code") to include in API
  15430. // requests with the JSON null value. By default, fields with empty
  15431. // values are omitted from API requests. However, any field with an
  15432. // empty value appearing in NullFields will be sent to the server as
  15433. // null. It is an error if a field in this list has a non-empty value.
  15434. // This may be used to include null fields in Patch requests.
  15435. NullFields []string `json:"-"`
  15436. }
  15437. func (s *NodeGroupListWarning) MarshalJSON() ([]byte, error) {
  15438. type NoMethod NodeGroupListWarning
  15439. raw := NoMethod(*s)
  15440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15441. }
  15442. type NodeGroupListWarningData struct {
  15443. // Key: [Output Only] A key that provides more detail on the warning
  15444. // being returned. For example, for warnings where there are no results
  15445. // in a list request for a particular zone, this key might be scope and
  15446. // the key value might be the zone name. Other examples might be a key
  15447. // indicating a deprecated resource and a suggested replacement, or a
  15448. // warning about invalid network settings (for example, if an instance
  15449. // attempts to perform IP forwarding but is not enabled for IP
  15450. // forwarding).
  15451. Key string `json:"key,omitempty"`
  15452. // Value: [Output Only] A warning data value corresponding to the key.
  15453. Value string `json:"value,omitempty"`
  15454. // ForceSendFields is a list of field names (e.g. "Key") to
  15455. // unconditionally include in API requests. By default, fields with
  15456. // empty values are omitted from API requests. However, any non-pointer,
  15457. // non-interface field appearing in ForceSendFields will be sent to the
  15458. // server regardless of whether the field is empty or not. This may be
  15459. // used to include empty fields in Patch requests.
  15460. ForceSendFields []string `json:"-"`
  15461. // NullFields is a list of field names (e.g. "Key") to include in API
  15462. // requests with the JSON null value. By default, fields with empty
  15463. // values are omitted from API requests. However, any field with an
  15464. // empty value appearing in NullFields will be sent to the server as
  15465. // null. It is an error if a field in this list has a non-empty value.
  15466. // This may be used to include null fields in Patch requests.
  15467. NullFields []string `json:"-"`
  15468. }
  15469. func (s *NodeGroupListWarningData) MarshalJSON() ([]byte, error) {
  15470. type NoMethod NodeGroupListWarningData
  15471. raw := NoMethod(*s)
  15472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15473. }
  15474. type NodeGroupNode struct {
  15475. // Instances: Instances scheduled on this node.
  15476. Instances []string `json:"instances,omitempty"`
  15477. // Name: The name of the node.
  15478. Name string `json:"name,omitempty"`
  15479. // NodeType: The type of this node.
  15480. NodeType string `json:"nodeType,omitempty"`
  15481. // Possible values:
  15482. // "CREATING"
  15483. // "DELETING"
  15484. // "INVALID"
  15485. // "READY"
  15486. // "REPAIRING"
  15487. Status string `json:"status,omitempty"`
  15488. // ForceSendFields is a list of field names (e.g. "Instances") to
  15489. // unconditionally include in API requests. By default, fields with
  15490. // empty values are omitted from API requests. However, any non-pointer,
  15491. // non-interface field appearing in ForceSendFields will be sent to the
  15492. // server regardless of whether the field is empty or not. This may be
  15493. // used to include empty fields in Patch requests.
  15494. ForceSendFields []string `json:"-"`
  15495. // NullFields is a list of field names (e.g. "Instances") to include in
  15496. // API requests with the JSON null value. By default, fields with empty
  15497. // values are omitted from API requests. However, any field with an
  15498. // empty value appearing in NullFields will be sent to the server as
  15499. // null. It is an error if a field in this list has a non-empty value.
  15500. // This may be used to include null fields in Patch requests.
  15501. NullFields []string `json:"-"`
  15502. }
  15503. func (s *NodeGroupNode) MarshalJSON() ([]byte, error) {
  15504. type NoMethod NodeGroupNode
  15505. raw := NoMethod(*s)
  15506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15507. }
  15508. type NodeGroupsAddNodesRequest struct {
  15509. // AdditionalNodeCount: Count of additional nodes to be added to the
  15510. // node group.
  15511. AdditionalNodeCount int64 `json:"additionalNodeCount,omitempty"`
  15512. // ForceSendFields is a list of field names (e.g. "AdditionalNodeCount")
  15513. // to unconditionally include in API requests. By default, fields with
  15514. // empty values are omitted from API requests. However, any non-pointer,
  15515. // non-interface field appearing in ForceSendFields will be sent to the
  15516. // server regardless of whether the field is empty or not. This may be
  15517. // used to include empty fields in Patch requests.
  15518. ForceSendFields []string `json:"-"`
  15519. // NullFields is a list of field names (e.g. "AdditionalNodeCount") to
  15520. // include in API requests with the JSON null value. By default, fields
  15521. // with empty values are omitted from API requests. However, any field
  15522. // with an empty value appearing in NullFields will be sent to the
  15523. // server as null. It is an error if a field in this list has a
  15524. // non-empty value. This may be used to include null fields in Patch
  15525. // requests.
  15526. NullFields []string `json:"-"`
  15527. }
  15528. func (s *NodeGroupsAddNodesRequest) MarshalJSON() ([]byte, error) {
  15529. type NoMethod NodeGroupsAddNodesRequest
  15530. raw := NoMethod(*s)
  15531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15532. }
  15533. type NodeGroupsDeleteNodesRequest struct {
  15534. Nodes []string `json:"nodes,omitempty"`
  15535. // ForceSendFields is a list of field names (e.g. "Nodes") to
  15536. // unconditionally include in API requests. By default, fields with
  15537. // empty values are omitted from API requests. However, any non-pointer,
  15538. // non-interface field appearing in ForceSendFields will be sent to the
  15539. // server regardless of whether the field is empty or not. This may be
  15540. // used to include empty fields in Patch requests.
  15541. ForceSendFields []string `json:"-"`
  15542. // NullFields is a list of field names (e.g. "Nodes") to include in API
  15543. // requests with the JSON null value. By default, fields with empty
  15544. // values are omitted from API requests. However, any field with an
  15545. // empty value appearing in NullFields will be sent to the server as
  15546. // null. It is an error if a field in this list has a non-empty value.
  15547. // This may be used to include null fields in Patch requests.
  15548. NullFields []string `json:"-"`
  15549. }
  15550. func (s *NodeGroupsDeleteNodesRequest) MarshalJSON() ([]byte, error) {
  15551. type NoMethod NodeGroupsDeleteNodesRequest
  15552. raw := NoMethod(*s)
  15553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15554. }
  15555. type NodeGroupsListNodes struct {
  15556. // Id: [Output Only] Unique identifier for the resource; defined by the
  15557. // server.
  15558. Id string `json:"id,omitempty"`
  15559. // Items: A list of Node resources.
  15560. Items []*NodeGroupNode `json:"items,omitempty"`
  15561. // Kind: [Output Only] The resource type, which is always
  15562. // compute.nodeGroupsListNodes for the list of nodes in the specified
  15563. // node group.
  15564. Kind string `json:"kind,omitempty"`
  15565. // NextPageToken: [Output Only] This token allows you to get the next
  15566. // page of results for list requests. If the number of results is larger
  15567. // than maxResults, use the nextPageToken as a value for the query
  15568. // parameter pageToken in the next list request. Subsequent list
  15569. // requests will have their own nextPageToken to continue paging through
  15570. // the results.
  15571. NextPageToken string `json:"nextPageToken,omitempty"`
  15572. // SelfLink: [Output Only] Server-defined URL for this resource.
  15573. SelfLink string `json:"selfLink,omitempty"`
  15574. // Warning: [Output Only] Informational warning message.
  15575. Warning *NodeGroupsListNodesWarning `json:"warning,omitempty"`
  15576. // ServerResponse contains the HTTP response code and headers from the
  15577. // server.
  15578. googleapi.ServerResponse `json:"-"`
  15579. // ForceSendFields is a list of field names (e.g. "Id") to
  15580. // unconditionally include in API requests. By default, fields with
  15581. // empty values are omitted from API requests. However, any non-pointer,
  15582. // non-interface field appearing in ForceSendFields will be sent to the
  15583. // server regardless of whether the field is empty or not. This may be
  15584. // used to include empty fields in Patch requests.
  15585. ForceSendFields []string `json:"-"`
  15586. // NullFields is a list of field names (e.g. "Id") to include in API
  15587. // requests with the JSON null value. By default, fields with empty
  15588. // values are omitted from API requests. However, any field with an
  15589. // empty value appearing in NullFields will be sent to the server as
  15590. // null. It is an error if a field in this list has a non-empty value.
  15591. // This may be used to include null fields in Patch requests.
  15592. NullFields []string `json:"-"`
  15593. }
  15594. func (s *NodeGroupsListNodes) MarshalJSON() ([]byte, error) {
  15595. type NoMethod NodeGroupsListNodes
  15596. raw := NoMethod(*s)
  15597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15598. }
  15599. // NodeGroupsListNodesWarning: [Output Only] Informational warning
  15600. // message.
  15601. type NodeGroupsListNodesWarning struct {
  15602. // Code: [Output Only] A warning code, if applicable. For example,
  15603. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15604. // the response.
  15605. //
  15606. // Possible values:
  15607. // "CLEANUP_FAILED"
  15608. // "DEPRECATED_RESOURCE_USED"
  15609. // "DEPRECATED_TYPE_USED"
  15610. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15611. // "EXPERIMENTAL_TYPE_USED"
  15612. // "EXTERNAL_API_WARNING"
  15613. // "FIELD_VALUE_OVERRIDEN"
  15614. // "INJECTED_KERNELS_DEPRECATED"
  15615. // "MISSING_TYPE_DEPENDENCY"
  15616. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15617. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15618. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15619. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15620. // "NEXT_HOP_NOT_RUNNING"
  15621. // "NOT_CRITICAL_ERROR"
  15622. // "NO_RESULTS_ON_PAGE"
  15623. // "REQUIRED_TOS_AGREEMENT"
  15624. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15625. // "RESOURCE_NOT_DELETED"
  15626. // "SCHEMA_VALIDATION_IGNORED"
  15627. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15628. // "UNDECLARED_PROPERTIES"
  15629. // "UNREACHABLE"
  15630. Code string `json:"code,omitempty"`
  15631. // Data: [Output Only] Metadata about this warning in key: value format.
  15632. // For example:
  15633. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15634. Data []*NodeGroupsListNodesWarningData `json:"data,omitempty"`
  15635. // Message: [Output Only] A human-readable description of the warning
  15636. // code.
  15637. Message string `json:"message,omitempty"`
  15638. // ForceSendFields is a list of field names (e.g. "Code") to
  15639. // unconditionally include in API requests. By default, fields with
  15640. // empty values are omitted from API requests. However, any non-pointer,
  15641. // non-interface field appearing in ForceSendFields will be sent to the
  15642. // server regardless of whether the field is empty or not. This may be
  15643. // used to include empty fields in Patch requests.
  15644. ForceSendFields []string `json:"-"`
  15645. // NullFields is a list of field names (e.g. "Code") to include in API
  15646. // requests with the JSON null value. By default, fields with empty
  15647. // values are omitted from API requests. However, any field with an
  15648. // empty value appearing in NullFields will be sent to the server as
  15649. // null. It is an error if a field in this list has a non-empty value.
  15650. // This may be used to include null fields in Patch requests.
  15651. NullFields []string `json:"-"`
  15652. }
  15653. func (s *NodeGroupsListNodesWarning) MarshalJSON() ([]byte, error) {
  15654. type NoMethod NodeGroupsListNodesWarning
  15655. raw := NoMethod(*s)
  15656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15657. }
  15658. type NodeGroupsListNodesWarningData struct {
  15659. // Key: [Output Only] A key that provides more detail on the warning
  15660. // being returned. For example, for warnings where there are no results
  15661. // in a list request for a particular zone, this key might be scope and
  15662. // the key value might be the zone name. Other examples might be a key
  15663. // indicating a deprecated resource and a suggested replacement, or a
  15664. // warning about invalid network settings (for example, if an instance
  15665. // attempts to perform IP forwarding but is not enabled for IP
  15666. // forwarding).
  15667. Key string `json:"key,omitempty"`
  15668. // Value: [Output Only] A warning data value corresponding to the key.
  15669. Value string `json:"value,omitempty"`
  15670. // ForceSendFields is a list of field names (e.g. "Key") to
  15671. // unconditionally include in API requests. By default, fields with
  15672. // empty values are omitted from API requests. However, any non-pointer,
  15673. // non-interface field appearing in ForceSendFields will be sent to the
  15674. // server regardless of whether the field is empty or not. This may be
  15675. // used to include empty fields in Patch requests.
  15676. ForceSendFields []string `json:"-"`
  15677. // NullFields is a list of field names (e.g. "Key") to include in API
  15678. // requests with the JSON null value. By default, fields with empty
  15679. // values are omitted from API requests. However, any field with an
  15680. // empty value appearing in NullFields will be sent to the server as
  15681. // null. It is an error if a field in this list has a non-empty value.
  15682. // This may be used to include null fields in Patch requests.
  15683. NullFields []string `json:"-"`
  15684. }
  15685. func (s *NodeGroupsListNodesWarningData) MarshalJSON() ([]byte, error) {
  15686. type NoMethod NodeGroupsListNodesWarningData
  15687. raw := NoMethod(*s)
  15688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15689. }
  15690. type NodeGroupsScopedList struct {
  15691. // NodeGroups: [Output Only] A list of node groups contained in this
  15692. // scope.
  15693. NodeGroups []*NodeGroup `json:"nodeGroups,omitempty"`
  15694. // Warning: [Output Only] An informational warning that appears when the
  15695. // nodeGroup list is empty.
  15696. Warning *NodeGroupsScopedListWarning `json:"warning,omitempty"`
  15697. // ForceSendFields is a list of field names (e.g. "NodeGroups") to
  15698. // unconditionally include in API requests. By default, fields with
  15699. // empty values are omitted from API requests. However, any non-pointer,
  15700. // non-interface field appearing in ForceSendFields will be sent to the
  15701. // server regardless of whether the field is empty or not. This may be
  15702. // used to include empty fields in Patch requests.
  15703. ForceSendFields []string `json:"-"`
  15704. // NullFields is a list of field names (e.g. "NodeGroups") to include in
  15705. // API requests with the JSON null value. By default, fields with empty
  15706. // values are omitted from API requests. However, any field with an
  15707. // empty value appearing in NullFields will be sent to the server as
  15708. // null. It is an error if a field in this list has a non-empty value.
  15709. // This may be used to include null fields in Patch requests.
  15710. NullFields []string `json:"-"`
  15711. }
  15712. func (s *NodeGroupsScopedList) MarshalJSON() ([]byte, error) {
  15713. type NoMethod NodeGroupsScopedList
  15714. raw := NoMethod(*s)
  15715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15716. }
  15717. // NodeGroupsScopedListWarning: [Output Only] An informational warning
  15718. // that appears when the nodeGroup list is empty.
  15719. type NodeGroupsScopedListWarning struct {
  15720. // Code: [Output Only] A warning code, if applicable. For example,
  15721. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15722. // the response.
  15723. //
  15724. // Possible values:
  15725. // "CLEANUP_FAILED"
  15726. // "DEPRECATED_RESOURCE_USED"
  15727. // "DEPRECATED_TYPE_USED"
  15728. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15729. // "EXPERIMENTAL_TYPE_USED"
  15730. // "EXTERNAL_API_WARNING"
  15731. // "FIELD_VALUE_OVERRIDEN"
  15732. // "INJECTED_KERNELS_DEPRECATED"
  15733. // "MISSING_TYPE_DEPENDENCY"
  15734. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15735. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15736. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15737. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15738. // "NEXT_HOP_NOT_RUNNING"
  15739. // "NOT_CRITICAL_ERROR"
  15740. // "NO_RESULTS_ON_PAGE"
  15741. // "REQUIRED_TOS_AGREEMENT"
  15742. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15743. // "RESOURCE_NOT_DELETED"
  15744. // "SCHEMA_VALIDATION_IGNORED"
  15745. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15746. // "UNDECLARED_PROPERTIES"
  15747. // "UNREACHABLE"
  15748. Code string `json:"code,omitempty"`
  15749. // Data: [Output Only] Metadata about this warning in key: value format.
  15750. // For example:
  15751. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15752. Data []*NodeGroupsScopedListWarningData `json:"data,omitempty"`
  15753. // Message: [Output Only] A human-readable description of the warning
  15754. // code.
  15755. Message string `json:"message,omitempty"`
  15756. // ForceSendFields is a list of field names (e.g. "Code") to
  15757. // unconditionally include in API requests. By default, fields with
  15758. // empty values are omitted from API requests. However, any non-pointer,
  15759. // non-interface field appearing in ForceSendFields will be sent to the
  15760. // server regardless of whether the field is empty or not. This may be
  15761. // used to include empty fields in Patch requests.
  15762. ForceSendFields []string `json:"-"`
  15763. // NullFields is a list of field names (e.g. "Code") to include in API
  15764. // requests with the JSON null value. By default, fields with empty
  15765. // values are omitted from API requests. However, any field with an
  15766. // empty value appearing in NullFields will be sent to the server as
  15767. // null. It is an error if a field in this list has a non-empty value.
  15768. // This may be used to include null fields in Patch requests.
  15769. NullFields []string `json:"-"`
  15770. }
  15771. func (s *NodeGroupsScopedListWarning) MarshalJSON() ([]byte, error) {
  15772. type NoMethod NodeGroupsScopedListWarning
  15773. raw := NoMethod(*s)
  15774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15775. }
  15776. type NodeGroupsScopedListWarningData struct {
  15777. // Key: [Output Only] A key that provides more detail on the warning
  15778. // being returned. For example, for warnings where there are no results
  15779. // in a list request for a particular zone, this key might be scope and
  15780. // the key value might be the zone name. Other examples might be a key
  15781. // indicating a deprecated resource and a suggested replacement, or a
  15782. // warning about invalid network settings (for example, if an instance
  15783. // attempts to perform IP forwarding but is not enabled for IP
  15784. // forwarding).
  15785. Key string `json:"key,omitempty"`
  15786. // Value: [Output Only] A warning data value corresponding to the key.
  15787. Value string `json:"value,omitempty"`
  15788. // ForceSendFields is a list of field names (e.g. "Key") to
  15789. // unconditionally include in API requests. By default, fields with
  15790. // empty values are omitted from API requests. However, any non-pointer,
  15791. // non-interface field appearing in ForceSendFields will be sent to the
  15792. // server regardless of whether the field is empty or not. This may be
  15793. // used to include empty fields in Patch requests.
  15794. ForceSendFields []string `json:"-"`
  15795. // NullFields is a list of field names (e.g. "Key") to include in API
  15796. // requests with the JSON null value. By default, fields with empty
  15797. // values are omitted from API requests. However, any field with an
  15798. // empty value appearing in NullFields will be sent to the server as
  15799. // null. It is an error if a field in this list has a non-empty value.
  15800. // This may be used to include null fields in Patch requests.
  15801. NullFields []string `json:"-"`
  15802. }
  15803. func (s *NodeGroupsScopedListWarningData) MarshalJSON() ([]byte, error) {
  15804. type NoMethod NodeGroupsScopedListWarningData
  15805. raw := NoMethod(*s)
  15806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15807. }
  15808. type NodeGroupsSetNodeTemplateRequest struct {
  15809. // NodeTemplate: Full or partial URL of the node template resource to be
  15810. // updated for this node group.
  15811. NodeTemplate string `json:"nodeTemplate,omitempty"`
  15812. // ForceSendFields is a list of field names (e.g. "NodeTemplate") to
  15813. // unconditionally include in API requests. By default, fields with
  15814. // empty values are omitted from API requests. However, any non-pointer,
  15815. // non-interface field appearing in ForceSendFields will be sent to the
  15816. // server regardless of whether the field is empty or not. This may be
  15817. // used to include empty fields in Patch requests.
  15818. ForceSendFields []string `json:"-"`
  15819. // NullFields is a list of field names (e.g. "NodeTemplate") to include
  15820. // in API requests with the JSON null value. By default, fields with
  15821. // empty values are omitted from API requests. However, any field with
  15822. // an empty value appearing in NullFields will be sent to the server as
  15823. // null. It is an error if a field in this list has a non-empty value.
  15824. // This may be used to include null fields in Patch requests.
  15825. NullFields []string `json:"-"`
  15826. }
  15827. func (s *NodeGroupsSetNodeTemplateRequest) MarshalJSON() ([]byte, error) {
  15828. type NoMethod NodeGroupsSetNodeTemplateRequest
  15829. raw := NoMethod(*s)
  15830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15831. }
  15832. // NodeTemplate: A Node Template resource. To learn more about node
  15833. // templates and sole-tenant nodes, read the Sole-tenant nodes
  15834. // documentation. (== resource_for beta.nodeTemplates ==) (==
  15835. // resource_for v1.nodeTemplates ==)
  15836. type NodeTemplate struct {
  15837. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  15838. // format.
  15839. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  15840. // Description: An optional description of this resource. Provide this
  15841. // property when you create the resource.
  15842. Description string `json:"description,omitempty"`
  15843. // Id: [Output Only] The unique identifier for the resource. This
  15844. // identifier is defined by the server.
  15845. Id uint64 `json:"id,omitempty,string"`
  15846. // Kind: [Output Only] The type of the resource. Always
  15847. // compute#nodeTemplate for node templates.
  15848. Kind string `json:"kind,omitempty"`
  15849. // Name: The name of the resource, provided by the client when initially
  15850. // creating the resource. The resource name must be 1-63 characters
  15851. // long, and comply with RFC1035. Specifically, the name must be 1-63
  15852. // characters long and match the regular expression
  15853. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  15854. // a lowercase letter, and all following characters must be a dash,
  15855. // lowercase letter, or digit, except the last character, which cannot
  15856. // be a dash.
  15857. Name string `json:"name,omitempty"`
  15858. // NodeAffinityLabels: Labels to use for node affinity, which will be
  15859. // used in instance scheduling.
  15860. NodeAffinityLabels map[string]string `json:"nodeAffinityLabels,omitempty"`
  15861. // NodeType: The node type to use for nodes group that are created from
  15862. // this template.
  15863. NodeType string `json:"nodeType,omitempty"`
  15864. // NodeTypeFlexibility: The flexible properties of the desired node
  15865. // type. Node groups that use this node template will create nodes of a
  15866. // type that matches these properties.
  15867. //
  15868. // This field is mutually exclusive with the node_type property; you can
  15869. // only define one or the other, but not both.
  15870. NodeTypeFlexibility *NodeTemplateNodeTypeFlexibility `json:"nodeTypeFlexibility,omitempty"`
  15871. // Region: [Output Only] The name of the region where the node template
  15872. // resides, such as us-central1.
  15873. Region string `json:"region,omitempty"`
  15874. // SelfLink: [Output Only] Server-defined URL for the resource.
  15875. SelfLink string `json:"selfLink,omitempty"`
  15876. // Status: [Output Only] The status of the node template. One of the
  15877. // following values: CREATING, READY, and DELETING.
  15878. //
  15879. // Possible values:
  15880. // "CREATING"
  15881. // "DELETING"
  15882. // "INVALID"
  15883. // "READY"
  15884. Status string `json:"status,omitempty"`
  15885. // StatusMessage: [Output Only] An optional, human-readable explanation
  15886. // of the status.
  15887. StatusMessage string `json:"statusMessage,omitempty"`
  15888. // ServerResponse contains the HTTP response code and headers from the
  15889. // server.
  15890. googleapi.ServerResponse `json:"-"`
  15891. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  15892. // to unconditionally include in API requests. By default, fields with
  15893. // empty values are omitted from API requests. However, any non-pointer,
  15894. // non-interface field appearing in ForceSendFields will be sent to the
  15895. // server regardless of whether the field is empty or not. This may be
  15896. // used to include empty fields in Patch requests.
  15897. ForceSendFields []string `json:"-"`
  15898. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  15899. // include in API requests with the JSON null value. By default, fields
  15900. // with empty values are omitted from API requests. However, any field
  15901. // with an empty value appearing in NullFields will be sent to the
  15902. // server as null. It is an error if a field in this list has a
  15903. // non-empty value. This may be used to include null fields in Patch
  15904. // requests.
  15905. NullFields []string `json:"-"`
  15906. }
  15907. func (s *NodeTemplate) MarshalJSON() ([]byte, error) {
  15908. type NoMethod NodeTemplate
  15909. raw := NoMethod(*s)
  15910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15911. }
  15912. type NodeTemplateAggregatedList struct {
  15913. // Id: [Output Only] Unique identifier for the resource; defined by the
  15914. // server.
  15915. Id string `json:"id,omitempty"`
  15916. // Items: A list of NodeTemplatesScopedList resources.
  15917. Items map[string]NodeTemplatesScopedList `json:"items,omitempty"`
  15918. // Kind: [Output Only] Type of resource.Always
  15919. // compute#nodeTemplateAggregatedList for aggregated lists of node
  15920. // templates.
  15921. Kind string `json:"kind,omitempty"`
  15922. // NextPageToken: [Output Only] This token allows you to get the next
  15923. // page of results for list requests. If the number of results is larger
  15924. // than maxResults, use the nextPageToken as a value for the query
  15925. // parameter pageToken in the next list request. Subsequent list
  15926. // requests will have their own nextPageToken to continue paging through
  15927. // the results.
  15928. NextPageToken string `json:"nextPageToken,omitempty"`
  15929. // SelfLink: [Output Only] Server-defined URL for this resource.
  15930. SelfLink string `json:"selfLink,omitempty"`
  15931. // Warning: [Output Only] Informational warning message.
  15932. Warning *NodeTemplateAggregatedListWarning `json:"warning,omitempty"`
  15933. // ServerResponse contains the HTTP response code and headers from the
  15934. // server.
  15935. googleapi.ServerResponse `json:"-"`
  15936. // ForceSendFields is a list of field names (e.g. "Id") to
  15937. // unconditionally include in API requests. By default, fields with
  15938. // empty values are omitted from API requests. However, any non-pointer,
  15939. // non-interface field appearing in ForceSendFields will be sent to the
  15940. // server regardless of whether the field is empty or not. This may be
  15941. // used to include empty fields in Patch requests.
  15942. ForceSendFields []string `json:"-"`
  15943. // NullFields is a list of field names (e.g. "Id") to include in API
  15944. // requests with the JSON null value. By default, fields with empty
  15945. // values are omitted from API requests. However, any field with an
  15946. // empty value appearing in NullFields will be sent to the server as
  15947. // null. It is an error if a field in this list has a non-empty value.
  15948. // This may be used to include null fields in Patch requests.
  15949. NullFields []string `json:"-"`
  15950. }
  15951. func (s *NodeTemplateAggregatedList) MarshalJSON() ([]byte, error) {
  15952. type NoMethod NodeTemplateAggregatedList
  15953. raw := NoMethod(*s)
  15954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  15955. }
  15956. // NodeTemplateAggregatedListWarning: [Output Only] Informational
  15957. // warning message.
  15958. type NodeTemplateAggregatedListWarning struct {
  15959. // Code: [Output Only] A warning code, if applicable. For example,
  15960. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  15961. // the response.
  15962. //
  15963. // Possible values:
  15964. // "CLEANUP_FAILED"
  15965. // "DEPRECATED_RESOURCE_USED"
  15966. // "DEPRECATED_TYPE_USED"
  15967. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  15968. // "EXPERIMENTAL_TYPE_USED"
  15969. // "EXTERNAL_API_WARNING"
  15970. // "FIELD_VALUE_OVERRIDEN"
  15971. // "INJECTED_KERNELS_DEPRECATED"
  15972. // "MISSING_TYPE_DEPENDENCY"
  15973. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  15974. // "NEXT_HOP_CANNOT_IP_FORWARD"
  15975. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  15976. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  15977. // "NEXT_HOP_NOT_RUNNING"
  15978. // "NOT_CRITICAL_ERROR"
  15979. // "NO_RESULTS_ON_PAGE"
  15980. // "REQUIRED_TOS_AGREEMENT"
  15981. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  15982. // "RESOURCE_NOT_DELETED"
  15983. // "SCHEMA_VALIDATION_IGNORED"
  15984. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  15985. // "UNDECLARED_PROPERTIES"
  15986. // "UNREACHABLE"
  15987. Code string `json:"code,omitempty"`
  15988. // Data: [Output Only] Metadata about this warning in key: value format.
  15989. // For example:
  15990. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  15991. Data []*NodeTemplateAggregatedListWarningData `json:"data,omitempty"`
  15992. // Message: [Output Only] A human-readable description of the warning
  15993. // code.
  15994. Message string `json:"message,omitempty"`
  15995. // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *NodeTemplateAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16011. type NoMethod NodeTemplateAggregatedListWarning
  16012. raw := NoMethod(*s)
  16013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16014. }
  16015. type NodeTemplateAggregatedListWarningData struct {
  16016. // Key: [Output Only] A key that provides more detail on the warning
  16017. // being returned. For example, for warnings where there are no results
  16018. // in a list request for a particular zone, this key might be scope and
  16019. // the key value might be the zone name. Other examples might be a key
  16020. // indicating a deprecated resource and a suggested replacement, or a
  16021. // warning about invalid network settings (for example, if an instance
  16022. // attempts to perform IP forwarding but is not enabled for IP
  16023. // forwarding).
  16024. Key string `json:"key,omitempty"`
  16025. // Value: [Output Only] A warning data value corresponding to the key.
  16026. Value string `json:"value,omitempty"`
  16027. // ForceSendFields is a list of field names (e.g. "Key") to
  16028. // unconditionally include in API requests. By default, fields with
  16029. // empty values are omitted from API requests. However, any non-pointer,
  16030. // non-interface field appearing in ForceSendFields will be sent to the
  16031. // server regardless of whether the field is empty or not. This may be
  16032. // used to include empty fields in Patch requests.
  16033. ForceSendFields []string `json:"-"`
  16034. // NullFields is a list of field names (e.g. "Key") to include in API
  16035. // requests with the JSON null value. By default, fields with empty
  16036. // values are omitted from API requests. However, any field with an
  16037. // empty value appearing in NullFields will be sent to the server as
  16038. // null. It is an error if a field in this list has a non-empty value.
  16039. // This may be used to include null fields in Patch requests.
  16040. NullFields []string `json:"-"`
  16041. }
  16042. func (s *NodeTemplateAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16043. type NoMethod NodeTemplateAggregatedListWarningData
  16044. raw := NoMethod(*s)
  16045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16046. }
  16047. // NodeTemplateList: Contains a list of node templates.
  16048. type NodeTemplateList struct {
  16049. // Id: [Output Only] Unique identifier for the resource; defined by the
  16050. // server.
  16051. Id string `json:"id,omitempty"`
  16052. // Items: A list of NodeTemplate resources.
  16053. Items []*NodeTemplate `json:"items,omitempty"`
  16054. // Kind: [Output Only] Type of resource.Always compute#nodeTemplateList
  16055. // for lists of node templates.
  16056. Kind string `json:"kind,omitempty"`
  16057. // NextPageToken: [Output Only] This token allows you to get the next
  16058. // page of results for list requests. If the number of results is larger
  16059. // than maxResults, use the nextPageToken as a value for the query
  16060. // parameter pageToken in the next list request. Subsequent list
  16061. // requests will have their own nextPageToken to continue paging through
  16062. // the results.
  16063. NextPageToken string `json:"nextPageToken,omitempty"`
  16064. // SelfLink: [Output Only] Server-defined URL for this resource.
  16065. SelfLink string `json:"selfLink,omitempty"`
  16066. // Warning: [Output Only] Informational warning message.
  16067. Warning *NodeTemplateListWarning `json:"warning,omitempty"`
  16068. // ServerResponse contains the HTTP response code and headers from the
  16069. // server.
  16070. googleapi.ServerResponse `json:"-"`
  16071. // ForceSendFields is a list of field names (e.g. "Id") to
  16072. // unconditionally include in API requests. By default, fields with
  16073. // empty values are omitted from API requests. However, any non-pointer,
  16074. // non-interface field appearing in ForceSendFields will be sent to the
  16075. // server regardless of whether the field is empty or not. This may be
  16076. // used to include empty fields in Patch requests.
  16077. ForceSendFields []string `json:"-"`
  16078. // NullFields is a list of field names (e.g. "Id") to include in API
  16079. // requests with the JSON null value. By default, fields with empty
  16080. // values are omitted from API requests. However, any field with an
  16081. // empty value appearing in NullFields will be sent to the server as
  16082. // null. It is an error if a field in this list has a non-empty value.
  16083. // This may be used to include null fields in Patch requests.
  16084. NullFields []string `json:"-"`
  16085. }
  16086. func (s *NodeTemplateList) MarshalJSON() ([]byte, error) {
  16087. type NoMethod NodeTemplateList
  16088. raw := NoMethod(*s)
  16089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16090. }
  16091. // NodeTemplateListWarning: [Output Only] Informational warning message.
  16092. type NodeTemplateListWarning struct {
  16093. // Code: [Output Only] A warning code, if applicable. For example,
  16094. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16095. // the response.
  16096. //
  16097. // Possible values:
  16098. // "CLEANUP_FAILED"
  16099. // "DEPRECATED_RESOURCE_USED"
  16100. // "DEPRECATED_TYPE_USED"
  16101. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16102. // "EXPERIMENTAL_TYPE_USED"
  16103. // "EXTERNAL_API_WARNING"
  16104. // "FIELD_VALUE_OVERRIDEN"
  16105. // "INJECTED_KERNELS_DEPRECATED"
  16106. // "MISSING_TYPE_DEPENDENCY"
  16107. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16108. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16109. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16110. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16111. // "NEXT_HOP_NOT_RUNNING"
  16112. // "NOT_CRITICAL_ERROR"
  16113. // "NO_RESULTS_ON_PAGE"
  16114. // "REQUIRED_TOS_AGREEMENT"
  16115. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16116. // "RESOURCE_NOT_DELETED"
  16117. // "SCHEMA_VALIDATION_IGNORED"
  16118. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16119. // "UNDECLARED_PROPERTIES"
  16120. // "UNREACHABLE"
  16121. Code string `json:"code,omitempty"`
  16122. // Data: [Output Only] Metadata about this warning in key: value format.
  16123. // For example:
  16124. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16125. Data []*NodeTemplateListWarningData `json:"data,omitempty"`
  16126. // Message: [Output Only] A human-readable description of the warning
  16127. // code.
  16128. Message string `json:"message,omitempty"`
  16129. // ForceSendFields is a list of field names (e.g. "Code") to
  16130. // unconditionally include in API requests. By default, fields with
  16131. // empty values are omitted from API requests. However, any non-pointer,
  16132. // non-interface field appearing in ForceSendFields will be sent to the
  16133. // server regardless of whether the field is empty or not. This may be
  16134. // used to include empty fields in Patch requests.
  16135. ForceSendFields []string `json:"-"`
  16136. // NullFields is a list of field names (e.g. "Code") to include in API
  16137. // requests with the JSON null value. By default, fields with empty
  16138. // values are omitted from API requests. However, any field with an
  16139. // empty value appearing in NullFields will be sent to the server as
  16140. // null. It is an error if a field in this list has a non-empty value.
  16141. // This may be used to include null fields in Patch requests.
  16142. NullFields []string `json:"-"`
  16143. }
  16144. func (s *NodeTemplateListWarning) MarshalJSON() ([]byte, error) {
  16145. type NoMethod NodeTemplateListWarning
  16146. raw := NoMethod(*s)
  16147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16148. }
  16149. type NodeTemplateListWarningData struct {
  16150. // Key: [Output Only] A key that provides more detail on the warning
  16151. // being returned. For example, for warnings where there are no results
  16152. // in a list request for a particular zone, this key might be scope and
  16153. // the key value might be the zone name. Other examples might be a key
  16154. // indicating a deprecated resource and a suggested replacement, or a
  16155. // warning about invalid network settings (for example, if an instance
  16156. // attempts to perform IP forwarding but is not enabled for IP
  16157. // forwarding).
  16158. Key string `json:"key,omitempty"`
  16159. // Value: [Output Only] A warning data value corresponding to the key.
  16160. Value string `json:"value,omitempty"`
  16161. // ForceSendFields is a list of field names (e.g. "Key") to
  16162. // unconditionally include in API requests. By default, fields with
  16163. // empty values are omitted from API requests. However, any non-pointer,
  16164. // non-interface field appearing in ForceSendFields will be sent to the
  16165. // server regardless of whether the field is empty or not. This may be
  16166. // used to include empty fields in Patch requests.
  16167. ForceSendFields []string `json:"-"`
  16168. // NullFields is a list of field names (e.g. "Key") to include in API
  16169. // requests with the JSON null value. By default, fields with empty
  16170. // values are omitted from API requests. However, any field with an
  16171. // empty value appearing in NullFields will be sent to the server as
  16172. // null. It is an error if a field in this list has a non-empty value.
  16173. // This may be used to include null fields in Patch requests.
  16174. NullFields []string `json:"-"`
  16175. }
  16176. func (s *NodeTemplateListWarningData) MarshalJSON() ([]byte, error) {
  16177. type NoMethod NodeTemplateListWarningData
  16178. raw := NoMethod(*s)
  16179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16180. }
  16181. type NodeTemplateNodeTypeFlexibility struct {
  16182. Cpus string `json:"cpus,omitempty"`
  16183. LocalSsd string `json:"localSsd,omitempty"`
  16184. Memory string `json:"memory,omitempty"`
  16185. // ForceSendFields is a list of field names (e.g. "Cpus") to
  16186. // unconditionally include in API requests. By default, fields with
  16187. // empty values are omitted from API requests. However, any non-pointer,
  16188. // non-interface field appearing in ForceSendFields will be sent to the
  16189. // server regardless of whether the field is empty or not. This may be
  16190. // used to include empty fields in Patch requests.
  16191. ForceSendFields []string `json:"-"`
  16192. // NullFields is a list of field names (e.g. "Cpus") to include in API
  16193. // requests with the JSON null value. By default, fields with empty
  16194. // values are omitted from API requests. However, any field with an
  16195. // empty value appearing in NullFields will be sent to the server as
  16196. // null. It is an error if a field in this list has a non-empty value.
  16197. // This may be used to include null fields in Patch requests.
  16198. NullFields []string `json:"-"`
  16199. }
  16200. func (s *NodeTemplateNodeTypeFlexibility) MarshalJSON() ([]byte, error) {
  16201. type NoMethod NodeTemplateNodeTypeFlexibility
  16202. raw := NoMethod(*s)
  16203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16204. }
  16205. type NodeTemplatesScopedList struct {
  16206. // NodeTemplates: [Output Only] A list of node templates contained in
  16207. // this scope.
  16208. NodeTemplates []*NodeTemplate `json:"nodeTemplates,omitempty"`
  16209. // Warning: [Output Only] An informational warning that appears when the
  16210. // node templates list is empty.
  16211. Warning *NodeTemplatesScopedListWarning `json:"warning,omitempty"`
  16212. // ForceSendFields is a list of field names (e.g. "NodeTemplates") to
  16213. // unconditionally include in API requests. By default, fields with
  16214. // empty values are omitted from API requests. However, any non-pointer,
  16215. // non-interface field appearing in ForceSendFields will be sent to the
  16216. // server regardless of whether the field is empty or not. This may be
  16217. // used to include empty fields in Patch requests.
  16218. ForceSendFields []string `json:"-"`
  16219. // NullFields is a list of field names (e.g. "NodeTemplates") to include
  16220. // in API requests with the JSON null value. By default, fields with
  16221. // empty values are omitted from API requests. However, any field with
  16222. // an empty value appearing in NullFields will be sent to the server as
  16223. // null. It is an error if a field in this list has a non-empty value.
  16224. // This may be used to include null fields in Patch requests.
  16225. NullFields []string `json:"-"`
  16226. }
  16227. func (s *NodeTemplatesScopedList) MarshalJSON() ([]byte, error) {
  16228. type NoMethod NodeTemplatesScopedList
  16229. raw := NoMethod(*s)
  16230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16231. }
  16232. // NodeTemplatesScopedListWarning: [Output Only] An informational
  16233. // warning that appears when the node templates list is empty.
  16234. type NodeTemplatesScopedListWarning struct {
  16235. // Code: [Output Only] A warning code, if applicable. For example,
  16236. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16237. // the response.
  16238. //
  16239. // Possible values:
  16240. // "CLEANUP_FAILED"
  16241. // "DEPRECATED_RESOURCE_USED"
  16242. // "DEPRECATED_TYPE_USED"
  16243. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16244. // "EXPERIMENTAL_TYPE_USED"
  16245. // "EXTERNAL_API_WARNING"
  16246. // "FIELD_VALUE_OVERRIDEN"
  16247. // "INJECTED_KERNELS_DEPRECATED"
  16248. // "MISSING_TYPE_DEPENDENCY"
  16249. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16250. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16251. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16252. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16253. // "NEXT_HOP_NOT_RUNNING"
  16254. // "NOT_CRITICAL_ERROR"
  16255. // "NO_RESULTS_ON_PAGE"
  16256. // "REQUIRED_TOS_AGREEMENT"
  16257. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16258. // "RESOURCE_NOT_DELETED"
  16259. // "SCHEMA_VALIDATION_IGNORED"
  16260. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16261. // "UNDECLARED_PROPERTIES"
  16262. // "UNREACHABLE"
  16263. Code string `json:"code,omitempty"`
  16264. // Data: [Output Only] Metadata about this warning in key: value format.
  16265. // For example:
  16266. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16267. Data []*NodeTemplatesScopedListWarningData `json:"data,omitempty"`
  16268. // Message: [Output Only] A human-readable description of the warning
  16269. // code.
  16270. Message string `json:"message,omitempty"`
  16271. // ForceSendFields is a list of field names (e.g. "Code") to
  16272. // unconditionally include in API requests. By default, fields with
  16273. // empty values are omitted from API requests. However, any non-pointer,
  16274. // non-interface field appearing in ForceSendFields will be sent to the
  16275. // server regardless of whether the field is empty or not. This may be
  16276. // used to include empty fields in Patch requests.
  16277. ForceSendFields []string `json:"-"`
  16278. // NullFields is a list of field names (e.g. "Code") to include in API
  16279. // requests with the JSON null value. By default, fields with empty
  16280. // values are omitted from API requests. However, any field with an
  16281. // empty value appearing in NullFields will be sent to the server as
  16282. // null. It is an error if a field in this list has a non-empty value.
  16283. // This may be used to include null fields in Patch requests.
  16284. NullFields []string `json:"-"`
  16285. }
  16286. func (s *NodeTemplatesScopedListWarning) MarshalJSON() ([]byte, error) {
  16287. type NoMethod NodeTemplatesScopedListWarning
  16288. raw := NoMethod(*s)
  16289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16290. }
  16291. type NodeTemplatesScopedListWarningData struct {
  16292. // Key: [Output Only] A key that provides more detail on the warning
  16293. // being returned. For example, for warnings where there are no results
  16294. // in a list request for a particular zone, this key might be scope and
  16295. // the key value might be the zone name. Other examples might be a key
  16296. // indicating a deprecated resource and a suggested replacement, or a
  16297. // warning about invalid network settings (for example, if an instance
  16298. // attempts to perform IP forwarding but is not enabled for IP
  16299. // forwarding).
  16300. Key string `json:"key,omitempty"`
  16301. // Value: [Output Only] A warning data value corresponding to the key.
  16302. Value string `json:"value,omitempty"`
  16303. // ForceSendFields is a list of field names (e.g. "Key") to
  16304. // unconditionally include in API requests. By default, fields with
  16305. // empty values are omitted from API requests. However, any non-pointer,
  16306. // non-interface field appearing in ForceSendFields will be sent to the
  16307. // server regardless of whether the field is empty or not. This may be
  16308. // used to include empty fields in Patch requests.
  16309. ForceSendFields []string `json:"-"`
  16310. // NullFields is a list of field names (e.g. "Key") to include in API
  16311. // requests with the JSON null value. By default, fields with empty
  16312. // values are omitted from API requests. However, any field with an
  16313. // empty value appearing in NullFields will be sent to the server as
  16314. // null. It is an error if a field in this list has a non-empty value.
  16315. // This may be used to include null fields in Patch requests.
  16316. NullFields []string `json:"-"`
  16317. }
  16318. func (s *NodeTemplatesScopedListWarningData) MarshalJSON() ([]byte, error) {
  16319. type NoMethod NodeTemplatesScopedListWarningData
  16320. raw := NoMethod(*s)
  16321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16322. }
  16323. // NodeType: A Node Type resource.
  16324. type NodeType struct {
  16325. // CpuPlatform: [Output Only] The CPU platform used by this node type.
  16326. CpuPlatform string `json:"cpuPlatform,omitempty"`
  16327. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  16328. // format.
  16329. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16330. // Deprecated: [Output Only] The deprecation status associated with this
  16331. // node type.
  16332. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  16333. // Description: [Output Only] An optional textual description of the
  16334. // resource.
  16335. Description string `json:"description,omitempty"`
  16336. // GuestCpus: [Output Only] The number of virtual CPUs that are
  16337. // available to the node type.
  16338. GuestCpus int64 `json:"guestCpus,omitempty"`
  16339. // Id: [Output Only] The unique identifier for the resource. This
  16340. // identifier is defined by the server.
  16341. Id uint64 `json:"id,omitempty,string"`
  16342. // Kind: [Output Only] The type of the resource. Always compute#nodeType
  16343. // for node types.
  16344. Kind string `json:"kind,omitempty"`
  16345. // LocalSsdGb: [Output Only] Local SSD available to the node type,
  16346. // defined in GB.
  16347. LocalSsdGb int64 `json:"localSsdGb,omitempty"`
  16348. // MemoryMb: [Output Only] The amount of physical memory available to
  16349. // the node type, defined in MB.
  16350. MemoryMb int64 `json:"memoryMb,omitempty"`
  16351. // Name: [Output Only] Name of the resource.
  16352. Name string `json:"name,omitempty"`
  16353. // SelfLink: [Output Only] Server-defined URL for the resource.
  16354. SelfLink string `json:"selfLink,omitempty"`
  16355. // Zone: [Output Only] The name of the zone where the node type resides,
  16356. // such as us-central1-a.
  16357. Zone string `json:"zone,omitempty"`
  16358. // ServerResponse contains the HTTP response code and headers from the
  16359. // server.
  16360. googleapi.ServerResponse `json:"-"`
  16361. // ForceSendFields is a list of field names (e.g. "CpuPlatform") to
  16362. // unconditionally include in API requests. By default, fields with
  16363. // empty values are omitted from API requests. However, any non-pointer,
  16364. // non-interface field appearing in ForceSendFields will be sent to the
  16365. // server regardless of whether the field is empty or not. This may be
  16366. // used to include empty fields in Patch requests.
  16367. ForceSendFields []string `json:"-"`
  16368. // NullFields is a list of field names (e.g. "CpuPlatform") to include
  16369. // in API requests with the JSON null value. By default, fields with
  16370. // empty values are omitted from API requests. However, any field with
  16371. // an empty value appearing in NullFields will be sent to the server as
  16372. // null. It is an error if a field in this list has a non-empty value.
  16373. // This may be used to include null fields in Patch requests.
  16374. NullFields []string `json:"-"`
  16375. }
  16376. func (s *NodeType) MarshalJSON() ([]byte, error) {
  16377. type NoMethod NodeType
  16378. raw := NoMethod(*s)
  16379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16380. }
  16381. type NodeTypeAggregatedList struct {
  16382. // Id: [Output Only] Unique identifier for the resource; defined by the
  16383. // server.
  16384. Id string `json:"id,omitempty"`
  16385. // Items: A list of NodeTypesScopedList resources.
  16386. Items map[string]NodeTypesScopedList `json:"items,omitempty"`
  16387. // Kind: [Output Only] Type of resource.Always
  16388. // compute#nodeTypeAggregatedList for aggregated lists of node types.
  16389. Kind string `json:"kind,omitempty"`
  16390. // NextPageToken: [Output Only] This token allows you to get the next
  16391. // page of results for list requests. If the number of results is larger
  16392. // than maxResults, use the nextPageToken as a value for the query
  16393. // parameter pageToken in the next list request. Subsequent list
  16394. // requests will have their own nextPageToken to continue paging through
  16395. // the results.
  16396. NextPageToken string `json:"nextPageToken,omitempty"`
  16397. // SelfLink: [Output Only] Server-defined URL for this resource.
  16398. SelfLink string `json:"selfLink,omitempty"`
  16399. // Warning: [Output Only] Informational warning message.
  16400. Warning *NodeTypeAggregatedListWarning `json:"warning,omitempty"`
  16401. // ServerResponse contains the HTTP response code and headers from the
  16402. // server.
  16403. googleapi.ServerResponse `json:"-"`
  16404. // ForceSendFields is a list of field names (e.g. "Id") to
  16405. // unconditionally include in API requests. By default, fields with
  16406. // empty values are omitted from API requests. However, any non-pointer,
  16407. // non-interface field appearing in ForceSendFields will be sent to the
  16408. // server regardless of whether the field is empty or not. This may be
  16409. // used to include empty fields in Patch requests.
  16410. ForceSendFields []string `json:"-"`
  16411. // NullFields is a list of field names (e.g. "Id") to include in API
  16412. // requests with the JSON null value. By default, fields with empty
  16413. // values are omitted from API requests. However, any field with an
  16414. // empty value appearing in NullFields will be sent to the server as
  16415. // null. It is an error if a field in this list has a non-empty value.
  16416. // This may be used to include null fields in Patch requests.
  16417. NullFields []string `json:"-"`
  16418. }
  16419. func (s *NodeTypeAggregatedList) MarshalJSON() ([]byte, error) {
  16420. type NoMethod NodeTypeAggregatedList
  16421. raw := NoMethod(*s)
  16422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16423. }
  16424. // NodeTypeAggregatedListWarning: [Output Only] Informational warning
  16425. // message.
  16426. type NodeTypeAggregatedListWarning struct {
  16427. // Code: [Output Only] A warning code, if applicable. For example,
  16428. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16429. // the response.
  16430. //
  16431. // Possible values:
  16432. // "CLEANUP_FAILED"
  16433. // "DEPRECATED_RESOURCE_USED"
  16434. // "DEPRECATED_TYPE_USED"
  16435. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16436. // "EXPERIMENTAL_TYPE_USED"
  16437. // "EXTERNAL_API_WARNING"
  16438. // "FIELD_VALUE_OVERRIDEN"
  16439. // "INJECTED_KERNELS_DEPRECATED"
  16440. // "MISSING_TYPE_DEPENDENCY"
  16441. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16442. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16443. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16444. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16445. // "NEXT_HOP_NOT_RUNNING"
  16446. // "NOT_CRITICAL_ERROR"
  16447. // "NO_RESULTS_ON_PAGE"
  16448. // "REQUIRED_TOS_AGREEMENT"
  16449. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16450. // "RESOURCE_NOT_DELETED"
  16451. // "SCHEMA_VALIDATION_IGNORED"
  16452. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16453. // "UNDECLARED_PROPERTIES"
  16454. // "UNREACHABLE"
  16455. Code string `json:"code,omitempty"`
  16456. // Data: [Output Only] Metadata about this warning in key: value format.
  16457. // For example:
  16458. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16459. Data []*NodeTypeAggregatedListWarningData `json:"data,omitempty"`
  16460. // Message: [Output Only] A human-readable description of the warning
  16461. // code.
  16462. Message string `json:"message,omitempty"`
  16463. // ForceSendFields is a list of field names (e.g. "Code") to
  16464. // unconditionally include in API requests. By default, fields with
  16465. // empty values are omitted from API requests. However, any non-pointer,
  16466. // non-interface field appearing in ForceSendFields will be sent to the
  16467. // server regardless of whether the field is empty or not. This may be
  16468. // used to include empty fields in Patch requests.
  16469. ForceSendFields []string `json:"-"`
  16470. // NullFields is a list of field names (e.g. "Code") to include in API
  16471. // requests with the JSON null value. By default, fields with empty
  16472. // values are omitted from API requests. However, any field with an
  16473. // empty value appearing in NullFields will be sent to the server as
  16474. // null. It is an error if a field in this list has a non-empty value.
  16475. // This may be used to include null fields in Patch requests.
  16476. NullFields []string `json:"-"`
  16477. }
  16478. func (s *NodeTypeAggregatedListWarning) MarshalJSON() ([]byte, error) {
  16479. type NoMethod NodeTypeAggregatedListWarning
  16480. raw := NoMethod(*s)
  16481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16482. }
  16483. type NodeTypeAggregatedListWarningData struct {
  16484. // Key: [Output Only] A key that provides more detail on the warning
  16485. // being returned. For example, for warnings where there are no results
  16486. // in a list request for a particular zone, this key might be scope and
  16487. // the key value might be the zone name. Other examples might be a key
  16488. // indicating a deprecated resource and a suggested replacement, or a
  16489. // warning about invalid network settings (for example, if an instance
  16490. // attempts to perform IP forwarding but is not enabled for IP
  16491. // forwarding).
  16492. Key string `json:"key,omitempty"`
  16493. // Value: [Output Only] A warning data value corresponding to the key.
  16494. Value string `json:"value,omitempty"`
  16495. // ForceSendFields is a list of field names (e.g. "Key") to
  16496. // unconditionally include in API requests. By default, fields with
  16497. // empty values are omitted from API requests. However, any non-pointer,
  16498. // non-interface field appearing in ForceSendFields will be sent to the
  16499. // server regardless of whether the field is empty or not. This may be
  16500. // used to include empty fields in Patch requests.
  16501. ForceSendFields []string `json:"-"`
  16502. // NullFields is a list of field names (e.g. "Key") to include in API
  16503. // requests with the JSON null value. By default, fields with empty
  16504. // values are omitted from API requests. However, any field with an
  16505. // empty value appearing in NullFields will be sent to the server as
  16506. // null. It is an error if a field in this list has a non-empty value.
  16507. // This may be used to include null fields in Patch requests.
  16508. NullFields []string `json:"-"`
  16509. }
  16510. func (s *NodeTypeAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  16511. type NoMethod NodeTypeAggregatedListWarningData
  16512. raw := NoMethod(*s)
  16513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16514. }
  16515. // NodeTypeList: Contains a list of node types.
  16516. type NodeTypeList struct {
  16517. // Id: [Output Only] Unique identifier for the resource; defined by the
  16518. // server.
  16519. Id string `json:"id,omitempty"`
  16520. // Items: A list of NodeType resources.
  16521. Items []*NodeType `json:"items,omitempty"`
  16522. // Kind: [Output Only] Type of resource.Always compute#nodeTypeList for
  16523. // lists of node types.
  16524. Kind string `json:"kind,omitempty"`
  16525. // NextPageToken: [Output Only] This token allows you to get the next
  16526. // page of results for list requests. If the number of results is larger
  16527. // than maxResults, use the nextPageToken as a value for the query
  16528. // parameter pageToken in the next list request. Subsequent list
  16529. // requests will have their own nextPageToken to continue paging through
  16530. // the results.
  16531. NextPageToken string `json:"nextPageToken,omitempty"`
  16532. // SelfLink: [Output Only] Server-defined URL for this resource.
  16533. SelfLink string `json:"selfLink,omitempty"`
  16534. // Warning: [Output Only] Informational warning message.
  16535. Warning *NodeTypeListWarning `json:"warning,omitempty"`
  16536. // ServerResponse contains the HTTP response code and headers from the
  16537. // server.
  16538. googleapi.ServerResponse `json:"-"`
  16539. // ForceSendFields is a list of field names (e.g. "Id") to
  16540. // unconditionally include in API requests. By default, fields with
  16541. // empty values are omitted from API requests. However, any non-pointer,
  16542. // non-interface field appearing in ForceSendFields will be sent to the
  16543. // server regardless of whether the field is empty or not. This may be
  16544. // used to include empty fields in Patch requests.
  16545. ForceSendFields []string `json:"-"`
  16546. // NullFields is a list of field names (e.g. "Id") to include in API
  16547. // requests with the JSON null value. By default, fields with empty
  16548. // values are omitted from API requests. However, any field with an
  16549. // empty value appearing in NullFields will be sent to the server as
  16550. // null. It is an error if a field in this list has a non-empty value.
  16551. // This may be used to include null fields in Patch requests.
  16552. NullFields []string `json:"-"`
  16553. }
  16554. func (s *NodeTypeList) MarshalJSON() ([]byte, error) {
  16555. type NoMethod NodeTypeList
  16556. raw := NoMethod(*s)
  16557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16558. }
  16559. // NodeTypeListWarning: [Output Only] Informational warning message.
  16560. type NodeTypeListWarning struct {
  16561. // Code: [Output Only] A warning code, if applicable. For example,
  16562. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16563. // the response.
  16564. //
  16565. // Possible values:
  16566. // "CLEANUP_FAILED"
  16567. // "DEPRECATED_RESOURCE_USED"
  16568. // "DEPRECATED_TYPE_USED"
  16569. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16570. // "EXPERIMENTAL_TYPE_USED"
  16571. // "EXTERNAL_API_WARNING"
  16572. // "FIELD_VALUE_OVERRIDEN"
  16573. // "INJECTED_KERNELS_DEPRECATED"
  16574. // "MISSING_TYPE_DEPENDENCY"
  16575. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16576. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16577. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16578. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16579. // "NEXT_HOP_NOT_RUNNING"
  16580. // "NOT_CRITICAL_ERROR"
  16581. // "NO_RESULTS_ON_PAGE"
  16582. // "REQUIRED_TOS_AGREEMENT"
  16583. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16584. // "RESOURCE_NOT_DELETED"
  16585. // "SCHEMA_VALIDATION_IGNORED"
  16586. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16587. // "UNDECLARED_PROPERTIES"
  16588. // "UNREACHABLE"
  16589. Code string `json:"code,omitempty"`
  16590. // Data: [Output Only] Metadata about this warning in key: value format.
  16591. // For example:
  16592. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16593. Data []*NodeTypeListWarningData `json:"data,omitempty"`
  16594. // Message: [Output Only] A human-readable description of the warning
  16595. // code.
  16596. Message string `json:"message,omitempty"`
  16597. // ForceSendFields is a list of field names (e.g. "Code") to
  16598. // unconditionally include in API requests. By default, fields with
  16599. // empty values are omitted from API requests. However, any non-pointer,
  16600. // non-interface field appearing in ForceSendFields will be sent to the
  16601. // server regardless of whether the field is empty or not. This may be
  16602. // used to include empty fields in Patch requests.
  16603. ForceSendFields []string `json:"-"`
  16604. // NullFields is a list of field names (e.g. "Code") to include in API
  16605. // requests with the JSON null value. By default, fields with empty
  16606. // values are omitted from API requests. However, any field with an
  16607. // empty value appearing in NullFields will be sent to the server as
  16608. // null. It is an error if a field in this list has a non-empty value.
  16609. // This may be used to include null fields in Patch requests.
  16610. NullFields []string `json:"-"`
  16611. }
  16612. func (s *NodeTypeListWarning) MarshalJSON() ([]byte, error) {
  16613. type NoMethod NodeTypeListWarning
  16614. raw := NoMethod(*s)
  16615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16616. }
  16617. type NodeTypeListWarningData struct {
  16618. // Key: [Output Only] A key that provides more detail on the warning
  16619. // being returned. For example, for warnings where there are no results
  16620. // in a list request for a particular zone, this key might be scope and
  16621. // the key value might be the zone name. Other examples might be a key
  16622. // indicating a deprecated resource and a suggested replacement, or a
  16623. // warning about invalid network settings (for example, if an instance
  16624. // attempts to perform IP forwarding but is not enabled for IP
  16625. // forwarding).
  16626. Key string `json:"key,omitempty"`
  16627. // Value: [Output Only] A warning data value corresponding to the key.
  16628. Value string `json:"value,omitempty"`
  16629. // ForceSendFields is a list of field names (e.g. "Key") to
  16630. // unconditionally include in API requests. By default, fields with
  16631. // empty values are omitted from API requests. However, any non-pointer,
  16632. // non-interface field appearing in ForceSendFields will be sent to the
  16633. // server regardless of whether the field is empty or not. This may be
  16634. // used to include empty fields in Patch requests.
  16635. ForceSendFields []string `json:"-"`
  16636. // NullFields is a list of field names (e.g. "Key") to include in API
  16637. // requests with the JSON null value. By default, fields with empty
  16638. // values are omitted from API requests. However, any field with an
  16639. // empty value appearing in NullFields will be sent to the server as
  16640. // null. It is an error if a field in this list has a non-empty value.
  16641. // This may be used to include null fields in Patch requests.
  16642. NullFields []string `json:"-"`
  16643. }
  16644. func (s *NodeTypeListWarningData) MarshalJSON() ([]byte, error) {
  16645. type NoMethod NodeTypeListWarningData
  16646. raw := NoMethod(*s)
  16647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16648. }
  16649. type NodeTypesScopedList struct {
  16650. // NodeTypes: [Output Only] A list of node types contained in this
  16651. // scope.
  16652. NodeTypes []*NodeType `json:"nodeTypes,omitempty"`
  16653. // Warning: [Output Only] An informational warning that appears when the
  16654. // node types list is empty.
  16655. Warning *NodeTypesScopedListWarning `json:"warning,omitempty"`
  16656. // ForceSendFields is a list of field names (e.g. "NodeTypes") to
  16657. // unconditionally include in API requests. By default, fields with
  16658. // empty values are omitted from API requests. However, any non-pointer,
  16659. // non-interface field appearing in ForceSendFields will be sent to the
  16660. // server regardless of whether the field is empty or not. This may be
  16661. // used to include empty fields in Patch requests.
  16662. ForceSendFields []string `json:"-"`
  16663. // NullFields is a list of field names (e.g. "NodeTypes") to include in
  16664. // API requests with the JSON null value. By default, fields with empty
  16665. // values are omitted from API requests. However, any field with an
  16666. // empty value appearing in NullFields will be sent to the server as
  16667. // null. It is an error if a field in this list has a non-empty value.
  16668. // This may be used to include null fields in Patch requests.
  16669. NullFields []string `json:"-"`
  16670. }
  16671. func (s *NodeTypesScopedList) MarshalJSON() ([]byte, error) {
  16672. type NoMethod NodeTypesScopedList
  16673. raw := NoMethod(*s)
  16674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16675. }
  16676. // NodeTypesScopedListWarning: [Output Only] An informational warning
  16677. // that appears when the node types list is empty.
  16678. type NodeTypesScopedListWarning struct {
  16679. // Code: [Output Only] A warning code, if applicable. For example,
  16680. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16681. // the response.
  16682. //
  16683. // Possible values:
  16684. // "CLEANUP_FAILED"
  16685. // "DEPRECATED_RESOURCE_USED"
  16686. // "DEPRECATED_TYPE_USED"
  16687. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16688. // "EXPERIMENTAL_TYPE_USED"
  16689. // "EXTERNAL_API_WARNING"
  16690. // "FIELD_VALUE_OVERRIDEN"
  16691. // "INJECTED_KERNELS_DEPRECATED"
  16692. // "MISSING_TYPE_DEPENDENCY"
  16693. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16694. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16695. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16696. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16697. // "NEXT_HOP_NOT_RUNNING"
  16698. // "NOT_CRITICAL_ERROR"
  16699. // "NO_RESULTS_ON_PAGE"
  16700. // "REQUIRED_TOS_AGREEMENT"
  16701. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16702. // "RESOURCE_NOT_DELETED"
  16703. // "SCHEMA_VALIDATION_IGNORED"
  16704. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16705. // "UNDECLARED_PROPERTIES"
  16706. // "UNREACHABLE"
  16707. Code string `json:"code,omitempty"`
  16708. // Data: [Output Only] Metadata about this warning in key: value format.
  16709. // For example:
  16710. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16711. Data []*NodeTypesScopedListWarningData `json:"data,omitempty"`
  16712. // Message: [Output Only] A human-readable description of the warning
  16713. // code.
  16714. Message string `json:"message,omitempty"`
  16715. // ForceSendFields is a list of field names (e.g. "Code") to
  16716. // unconditionally include in API requests. By default, fields with
  16717. // empty values are omitted from API requests. However, any non-pointer,
  16718. // non-interface field appearing in ForceSendFields will be sent to the
  16719. // server regardless of whether the field is empty or not. This may be
  16720. // used to include empty fields in Patch requests.
  16721. ForceSendFields []string `json:"-"`
  16722. // NullFields is a list of field names (e.g. "Code") to include in API
  16723. // requests with the JSON null value. By default, fields with empty
  16724. // values are omitted from API requests. However, any field with an
  16725. // empty value appearing in NullFields will be sent to the server as
  16726. // null. It is an error if a field in this list has a non-empty value.
  16727. // This may be used to include null fields in Patch requests.
  16728. NullFields []string `json:"-"`
  16729. }
  16730. func (s *NodeTypesScopedListWarning) MarshalJSON() ([]byte, error) {
  16731. type NoMethod NodeTypesScopedListWarning
  16732. raw := NoMethod(*s)
  16733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16734. }
  16735. type NodeTypesScopedListWarningData struct {
  16736. // Key: [Output Only] A key that provides more detail on the warning
  16737. // being returned. For example, for warnings where there are no results
  16738. // in a list request for a particular zone, this key might be scope and
  16739. // the key value might be the zone name. Other examples might be a key
  16740. // indicating a deprecated resource and a suggested replacement, or a
  16741. // warning about invalid network settings (for example, if an instance
  16742. // attempts to perform IP forwarding but is not enabled for IP
  16743. // forwarding).
  16744. Key string `json:"key,omitempty"`
  16745. // Value: [Output Only] A warning data value corresponding to the key.
  16746. Value string `json:"value,omitempty"`
  16747. // ForceSendFields is a list of field names (e.g. "Key") to
  16748. // unconditionally include in API requests. By default, fields with
  16749. // empty values are omitted from API requests. However, any non-pointer,
  16750. // non-interface field appearing in ForceSendFields will be sent to the
  16751. // server regardless of whether the field is empty or not. This may be
  16752. // used to include empty fields in Patch requests.
  16753. ForceSendFields []string `json:"-"`
  16754. // NullFields is a list of field names (e.g. "Key") to include in API
  16755. // requests with the JSON null value. By default, fields with empty
  16756. // values are omitted from API requests. However, any field with an
  16757. // empty value appearing in NullFields will be sent to the server as
  16758. // null. It is an error if a field in this list has a non-empty value.
  16759. // This may be used to include null fields in Patch requests.
  16760. NullFields []string `json:"-"`
  16761. }
  16762. func (s *NodeTypesScopedListWarningData) MarshalJSON() ([]byte, error) {
  16763. type NoMethod NodeTypesScopedListWarningData
  16764. raw := NoMethod(*s)
  16765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16766. }
  16767. // Operation: An Operation resource, used to manage asynchronous API
  16768. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  16769. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  16770. // (== resource_for beta.regionOperations ==) (== resource_for
  16771. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  16772. type Operation struct {
  16773. // ClientOperationId: [Output Only] The value of `requestId` if you
  16774. // provided it in the request. Not present otherwise.
  16775. ClientOperationId string `json:"clientOperationId,omitempty"`
  16776. // CreationTimestamp: [Deprecated] This field is deprecated.
  16777. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  16778. // Description: [Output Only] A textual description of the operation,
  16779. // which is set when the operation is created.
  16780. Description string `json:"description,omitempty"`
  16781. // EndTime: [Output Only] The time that this operation was completed.
  16782. // This value is in RFC3339 text format.
  16783. EndTime string `json:"endTime,omitempty"`
  16784. // Error: [Output Only] If errors are generated during processing of the
  16785. // operation, this field will be populated.
  16786. Error *OperationError `json:"error,omitempty"`
  16787. // HttpErrorMessage: [Output Only] If the operation fails, this field
  16788. // contains the HTTP error message that was returned, such as NOT FOUND.
  16789. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  16790. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  16791. // contains the HTTP error status code that was returned. For example, a
  16792. // 404 means the resource was not found.
  16793. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  16794. // Id: [Output Only] The unique identifier for the resource. This
  16795. // identifier is defined by the server.
  16796. Id uint64 `json:"id,omitempty,string"`
  16797. // InsertTime: [Output Only] The time that this operation was requested.
  16798. // This value is in RFC3339 text format.
  16799. InsertTime string `json:"insertTime,omitempty"`
  16800. // Kind: [Output Only] Type of the resource. Always compute#operation
  16801. // for Operation resources.
  16802. Kind string `json:"kind,omitempty"`
  16803. // Name: [Output Only] Name of the resource.
  16804. Name string `json:"name,omitempty"`
  16805. // OperationType: [Output Only] The type of operation, such as insert,
  16806. // update, or delete, and so on.
  16807. OperationType string `json:"operationType,omitempty"`
  16808. // Progress: [Output Only] An optional progress indicator that ranges
  16809. // from 0 to 100. There is no requirement that this be linear or support
  16810. // any granularity of operations. This should not be used to guess when
  16811. // the operation will be complete. This number should monotonically
  16812. // increase as the operation progresses.
  16813. Progress int64 `json:"progress,omitempty"`
  16814. // Region: [Output Only] The URL of the region where the operation
  16815. // resides. Only available when performing regional operations. You must
  16816. // specify this field as part of the HTTP request URL. It is not
  16817. // settable as a field in the request body.
  16818. Region string `json:"region,omitempty"`
  16819. // SelfLink: [Output Only] Server-defined URL for the resource.
  16820. SelfLink string `json:"selfLink,omitempty"`
  16821. // StartTime: [Output Only] The time that this operation was started by
  16822. // the server. This value is in RFC3339 text format.
  16823. StartTime string `json:"startTime,omitempty"`
  16824. // Status: [Output Only] The status of the operation, which can be one
  16825. // of the following: PENDING, RUNNING, or DONE.
  16826. //
  16827. // Possible values:
  16828. // "DONE"
  16829. // "PENDING"
  16830. // "RUNNING"
  16831. Status string `json:"status,omitempty"`
  16832. // StatusMessage: [Output Only] An optional textual description of the
  16833. // current status of the operation.
  16834. StatusMessage string `json:"statusMessage,omitempty"`
  16835. // TargetId: [Output Only] The unique target ID, which identifies a
  16836. // specific incarnation of the target resource.
  16837. TargetId uint64 `json:"targetId,omitempty,string"`
  16838. // TargetLink: [Output Only] The URL of the resource that the operation
  16839. // modifies. For operations related to creating a snapshot, this points
  16840. // to the persistent disk that the snapshot was created from.
  16841. TargetLink string `json:"targetLink,omitempty"`
  16842. // User: [Output Only] User who requested the operation, for example:
  16843. // user@example.com.
  16844. User string `json:"user,omitempty"`
  16845. // Warnings: [Output Only] If warning messages are generated during
  16846. // processing of the operation, this field will be populated.
  16847. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  16848. // Zone: [Output Only] The URL of the zone where the operation resides.
  16849. // Only available when performing per-zone operations. You must specify
  16850. // this field as part of the HTTP request URL. It is not settable as a
  16851. // field in the request body.
  16852. Zone string `json:"zone,omitempty"`
  16853. // ServerResponse contains the HTTP response code and headers from the
  16854. // server.
  16855. googleapi.ServerResponse `json:"-"`
  16856. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  16857. // to unconditionally include in API requests. By default, fields with
  16858. // empty values are omitted from API requests. However, any non-pointer,
  16859. // non-interface field appearing in ForceSendFields will be sent to the
  16860. // server regardless of whether the field is empty or not. This may be
  16861. // used to include empty fields in Patch requests.
  16862. ForceSendFields []string `json:"-"`
  16863. // NullFields is a list of field names (e.g. "ClientOperationId") to
  16864. // include in API requests with the JSON null value. By default, fields
  16865. // with empty values are omitted from API requests. However, any field
  16866. // with an empty value appearing in NullFields will be sent to the
  16867. // server as null. It is an error if a field in this list has a
  16868. // non-empty value. This may be used to include null fields in Patch
  16869. // requests.
  16870. NullFields []string `json:"-"`
  16871. }
  16872. func (s *Operation) MarshalJSON() ([]byte, error) {
  16873. type NoMethod Operation
  16874. raw := NoMethod(*s)
  16875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16876. }
  16877. // OperationError: [Output Only] If errors are generated during
  16878. // processing of the operation, this field will be populated.
  16879. type OperationError struct {
  16880. // Errors: [Output Only] The array of errors encountered while
  16881. // processing this operation.
  16882. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  16883. // ForceSendFields is a list of field names (e.g. "Errors") to
  16884. // unconditionally include in API requests. By default, fields with
  16885. // empty values are omitted from API requests. However, any non-pointer,
  16886. // non-interface field appearing in ForceSendFields will be sent to the
  16887. // server regardless of whether the field is empty or not. This may be
  16888. // used to include empty fields in Patch requests.
  16889. ForceSendFields []string `json:"-"`
  16890. // NullFields is a list of field names (e.g. "Errors") to include in API
  16891. // requests with the JSON null value. By default, fields with empty
  16892. // values are omitted from API requests. However, any field with an
  16893. // empty value appearing in NullFields will be sent to the server as
  16894. // null. It is an error if a field in this list has a non-empty value.
  16895. // This may be used to include null fields in Patch requests.
  16896. NullFields []string `json:"-"`
  16897. }
  16898. func (s *OperationError) MarshalJSON() ([]byte, error) {
  16899. type NoMethod OperationError
  16900. raw := NoMethod(*s)
  16901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16902. }
  16903. type OperationErrorErrors struct {
  16904. // Code: [Output Only] The error type identifier for this error.
  16905. Code string `json:"code,omitempty"`
  16906. // Location: [Output Only] Indicates the field in the request that
  16907. // caused the error. This property is optional.
  16908. Location string `json:"location,omitempty"`
  16909. // Message: [Output Only] An optional, human-readable error message.
  16910. Message string `json:"message,omitempty"`
  16911. // ForceSendFields is a list of field names (e.g. "Code") to
  16912. // unconditionally include in API requests. By default, fields with
  16913. // empty values are omitted from API requests. However, any non-pointer,
  16914. // non-interface field appearing in ForceSendFields will be sent to the
  16915. // server regardless of whether the field is empty or not. This may be
  16916. // used to include empty fields in Patch requests.
  16917. ForceSendFields []string `json:"-"`
  16918. // NullFields is a list of field names (e.g. "Code") to include in API
  16919. // requests with the JSON null value. By default, fields with empty
  16920. // values are omitted from API requests. However, any field with an
  16921. // empty value appearing in NullFields will be sent to the server as
  16922. // null. It is an error if a field in this list has a non-empty value.
  16923. // This may be used to include null fields in Patch requests.
  16924. NullFields []string `json:"-"`
  16925. }
  16926. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  16927. type NoMethod OperationErrorErrors
  16928. raw := NoMethod(*s)
  16929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16930. }
  16931. type OperationWarnings struct {
  16932. // Code: [Output Only] A warning code, if applicable. For example,
  16933. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  16934. // the response.
  16935. //
  16936. // Possible values:
  16937. // "CLEANUP_FAILED"
  16938. // "DEPRECATED_RESOURCE_USED"
  16939. // "DEPRECATED_TYPE_USED"
  16940. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  16941. // "EXPERIMENTAL_TYPE_USED"
  16942. // "EXTERNAL_API_WARNING"
  16943. // "FIELD_VALUE_OVERRIDEN"
  16944. // "INJECTED_KERNELS_DEPRECATED"
  16945. // "MISSING_TYPE_DEPENDENCY"
  16946. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  16947. // "NEXT_HOP_CANNOT_IP_FORWARD"
  16948. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  16949. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  16950. // "NEXT_HOP_NOT_RUNNING"
  16951. // "NOT_CRITICAL_ERROR"
  16952. // "NO_RESULTS_ON_PAGE"
  16953. // "REQUIRED_TOS_AGREEMENT"
  16954. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  16955. // "RESOURCE_NOT_DELETED"
  16956. // "SCHEMA_VALIDATION_IGNORED"
  16957. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  16958. // "UNDECLARED_PROPERTIES"
  16959. // "UNREACHABLE"
  16960. Code string `json:"code,omitempty"`
  16961. // Data: [Output Only] Metadata about this warning in key: value format.
  16962. // For example:
  16963. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  16964. Data []*OperationWarningsData `json:"data,omitempty"`
  16965. // Message: [Output Only] A human-readable description of the warning
  16966. // code.
  16967. Message string `json:"message,omitempty"`
  16968. // ForceSendFields is a list of field names (e.g. "Code") to
  16969. // unconditionally include in API requests. By default, fields with
  16970. // empty values are omitted from API requests. However, any non-pointer,
  16971. // non-interface field appearing in ForceSendFields will be sent to the
  16972. // server regardless of whether the field is empty or not. This may be
  16973. // used to include empty fields in Patch requests.
  16974. ForceSendFields []string `json:"-"`
  16975. // NullFields is a list of field names (e.g. "Code") to include in API
  16976. // requests with the JSON null value. By default, fields with empty
  16977. // values are omitted from API requests. However, any field with an
  16978. // empty value appearing in NullFields will be sent to the server as
  16979. // null. It is an error if a field in this list has a non-empty value.
  16980. // This may be used to include null fields in Patch requests.
  16981. NullFields []string `json:"-"`
  16982. }
  16983. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  16984. type NoMethod OperationWarnings
  16985. raw := NoMethod(*s)
  16986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  16987. }
  16988. type OperationWarningsData struct {
  16989. // Key: [Output Only] A key that provides more detail on the warning
  16990. // being returned. For example, for warnings where there are no results
  16991. // in a list request for a particular zone, this key might be scope and
  16992. // the key value might be the zone name. Other examples might be a key
  16993. // indicating a deprecated resource and a suggested replacement, or a
  16994. // warning about invalid network settings (for example, if an instance
  16995. // attempts to perform IP forwarding but is not enabled for IP
  16996. // forwarding).
  16997. Key string `json:"key,omitempty"`
  16998. // Value: [Output Only] A warning data value corresponding to the key.
  16999. Value string `json:"value,omitempty"`
  17000. // ForceSendFields is a list of field names (e.g. "Key") to
  17001. // unconditionally include in API requests. By default, fields with
  17002. // empty values are omitted from API requests. However, any non-pointer,
  17003. // non-interface field appearing in ForceSendFields will be sent to the
  17004. // server regardless of whether the field is empty or not. This may be
  17005. // used to include empty fields in Patch requests.
  17006. ForceSendFields []string `json:"-"`
  17007. // NullFields is a list of field names (e.g. "Key") to include in API
  17008. // requests with the JSON null value. By default, fields with empty
  17009. // values are omitted from API requests. However, any field with an
  17010. // empty value appearing in NullFields will be sent to the server as
  17011. // null. It is an error if a field in this list has a non-empty value.
  17012. // This may be used to include null fields in Patch requests.
  17013. NullFields []string `json:"-"`
  17014. }
  17015. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  17016. type NoMethod OperationWarningsData
  17017. raw := NoMethod(*s)
  17018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17019. }
  17020. type OperationAggregatedList struct {
  17021. // Id: [Output Only] The unique identifier for the resource. This
  17022. // identifier is defined by the server.
  17023. Id string `json:"id,omitempty"`
  17024. // Items: [Output Only] A map of scoped operation lists.
  17025. Items map[string]OperationsScopedList `json:"items,omitempty"`
  17026. // Kind: [Output Only] Type of resource. Always
  17027. // compute#operationAggregatedList for aggregated lists of operations.
  17028. Kind string `json:"kind,omitempty"`
  17029. // NextPageToken: [Output Only] This token allows you to get the next
  17030. // page of results for list requests. If the number of results is larger
  17031. // than maxResults, use the nextPageToken as a value for the query
  17032. // parameter pageToken in the next list request. Subsequent list
  17033. // requests will have their own nextPageToken to continue paging through
  17034. // the results.
  17035. NextPageToken string `json:"nextPageToken,omitempty"`
  17036. // SelfLink: [Output Only] Server-defined URL for this resource.
  17037. SelfLink string `json:"selfLink,omitempty"`
  17038. // Warning: [Output Only] Informational warning message.
  17039. Warning *OperationAggregatedListWarning `json:"warning,omitempty"`
  17040. // ServerResponse contains the HTTP response code and headers from the
  17041. // server.
  17042. googleapi.ServerResponse `json:"-"`
  17043. // ForceSendFields is a list of field names (e.g. "Id") to
  17044. // unconditionally include in API requests. By default, fields with
  17045. // empty values are omitted from API requests. However, any non-pointer,
  17046. // non-interface field appearing in ForceSendFields will be sent to the
  17047. // server regardless of whether the field is empty or not. This may be
  17048. // used to include empty fields in Patch requests.
  17049. ForceSendFields []string `json:"-"`
  17050. // NullFields is a list of field names (e.g. "Id") to include in API
  17051. // requests with the JSON null value. By default, fields with empty
  17052. // values are omitted from API requests. However, any field with an
  17053. // empty value appearing in NullFields will be sent to the server as
  17054. // null. It is an error if a field in this list has a non-empty value.
  17055. // This may be used to include null fields in Patch requests.
  17056. NullFields []string `json:"-"`
  17057. }
  17058. func (s *OperationAggregatedList) MarshalJSON() ([]byte, error) {
  17059. type NoMethod OperationAggregatedList
  17060. raw := NoMethod(*s)
  17061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17062. }
  17063. // OperationAggregatedListWarning: [Output Only] Informational warning
  17064. // message.
  17065. type OperationAggregatedListWarning struct {
  17066. // Code: [Output Only] A warning code, if applicable. For example,
  17067. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17068. // the response.
  17069. //
  17070. // Possible values:
  17071. // "CLEANUP_FAILED"
  17072. // "DEPRECATED_RESOURCE_USED"
  17073. // "DEPRECATED_TYPE_USED"
  17074. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17075. // "EXPERIMENTAL_TYPE_USED"
  17076. // "EXTERNAL_API_WARNING"
  17077. // "FIELD_VALUE_OVERRIDEN"
  17078. // "INJECTED_KERNELS_DEPRECATED"
  17079. // "MISSING_TYPE_DEPENDENCY"
  17080. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17081. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17082. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17083. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17084. // "NEXT_HOP_NOT_RUNNING"
  17085. // "NOT_CRITICAL_ERROR"
  17086. // "NO_RESULTS_ON_PAGE"
  17087. // "REQUIRED_TOS_AGREEMENT"
  17088. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17089. // "RESOURCE_NOT_DELETED"
  17090. // "SCHEMA_VALIDATION_IGNORED"
  17091. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17092. // "UNDECLARED_PROPERTIES"
  17093. // "UNREACHABLE"
  17094. Code string `json:"code,omitempty"`
  17095. // Data: [Output Only] Metadata about this warning in key: value format.
  17096. // For example:
  17097. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17098. Data []*OperationAggregatedListWarningData `json:"data,omitempty"`
  17099. // Message: [Output Only] A human-readable description of the warning
  17100. // code.
  17101. Message string `json:"message,omitempty"`
  17102. // ForceSendFields is a list of field names (e.g. "Code") to
  17103. // unconditionally include in API requests. By default, fields with
  17104. // empty values are omitted from API requests. However, any non-pointer,
  17105. // non-interface field appearing in ForceSendFields will be sent to the
  17106. // server regardless of whether the field is empty or not. This may be
  17107. // used to include empty fields in Patch requests.
  17108. ForceSendFields []string `json:"-"`
  17109. // NullFields is a list of field names (e.g. "Code") to include in API
  17110. // requests with the JSON null value. By default, fields with empty
  17111. // values are omitted from API requests. However, any field with an
  17112. // empty value appearing in NullFields will be sent to the server as
  17113. // null. It is an error if a field in this list has a non-empty value.
  17114. // This may be used to include null fields in Patch requests.
  17115. NullFields []string `json:"-"`
  17116. }
  17117. func (s *OperationAggregatedListWarning) MarshalJSON() ([]byte, error) {
  17118. type NoMethod OperationAggregatedListWarning
  17119. raw := NoMethod(*s)
  17120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17121. }
  17122. type OperationAggregatedListWarningData struct {
  17123. // Key: [Output Only] A key that provides more detail on the warning
  17124. // being returned. For example, for warnings where there are no results
  17125. // in a list request for a particular zone, this key might be scope and
  17126. // the key value might be the zone name. Other examples might be a key
  17127. // indicating a deprecated resource and a suggested replacement, or a
  17128. // warning about invalid network settings (for example, if an instance
  17129. // attempts to perform IP forwarding but is not enabled for IP
  17130. // forwarding).
  17131. Key string `json:"key,omitempty"`
  17132. // Value: [Output Only] A warning data value corresponding to the key.
  17133. Value string `json:"value,omitempty"`
  17134. // ForceSendFields is a list of field names (e.g. "Key") to
  17135. // unconditionally include in API requests. By default, fields with
  17136. // empty values are omitted from API requests. However, any non-pointer,
  17137. // non-interface field appearing in ForceSendFields will be sent to the
  17138. // server regardless of whether the field is empty or not. This may be
  17139. // used to include empty fields in Patch requests.
  17140. ForceSendFields []string `json:"-"`
  17141. // NullFields is a list of field names (e.g. "Key") to include in API
  17142. // requests with the JSON null value. By default, fields with empty
  17143. // values are omitted from API requests. However, any field with an
  17144. // empty value appearing in NullFields will be sent to the server as
  17145. // null. It is an error if a field in this list has a non-empty value.
  17146. // This may be used to include null fields in Patch requests.
  17147. NullFields []string `json:"-"`
  17148. }
  17149. func (s *OperationAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  17150. type NoMethod OperationAggregatedListWarningData
  17151. raw := NoMethod(*s)
  17152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17153. }
  17154. // OperationList: Contains a list of Operation resources.
  17155. type OperationList struct {
  17156. // Id: [Output Only] The unique identifier for the resource. This
  17157. // identifier is defined by the server.
  17158. Id string `json:"id,omitempty"`
  17159. // Items: [Output Only] A list of Operation resources.
  17160. Items []*Operation `json:"items,omitempty"`
  17161. // Kind: [Output Only] Type of resource. Always compute#operations for
  17162. // Operations resource.
  17163. Kind string `json:"kind,omitempty"`
  17164. // NextPageToken: [Output Only] This token allows you to get the next
  17165. // page of results for list requests. If the number of results is larger
  17166. // than maxResults, use the nextPageToken as a value for the query
  17167. // parameter pageToken in the next list request. Subsequent list
  17168. // requests will have their own nextPageToken to continue paging through
  17169. // the results.
  17170. NextPageToken string `json:"nextPageToken,omitempty"`
  17171. // SelfLink: [Output Only] Server-defined URL for this resource.
  17172. SelfLink string `json:"selfLink,omitempty"`
  17173. // Warning: [Output Only] Informational warning message.
  17174. Warning *OperationListWarning `json:"warning,omitempty"`
  17175. // ServerResponse contains the HTTP response code and headers from the
  17176. // server.
  17177. googleapi.ServerResponse `json:"-"`
  17178. // ForceSendFields is a list of field names (e.g. "Id") to
  17179. // unconditionally include in API requests. By default, fields with
  17180. // empty values are omitted from API requests. However, any non-pointer,
  17181. // non-interface field appearing in ForceSendFields will be sent to the
  17182. // server regardless of whether the field is empty or not. This may be
  17183. // used to include empty fields in Patch requests.
  17184. ForceSendFields []string `json:"-"`
  17185. // NullFields is a list of field names (e.g. "Id") to include in API
  17186. // requests with the JSON null value. By default, fields with empty
  17187. // values are omitted from API requests. However, any field with an
  17188. // empty value appearing in NullFields will be sent to the server as
  17189. // null. It is an error if a field in this list has a non-empty value.
  17190. // This may be used to include null fields in Patch requests.
  17191. NullFields []string `json:"-"`
  17192. }
  17193. func (s *OperationList) MarshalJSON() ([]byte, error) {
  17194. type NoMethod OperationList
  17195. raw := NoMethod(*s)
  17196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17197. }
  17198. // OperationListWarning: [Output Only] Informational warning message.
  17199. type OperationListWarning struct {
  17200. // Code: [Output Only] A warning code, if applicable. For example,
  17201. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17202. // the response.
  17203. //
  17204. // Possible values:
  17205. // "CLEANUP_FAILED"
  17206. // "DEPRECATED_RESOURCE_USED"
  17207. // "DEPRECATED_TYPE_USED"
  17208. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17209. // "EXPERIMENTAL_TYPE_USED"
  17210. // "EXTERNAL_API_WARNING"
  17211. // "FIELD_VALUE_OVERRIDEN"
  17212. // "INJECTED_KERNELS_DEPRECATED"
  17213. // "MISSING_TYPE_DEPENDENCY"
  17214. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17215. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17216. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17217. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17218. // "NEXT_HOP_NOT_RUNNING"
  17219. // "NOT_CRITICAL_ERROR"
  17220. // "NO_RESULTS_ON_PAGE"
  17221. // "REQUIRED_TOS_AGREEMENT"
  17222. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17223. // "RESOURCE_NOT_DELETED"
  17224. // "SCHEMA_VALIDATION_IGNORED"
  17225. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17226. // "UNDECLARED_PROPERTIES"
  17227. // "UNREACHABLE"
  17228. Code string `json:"code,omitempty"`
  17229. // Data: [Output Only] Metadata about this warning in key: value format.
  17230. // For example:
  17231. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17232. Data []*OperationListWarningData `json:"data,omitempty"`
  17233. // Message: [Output Only] A human-readable description of the warning
  17234. // code.
  17235. Message string `json:"message,omitempty"`
  17236. // ForceSendFields is a list of field names (e.g. "Code") to
  17237. // unconditionally include in API requests. By default, fields with
  17238. // empty values are omitted from API requests. However, any non-pointer,
  17239. // non-interface field appearing in ForceSendFields will be sent to the
  17240. // server regardless of whether the field is empty or not. This may be
  17241. // used to include empty fields in Patch requests.
  17242. ForceSendFields []string `json:"-"`
  17243. // NullFields is a list of field names (e.g. "Code") to include in API
  17244. // requests with the JSON null value. By default, fields with empty
  17245. // values are omitted from API requests. However, any field with an
  17246. // empty value appearing in NullFields will be sent to the server as
  17247. // null. It is an error if a field in this list has a non-empty value.
  17248. // This may be used to include null fields in Patch requests.
  17249. NullFields []string `json:"-"`
  17250. }
  17251. func (s *OperationListWarning) MarshalJSON() ([]byte, error) {
  17252. type NoMethod OperationListWarning
  17253. raw := NoMethod(*s)
  17254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17255. }
  17256. type OperationListWarningData struct {
  17257. // Key: [Output Only] A key that provides more detail on the warning
  17258. // being returned. For example, for warnings where there are no results
  17259. // in a list request for a particular zone, this key might be scope and
  17260. // the key value might be the zone name. Other examples might be a key
  17261. // indicating a deprecated resource and a suggested replacement, or a
  17262. // warning about invalid network settings (for example, if an instance
  17263. // attempts to perform IP forwarding but is not enabled for IP
  17264. // forwarding).
  17265. Key string `json:"key,omitempty"`
  17266. // Value: [Output Only] A warning data value corresponding to the key.
  17267. Value string `json:"value,omitempty"`
  17268. // ForceSendFields is a list of field names (e.g. "Key") to
  17269. // unconditionally include in API requests. By default, fields with
  17270. // empty values are omitted from API requests. However, any non-pointer,
  17271. // non-interface field appearing in ForceSendFields will be sent to the
  17272. // server regardless of whether the field is empty or not. This may be
  17273. // used to include empty fields in Patch requests.
  17274. ForceSendFields []string `json:"-"`
  17275. // NullFields is a list of field names (e.g. "Key") to include in API
  17276. // requests with the JSON null value. By default, fields with empty
  17277. // values are omitted from API requests. However, any field with an
  17278. // empty value appearing in NullFields will be sent to the server as
  17279. // null. It is an error if a field in this list has a non-empty value.
  17280. // This may be used to include null fields in Patch requests.
  17281. NullFields []string `json:"-"`
  17282. }
  17283. func (s *OperationListWarningData) MarshalJSON() ([]byte, error) {
  17284. type NoMethod OperationListWarningData
  17285. raw := NoMethod(*s)
  17286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17287. }
  17288. type OperationsScopedList struct {
  17289. // Operations: [Output Only] A list of operations contained in this
  17290. // scope.
  17291. Operations []*Operation `json:"operations,omitempty"`
  17292. // Warning: [Output Only] Informational warning which replaces the list
  17293. // of operations when the list is empty.
  17294. Warning *OperationsScopedListWarning `json:"warning,omitempty"`
  17295. // ForceSendFields is a list of field names (e.g. "Operations") to
  17296. // unconditionally include in API requests. By default, fields with
  17297. // empty values are omitted from API requests. However, any non-pointer,
  17298. // non-interface field appearing in ForceSendFields will be sent to the
  17299. // server regardless of whether the field is empty or not. This may be
  17300. // used to include empty fields in Patch requests.
  17301. ForceSendFields []string `json:"-"`
  17302. // NullFields is a list of field names (e.g. "Operations") to include in
  17303. // API requests with the JSON null value. By default, fields with empty
  17304. // values are omitted from API requests. However, any field with an
  17305. // empty value appearing in NullFields will be sent to the server as
  17306. // null. It is an error if a field in this list has a non-empty value.
  17307. // This may be used to include null fields in Patch requests.
  17308. NullFields []string `json:"-"`
  17309. }
  17310. func (s *OperationsScopedList) MarshalJSON() ([]byte, error) {
  17311. type NoMethod OperationsScopedList
  17312. raw := NoMethod(*s)
  17313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17314. }
  17315. // OperationsScopedListWarning: [Output Only] Informational warning
  17316. // which replaces the list of operations when the list is empty.
  17317. type OperationsScopedListWarning struct {
  17318. // Code: [Output Only] A warning code, if applicable. For example,
  17319. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  17320. // the response.
  17321. //
  17322. // Possible values:
  17323. // "CLEANUP_FAILED"
  17324. // "DEPRECATED_RESOURCE_USED"
  17325. // "DEPRECATED_TYPE_USED"
  17326. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  17327. // "EXPERIMENTAL_TYPE_USED"
  17328. // "EXTERNAL_API_WARNING"
  17329. // "FIELD_VALUE_OVERRIDEN"
  17330. // "INJECTED_KERNELS_DEPRECATED"
  17331. // "MISSING_TYPE_DEPENDENCY"
  17332. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  17333. // "NEXT_HOP_CANNOT_IP_FORWARD"
  17334. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  17335. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  17336. // "NEXT_HOP_NOT_RUNNING"
  17337. // "NOT_CRITICAL_ERROR"
  17338. // "NO_RESULTS_ON_PAGE"
  17339. // "REQUIRED_TOS_AGREEMENT"
  17340. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  17341. // "RESOURCE_NOT_DELETED"
  17342. // "SCHEMA_VALIDATION_IGNORED"
  17343. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  17344. // "UNDECLARED_PROPERTIES"
  17345. // "UNREACHABLE"
  17346. Code string `json:"code,omitempty"`
  17347. // Data: [Output Only] Metadata about this warning in key: value format.
  17348. // For example:
  17349. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  17350. Data []*OperationsScopedListWarningData `json:"data,omitempty"`
  17351. // Message: [Output Only] A human-readable description of the warning
  17352. // code.
  17353. Message string `json:"message,omitempty"`
  17354. // ForceSendFields is a list of field names (e.g. "Code") to
  17355. // unconditionally include in API requests. By default, fields with
  17356. // empty values are omitted from API requests. However, any non-pointer,
  17357. // non-interface field appearing in ForceSendFields will be sent to the
  17358. // server regardless of whether the field is empty or not. This may be
  17359. // used to include empty fields in Patch requests.
  17360. ForceSendFields []string `json:"-"`
  17361. // NullFields is a list of field names (e.g. "Code") to include in API
  17362. // requests with the JSON null value. By default, fields with empty
  17363. // values are omitted from API requests. However, any field with an
  17364. // empty value appearing in NullFields will be sent to the server as
  17365. // null. It is an error if a field in this list has a non-empty value.
  17366. // This may be used to include null fields in Patch requests.
  17367. NullFields []string `json:"-"`
  17368. }
  17369. func (s *OperationsScopedListWarning) MarshalJSON() ([]byte, error) {
  17370. type NoMethod OperationsScopedListWarning
  17371. raw := NoMethod(*s)
  17372. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17373. }
  17374. type OperationsScopedListWarningData struct {
  17375. // Key: [Output Only] A key that provides more detail on the warning
  17376. // being returned. For example, for warnings where there are no results
  17377. // in a list request for a particular zone, this key might be scope and
  17378. // the key value might be the zone name. Other examples might be a key
  17379. // indicating a deprecated resource and a suggested replacement, or a
  17380. // warning about invalid network settings (for example, if an instance
  17381. // attempts to perform IP forwarding but is not enabled for IP
  17382. // forwarding).
  17383. Key string `json:"key,omitempty"`
  17384. // Value: [Output Only] A warning data value corresponding to the key.
  17385. Value string `json:"value,omitempty"`
  17386. // ForceSendFields is a list of field names (e.g. "Key") to
  17387. // unconditionally include in API requests. By default, fields with
  17388. // empty values are omitted from API requests. However, any non-pointer,
  17389. // non-interface field appearing in ForceSendFields will be sent to the
  17390. // server regardless of whether the field is empty or not. This may be
  17391. // used to include empty fields in Patch requests.
  17392. ForceSendFields []string `json:"-"`
  17393. // NullFields is a list of field names (e.g. "Key") to include in API
  17394. // requests with the JSON null value. By default, fields with empty
  17395. // values are omitted from API requests. However, any field with an
  17396. // empty value appearing in NullFields will be sent to the server as
  17397. // null. It is an error if a field in this list has a non-empty value.
  17398. // This may be used to include null fields in Patch requests.
  17399. NullFields []string `json:"-"`
  17400. }
  17401. func (s *OperationsScopedListWarningData) MarshalJSON() ([]byte, error) {
  17402. type NoMethod OperationsScopedListWarningData
  17403. raw := NoMethod(*s)
  17404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17405. }
  17406. // PathMatcher: A matcher for the path portion of the URL. The
  17407. // BackendService from the longest-matched rule will serve the URL. If
  17408. // no rule was matched, the default service will be used.
  17409. type PathMatcher struct {
  17410. // DefaultService: The full or partial URL to the BackendService
  17411. // resource. This will be used if none of the pathRules or routeRules
  17412. // defined by this PathMatcher are matched. For example, the following
  17413. // are all valid URLs to a BackendService resource:
  17414. // -
  17415. // https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService
  17416. // - compute/v1/projects/project/global/backendServices/backendService
  17417. //
  17418. // - global/backendServices/backendService If defaultRouteAction is
  17419. // additionally specified, advanced routing actions like URL Rewrites,
  17420. // etc. take effect prior to sending the request to the backend.
  17421. // However, if defaultService is specified, defaultRouteAction cannot
  17422. // contain any weightedBackendServices. Conversely, if
  17423. // defaultRouteAction specifies any weightedBackendServices,
  17424. // defaultService must not be specified.
  17425. // Only one of defaultService, defaultUrlRedirect or
  17426. // defaultRouteAction.weightedBackendService must be set.
  17427. // Authorization requires one or more of the following Google IAM
  17428. // permissions on the specified resource default_service:
  17429. // - compute.backendBuckets.use
  17430. // - compute.backendServices.use
  17431. DefaultService string `json:"defaultService,omitempty"`
  17432. // Description: An optional description of this resource. Provide this
  17433. // property when you create the resource.
  17434. Description string `json:"description,omitempty"`
  17435. // Name: The name to which this PathMatcher is referred by the HostRule.
  17436. Name string `json:"name,omitempty"`
  17437. // PathRules: The list of path rules. Use this list instead of
  17438. // routeRules when routing based on simple path matching is all that's
  17439. // required. The order by which path rules are specified does not
  17440. // matter. Matches are always done on the longest-path-first basis.
  17441. // For example: a pathRule with a path /a/b/c/* will match before /a/b/*
  17442. // irrespective of the order in which those paths appear in this
  17443. // list.
  17444. // Only one of pathRules or routeRules must be set.
  17445. PathRules []*PathRule `json:"pathRules,omitempty"`
  17446. // ForceSendFields is a list of field names (e.g. "DefaultService") to
  17447. // unconditionally include in API requests. By default, fields with
  17448. // empty values are omitted from API requests. However, any non-pointer,
  17449. // non-interface field appearing in ForceSendFields will be sent to the
  17450. // server regardless of whether the field is empty or not. This may be
  17451. // used to include empty fields in Patch requests.
  17452. ForceSendFields []string `json:"-"`
  17453. // NullFields is a list of field names (e.g. "DefaultService") to
  17454. // include in API requests with the JSON null value. By default, fields
  17455. // with empty values are omitted from API requests. However, any field
  17456. // with an empty value appearing in NullFields will be sent to the
  17457. // server as null. It is an error if a field in this list has a
  17458. // non-empty value. This may be used to include null fields in Patch
  17459. // requests.
  17460. NullFields []string `json:"-"`
  17461. }
  17462. func (s *PathMatcher) MarshalJSON() ([]byte, error) {
  17463. type NoMethod PathMatcher
  17464. raw := NoMethod(*s)
  17465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17466. }
  17467. // PathRule: A path-matching rule for a URL. If matched, will use the
  17468. // specified BackendService to handle the traffic arriving at this URL.
  17469. type PathRule struct {
  17470. // Paths: The list of path patterns to match. Each must start with / and
  17471. // the only place a * is allowed is at the end following a /. The string
  17472. // fed to the path matcher does not include any text after the first ?
  17473. // or #, and those chars are not allowed here.
  17474. Paths []string `json:"paths,omitempty"`
  17475. // Service: The full or partial URL of the backend service resource to
  17476. // which traffic is directed if this rule is matched. If routeAction is
  17477. // additionally specified, advanced routing actions like URL Rewrites,
  17478. // etc. take effect prior to sending the request to the backend.
  17479. // However, if service is specified, routeAction cannot contain any
  17480. // weightedBackendService s. Conversely, if routeAction specifies any
  17481. // weightedBackendServices, service must not be specified.
  17482. // Only one of urlRedirect, service or
  17483. // routeAction.weightedBackendService must be set.
  17484. Service string `json:"service,omitempty"`
  17485. // ForceSendFields is a list of field names (e.g. "Paths") to
  17486. // unconditionally include in API requests. By default, fields with
  17487. // empty values are omitted from API requests. However, any non-pointer,
  17488. // non-interface field appearing in ForceSendFields will be sent to the
  17489. // server regardless of whether the field is empty or not. This may be
  17490. // used to include empty fields in Patch requests.
  17491. ForceSendFields []string `json:"-"`
  17492. // NullFields is a list of field names (e.g. "Paths") to include in API
  17493. // requests with the JSON null value. By default, fields with empty
  17494. // values are omitted from API requests. However, any field with an
  17495. // empty value appearing in NullFields will be sent to the server as
  17496. // null. It is an error if a field in this list has a non-empty value.
  17497. // This may be used to include null fields in Patch requests.
  17498. NullFields []string `json:"-"`
  17499. }
  17500. func (s *PathRule) MarshalJSON() ([]byte, error) {
  17501. type NoMethod PathRule
  17502. raw := NoMethod(*s)
  17503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17504. }
  17505. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  17506. // used to specify access control policies for Cloud Platform
  17507. // resources.
  17508. //
  17509. //
  17510. //
  17511. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  17512. // of `members` to a `role`, where the members can be user accounts,
  17513. // Google groups, Google domains, and service accounts. A `role` is a
  17514. // named list of permissions defined by IAM.
  17515. //
  17516. // **JSON Example**
  17517. //
  17518. // { "bindings": [ { "role": "roles/owner", "members": [
  17519. // "user:mike@example.com", "group:admins@example.com",
  17520. // "domain:google.com",
  17521. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  17522. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  17523. // }
  17524. //
  17525. // **YAML Example**
  17526. //
  17527. // bindings: - members: - user:mike@example.com -
  17528. // group:admins@example.com - domain:google.com -
  17529. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  17530. // roles/owner - members: - user:sean@example.com role:
  17531. // roles/viewer
  17532. //
  17533. //
  17534. //
  17535. // For a description of IAM and its features, see the [IAM developer's
  17536. // guide](https://cloud.google.com/iam/docs).
  17537. type Policy struct {
  17538. // AuditConfigs: Specifies cloud audit logging configuration for this
  17539. // policy.
  17540. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  17541. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  17542. // no members will result in an error.
  17543. Bindings []*Binding `json:"bindings,omitempty"`
  17544. // Etag: `etag` is used for optimistic concurrency control as a way to
  17545. // help prevent simultaneous updates of a policy from overwriting each
  17546. // other. It is strongly suggested that systems make use of the `etag`
  17547. // in the read-modify-write cycle to perform policy updates in order to
  17548. // avoid race conditions: An `etag` is returned in the response to
  17549. // `getIamPolicy`, and systems are expected to put that etag in the
  17550. // request to `setIamPolicy` to ensure that their change will be applied
  17551. // to the same version of the policy.
  17552. //
  17553. // If no `etag` is provided in the call to `setIamPolicy`, then the
  17554. // existing policy is overwritten blindly.
  17555. Etag string `json:"etag,omitempty"`
  17556. IamOwned bool `json:"iamOwned,omitempty"`
  17557. // Rules: If more than one rule is specified, the rules are applied in
  17558. // the following manner: - All matching LOG rules are always applied. -
  17559. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  17560. // will be applied if one or more matching rule requires logging. -
  17561. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  17562. // granted. Logging will be applied if one or more matching rule
  17563. // requires logging. - Otherwise, if no rule applies, permission is
  17564. // denied.
  17565. Rules []*Rule `json:"rules,omitempty"`
  17566. // Version: Deprecated.
  17567. Version int64 `json:"version,omitempty"`
  17568. // ServerResponse contains the HTTP response code and headers from the
  17569. // server.
  17570. googleapi.ServerResponse `json:"-"`
  17571. // ForceSendFields is a list of field names (e.g. "AuditConfigs") 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. "AuditConfigs") to include
  17579. // in API requests with the JSON null value. By default, fields with
  17580. // empty values are omitted from API requests. However, any field with
  17581. // an empty value appearing in NullFields will be sent to the server as
  17582. // null. It is an error if a field in this list has a non-empty value.
  17583. // This may be used to include null fields in Patch requests.
  17584. NullFields []string `json:"-"`
  17585. }
  17586. func (s *Policy) MarshalJSON() ([]byte, error) {
  17587. type NoMethod Policy
  17588. raw := NoMethod(*s)
  17589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17590. }
  17591. // Project: A Project resource. For an overview of projects, see Cloud
  17592. // Platform Resource Hierarchy. (== resource_for v1.projects ==) (==
  17593. // resource_for beta.projects ==)
  17594. type Project struct {
  17595. // CommonInstanceMetadata: Metadata key/value pairs available to all
  17596. // instances contained in this project. See Custom metadata for more
  17597. // information.
  17598. CommonInstanceMetadata *Metadata `json:"commonInstanceMetadata,omitempty"`
  17599. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17600. // format.
  17601. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17602. // DefaultNetworkTier: This signifies the default network tier used for
  17603. // configuring resources of the project and can only take the following
  17604. // values: PREMIUM, STANDARD. Initially the default network tier is
  17605. // PREMIUM.
  17606. //
  17607. // Possible values:
  17608. // "PREMIUM"
  17609. // "STANDARD"
  17610. DefaultNetworkTier string `json:"defaultNetworkTier,omitempty"`
  17611. // DefaultServiceAccount: [Output Only] Default service account used by
  17612. // VMs running in this project.
  17613. DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"`
  17614. // Description: An optional textual description of the resource.
  17615. Description string `json:"description,omitempty"`
  17616. // EnabledFeatures: Restricted features enabled for use on this project.
  17617. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  17618. // Id: [Output Only] The unique identifier for the resource. This
  17619. // identifier is defined by the server. This is not the project ID, and
  17620. // is just a unique ID used by Compute Engine to identify resources.
  17621. Id uint64 `json:"id,omitempty,string"`
  17622. // Kind: [Output Only] Type of the resource. Always compute#project for
  17623. // projects.
  17624. Kind string `json:"kind,omitempty"`
  17625. // Name: The project ID. For example: my-example-project. Use the
  17626. // project ID to make requests to Compute Engine.
  17627. Name string `json:"name,omitempty"`
  17628. // Quotas: [Output Only] Quotas assigned to this project.
  17629. Quotas []*Quota `json:"quotas,omitempty"`
  17630. // SelfLink: [Output Only] Server-defined URL for the resource.
  17631. SelfLink string `json:"selfLink,omitempty"`
  17632. // UsageExportLocation: The naming prefix for daily usage reports and
  17633. // the Google Cloud Storage bucket where they are stored.
  17634. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"`
  17635. // XpnProjectStatus: [Output Only] The role this project has in a shared
  17636. // VPC configuration. Currently only HOST projects are differentiated.
  17637. //
  17638. // Possible values:
  17639. // "HOST"
  17640. // "UNSPECIFIED_XPN_PROJECT_STATUS"
  17641. XpnProjectStatus string `json:"xpnProjectStatus,omitempty"`
  17642. // ServerResponse contains the HTTP response code and headers from the
  17643. // server.
  17644. googleapi.ServerResponse `json:"-"`
  17645. // ForceSendFields is a list of field names (e.g.
  17646. // "CommonInstanceMetadata") to unconditionally include in API requests.
  17647. // By default, fields with empty values are omitted from API requests.
  17648. // However, any non-pointer, non-interface field appearing in
  17649. // ForceSendFields will be sent to the server regardless of whether the
  17650. // field is empty or not. This may be used to include empty fields in
  17651. // Patch requests.
  17652. ForceSendFields []string `json:"-"`
  17653. // NullFields is a list of field names (e.g. "CommonInstanceMetadata")
  17654. // to include in API requests with the JSON null value. By default,
  17655. // fields with empty values are omitted from API requests. However, any
  17656. // field with an empty value appearing in NullFields will be sent to the
  17657. // server as null. It is an error if a field in this list has a
  17658. // non-empty value. This may be used to include null fields in Patch
  17659. // requests.
  17660. NullFields []string `json:"-"`
  17661. }
  17662. func (s *Project) MarshalJSON() ([]byte, error) {
  17663. type NoMethod Project
  17664. raw := NoMethod(*s)
  17665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17666. }
  17667. type ProjectsDisableXpnResourceRequest struct {
  17668. // XpnResource: Service resource (a.k.a service project) ID.
  17669. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  17670. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  17671. // unconditionally include in API requests. By default, fields with
  17672. // empty values are omitted from API requests. However, any non-pointer,
  17673. // non-interface field appearing in ForceSendFields will be sent to the
  17674. // server regardless of whether the field is empty or not. This may be
  17675. // used to include empty fields in Patch requests.
  17676. ForceSendFields []string `json:"-"`
  17677. // NullFields is a list of field names (e.g. "XpnResource") to include
  17678. // in API requests with the JSON null value. By default, fields with
  17679. // empty values are omitted from API requests. However, any field with
  17680. // an empty value appearing in NullFields will be sent to the server as
  17681. // null. It is an error if a field in this list has a non-empty value.
  17682. // This may be used to include null fields in Patch requests.
  17683. NullFields []string `json:"-"`
  17684. }
  17685. func (s *ProjectsDisableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  17686. type NoMethod ProjectsDisableXpnResourceRequest
  17687. raw := NoMethod(*s)
  17688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17689. }
  17690. type ProjectsEnableXpnResourceRequest struct {
  17691. // XpnResource: Service resource (a.k.a service project) ID.
  17692. XpnResource *XpnResourceId `json:"xpnResource,omitempty"`
  17693. // ForceSendFields is a list of field names (e.g. "XpnResource") to
  17694. // unconditionally include in API requests. By default, fields with
  17695. // empty values are omitted from API requests. However, any non-pointer,
  17696. // non-interface field appearing in ForceSendFields will be sent to the
  17697. // server regardless of whether the field is empty or not. This may be
  17698. // used to include empty fields in Patch requests.
  17699. ForceSendFields []string `json:"-"`
  17700. // NullFields is a list of field names (e.g. "XpnResource") to include
  17701. // in API requests with the JSON null value. By default, fields with
  17702. // empty values are omitted from API requests. However, any field with
  17703. // an empty value appearing in NullFields will be sent to the server as
  17704. // null. It is an error if a field in this list has a non-empty value.
  17705. // This may be used to include null fields in Patch requests.
  17706. NullFields []string `json:"-"`
  17707. }
  17708. func (s *ProjectsEnableXpnResourceRequest) MarshalJSON() ([]byte, error) {
  17709. type NoMethod ProjectsEnableXpnResourceRequest
  17710. raw := NoMethod(*s)
  17711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17712. }
  17713. type ProjectsGetXpnResources struct {
  17714. // Kind: [Output Only] Type of resource. Always
  17715. // compute#projectsGetXpnResources for lists of service resources (a.k.a
  17716. // service projects)
  17717. Kind string `json:"kind,omitempty"`
  17718. // NextPageToken: [Output Only] This token allows you to get the next
  17719. // page of results for list requests. If the number of results is larger
  17720. // than maxResults, use the nextPageToken as a value for the query
  17721. // parameter pageToken in the next list request. Subsequent list
  17722. // requests will have their own nextPageToken to continue paging through
  17723. // the results.
  17724. NextPageToken string `json:"nextPageToken,omitempty"`
  17725. // Resources: Service resources (a.k.a service projects) attached to
  17726. // this project as their shared VPC host.
  17727. Resources []*XpnResourceId `json:"resources,omitempty"`
  17728. // ServerResponse contains the HTTP response code and headers from the
  17729. // server.
  17730. googleapi.ServerResponse `json:"-"`
  17731. // ForceSendFields is a list of field names (e.g. "Kind") to
  17732. // unconditionally include in API requests. By default, fields with
  17733. // empty values are omitted from API requests. However, any non-pointer,
  17734. // non-interface field appearing in ForceSendFields will be sent to the
  17735. // server regardless of whether the field is empty or not. This may be
  17736. // used to include empty fields in Patch requests.
  17737. ForceSendFields []string `json:"-"`
  17738. // NullFields is a list of field names (e.g. "Kind") to include in API
  17739. // requests with the JSON null value. By default, fields with empty
  17740. // values are omitted from API requests. However, any field with an
  17741. // empty value appearing in NullFields will be sent to the server as
  17742. // null. It is an error if a field in this list has a non-empty value.
  17743. // This may be used to include null fields in Patch requests.
  17744. NullFields []string `json:"-"`
  17745. }
  17746. func (s *ProjectsGetXpnResources) MarshalJSON() ([]byte, error) {
  17747. type NoMethod ProjectsGetXpnResources
  17748. raw := NoMethod(*s)
  17749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17750. }
  17751. type ProjectsListXpnHostsRequest struct {
  17752. // Organization: Optional organization ID managed by Cloud Resource
  17753. // Manager, for which to list shared VPC host projects. If not
  17754. // specified, the organization will be inferred from the project.
  17755. Organization string `json:"organization,omitempty"`
  17756. // ForceSendFields is a list of field names (e.g. "Organization") to
  17757. // unconditionally include in API requests. By default, fields with
  17758. // empty values are omitted from API requests. However, any non-pointer,
  17759. // non-interface field appearing in ForceSendFields will be sent to the
  17760. // server regardless of whether the field is empty or not. This may be
  17761. // used to include empty fields in Patch requests.
  17762. ForceSendFields []string `json:"-"`
  17763. // NullFields is a list of field names (e.g. "Organization") to include
  17764. // in API requests with the JSON null value. By default, fields with
  17765. // empty values are omitted from API requests. However, any field with
  17766. // an empty value appearing in NullFields will be sent to the server as
  17767. // null. It is an error if a field in this list has a non-empty value.
  17768. // This may be used to include null fields in Patch requests.
  17769. NullFields []string `json:"-"`
  17770. }
  17771. func (s *ProjectsListXpnHostsRequest) MarshalJSON() ([]byte, error) {
  17772. type NoMethod ProjectsListXpnHostsRequest
  17773. raw := NoMethod(*s)
  17774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17775. }
  17776. type ProjectsSetDefaultNetworkTierRequest struct {
  17777. // NetworkTier: Default network tier to be set.
  17778. //
  17779. // Possible values:
  17780. // "PREMIUM"
  17781. // "STANDARD"
  17782. NetworkTier string `json:"networkTier,omitempty"`
  17783. // ForceSendFields is a list of field names (e.g. "NetworkTier") to
  17784. // unconditionally include in API requests. By default, fields with
  17785. // empty values are omitted from API requests. However, any non-pointer,
  17786. // non-interface field appearing in ForceSendFields will be sent to the
  17787. // server regardless of whether the field is empty or not. This may be
  17788. // used to include empty fields in Patch requests.
  17789. ForceSendFields []string `json:"-"`
  17790. // NullFields is a list of field names (e.g. "NetworkTier") to include
  17791. // in API requests with the JSON null value. By default, fields with
  17792. // empty values are omitted from API requests. However, any field with
  17793. // an empty value appearing in NullFields will be sent to the server as
  17794. // null. It is an error if a field in this list has a non-empty value.
  17795. // This may be used to include null fields in Patch requests.
  17796. NullFields []string `json:"-"`
  17797. }
  17798. func (s *ProjectsSetDefaultNetworkTierRequest) MarshalJSON() ([]byte, error) {
  17799. type NoMethod ProjectsSetDefaultNetworkTierRequest
  17800. raw := NoMethod(*s)
  17801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17802. }
  17803. // Quota: A quotas entry.
  17804. type Quota struct {
  17805. // Limit: [Output Only] Quota limit for this metric.
  17806. Limit float64 `json:"limit,omitempty"`
  17807. // Metric: [Output Only] Name of the quota metric.
  17808. //
  17809. // Possible values:
  17810. // "AUTOSCALERS"
  17811. // "BACKEND_BUCKETS"
  17812. // "BACKEND_SERVICES"
  17813. // "COMMITMENTS"
  17814. // "CPUS"
  17815. // "CPUS_ALL_REGIONS"
  17816. // "DISKS_TOTAL_GB"
  17817. // "EXTERNAL_VPN_GATEWAYS"
  17818. // "FIREWALLS"
  17819. // "FORWARDING_RULES"
  17820. // "GLOBAL_INTERNAL_ADDRESSES"
  17821. // "GPUS_ALL_REGIONS"
  17822. // "HEALTH_CHECKS"
  17823. // "IMAGES"
  17824. // "INSTANCES"
  17825. // "INSTANCE_GROUPS"
  17826. // "INSTANCE_GROUP_MANAGERS"
  17827. // "INSTANCE_TEMPLATES"
  17828. // "INTERCONNECTS"
  17829. // "INTERCONNECT_ATTACHMENTS_PER_REGION"
  17830. // "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"
  17831. // "INTERNAL_ADDRESSES"
  17832. // "IN_USE_ADDRESSES"
  17833. // "IN_USE_BACKUP_SCHEDULES"
  17834. // "IN_USE_SNAPSHOT_SCHEDULES"
  17835. // "LOCAL_SSD_TOTAL_GB"
  17836. // "NETWORKS"
  17837. // "NETWORK_ENDPOINT_GROUPS"
  17838. // "NVIDIA_K80_GPUS"
  17839. // "NVIDIA_P100_GPUS"
  17840. // "NVIDIA_P100_VWS_GPUS"
  17841. // "NVIDIA_P4_GPUS"
  17842. // "NVIDIA_P4_VWS_GPUS"
  17843. // "NVIDIA_T4_GPUS"
  17844. // "NVIDIA_T4_VWS_GPUS"
  17845. // "NVIDIA_V100_GPUS"
  17846. // "PREEMPTIBLE_CPUS"
  17847. // "PREEMPTIBLE_LOCAL_SSD_GB"
  17848. // "PREEMPTIBLE_NVIDIA_K80_GPUS"
  17849. // "PREEMPTIBLE_NVIDIA_P100_GPUS"
  17850. // "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"
  17851. // "PREEMPTIBLE_NVIDIA_P4_GPUS"
  17852. // "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"
  17853. // "PREEMPTIBLE_NVIDIA_T4_GPUS"
  17854. // "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"
  17855. // "PREEMPTIBLE_NVIDIA_V100_GPUS"
  17856. // "REGIONAL_AUTOSCALERS"
  17857. // "REGIONAL_INSTANCE_GROUP_MANAGERS"
  17858. // "RESOURCE_POLICIES"
  17859. // "ROUTERS"
  17860. // "ROUTES"
  17861. // "SECURITY_POLICIES"
  17862. // "SECURITY_POLICY_RULES"
  17863. // "SNAPSHOTS"
  17864. // "SSD_TOTAL_GB"
  17865. // "SSL_CERTIFICATES"
  17866. // "STATIC_ADDRESSES"
  17867. // "SUBNETWORKS"
  17868. // "TARGET_HTTPS_PROXIES"
  17869. // "TARGET_HTTP_PROXIES"
  17870. // "TARGET_INSTANCES"
  17871. // "TARGET_POOLS"
  17872. // "TARGET_SSL_PROXIES"
  17873. // "TARGET_TCP_PROXIES"
  17874. // "TARGET_VPN_GATEWAYS"
  17875. // "URL_MAPS"
  17876. // "VPN_GATEWAYS"
  17877. // "VPN_TUNNELS"
  17878. Metric string `json:"metric,omitempty"`
  17879. // Owner: [Output Only] Owning resource. This is the resource on which
  17880. // this quota is applied.
  17881. Owner string `json:"owner,omitempty"`
  17882. // Usage: [Output Only] Current usage of this metric.
  17883. Usage float64 `json:"usage,omitempty"`
  17884. // ForceSendFields is a list of field names (e.g. "Limit") to
  17885. // unconditionally include in API requests. By default, fields with
  17886. // empty values are omitted from API requests. However, any non-pointer,
  17887. // non-interface field appearing in ForceSendFields will be sent to the
  17888. // server regardless of whether the field is empty or not. This may be
  17889. // used to include empty fields in Patch requests.
  17890. ForceSendFields []string `json:"-"`
  17891. // NullFields is a list of field names (e.g. "Limit") to include in API
  17892. // requests with the JSON null value. By default, fields with empty
  17893. // values are omitted from API requests. However, any field with an
  17894. // empty value appearing in NullFields will be sent to the server as
  17895. // null. It is an error if a field in this list has a non-empty value.
  17896. // This may be used to include null fields in Patch requests.
  17897. NullFields []string `json:"-"`
  17898. }
  17899. func (s *Quota) MarshalJSON() ([]byte, error) {
  17900. type NoMethod Quota
  17901. raw := NoMethod(*s)
  17902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17903. }
  17904. func (s *Quota) UnmarshalJSON(data []byte) error {
  17905. type NoMethod Quota
  17906. var s1 struct {
  17907. Limit gensupport.JSONFloat64 `json:"limit"`
  17908. Usage gensupport.JSONFloat64 `json:"usage"`
  17909. *NoMethod
  17910. }
  17911. s1.NoMethod = (*NoMethod)(s)
  17912. if err := json.Unmarshal(data, &s1); err != nil {
  17913. return err
  17914. }
  17915. s.Limit = float64(s1.Limit)
  17916. s.Usage = float64(s1.Usage)
  17917. return nil
  17918. }
  17919. // Reference: Represents a reference to a resource.
  17920. type Reference struct {
  17921. // Kind: [Output Only] Type of the resource. Always compute#reference
  17922. // for references.
  17923. Kind string `json:"kind,omitempty"`
  17924. // ReferenceType: A description of the reference type with no implied
  17925. // semantics. Possible values include:
  17926. // - MEMBER_OF
  17927. ReferenceType string `json:"referenceType,omitempty"`
  17928. // Referrer: URL of the resource which refers to the target.
  17929. Referrer string `json:"referrer,omitempty"`
  17930. // Target: URL of the resource to which this reference points.
  17931. Target string `json:"target,omitempty"`
  17932. // ForceSendFields is a list of field names (e.g. "Kind") to
  17933. // unconditionally include in API requests. By default, fields with
  17934. // empty values are omitted from API requests. However, any non-pointer,
  17935. // non-interface field appearing in ForceSendFields will be sent to the
  17936. // server regardless of whether the field is empty or not. This may be
  17937. // used to include empty fields in Patch requests.
  17938. ForceSendFields []string `json:"-"`
  17939. // NullFields is a list of field names (e.g. "Kind") to include in API
  17940. // requests with the JSON null value. By default, fields with empty
  17941. // values are omitted from API requests. However, any field with an
  17942. // empty value appearing in NullFields will be sent to the server as
  17943. // null. It is an error if a field in this list has a non-empty value.
  17944. // This may be used to include null fields in Patch requests.
  17945. NullFields []string `json:"-"`
  17946. }
  17947. func (s *Reference) MarshalJSON() ([]byte, error) {
  17948. type NoMethod Reference
  17949. raw := NoMethod(*s)
  17950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  17951. }
  17952. // Region: Region resource. (== resource_for beta.regions ==) (==
  17953. // resource_for v1.regions ==)
  17954. type Region struct {
  17955. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  17956. // format.
  17957. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  17958. // Deprecated: [Output Only] The deprecation status associated with this
  17959. // region.
  17960. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  17961. // Description: [Output Only] Textual description of the resource.
  17962. Description string `json:"description,omitempty"`
  17963. // Id: [Output Only] The unique identifier for the resource. This
  17964. // identifier is defined by the server.
  17965. Id uint64 `json:"id,omitempty,string"`
  17966. // Kind: [Output Only] Type of the resource. Always compute#region for
  17967. // regions.
  17968. Kind string `json:"kind,omitempty"`
  17969. // Name: [Output Only] Name of the resource.
  17970. Name string `json:"name,omitempty"`
  17971. // Quotas: [Output Only] Quotas assigned to this region.
  17972. Quotas []*Quota `json:"quotas,omitempty"`
  17973. // SelfLink: [Output Only] Server-defined URL for the resource.
  17974. SelfLink string `json:"selfLink,omitempty"`
  17975. // Status: [Output Only] Status of the region, either UP or DOWN.
  17976. //
  17977. // Possible values:
  17978. // "DOWN"
  17979. // "UP"
  17980. Status string `json:"status,omitempty"`
  17981. // Zones: [Output Only] A list of zones available in this region, in the
  17982. // form of resource URLs.
  17983. Zones []string `json:"zones,omitempty"`
  17984. // ServerResponse contains the HTTP response code and headers from the
  17985. // server.
  17986. googleapi.ServerResponse `json:"-"`
  17987. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  17988. // to unconditionally include in API requests. By default, fields with
  17989. // empty values are omitted from API requests. However, any non-pointer,
  17990. // non-interface field appearing in ForceSendFields will be sent to the
  17991. // server regardless of whether the field is empty or not. This may be
  17992. // used to include empty fields in Patch requests.
  17993. ForceSendFields []string `json:"-"`
  17994. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  17995. // include in API requests with the JSON null value. By default, fields
  17996. // with empty values are omitted from API requests. However, any field
  17997. // with an empty value appearing in NullFields will be sent to the
  17998. // server as null. It is an error if a field in this list has a
  17999. // non-empty value. This may be used to include null fields in Patch
  18000. // requests.
  18001. NullFields []string `json:"-"`
  18002. }
  18003. func (s *Region) MarshalJSON() ([]byte, error) {
  18004. type NoMethod Region
  18005. raw := NoMethod(*s)
  18006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18007. }
  18008. // RegionAutoscalerList: Contains a list of autoscalers.
  18009. type RegionAutoscalerList struct {
  18010. // Id: [Output Only] Unique identifier for the resource; defined by the
  18011. // server.
  18012. Id string `json:"id,omitempty"`
  18013. // Items: A list of Autoscaler resources.
  18014. Items []*Autoscaler `json:"items,omitempty"`
  18015. // Kind: Type of resource.
  18016. Kind string `json:"kind,omitempty"`
  18017. // NextPageToken: [Output Only] This token allows you to get the next
  18018. // page of results for list requests. If the number of results is larger
  18019. // than maxResults, use the nextPageToken as a value for the query
  18020. // parameter pageToken in the next list request. Subsequent list
  18021. // requests will have their own nextPageToken to continue paging through
  18022. // the results.
  18023. NextPageToken string `json:"nextPageToken,omitempty"`
  18024. // SelfLink: [Output Only] Server-defined URL for this resource.
  18025. SelfLink string `json:"selfLink,omitempty"`
  18026. // Warning: [Output Only] Informational warning message.
  18027. Warning *RegionAutoscalerListWarning `json:"warning,omitempty"`
  18028. // ServerResponse contains the HTTP response code and headers from the
  18029. // server.
  18030. googleapi.ServerResponse `json:"-"`
  18031. // ForceSendFields is a list of field names (e.g. "Id") to
  18032. // unconditionally include in API requests. By default, fields with
  18033. // empty values are omitted from API requests. However, any non-pointer,
  18034. // non-interface field appearing in ForceSendFields will be sent to the
  18035. // server regardless of whether the field is empty or not. This may be
  18036. // used to include empty fields in Patch requests.
  18037. ForceSendFields []string `json:"-"`
  18038. // NullFields is a list of field names (e.g. "Id") to include in API
  18039. // requests with the JSON null value. By default, fields with empty
  18040. // values are omitted from API requests. However, any field with an
  18041. // empty value appearing in NullFields will be sent to the server as
  18042. // null. It is an error if a field in this list has a non-empty value.
  18043. // This may be used to include null fields in Patch requests.
  18044. NullFields []string `json:"-"`
  18045. }
  18046. func (s *RegionAutoscalerList) MarshalJSON() ([]byte, error) {
  18047. type NoMethod RegionAutoscalerList
  18048. raw := NoMethod(*s)
  18049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18050. }
  18051. // RegionAutoscalerListWarning: [Output Only] Informational warning
  18052. // message.
  18053. type RegionAutoscalerListWarning struct {
  18054. // Code: [Output Only] A warning code, if applicable. For example,
  18055. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18056. // the response.
  18057. //
  18058. // Possible values:
  18059. // "CLEANUP_FAILED"
  18060. // "DEPRECATED_RESOURCE_USED"
  18061. // "DEPRECATED_TYPE_USED"
  18062. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18063. // "EXPERIMENTAL_TYPE_USED"
  18064. // "EXTERNAL_API_WARNING"
  18065. // "FIELD_VALUE_OVERRIDEN"
  18066. // "INJECTED_KERNELS_DEPRECATED"
  18067. // "MISSING_TYPE_DEPENDENCY"
  18068. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18069. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18070. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18071. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18072. // "NEXT_HOP_NOT_RUNNING"
  18073. // "NOT_CRITICAL_ERROR"
  18074. // "NO_RESULTS_ON_PAGE"
  18075. // "REQUIRED_TOS_AGREEMENT"
  18076. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18077. // "RESOURCE_NOT_DELETED"
  18078. // "SCHEMA_VALIDATION_IGNORED"
  18079. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18080. // "UNDECLARED_PROPERTIES"
  18081. // "UNREACHABLE"
  18082. Code string `json:"code,omitempty"`
  18083. // Data: [Output Only] Metadata about this warning in key: value format.
  18084. // For example:
  18085. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18086. Data []*RegionAutoscalerListWarningData `json:"data,omitempty"`
  18087. // Message: [Output Only] A human-readable description of the warning
  18088. // code.
  18089. Message string `json:"message,omitempty"`
  18090. // ForceSendFields is a list of field names (e.g. "Code") to
  18091. // unconditionally include in API requests. By default, fields with
  18092. // empty values are omitted from API requests. However, any non-pointer,
  18093. // non-interface field appearing in ForceSendFields will be sent to the
  18094. // server regardless of whether the field is empty or not. This may be
  18095. // used to include empty fields in Patch requests.
  18096. ForceSendFields []string `json:"-"`
  18097. // NullFields is a list of field names (e.g. "Code") to include in API
  18098. // requests with the JSON null value. By default, fields with empty
  18099. // values are omitted from API requests. However, any field with an
  18100. // empty value appearing in NullFields will be sent to the server as
  18101. // null. It is an error if a field in this list has a non-empty value.
  18102. // This may be used to include null fields in Patch requests.
  18103. NullFields []string `json:"-"`
  18104. }
  18105. func (s *RegionAutoscalerListWarning) MarshalJSON() ([]byte, error) {
  18106. type NoMethod RegionAutoscalerListWarning
  18107. raw := NoMethod(*s)
  18108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18109. }
  18110. type RegionAutoscalerListWarningData struct {
  18111. // Key: [Output Only] A key that provides more detail on the warning
  18112. // being returned. For example, for warnings where there are no results
  18113. // in a list request for a particular zone, this key might be scope and
  18114. // the key value might be the zone name. Other examples might be a key
  18115. // indicating a deprecated resource and a suggested replacement, or a
  18116. // warning about invalid network settings (for example, if an instance
  18117. // attempts to perform IP forwarding but is not enabled for IP
  18118. // forwarding).
  18119. Key string `json:"key,omitempty"`
  18120. // Value: [Output Only] A warning data value corresponding to the key.
  18121. Value string `json:"value,omitempty"`
  18122. // ForceSendFields is a list of field names (e.g. "Key") to
  18123. // unconditionally include in API requests. By default, fields with
  18124. // empty values are omitted from API requests. However, any non-pointer,
  18125. // non-interface field appearing in ForceSendFields will be sent to the
  18126. // server regardless of whether the field is empty or not. This may be
  18127. // used to include empty fields in Patch requests.
  18128. ForceSendFields []string `json:"-"`
  18129. // NullFields is a list of field names (e.g. "Key") to include in API
  18130. // requests with the JSON null value. By default, fields with empty
  18131. // values are omitted from API requests. However, any field with an
  18132. // empty value appearing in NullFields will be sent to the server as
  18133. // null. It is an error if a field in this list has a non-empty value.
  18134. // This may be used to include null fields in Patch requests.
  18135. NullFields []string `json:"-"`
  18136. }
  18137. func (s *RegionAutoscalerListWarningData) MarshalJSON() ([]byte, error) {
  18138. type NoMethod RegionAutoscalerListWarningData
  18139. raw := NoMethod(*s)
  18140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18141. }
  18142. type RegionDiskTypeList struct {
  18143. // Id: [Output Only] Unique identifier for the resource; defined by the
  18144. // server.
  18145. Id string `json:"id,omitempty"`
  18146. // Items: A list of DiskType resources.
  18147. Items []*DiskType `json:"items,omitempty"`
  18148. // Kind: [Output Only] Type of resource. Always
  18149. // compute#regionDiskTypeList for region disk types.
  18150. Kind string `json:"kind,omitempty"`
  18151. // NextPageToken: [Output Only] This token allows you to get the next
  18152. // page of results for list requests. If the number of results is larger
  18153. // than maxResults, use the nextPageToken as a value for the query
  18154. // parameter pageToken in the next list request. Subsequent list
  18155. // requests will have their own nextPageToken to continue paging through
  18156. // the results.
  18157. NextPageToken string `json:"nextPageToken,omitempty"`
  18158. // SelfLink: [Output Only] Server-defined URL for this resource.
  18159. SelfLink string `json:"selfLink,omitempty"`
  18160. // Warning: [Output Only] Informational warning message.
  18161. Warning *RegionDiskTypeListWarning `json:"warning,omitempty"`
  18162. // ServerResponse contains the HTTP response code and headers from the
  18163. // server.
  18164. googleapi.ServerResponse `json:"-"`
  18165. // ForceSendFields is a list of field names (e.g. "Id") to
  18166. // unconditionally include in API requests. By default, fields with
  18167. // empty values are omitted from API requests. However, any non-pointer,
  18168. // non-interface field appearing in ForceSendFields will be sent to the
  18169. // server regardless of whether the field is empty or not. This may be
  18170. // used to include empty fields in Patch requests.
  18171. ForceSendFields []string `json:"-"`
  18172. // NullFields is a list of field names (e.g. "Id") to include in API
  18173. // requests with the JSON null value. By default, fields with empty
  18174. // values are omitted from API requests. However, any field with an
  18175. // empty value appearing in NullFields will be sent to the server as
  18176. // null. It is an error if a field in this list has a non-empty value.
  18177. // This may be used to include null fields in Patch requests.
  18178. NullFields []string `json:"-"`
  18179. }
  18180. func (s *RegionDiskTypeList) MarshalJSON() ([]byte, error) {
  18181. type NoMethod RegionDiskTypeList
  18182. raw := NoMethod(*s)
  18183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18184. }
  18185. // RegionDiskTypeListWarning: [Output Only] Informational warning
  18186. // message.
  18187. type RegionDiskTypeListWarning struct {
  18188. // Code: [Output Only] A warning code, if applicable. For example,
  18189. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18190. // the response.
  18191. //
  18192. // Possible values:
  18193. // "CLEANUP_FAILED"
  18194. // "DEPRECATED_RESOURCE_USED"
  18195. // "DEPRECATED_TYPE_USED"
  18196. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18197. // "EXPERIMENTAL_TYPE_USED"
  18198. // "EXTERNAL_API_WARNING"
  18199. // "FIELD_VALUE_OVERRIDEN"
  18200. // "INJECTED_KERNELS_DEPRECATED"
  18201. // "MISSING_TYPE_DEPENDENCY"
  18202. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18203. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18204. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18205. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18206. // "NEXT_HOP_NOT_RUNNING"
  18207. // "NOT_CRITICAL_ERROR"
  18208. // "NO_RESULTS_ON_PAGE"
  18209. // "REQUIRED_TOS_AGREEMENT"
  18210. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18211. // "RESOURCE_NOT_DELETED"
  18212. // "SCHEMA_VALIDATION_IGNORED"
  18213. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18214. // "UNDECLARED_PROPERTIES"
  18215. // "UNREACHABLE"
  18216. Code string `json:"code,omitempty"`
  18217. // Data: [Output Only] Metadata about this warning in key: value format.
  18218. // For example:
  18219. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18220. Data []*RegionDiskTypeListWarningData `json:"data,omitempty"`
  18221. // Message: [Output Only] A human-readable description of the warning
  18222. // code.
  18223. Message string `json:"message,omitempty"`
  18224. // ForceSendFields is a list of field names (e.g. "Code") to
  18225. // unconditionally include in API requests. By default, fields with
  18226. // empty values are omitted from API requests. However, any non-pointer,
  18227. // non-interface field appearing in ForceSendFields will be sent to the
  18228. // server regardless of whether the field is empty or not. This may be
  18229. // used to include empty fields in Patch requests.
  18230. ForceSendFields []string `json:"-"`
  18231. // NullFields is a list of field names (e.g. "Code") to include in API
  18232. // requests with the JSON null value. By default, fields with empty
  18233. // values are omitted from API requests. However, any field with an
  18234. // empty value appearing in NullFields will be sent to the server as
  18235. // null. It is an error if a field in this list has a non-empty value.
  18236. // This may be used to include null fields in Patch requests.
  18237. NullFields []string `json:"-"`
  18238. }
  18239. func (s *RegionDiskTypeListWarning) MarshalJSON() ([]byte, error) {
  18240. type NoMethod RegionDiskTypeListWarning
  18241. raw := NoMethod(*s)
  18242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18243. }
  18244. type RegionDiskTypeListWarningData struct {
  18245. // Key: [Output Only] A key that provides more detail on the warning
  18246. // being returned. For example, for warnings where there are no results
  18247. // in a list request for a particular zone, this key might be scope and
  18248. // the key value might be the zone name. Other examples might be a key
  18249. // indicating a deprecated resource and a suggested replacement, or a
  18250. // warning about invalid network settings (for example, if an instance
  18251. // attempts to perform IP forwarding but is not enabled for IP
  18252. // forwarding).
  18253. Key string `json:"key,omitempty"`
  18254. // Value: [Output Only] A warning data value corresponding to the key.
  18255. Value string `json:"value,omitempty"`
  18256. // ForceSendFields is a list of field names (e.g. "Key") to
  18257. // unconditionally include in API requests. By default, fields with
  18258. // empty values are omitted from API requests. However, any non-pointer,
  18259. // non-interface field appearing in ForceSendFields will be sent to the
  18260. // server regardless of whether the field is empty or not. This may be
  18261. // used to include empty fields in Patch requests.
  18262. ForceSendFields []string `json:"-"`
  18263. // NullFields is a list of field names (e.g. "Key") to include in API
  18264. // requests with the JSON null value. By default, fields with empty
  18265. // values are omitted from API requests. However, any field with an
  18266. // empty value appearing in NullFields will be sent to the server as
  18267. // null. It is an error if a field in this list has a non-empty value.
  18268. // This may be used to include null fields in Patch requests.
  18269. NullFields []string `json:"-"`
  18270. }
  18271. func (s *RegionDiskTypeListWarningData) MarshalJSON() ([]byte, error) {
  18272. type NoMethod RegionDiskTypeListWarningData
  18273. raw := NoMethod(*s)
  18274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18275. }
  18276. type RegionDisksResizeRequest struct {
  18277. // SizeGb: The new size of the regional persistent disk, which is
  18278. // specified in GB.
  18279. SizeGb int64 `json:"sizeGb,omitempty,string"`
  18280. // ForceSendFields is a list of field names (e.g. "SizeGb") to
  18281. // unconditionally include in API requests. By default, fields with
  18282. // empty values are omitted from API requests. However, any non-pointer,
  18283. // non-interface field appearing in ForceSendFields will be sent to the
  18284. // server regardless of whether the field is empty or not. This may be
  18285. // used to include empty fields in Patch requests.
  18286. ForceSendFields []string `json:"-"`
  18287. // NullFields is a list of field names (e.g. "SizeGb") to include in API
  18288. // requests with the JSON null value. By default, fields with empty
  18289. // values are omitted from API requests. However, any field with an
  18290. // empty value appearing in NullFields will be sent to the server as
  18291. // null. It is an error if a field in this list has a non-empty value.
  18292. // This may be used to include null fields in Patch requests.
  18293. NullFields []string `json:"-"`
  18294. }
  18295. func (s *RegionDisksResizeRequest) MarshalJSON() ([]byte, error) {
  18296. type NoMethod RegionDisksResizeRequest
  18297. raw := NoMethod(*s)
  18298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18299. }
  18300. // RegionInstanceGroupList: Contains a list of InstanceGroup resources.
  18301. type RegionInstanceGroupList struct {
  18302. // Id: [Output Only] Unique identifier for the resource; defined by the
  18303. // server.
  18304. Id string `json:"id,omitempty"`
  18305. // Items: A list of InstanceGroup resources.
  18306. Items []*InstanceGroup `json:"items,omitempty"`
  18307. // Kind: The resource type.
  18308. Kind string `json:"kind,omitempty"`
  18309. // NextPageToken: [Output Only] This token allows you to get the next
  18310. // page of results for list requests. If the number of results is larger
  18311. // than maxResults, use the nextPageToken as a value for the query
  18312. // parameter pageToken in the next list request. Subsequent list
  18313. // requests will have their own nextPageToken to continue paging through
  18314. // the results.
  18315. NextPageToken string `json:"nextPageToken,omitempty"`
  18316. // SelfLink: [Output Only] Server-defined URL for this resource.
  18317. SelfLink string `json:"selfLink,omitempty"`
  18318. // Warning: [Output Only] Informational warning message.
  18319. Warning *RegionInstanceGroupListWarning `json:"warning,omitempty"`
  18320. // ServerResponse contains the HTTP response code and headers from the
  18321. // server.
  18322. googleapi.ServerResponse `json:"-"`
  18323. // ForceSendFields is a list of field names (e.g. "Id") to
  18324. // unconditionally include in API requests. By default, fields with
  18325. // empty values are omitted from API requests. However, any non-pointer,
  18326. // non-interface field appearing in ForceSendFields will be sent to the
  18327. // server regardless of whether the field is empty or not. This may be
  18328. // used to include empty fields in Patch requests.
  18329. ForceSendFields []string `json:"-"`
  18330. // NullFields is a list of field names (e.g. "Id") to include in API
  18331. // requests with the JSON null value. By default, fields with empty
  18332. // values are omitted from API requests. However, any field with an
  18333. // empty value appearing in NullFields will be sent to the server as
  18334. // null. It is an error if a field in this list has a non-empty value.
  18335. // This may be used to include null fields in Patch requests.
  18336. NullFields []string `json:"-"`
  18337. }
  18338. func (s *RegionInstanceGroupList) MarshalJSON() ([]byte, error) {
  18339. type NoMethod RegionInstanceGroupList
  18340. raw := NoMethod(*s)
  18341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18342. }
  18343. // RegionInstanceGroupListWarning: [Output Only] Informational warning
  18344. // message.
  18345. type RegionInstanceGroupListWarning struct {
  18346. // Code: [Output Only] A warning code, if applicable. For example,
  18347. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18348. // the response.
  18349. //
  18350. // Possible values:
  18351. // "CLEANUP_FAILED"
  18352. // "DEPRECATED_RESOURCE_USED"
  18353. // "DEPRECATED_TYPE_USED"
  18354. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18355. // "EXPERIMENTAL_TYPE_USED"
  18356. // "EXTERNAL_API_WARNING"
  18357. // "FIELD_VALUE_OVERRIDEN"
  18358. // "INJECTED_KERNELS_DEPRECATED"
  18359. // "MISSING_TYPE_DEPENDENCY"
  18360. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18361. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18362. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18363. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18364. // "NEXT_HOP_NOT_RUNNING"
  18365. // "NOT_CRITICAL_ERROR"
  18366. // "NO_RESULTS_ON_PAGE"
  18367. // "REQUIRED_TOS_AGREEMENT"
  18368. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18369. // "RESOURCE_NOT_DELETED"
  18370. // "SCHEMA_VALIDATION_IGNORED"
  18371. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18372. // "UNDECLARED_PROPERTIES"
  18373. // "UNREACHABLE"
  18374. Code string `json:"code,omitempty"`
  18375. // Data: [Output Only] Metadata about this warning in key: value format.
  18376. // For example:
  18377. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18378. Data []*RegionInstanceGroupListWarningData `json:"data,omitempty"`
  18379. // Message: [Output Only] A human-readable description of the warning
  18380. // code.
  18381. Message string `json:"message,omitempty"`
  18382. // ForceSendFields is a list of field names (e.g. "Code") to
  18383. // unconditionally include in API requests. By default, fields with
  18384. // empty values are omitted from API requests. However, any non-pointer,
  18385. // non-interface field appearing in ForceSendFields will be sent to the
  18386. // server regardless of whether the field is empty or not. This may be
  18387. // used to include empty fields in Patch requests.
  18388. ForceSendFields []string `json:"-"`
  18389. // NullFields is a list of field names (e.g. "Code") to include in API
  18390. // requests with the JSON null value. By default, fields with empty
  18391. // values are omitted from API requests. However, any field with an
  18392. // empty value appearing in NullFields will be sent to the server as
  18393. // null. It is an error if a field in this list has a non-empty value.
  18394. // This may be used to include null fields in Patch requests.
  18395. NullFields []string `json:"-"`
  18396. }
  18397. func (s *RegionInstanceGroupListWarning) MarshalJSON() ([]byte, error) {
  18398. type NoMethod RegionInstanceGroupListWarning
  18399. raw := NoMethod(*s)
  18400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18401. }
  18402. type RegionInstanceGroupListWarningData struct {
  18403. // Key: [Output Only] A key that provides more detail on the warning
  18404. // being returned. For example, for warnings where there are no results
  18405. // in a list request for a particular zone, this key might be scope and
  18406. // the key value might be the zone name. Other examples might be a key
  18407. // indicating a deprecated resource and a suggested replacement, or a
  18408. // warning about invalid network settings (for example, if an instance
  18409. // attempts to perform IP forwarding but is not enabled for IP
  18410. // forwarding).
  18411. Key string `json:"key,omitempty"`
  18412. // Value: [Output Only] A warning data value corresponding to the key.
  18413. Value string `json:"value,omitempty"`
  18414. // ForceSendFields is a list of field names (e.g. "Key") to
  18415. // unconditionally include in API requests. By default, fields with
  18416. // empty values are omitted from API requests. However, any non-pointer,
  18417. // non-interface field appearing in ForceSendFields will be sent to the
  18418. // server regardless of whether the field is empty or not. This may be
  18419. // used to include empty fields in Patch requests.
  18420. ForceSendFields []string `json:"-"`
  18421. // NullFields is a list of field names (e.g. "Key") to include in API
  18422. // requests with the JSON null value. By default, fields with empty
  18423. // values are omitted from API requests. However, any field with an
  18424. // empty value appearing in NullFields will be sent to the server as
  18425. // null. It is an error if a field in this list has a non-empty value.
  18426. // This may be used to include null fields in Patch requests.
  18427. NullFields []string `json:"-"`
  18428. }
  18429. func (s *RegionInstanceGroupListWarningData) MarshalJSON() ([]byte, error) {
  18430. type NoMethod RegionInstanceGroupListWarningData
  18431. raw := NoMethod(*s)
  18432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18433. }
  18434. // RegionInstanceGroupManagerList: Contains a list of managed instance
  18435. // groups.
  18436. type RegionInstanceGroupManagerList struct {
  18437. // Id: [Output Only] Unique identifier for the resource; defined by the
  18438. // server.
  18439. Id string `json:"id,omitempty"`
  18440. // Items: A list of InstanceGroupManager resources.
  18441. Items []*InstanceGroupManager `json:"items,omitempty"`
  18442. // Kind: [Output Only] The resource type, which is always
  18443. // compute#instanceGroupManagerList for a list of managed instance
  18444. // groups that exist in th regional scope.
  18445. Kind string `json:"kind,omitempty"`
  18446. // NextPageToken: [Output Only] This token allows you to get the next
  18447. // page of results for list requests. If the number of results is larger
  18448. // than maxResults, use the nextPageToken as a value for the query
  18449. // parameter pageToken in the next list request. Subsequent list
  18450. // requests will have their own nextPageToken to continue paging through
  18451. // the results.
  18452. NextPageToken string `json:"nextPageToken,omitempty"`
  18453. // SelfLink: [Output Only] Server-defined URL for this resource.
  18454. SelfLink string `json:"selfLink,omitempty"`
  18455. // Warning: [Output Only] Informational warning message.
  18456. Warning *RegionInstanceGroupManagerListWarning `json:"warning,omitempty"`
  18457. // ServerResponse contains the HTTP response code and headers from the
  18458. // server.
  18459. googleapi.ServerResponse `json:"-"`
  18460. // ForceSendFields is a list of field names (e.g. "Id") to
  18461. // unconditionally include in API requests. By default, fields with
  18462. // empty values are omitted from API requests. However, any non-pointer,
  18463. // non-interface field appearing in ForceSendFields will be sent to the
  18464. // server regardless of whether the field is empty or not. This may be
  18465. // used to include empty fields in Patch requests.
  18466. ForceSendFields []string `json:"-"`
  18467. // NullFields is a list of field names (e.g. "Id") to include in API
  18468. // requests with the JSON null value. By default, fields with empty
  18469. // values are omitted from API requests. However, any field with an
  18470. // empty value appearing in NullFields will be sent to the server as
  18471. // null. It is an error if a field in this list has a non-empty value.
  18472. // This may be used to include null fields in Patch requests.
  18473. NullFields []string `json:"-"`
  18474. }
  18475. func (s *RegionInstanceGroupManagerList) MarshalJSON() ([]byte, error) {
  18476. type NoMethod RegionInstanceGroupManagerList
  18477. raw := NoMethod(*s)
  18478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18479. }
  18480. // RegionInstanceGroupManagerListWarning: [Output Only] Informational
  18481. // warning message.
  18482. type RegionInstanceGroupManagerListWarning struct {
  18483. // Code: [Output Only] A warning code, if applicable. For example,
  18484. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18485. // the response.
  18486. //
  18487. // Possible values:
  18488. // "CLEANUP_FAILED"
  18489. // "DEPRECATED_RESOURCE_USED"
  18490. // "DEPRECATED_TYPE_USED"
  18491. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18492. // "EXPERIMENTAL_TYPE_USED"
  18493. // "EXTERNAL_API_WARNING"
  18494. // "FIELD_VALUE_OVERRIDEN"
  18495. // "INJECTED_KERNELS_DEPRECATED"
  18496. // "MISSING_TYPE_DEPENDENCY"
  18497. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18498. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18499. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18500. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18501. // "NEXT_HOP_NOT_RUNNING"
  18502. // "NOT_CRITICAL_ERROR"
  18503. // "NO_RESULTS_ON_PAGE"
  18504. // "REQUIRED_TOS_AGREEMENT"
  18505. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18506. // "RESOURCE_NOT_DELETED"
  18507. // "SCHEMA_VALIDATION_IGNORED"
  18508. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18509. // "UNDECLARED_PROPERTIES"
  18510. // "UNREACHABLE"
  18511. Code string `json:"code,omitempty"`
  18512. // Data: [Output Only] Metadata about this warning in key: value format.
  18513. // For example:
  18514. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18515. Data []*RegionInstanceGroupManagerListWarningData `json:"data,omitempty"`
  18516. // Message: [Output Only] A human-readable description of the warning
  18517. // code.
  18518. Message string `json:"message,omitempty"`
  18519. // ForceSendFields is a list of field names (e.g. "Code") to
  18520. // unconditionally include in API requests. By default, fields with
  18521. // empty values are omitted from API requests. However, any non-pointer,
  18522. // non-interface field appearing in ForceSendFields will be sent to the
  18523. // server regardless of whether the field is empty or not. This may be
  18524. // used to include empty fields in Patch requests.
  18525. ForceSendFields []string `json:"-"`
  18526. // NullFields is a list of field names (e.g. "Code") to include in API
  18527. // requests with the JSON null value. By default, fields with empty
  18528. // values are omitted from API requests. However, any field with an
  18529. // empty value appearing in NullFields will be sent to the server as
  18530. // null. It is an error if a field in this list has a non-empty value.
  18531. // This may be used to include null fields in Patch requests.
  18532. NullFields []string `json:"-"`
  18533. }
  18534. func (s *RegionInstanceGroupManagerListWarning) MarshalJSON() ([]byte, error) {
  18535. type NoMethod RegionInstanceGroupManagerListWarning
  18536. raw := NoMethod(*s)
  18537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18538. }
  18539. type RegionInstanceGroupManagerListWarningData struct {
  18540. // Key: [Output Only] A key that provides more detail on the warning
  18541. // being returned. For example, for warnings where there are no results
  18542. // in a list request for a particular zone, this key might be scope and
  18543. // the key value might be the zone name. Other examples might be a key
  18544. // indicating a deprecated resource and a suggested replacement, or a
  18545. // warning about invalid network settings (for example, if an instance
  18546. // attempts to perform IP forwarding but is not enabled for IP
  18547. // forwarding).
  18548. Key string `json:"key,omitempty"`
  18549. // Value: [Output Only] A warning data value corresponding to the key.
  18550. Value string `json:"value,omitempty"`
  18551. // ForceSendFields is a list of field names (e.g. "Key") to
  18552. // unconditionally include in API requests. By default, fields with
  18553. // empty values are omitted from API requests. However, any non-pointer,
  18554. // non-interface field appearing in ForceSendFields will be sent to the
  18555. // server regardless of whether the field is empty or not. This may be
  18556. // used to include empty fields in Patch requests.
  18557. ForceSendFields []string `json:"-"`
  18558. // NullFields is a list of field names (e.g. "Key") to include in API
  18559. // requests with the JSON null value. By default, fields with empty
  18560. // values are omitted from API requests. However, any field with an
  18561. // empty value appearing in NullFields will be sent to the server as
  18562. // null. It is an error if a field in this list has a non-empty value.
  18563. // This may be used to include null fields in Patch requests.
  18564. NullFields []string `json:"-"`
  18565. }
  18566. func (s *RegionInstanceGroupManagerListWarningData) MarshalJSON() ([]byte, error) {
  18567. type NoMethod RegionInstanceGroupManagerListWarningData
  18568. raw := NoMethod(*s)
  18569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18570. }
  18571. type RegionInstanceGroupManagersAbandonInstancesRequest struct {
  18572. // Instances: The URLs of one or more instances to abandon. This can be
  18573. // a full URL or a partial URL, such as
  18574. // zones/[ZONE]/instances/[INSTANCE_NAME].
  18575. Instances []string `json:"instances,omitempty"`
  18576. // ForceSendFields is a list of field names (e.g. "Instances") to
  18577. // unconditionally include in API requests. By default, fields with
  18578. // empty values are omitted from API requests. However, any non-pointer,
  18579. // non-interface field appearing in ForceSendFields will be sent to the
  18580. // server regardless of whether the field is empty or not. This may be
  18581. // used to include empty fields in Patch requests.
  18582. ForceSendFields []string `json:"-"`
  18583. // NullFields is a list of field names (e.g. "Instances") to include in
  18584. // API requests with the JSON null value. By default, fields with empty
  18585. // values are omitted from API requests. However, any field with an
  18586. // empty value appearing in NullFields will be sent to the server as
  18587. // null. It is an error if a field in this list has a non-empty value.
  18588. // This may be used to include null fields in Patch requests.
  18589. NullFields []string `json:"-"`
  18590. }
  18591. func (s *RegionInstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) {
  18592. type NoMethod RegionInstanceGroupManagersAbandonInstancesRequest
  18593. raw := NoMethod(*s)
  18594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18595. }
  18596. type RegionInstanceGroupManagersDeleteInstancesRequest struct {
  18597. // Instances: The URLs of one or more instances to delete. This can be a
  18598. // full URL or a partial URL, such as
  18599. // zones/[ZONE]/instances/[INSTANCE_NAME].
  18600. Instances []string `json:"instances,omitempty"`
  18601. // ForceSendFields is a list of field names (e.g. "Instances") to
  18602. // unconditionally include in API requests. By default, fields with
  18603. // empty values are omitted from API requests. However, any non-pointer,
  18604. // non-interface field appearing in ForceSendFields will be sent to the
  18605. // server regardless of whether the field is empty or not. This may be
  18606. // used to include empty fields in Patch requests.
  18607. ForceSendFields []string `json:"-"`
  18608. // NullFields is a list of field names (e.g. "Instances") to include in
  18609. // API requests with the JSON null value. By default, fields with empty
  18610. // values are omitted from API requests. However, any field with an
  18611. // empty value appearing in NullFields will be sent to the server as
  18612. // null. It is an error if a field in this list has a non-empty value.
  18613. // This may be used to include null fields in Patch requests.
  18614. NullFields []string `json:"-"`
  18615. }
  18616. func (s *RegionInstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) {
  18617. type NoMethod RegionInstanceGroupManagersDeleteInstancesRequest
  18618. raw := NoMethod(*s)
  18619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18620. }
  18621. type RegionInstanceGroupManagersListInstancesResponse struct {
  18622. // ManagedInstances: A list of managed instances.
  18623. ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"`
  18624. // ServerResponse contains the HTTP response code and headers from the
  18625. // server.
  18626. googleapi.ServerResponse `json:"-"`
  18627. // ForceSendFields is a list of field names (e.g. "ManagedInstances") to
  18628. // unconditionally include in API requests. By default, fields with
  18629. // empty values are omitted from API requests. However, any non-pointer,
  18630. // non-interface field appearing in ForceSendFields will be sent to the
  18631. // server regardless of whether the field is empty or not. This may be
  18632. // used to include empty fields in Patch requests.
  18633. ForceSendFields []string `json:"-"`
  18634. // NullFields is a list of field names (e.g. "ManagedInstances") to
  18635. // include in API requests with the JSON null value. By default, fields
  18636. // with empty values are omitted from API requests. However, any field
  18637. // with an empty value appearing in NullFields will be sent to the
  18638. // server as null. It is an error if a field in this list has a
  18639. // non-empty value. This may be used to include null fields in Patch
  18640. // requests.
  18641. NullFields []string `json:"-"`
  18642. }
  18643. func (s *RegionInstanceGroupManagersListInstancesResponse) MarshalJSON() ([]byte, error) {
  18644. type NoMethod RegionInstanceGroupManagersListInstancesResponse
  18645. raw := NoMethod(*s)
  18646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18647. }
  18648. type RegionInstanceGroupManagersRecreateRequest struct {
  18649. // Instances: The URLs of one or more instances to recreate. This can be
  18650. // a full URL or a partial URL, such as
  18651. // zones/[ZONE]/instances/[INSTANCE_NAME].
  18652. Instances []string `json:"instances,omitempty"`
  18653. // ForceSendFields is a list of field names (e.g. "Instances") to
  18654. // unconditionally include in API requests. By default, fields with
  18655. // empty values are omitted from API requests. However, any non-pointer,
  18656. // non-interface field appearing in ForceSendFields will be sent to the
  18657. // server regardless of whether the field is empty or not. This may be
  18658. // used to include empty fields in Patch requests.
  18659. ForceSendFields []string `json:"-"`
  18660. // NullFields is a list of field names (e.g. "Instances") to include in
  18661. // API requests with the JSON null value. By default, fields with empty
  18662. // values are omitted from API requests. However, any field with an
  18663. // empty value appearing in NullFields will be sent to the server as
  18664. // null. It is an error if a field in this list has a non-empty value.
  18665. // This may be used to include null fields in Patch requests.
  18666. NullFields []string `json:"-"`
  18667. }
  18668. func (s *RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error) {
  18669. type NoMethod RegionInstanceGroupManagersRecreateRequest
  18670. raw := NoMethod(*s)
  18671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18672. }
  18673. type RegionInstanceGroupManagersSetTargetPoolsRequest struct {
  18674. // Fingerprint: Fingerprint of the target pools information, which is a
  18675. // hash of the contents. This field is used for optimistic locking when
  18676. // you update the target pool entries. This field is optional.
  18677. Fingerprint string `json:"fingerprint,omitempty"`
  18678. // TargetPools: The URL of all TargetPool resources to which instances
  18679. // in the instanceGroup field are added. The target pools automatically
  18680. // apply to all of the instances in the managed instance group.
  18681. TargetPools []string `json:"targetPools,omitempty"`
  18682. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  18683. // unconditionally include in API requests. By default, fields with
  18684. // empty values are omitted from API requests. However, any non-pointer,
  18685. // non-interface field appearing in ForceSendFields will be sent to the
  18686. // server regardless of whether the field is empty or not. This may be
  18687. // used to include empty fields in Patch requests.
  18688. ForceSendFields []string `json:"-"`
  18689. // NullFields is a list of field names (e.g. "Fingerprint") to include
  18690. // in API requests with the JSON null value. By default, fields with
  18691. // empty values are omitted from API requests. However, any field with
  18692. // an empty value appearing in NullFields will be sent to the server as
  18693. // null. It is an error if a field in this list has a non-empty value.
  18694. // This may be used to include null fields in Patch requests.
  18695. NullFields []string `json:"-"`
  18696. }
  18697. func (s *RegionInstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) {
  18698. type NoMethod RegionInstanceGroupManagersSetTargetPoolsRequest
  18699. raw := NoMethod(*s)
  18700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18701. }
  18702. type RegionInstanceGroupManagersSetTemplateRequest struct {
  18703. // InstanceTemplate: URL of the InstanceTemplate resource from which all
  18704. // new instances will be created.
  18705. InstanceTemplate string `json:"instanceTemplate,omitempty"`
  18706. // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to
  18707. // unconditionally include in API requests. By default, fields with
  18708. // empty values are omitted from API requests. However, any non-pointer,
  18709. // non-interface field appearing in ForceSendFields will be sent to the
  18710. // server regardless of whether the field is empty or not. This may be
  18711. // used to include empty fields in Patch requests.
  18712. ForceSendFields []string `json:"-"`
  18713. // NullFields is a list of field names (e.g. "InstanceTemplate") to
  18714. // include in API requests with the JSON null value. By default, fields
  18715. // with empty values are omitted from API requests. However, any field
  18716. // with an empty value appearing in NullFields will be sent to the
  18717. // server as null. It is an error if a field in this list has a
  18718. // non-empty value. This may be used to include null fields in Patch
  18719. // requests.
  18720. NullFields []string `json:"-"`
  18721. }
  18722. func (s *RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, error) {
  18723. type NoMethod RegionInstanceGroupManagersSetTemplateRequest
  18724. raw := NoMethod(*s)
  18725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18726. }
  18727. type RegionInstanceGroupsListInstances struct {
  18728. // Id: [Output Only] Unique identifier for the resource; defined by the
  18729. // server.
  18730. Id string `json:"id,omitempty"`
  18731. // Items: A list of InstanceWithNamedPorts resources.
  18732. Items []*InstanceWithNamedPorts `json:"items,omitempty"`
  18733. // Kind: The resource type.
  18734. Kind string `json:"kind,omitempty"`
  18735. // NextPageToken: [Output Only] This token allows you to get the next
  18736. // page of results for list requests. If the number of results is larger
  18737. // than maxResults, use the nextPageToken as a value for the query
  18738. // parameter pageToken in the next list request. Subsequent list
  18739. // requests will have their own nextPageToken to continue paging through
  18740. // the results.
  18741. NextPageToken string `json:"nextPageToken,omitempty"`
  18742. // SelfLink: [Output Only] Server-defined URL for this resource.
  18743. SelfLink string `json:"selfLink,omitempty"`
  18744. // Warning: [Output Only] Informational warning message.
  18745. Warning *RegionInstanceGroupsListInstancesWarning `json:"warning,omitempty"`
  18746. // ServerResponse contains the HTTP response code and headers from the
  18747. // server.
  18748. googleapi.ServerResponse `json:"-"`
  18749. // ForceSendFields is a list of field names (e.g. "Id") to
  18750. // unconditionally include in API requests. By default, fields with
  18751. // empty values are omitted from API requests. However, any non-pointer,
  18752. // non-interface field appearing in ForceSendFields will be sent to the
  18753. // server regardless of whether the field is empty or not. This may be
  18754. // used to include empty fields in Patch requests.
  18755. ForceSendFields []string `json:"-"`
  18756. // NullFields is a list of field names (e.g. "Id") to include in API
  18757. // requests with the JSON null value. By default, fields with empty
  18758. // values are omitted from API requests. However, any field with an
  18759. // empty value appearing in NullFields will be sent to the server as
  18760. // null. It is an error if a field in this list has a non-empty value.
  18761. // This may be used to include null fields in Patch requests.
  18762. NullFields []string `json:"-"`
  18763. }
  18764. func (s *RegionInstanceGroupsListInstances) MarshalJSON() ([]byte, error) {
  18765. type NoMethod RegionInstanceGroupsListInstances
  18766. raw := NoMethod(*s)
  18767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18768. }
  18769. // RegionInstanceGroupsListInstancesWarning: [Output Only] Informational
  18770. // warning message.
  18771. type RegionInstanceGroupsListInstancesWarning struct {
  18772. // Code: [Output Only] A warning code, if applicable. For example,
  18773. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18774. // the response.
  18775. //
  18776. // Possible values:
  18777. // "CLEANUP_FAILED"
  18778. // "DEPRECATED_RESOURCE_USED"
  18779. // "DEPRECATED_TYPE_USED"
  18780. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18781. // "EXPERIMENTAL_TYPE_USED"
  18782. // "EXTERNAL_API_WARNING"
  18783. // "FIELD_VALUE_OVERRIDEN"
  18784. // "INJECTED_KERNELS_DEPRECATED"
  18785. // "MISSING_TYPE_DEPENDENCY"
  18786. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18787. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18788. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18789. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18790. // "NEXT_HOP_NOT_RUNNING"
  18791. // "NOT_CRITICAL_ERROR"
  18792. // "NO_RESULTS_ON_PAGE"
  18793. // "REQUIRED_TOS_AGREEMENT"
  18794. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18795. // "RESOURCE_NOT_DELETED"
  18796. // "SCHEMA_VALIDATION_IGNORED"
  18797. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18798. // "UNDECLARED_PROPERTIES"
  18799. // "UNREACHABLE"
  18800. Code string `json:"code,omitempty"`
  18801. // Data: [Output Only] Metadata about this warning in key: value format.
  18802. // For example:
  18803. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  18804. Data []*RegionInstanceGroupsListInstancesWarningData `json:"data,omitempty"`
  18805. // Message: [Output Only] A human-readable description of the warning
  18806. // code.
  18807. Message string `json:"message,omitempty"`
  18808. // ForceSendFields is a list of field names (e.g. "Code") to
  18809. // unconditionally include in API requests. By default, fields with
  18810. // empty values are omitted from API requests. However, any non-pointer,
  18811. // non-interface field appearing in ForceSendFields will be sent to the
  18812. // server regardless of whether the field is empty or not. This may be
  18813. // used to include empty fields in Patch requests.
  18814. ForceSendFields []string `json:"-"`
  18815. // NullFields is a list of field names (e.g. "Code") to include in API
  18816. // requests with the JSON null value. By default, fields with empty
  18817. // values are omitted from API requests. However, any field with an
  18818. // empty value appearing in NullFields will be sent to the server as
  18819. // null. It is an error if a field in this list has a non-empty value.
  18820. // This may be used to include null fields in Patch requests.
  18821. NullFields []string `json:"-"`
  18822. }
  18823. func (s *RegionInstanceGroupsListInstancesWarning) MarshalJSON() ([]byte, error) {
  18824. type NoMethod RegionInstanceGroupsListInstancesWarning
  18825. raw := NoMethod(*s)
  18826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18827. }
  18828. type RegionInstanceGroupsListInstancesWarningData struct {
  18829. // Key: [Output Only] A key that provides more detail on the warning
  18830. // being returned. For example, for warnings where there are no results
  18831. // in a list request for a particular zone, this key might be scope and
  18832. // the key value might be the zone name. Other examples might be a key
  18833. // indicating a deprecated resource and a suggested replacement, or a
  18834. // warning about invalid network settings (for example, if an instance
  18835. // attempts to perform IP forwarding but is not enabled for IP
  18836. // forwarding).
  18837. Key string `json:"key,omitempty"`
  18838. // Value: [Output Only] A warning data value corresponding to the key.
  18839. Value string `json:"value,omitempty"`
  18840. // ForceSendFields is a list of field names (e.g. "Key") to
  18841. // unconditionally include in API requests. By default, fields with
  18842. // empty values are omitted from API requests. However, any non-pointer,
  18843. // non-interface field appearing in ForceSendFields will be sent to the
  18844. // server regardless of whether the field is empty or not. This may be
  18845. // used to include empty fields in Patch requests.
  18846. ForceSendFields []string `json:"-"`
  18847. // NullFields is a list of field names (e.g. "Key") to include in API
  18848. // requests with the JSON null value. By default, fields with empty
  18849. // values are omitted from API requests. However, any field with an
  18850. // empty value appearing in NullFields will be sent to the server as
  18851. // null. It is an error if a field in this list has a non-empty value.
  18852. // This may be used to include null fields in Patch requests.
  18853. NullFields []string `json:"-"`
  18854. }
  18855. func (s *RegionInstanceGroupsListInstancesWarningData) MarshalJSON() ([]byte, error) {
  18856. type NoMethod RegionInstanceGroupsListInstancesWarningData
  18857. raw := NoMethod(*s)
  18858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18859. }
  18860. type RegionInstanceGroupsListInstancesRequest struct {
  18861. // InstanceState: Instances in which state should be returned. Valid
  18862. // options are: 'ALL', 'RUNNING'. By default, it lists all instances.
  18863. //
  18864. // Possible values:
  18865. // "ALL"
  18866. // "RUNNING"
  18867. InstanceState string `json:"instanceState,omitempty"`
  18868. // PortName: Name of port user is interested in. It is optional. If it
  18869. // is set, only information about this ports will be returned. If it is
  18870. // not set, all the named ports will be returned. Always lists all
  18871. // instances.
  18872. PortName string `json:"portName,omitempty"`
  18873. // ForceSendFields is a list of field names (e.g. "InstanceState") to
  18874. // unconditionally include in API requests. By default, fields with
  18875. // empty values are omitted from API requests. However, any non-pointer,
  18876. // non-interface field appearing in ForceSendFields will be sent to the
  18877. // server regardless of whether the field is empty or not. This may be
  18878. // used to include empty fields in Patch requests.
  18879. ForceSendFields []string `json:"-"`
  18880. // NullFields is a list of field names (e.g. "InstanceState") to include
  18881. // in API requests with the JSON null value. By default, fields with
  18882. // empty values are omitted from API requests. However, any field with
  18883. // an empty value appearing in NullFields will be sent to the server as
  18884. // null. It is an error if a field in this list has a non-empty value.
  18885. // This may be used to include null fields in Patch requests.
  18886. NullFields []string `json:"-"`
  18887. }
  18888. func (s *RegionInstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) {
  18889. type NoMethod RegionInstanceGroupsListInstancesRequest
  18890. raw := NoMethod(*s)
  18891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18892. }
  18893. type RegionInstanceGroupsSetNamedPortsRequest struct {
  18894. // Fingerprint: The fingerprint of the named ports information for this
  18895. // instance group. Use this optional property to prevent conflicts when
  18896. // multiple users change the named ports settings concurrently. Obtain
  18897. // the fingerprint with the instanceGroups.get method. Then, include the
  18898. // fingerprint in your request to ensure that you do not overwrite
  18899. // changes that were applied from another concurrent request.
  18900. Fingerprint string `json:"fingerprint,omitempty"`
  18901. // NamedPorts: The list of named ports to set for this instance group.
  18902. NamedPorts []*NamedPort `json:"namedPorts,omitempty"`
  18903. // ForceSendFields is a list of field names (e.g. "Fingerprint") 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. "Fingerprint") to include
  18911. // in API requests with the JSON null value. By default, fields with
  18912. // empty values are omitted from API requests. However, any field with
  18913. // an 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 *RegionInstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) {
  18919. type NoMethod RegionInstanceGroupsSetNamedPortsRequest
  18920. raw := NoMethod(*s)
  18921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18922. }
  18923. // RegionList: Contains a list of region resources.
  18924. type RegionList struct {
  18925. // Id: [Output Only] Unique identifier for the resource; defined by the
  18926. // server.
  18927. Id string `json:"id,omitempty"`
  18928. // Items: A list of Region resources.
  18929. Items []*Region `json:"items,omitempty"`
  18930. // Kind: [Output Only] Type of resource. Always compute#regionList for
  18931. // lists of regions.
  18932. Kind string `json:"kind,omitempty"`
  18933. // NextPageToken: [Output Only] This token allows you to get the next
  18934. // page of results for list requests. If the number of results is larger
  18935. // than maxResults, use the nextPageToken as a value for the query
  18936. // parameter pageToken in the next list request. Subsequent list
  18937. // requests will have their own nextPageToken to continue paging through
  18938. // the results.
  18939. NextPageToken string `json:"nextPageToken,omitempty"`
  18940. // SelfLink: [Output Only] Server-defined URL for this resource.
  18941. SelfLink string `json:"selfLink,omitempty"`
  18942. // Warning: [Output Only] Informational warning message.
  18943. Warning *RegionListWarning `json:"warning,omitempty"`
  18944. // ServerResponse contains the HTTP response code and headers from the
  18945. // server.
  18946. googleapi.ServerResponse `json:"-"`
  18947. // ForceSendFields is a list of field names (e.g. "Id") to
  18948. // unconditionally include in API requests. By default, fields with
  18949. // empty values are omitted from API requests. However, any non-pointer,
  18950. // non-interface field appearing in ForceSendFields will be sent to the
  18951. // server regardless of whether the field is empty or not. This may be
  18952. // used to include empty fields in Patch requests.
  18953. ForceSendFields []string `json:"-"`
  18954. // NullFields is a list of field names (e.g. "Id") to include in API
  18955. // requests with the JSON null value. By default, fields with empty
  18956. // values are omitted from API requests. However, any field with an
  18957. // empty value appearing in NullFields will be sent to the server as
  18958. // null. It is an error if a field in this list has a non-empty value.
  18959. // This may be used to include null fields in Patch requests.
  18960. NullFields []string `json:"-"`
  18961. }
  18962. func (s *RegionList) MarshalJSON() ([]byte, error) {
  18963. type NoMethod RegionList
  18964. raw := NoMethod(*s)
  18965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  18966. }
  18967. // RegionListWarning: [Output Only] Informational warning message.
  18968. type RegionListWarning struct {
  18969. // Code: [Output Only] A warning code, if applicable. For example,
  18970. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  18971. // the response.
  18972. //
  18973. // Possible values:
  18974. // "CLEANUP_FAILED"
  18975. // "DEPRECATED_RESOURCE_USED"
  18976. // "DEPRECATED_TYPE_USED"
  18977. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  18978. // "EXPERIMENTAL_TYPE_USED"
  18979. // "EXTERNAL_API_WARNING"
  18980. // "FIELD_VALUE_OVERRIDEN"
  18981. // "INJECTED_KERNELS_DEPRECATED"
  18982. // "MISSING_TYPE_DEPENDENCY"
  18983. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  18984. // "NEXT_HOP_CANNOT_IP_FORWARD"
  18985. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  18986. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  18987. // "NEXT_HOP_NOT_RUNNING"
  18988. // "NOT_CRITICAL_ERROR"
  18989. // "NO_RESULTS_ON_PAGE"
  18990. // "REQUIRED_TOS_AGREEMENT"
  18991. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  18992. // "RESOURCE_NOT_DELETED"
  18993. // "SCHEMA_VALIDATION_IGNORED"
  18994. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  18995. // "UNDECLARED_PROPERTIES"
  18996. // "UNREACHABLE"
  18997. Code string `json:"code,omitempty"`
  18998. // Data: [Output Only] Metadata about this warning in key: value format.
  18999. // For example:
  19000. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19001. Data []*RegionListWarningData `json:"data,omitempty"`
  19002. // Message: [Output Only] A human-readable description of the warning
  19003. // code.
  19004. Message string `json:"message,omitempty"`
  19005. // ForceSendFields is a list of field names (e.g. "Code") to
  19006. // unconditionally include in API requests. By default, fields with
  19007. // empty values are omitted from API requests. However, any non-pointer,
  19008. // non-interface field appearing in ForceSendFields will be sent to the
  19009. // server regardless of whether the field is empty or not. This may be
  19010. // used to include empty fields in Patch requests.
  19011. ForceSendFields []string `json:"-"`
  19012. // NullFields is a list of field names (e.g. "Code") to include in API
  19013. // requests with the JSON null value. By default, fields with empty
  19014. // values are omitted from API requests. However, any field with an
  19015. // empty value appearing in NullFields will be sent to the server as
  19016. // null. It is an error if a field in this list has a non-empty value.
  19017. // This may be used to include null fields in Patch requests.
  19018. NullFields []string `json:"-"`
  19019. }
  19020. func (s *RegionListWarning) MarshalJSON() ([]byte, error) {
  19021. type NoMethod RegionListWarning
  19022. raw := NoMethod(*s)
  19023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19024. }
  19025. type RegionListWarningData struct {
  19026. // Key: [Output Only] A key that provides more detail on the warning
  19027. // being returned. For example, for warnings where there are no results
  19028. // in a list request for a particular zone, this key might be scope and
  19029. // the key value might be the zone name. Other examples might be a key
  19030. // indicating a deprecated resource and a suggested replacement, or a
  19031. // warning about invalid network settings (for example, if an instance
  19032. // attempts to perform IP forwarding but is not enabled for IP
  19033. // forwarding).
  19034. Key string `json:"key,omitempty"`
  19035. // Value: [Output Only] A warning data value corresponding to the key.
  19036. Value string `json:"value,omitempty"`
  19037. // ForceSendFields is a list of field names (e.g. "Key") to
  19038. // unconditionally include in API requests. By default, fields with
  19039. // empty values are omitted from API requests. However, any non-pointer,
  19040. // non-interface field appearing in ForceSendFields will be sent to the
  19041. // server regardless of whether the field is empty or not. This may be
  19042. // used to include empty fields in Patch requests.
  19043. ForceSendFields []string `json:"-"`
  19044. // NullFields is a list of field names (e.g. "Key") to include in API
  19045. // requests with the JSON null value. By default, fields with empty
  19046. // values are omitted from API requests. However, any field with an
  19047. // empty value appearing in NullFields will be sent to the server as
  19048. // null. It is an error if a field in this list has a non-empty value.
  19049. // This may be used to include null fields in Patch requests.
  19050. NullFields []string `json:"-"`
  19051. }
  19052. func (s *RegionListWarningData) MarshalJSON() ([]byte, error) {
  19053. type NoMethod RegionListWarningData
  19054. raw := NoMethod(*s)
  19055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19056. }
  19057. type RegionSetLabelsRequest struct {
  19058. // LabelFingerprint: The fingerprint of the previous set of labels for
  19059. // this resource, used to detect conflicts. The fingerprint is initially
  19060. // generated by Compute Engine and changes after every request to modify
  19061. // or update labels. You must always provide an up-to-date fingerprint
  19062. // hash in order to update or change labels. Make a get() request to the
  19063. // resource to get the latest fingerprint.
  19064. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  19065. // Labels: The labels to set for this resource.
  19066. Labels map[string]string `json:"labels,omitempty"`
  19067. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  19068. // unconditionally include in API requests. By default, fields with
  19069. // empty values are omitted from API requests. However, any non-pointer,
  19070. // non-interface field appearing in ForceSendFields will be sent to the
  19071. // server regardless of whether the field is empty or not. This may be
  19072. // used to include empty fields in Patch requests.
  19073. ForceSendFields []string `json:"-"`
  19074. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  19075. // include in API requests with the JSON null value. By default, fields
  19076. // with empty values are omitted from API requests. However, any field
  19077. // with an empty value appearing in NullFields will be sent to the
  19078. // server as null. It is an error if a field in this list has a
  19079. // non-empty value. This may be used to include null fields in Patch
  19080. // requests.
  19081. NullFields []string `json:"-"`
  19082. }
  19083. func (s *RegionSetLabelsRequest) MarshalJSON() ([]byte, error) {
  19084. type NoMethod RegionSetLabelsRequest
  19085. raw := NoMethod(*s)
  19086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19087. }
  19088. type RegionSetPolicyRequest struct {
  19089. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  19090. // Deprecated. Use 'policy' to specify bindings.
  19091. Bindings []*Binding `json:"bindings,omitempty"`
  19092. // Etag: Flatten Policy to create a backward compatible wire-format.
  19093. // Deprecated. Use 'policy' to specify the etag.
  19094. Etag string `json:"etag,omitempty"`
  19095. // Policy: REQUIRED: The complete policy to be applied to the
  19096. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  19097. // empty policy is in general a valid policy but certain services (like
  19098. // Projects) might reject them.
  19099. Policy *Policy `json:"policy,omitempty"`
  19100. // ForceSendFields is a list of field names (e.g. "Bindings") to
  19101. // unconditionally include in API requests. By default, fields with
  19102. // empty values are omitted from API requests. However, any non-pointer,
  19103. // non-interface field appearing in ForceSendFields will be sent to the
  19104. // server regardless of whether the field is empty or not. This may be
  19105. // used to include empty fields in Patch requests.
  19106. ForceSendFields []string `json:"-"`
  19107. // NullFields is a list of field names (e.g. "Bindings") to include in
  19108. // API requests with the JSON null value. By default, fields with empty
  19109. // values are omitted from API requests. However, any field with an
  19110. // empty value appearing in NullFields will be sent to the server as
  19111. // null. It is an error if a field in this list has a non-empty value.
  19112. // This may be used to include null fields in Patch requests.
  19113. NullFields []string `json:"-"`
  19114. }
  19115. func (s *RegionSetPolicyRequest) MarshalJSON() ([]byte, error) {
  19116. type NoMethod RegionSetPolicyRequest
  19117. raw := NoMethod(*s)
  19118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19119. }
  19120. // ResourceCommitment: Commitment for a particular resource (a
  19121. // Commitment is composed of one or more of these).
  19122. type ResourceCommitment struct {
  19123. // Amount: The amount of the resource purchased (in a type-dependent
  19124. // unit, such as bytes). For vCPUs, this can just be an integer. For
  19125. // memory, this must be provided in MB. Memory must be a multiple of 256
  19126. // MB, with up to 6.5GB of memory per every vCPU.
  19127. Amount int64 `json:"amount,omitempty,string"`
  19128. // Type: Type of resource for which this commitment applies. Possible
  19129. // values are VCPU and MEMORY
  19130. //
  19131. // Possible values:
  19132. // "MEMORY"
  19133. // "UNSPECIFIED"
  19134. // "VCPU"
  19135. Type string `json:"type,omitempty"`
  19136. // ForceSendFields is a list of field names (e.g. "Amount") to
  19137. // unconditionally include in API requests. By default, fields with
  19138. // empty values are omitted from API requests. However, any non-pointer,
  19139. // non-interface field appearing in ForceSendFields will be sent to the
  19140. // server regardless of whether the field is empty or not. This may be
  19141. // used to include empty fields in Patch requests.
  19142. ForceSendFields []string `json:"-"`
  19143. // NullFields is a list of field names (e.g. "Amount") to include in API
  19144. // requests with the JSON null value. By default, fields with empty
  19145. // values are omitted from API requests. However, any field with an
  19146. // empty value appearing in NullFields will be sent to the server as
  19147. // null. It is an error if a field in this list has a non-empty value.
  19148. // This may be used to include null fields in Patch requests.
  19149. NullFields []string `json:"-"`
  19150. }
  19151. func (s *ResourceCommitment) MarshalJSON() ([]byte, error) {
  19152. type NoMethod ResourceCommitment
  19153. raw := NoMethod(*s)
  19154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19155. }
  19156. type ResourceGroupReference struct {
  19157. // Group: A URI referencing one of the instance groups or network
  19158. // endpoint groups listed in the backend service.
  19159. Group string `json:"group,omitempty"`
  19160. // ForceSendFields is a list of field names (e.g. "Group") to
  19161. // unconditionally include in API requests. By default, fields with
  19162. // empty values are omitted from API requests. However, any non-pointer,
  19163. // non-interface field appearing in ForceSendFields will be sent to the
  19164. // server regardless of whether the field is empty or not. This may be
  19165. // used to include empty fields in Patch requests.
  19166. ForceSendFields []string `json:"-"`
  19167. // NullFields is a list of field names (e.g. "Group") to include in API
  19168. // requests with the JSON null value. By default, fields with empty
  19169. // values are omitted from API requests. However, any field with an
  19170. // empty value appearing in NullFields will be sent to the server as
  19171. // null. It is an error if a field in this list has a non-empty value.
  19172. // This may be used to include null fields in Patch requests.
  19173. NullFields []string `json:"-"`
  19174. }
  19175. func (s *ResourceGroupReference) MarshalJSON() ([]byte, error) {
  19176. type NoMethod ResourceGroupReference
  19177. raw := NoMethod(*s)
  19178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19179. }
  19180. // Route: Represents a Route resource. A route specifies how certain
  19181. // packets should be handled by the network. Routes are associated with
  19182. // instances by tags and the set of routes for a particular instance is
  19183. // called its routing table.
  19184. //
  19185. // For each packet leaving an instance, the system searches that
  19186. // instance's routing table for a single best matching route. Routes
  19187. // match packets by destination IP address, preferring smaller or more
  19188. // specific ranges over larger ones. If there is a tie, the system
  19189. // selects the route with the smallest priority value. If there is still
  19190. // a tie, it uses the layer three and four packet headers to select just
  19191. // one of the remaining matching routes. The packet is then forwarded as
  19192. // specified by the nextHop field of the winning route - either to
  19193. // another instance destination, an instance gateway, or a Google
  19194. // Compute Engine-operated gateway.
  19195. //
  19196. // Packets that do not match any route in the sending instance's routing
  19197. // table are dropped. (== resource_for beta.routes ==) (== resource_for
  19198. // v1.routes ==)
  19199. type Route struct {
  19200. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19201. // format.
  19202. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19203. // Description: An optional description of this resource. Provide this
  19204. // property when you create the resource.
  19205. Description string `json:"description,omitempty"`
  19206. // DestRange: The destination range of outgoing packets that this route
  19207. // applies to. Only IPv4 is supported.
  19208. DestRange string `json:"destRange,omitempty"`
  19209. // Id: [Output Only] The unique identifier for the resource. This
  19210. // identifier is defined by the server.
  19211. Id uint64 `json:"id,omitempty,string"`
  19212. // Kind: [Output Only] Type of this resource. Always compute#routes for
  19213. // Route resources.
  19214. Kind string `json:"kind,omitempty"`
  19215. // Name: Name of the resource. Provided by the client when the resource
  19216. // is created. The name must be 1-63 characters long, and comply with
  19217. // RFC1035. Specifically, the name must be 1-63 characters long and
  19218. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19219. // the first character must be a lowercase letter, and all following
  19220. // characters must be a dash, lowercase letter, or digit, except the
  19221. // last character, which cannot be a dash.
  19222. Name string `json:"name,omitempty"`
  19223. // Network: Fully-qualified URL of the network that this route applies
  19224. // to.
  19225. Network string `json:"network,omitempty"`
  19226. // NextHopGateway: The URL to a gateway that should handle matching
  19227. // packets. You can only specify the internet gateway using a full or
  19228. // partial valid URL:
  19229. // projects/<project-id>/global/gateways/default-internet-gateway
  19230. NextHopGateway string `json:"nextHopGateway,omitempty"`
  19231. // NextHopInstance: The URL to an instance that should handle matching
  19232. // packets. You can specify this as a full or partial URL. For
  19233. // example:
  19234. // https://www.googleapis.com/compute/v1/projects/project/zones/
  19235. // zone/instances/
  19236. NextHopInstance string `json:"nextHopInstance,omitempty"`
  19237. // NextHopIp: The network IP address of an instance that should handle
  19238. // matching packets. Only IPv4 is supported.
  19239. NextHopIp string `json:"nextHopIp,omitempty"`
  19240. // NextHopNetwork: The URL of the local network if it should handle
  19241. // matching packets.
  19242. NextHopNetwork string `json:"nextHopNetwork,omitempty"`
  19243. // NextHopPeering: [Output Only] The network peering name that should
  19244. // handle matching packets, which should conform to RFC1035.
  19245. NextHopPeering string `json:"nextHopPeering,omitempty"`
  19246. // NextHopVpnTunnel: The URL to a VpnTunnel that should handle matching
  19247. // packets.
  19248. NextHopVpnTunnel string `json:"nextHopVpnTunnel,omitempty"`
  19249. // Priority: The priority of this route. Priority is used to break ties
  19250. // in cases where there is more than one matching route of equal prefix
  19251. // length. In the case of two routes with equal prefix length, the one
  19252. // with the lowest-numbered priority value wins. Default value is 1000.
  19253. // Valid range is 0 through 65535.
  19254. Priority int64 `json:"priority,omitempty"`
  19255. // SelfLink: [Output Only] Server-defined fully-qualified URL for this
  19256. // resource.
  19257. SelfLink string `json:"selfLink,omitempty"`
  19258. // Tags: A list of instance tags to which this route applies.
  19259. Tags []string `json:"tags,omitempty"`
  19260. // Warnings: [Output Only] If potential misconfigurations are detected
  19261. // for this route, this field will be populated with warning messages.
  19262. Warnings []*RouteWarnings `json:"warnings,omitempty"`
  19263. // ServerResponse contains the HTTP response code and headers from the
  19264. // server.
  19265. googleapi.ServerResponse `json:"-"`
  19266. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  19267. // to unconditionally include in API requests. By default, fields with
  19268. // empty values are omitted from API requests. However, any non-pointer,
  19269. // non-interface field appearing in ForceSendFields will be sent to the
  19270. // server regardless of whether the field is empty or not. This may be
  19271. // used to include empty fields in Patch requests.
  19272. ForceSendFields []string `json:"-"`
  19273. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  19274. // include in API requests with the JSON null value. By default, fields
  19275. // with empty values are omitted from API requests. However, any field
  19276. // with an empty value appearing in NullFields will be sent to the
  19277. // server as null. It is an error if a field in this list has a
  19278. // non-empty value. This may be used to include null fields in Patch
  19279. // requests.
  19280. NullFields []string `json:"-"`
  19281. }
  19282. func (s *Route) MarshalJSON() ([]byte, error) {
  19283. type NoMethod Route
  19284. raw := NoMethod(*s)
  19285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19286. }
  19287. type RouteWarnings struct {
  19288. // Code: [Output Only] A warning code, if applicable. For example,
  19289. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19290. // the response.
  19291. //
  19292. // Possible values:
  19293. // "CLEANUP_FAILED"
  19294. // "DEPRECATED_RESOURCE_USED"
  19295. // "DEPRECATED_TYPE_USED"
  19296. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19297. // "EXPERIMENTAL_TYPE_USED"
  19298. // "EXTERNAL_API_WARNING"
  19299. // "FIELD_VALUE_OVERRIDEN"
  19300. // "INJECTED_KERNELS_DEPRECATED"
  19301. // "MISSING_TYPE_DEPENDENCY"
  19302. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19303. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19304. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19305. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19306. // "NEXT_HOP_NOT_RUNNING"
  19307. // "NOT_CRITICAL_ERROR"
  19308. // "NO_RESULTS_ON_PAGE"
  19309. // "REQUIRED_TOS_AGREEMENT"
  19310. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19311. // "RESOURCE_NOT_DELETED"
  19312. // "SCHEMA_VALIDATION_IGNORED"
  19313. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19314. // "UNDECLARED_PROPERTIES"
  19315. // "UNREACHABLE"
  19316. Code string `json:"code,omitempty"`
  19317. // Data: [Output Only] Metadata about this warning in key: value format.
  19318. // For example:
  19319. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19320. Data []*RouteWarningsData `json:"data,omitempty"`
  19321. // Message: [Output Only] A human-readable description of the warning
  19322. // code.
  19323. Message string `json:"message,omitempty"`
  19324. // ForceSendFields is a list of field names (e.g. "Code") to
  19325. // unconditionally include in API requests. By default, fields with
  19326. // empty values are omitted from API requests. However, any non-pointer,
  19327. // non-interface field appearing in ForceSendFields will be sent to the
  19328. // server regardless of whether the field is empty or not. This may be
  19329. // used to include empty fields in Patch requests.
  19330. ForceSendFields []string `json:"-"`
  19331. // NullFields is a list of field names (e.g. "Code") to include in API
  19332. // requests with the JSON null value. By default, fields with empty
  19333. // values are omitted from API requests. However, any field with an
  19334. // empty value appearing in NullFields will be sent to the server as
  19335. // null. It is an error if a field in this list has a non-empty value.
  19336. // This may be used to include null fields in Patch requests.
  19337. NullFields []string `json:"-"`
  19338. }
  19339. func (s *RouteWarnings) MarshalJSON() ([]byte, error) {
  19340. type NoMethod RouteWarnings
  19341. raw := NoMethod(*s)
  19342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19343. }
  19344. type RouteWarningsData struct {
  19345. // Key: [Output Only] A key that provides more detail on the warning
  19346. // being returned. For example, for warnings where there are no results
  19347. // in a list request for a particular zone, this key might be scope and
  19348. // the key value might be the zone name. Other examples might be a key
  19349. // indicating a deprecated resource and a suggested replacement, or a
  19350. // warning about invalid network settings (for example, if an instance
  19351. // attempts to perform IP forwarding but is not enabled for IP
  19352. // forwarding).
  19353. Key string `json:"key,omitempty"`
  19354. // Value: [Output Only] A warning data value corresponding to the key.
  19355. Value string `json:"value,omitempty"`
  19356. // ForceSendFields is a list of field names (e.g. "Key") to
  19357. // unconditionally include in API requests. By default, fields with
  19358. // empty values are omitted from API requests. However, any non-pointer,
  19359. // non-interface field appearing in ForceSendFields will be sent to the
  19360. // server regardless of whether the field is empty or not. This may be
  19361. // used to include empty fields in Patch requests.
  19362. ForceSendFields []string `json:"-"`
  19363. // NullFields is a list of field names (e.g. "Key") to include in API
  19364. // requests with the JSON null value. By default, fields with empty
  19365. // values are omitted from API requests. However, any field with an
  19366. // empty value appearing in NullFields will be sent to the server as
  19367. // null. It is an error if a field in this list has a non-empty value.
  19368. // This may be used to include null fields in Patch requests.
  19369. NullFields []string `json:"-"`
  19370. }
  19371. func (s *RouteWarningsData) MarshalJSON() ([]byte, error) {
  19372. type NoMethod RouteWarningsData
  19373. raw := NoMethod(*s)
  19374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19375. }
  19376. // RouteList: Contains a list of Route resources.
  19377. type RouteList struct {
  19378. // Id: [Output Only] Unique identifier for the resource; defined by the
  19379. // server.
  19380. Id string `json:"id,omitempty"`
  19381. // Items: A list of Route resources.
  19382. Items []*Route `json:"items,omitempty"`
  19383. // Kind: Type of resource.
  19384. Kind string `json:"kind,omitempty"`
  19385. // NextPageToken: [Output Only] This token allows you to get the next
  19386. // page of results for list requests. If the number of results is larger
  19387. // than maxResults, use the nextPageToken as a value for the query
  19388. // parameter pageToken in the next list request. Subsequent list
  19389. // requests will have their own nextPageToken to continue paging through
  19390. // the results.
  19391. NextPageToken string `json:"nextPageToken,omitempty"`
  19392. // SelfLink: [Output Only] Server-defined URL for this resource.
  19393. SelfLink string `json:"selfLink,omitempty"`
  19394. // Warning: [Output Only] Informational warning message.
  19395. Warning *RouteListWarning `json:"warning,omitempty"`
  19396. // ServerResponse contains the HTTP response code and headers from the
  19397. // server.
  19398. googleapi.ServerResponse `json:"-"`
  19399. // ForceSendFields is a list of field names (e.g. "Id") to
  19400. // unconditionally include in API requests. By default, fields with
  19401. // empty values are omitted from API requests. However, any non-pointer,
  19402. // non-interface field appearing in ForceSendFields will be sent to the
  19403. // server regardless of whether the field is empty or not. This may be
  19404. // used to include empty fields in Patch requests.
  19405. ForceSendFields []string `json:"-"`
  19406. // NullFields is a list of field names (e.g. "Id") to include in API
  19407. // requests with the JSON null value. By default, fields with empty
  19408. // values are omitted from API requests. However, any field with an
  19409. // empty value appearing in NullFields will be sent to the server as
  19410. // null. It is an error if a field in this list has a non-empty value.
  19411. // This may be used to include null fields in Patch requests.
  19412. NullFields []string `json:"-"`
  19413. }
  19414. func (s *RouteList) MarshalJSON() ([]byte, error) {
  19415. type NoMethod RouteList
  19416. raw := NoMethod(*s)
  19417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19418. }
  19419. // RouteListWarning: [Output Only] Informational warning message.
  19420. type RouteListWarning struct {
  19421. // Code: [Output Only] A warning code, if applicable. For example,
  19422. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19423. // the response.
  19424. //
  19425. // Possible values:
  19426. // "CLEANUP_FAILED"
  19427. // "DEPRECATED_RESOURCE_USED"
  19428. // "DEPRECATED_TYPE_USED"
  19429. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19430. // "EXPERIMENTAL_TYPE_USED"
  19431. // "EXTERNAL_API_WARNING"
  19432. // "FIELD_VALUE_OVERRIDEN"
  19433. // "INJECTED_KERNELS_DEPRECATED"
  19434. // "MISSING_TYPE_DEPENDENCY"
  19435. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19436. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19437. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19438. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19439. // "NEXT_HOP_NOT_RUNNING"
  19440. // "NOT_CRITICAL_ERROR"
  19441. // "NO_RESULTS_ON_PAGE"
  19442. // "REQUIRED_TOS_AGREEMENT"
  19443. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19444. // "RESOURCE_NOT_DELETED"
  19445. // "SCHEMA_VALIDATION_IGNORED"
  19446. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19447. // "UNDECLARED_PROPERTIES"
  19448. // "UNREACHABLE"
  19449. Code string `json:"code,omitempty"`
  19450. // Data: [Output Only] Metadata about this warning in key: value format.
  19451. // For example:
  19452. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19453. Data []*RouteListWarningData `json:"data,omitempty"`
  19454. // Message: [Output Only] A human-readable description of the warning
  19455. // code.
  19456. Message string `json:"message,omitempty"`
  19457. // ForceSendFields is a list of field names (e.g. "Code") to
  19458. // unconditionally include in API requests. By default, fields with
  19459. // empty values are omitted from API requests. However, any non-pointer,
  19460. // non-interface field appearing in ForceSendFields will be sent to the
  19461. // server regardless of whether the field is empty or not. This may be
  19462. // used to include empty fields in Patch requests.
  19463. ForceSendFields []string `json:"-"`
  19464. // NullFields is a list of field names (e.g. "Code") to include in API
  19465. // requests with the JSON null value. By default, fields with empty
  19466. // values are omitted from API requests. However, any field with an
  19467. // empty value appearing in NullFields will be sent to the server as
  19468. // null. It is an error if a field in this list has a non-empty value.
  19469. // This may be used to include null fields in Patch requests.
  19470. NullFields []string `json:"-"`
  19471. }
  19472. func (s *RouteListWarning) MarshalJSON() ([]byte, error) {
  19473. type NoMethod RouteListWarning
  19474. raw := NoMethod(*s)
  19475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19476. }
  19477. type RouteListWarningData struct {
  19478. // Key: [Output Only] A key that provides more detail on the warning
  19479. // being returned. For example, for warnings where there are no results
  19480. // in a list request for a particular zone, this key might be scope and
  19481. // the key value might be the zone name. Other examples might be a key
  19482. // indicating a deprecated resource and a suggested replacement, or a
  19483. // warning about invalid network settings (for example, if an instance
  19484. // attempts to perform IP forwarding but is not enabled for IP
  19485. // forwarding).
  19486. Key string `json:"key,omitempty"`
  19487. // Value: [Output Only] A warning data value corresponding to the key.
  19488. Value string `json:"value,omitempty"`
  19489. // ForceSendFields is a list of field names (e.g. "Key") to
  19490. // unconditionally include in API requests. By default, fields with
  19491. // empty values are omitted from API requests. However, any non-pointer,
  19492. // non-interface field appearing in ForceSendFields will be sent to the
  19493. // server regardless of whether the field is empty or not. This may be
  19494. // used to include empty fields in Patch requests.
  19495. ForceSendFields []string `json:"-"`
  19496. // NullFields is a list of field names (e.g. "Key") to include in API
  19497. // requests with the JSON null value. By default, fields with empty
  19498. // values are omitted from API requests. However, any field with an
  19499. // empty value appearing in NullFields will be sent to the server as
  19500. // null. It is an error if a field in this list has a non-empty value.
  19501. // This may be used to include null fields in Patch requests.
  19502. NullFields []string `json:"-"`
  19503. }
  19504. func (s *RouteListWarningData) MarshalJSON() ([]byte, error) {
  19505. type NoMethod RouteListWarningData
  19506. raw := NoMethod(*s)
  19507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19508. }
  19509. // Router: Router resource.
  19510. type Router struct {
  19511. // Bgp: BGP information specific to this router.
  19512. Bgp *RouterBgp `json:"bgp,omitempty"`
  19513. // BgpPeers: BGP information that must be configured into the routing
  19514. // stack to establish BGP peering. This information must specify the
  19515. // peer ASN and either the interface name, IP address, or peer IP
  19516. // address. Please refer to RFC4273.
  19517. BgpPeers []*RouterBgpPeer `json:"bgpPeers,omitempty"`
  19518. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  19519. // format.
  19520. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  19521. // Description: An optional description of this resource. Provide this
  19522. // property when you create the resource.
  19523. Description string `json:"description,omitempty"`
  19524. // Id: [Output Only] The unique identifier for the resource. This
  19525. // identifier is defined by the server.
  19526. Id uint64 `json:"id,omitempty,string"`
  19527. // Interfaces: Router interfaces. Each interface requires either one
  19528. // linked resource, (for example, linkedVpnTunnel), or IP address and IP
  19529. // address range (for example, ipRange), or both.
  19530. Interfaces []*RouterInterface `json:"interfaces,omitempty"`
  19531. // Kind: [Output Only] Type of resource. Always compute#router for
  19532. // routers.
  19533. Kind string `json:"kind,omitempty"`
  19534. // Name: Name of the resource. Provided by the client when the resource
  19535. // is created. The name must be 1-63 characters long, and comply with
  19536. // RFC1035. Specifically, the name must be 1-63 characters long and
  19537. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  19538. // the first character must be a lowercase letter, and all following
  19539. // characters must be a dash, lowercase letter, or digit, except the
  19540. // last character, which cannot be a dash.
  19541. Name string `json:"name,omitempty"`
  19542. // Nats: A list of NAT services created in this router.
  19543. Nats []*RouterNat `json:"nats,omitempty"`
  19544. // Network: URI of the network to which this router belongs.
  19545. Network string `json:"network,omitempty"`
  19546. // Region: [Output Only] URI of the region where the router resides. You
  19547. // must specify this field as part of the HTTP request URL. It is not
  19548. // settable as a field in the request body.
  19549. Region string `json:"region,omitempty"`
  19550. // SelfLink: [Output Only] Server-defined URL for the resource.
  19551. SelfLink string `json:"selfLink,omitempty"`
  19552. // ServerResponse contains the HTTP response code and headers from the
  19553. // server.
  19554. googleapi.ServerResponse `json:"-"`
  19555. // ForceSendFields is a list of field names (e.g. "Bgp") to
  19556. // unconditionally include in API requests. By default, fields with
  19557. // empty values are omitted from API requests. However, any non-pointer,
  19558. // non-interface field appearing in ForceSendFields will be sent to the
  19559. // server regardless of whether the field is empty or not. This may be
  19560. // used to include empty fields in Patch requests.
  19561. ForceSendFields []string `json:"-"`
  19562. // NullFields is a list of field names (e.g. "Bgp") to include in API
  19563. // requests with the JSON null value. By default, fields with empty
  19564. // values are omitted from API requests. However, any field with an
  19565. // empty value appearing in NullFields will be sent to the server as
  19566. // null. It is an error if a field in this list has a non-empty value.
  19567. // This may be used to include null fields in Patch requests.
  19568. NullFields []string `json:"-"`
  19569. }
  19570. func (s *Router) MarshalJSON() ([]byte, error) {
  19571. type NoMethod Router
  19572. raw := NoMethod(*s)
  19573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19574. }
  19575. // RouterAdvertisedIpRange: Description-tagged IP ranges for the router
  19576. // to advertise.
  19577. type RouterAdvertisedIpRange struct {
  19578. // Description: User-specified description for the IP range.
  19579. Description string `json:"description,omitempty"`
  19580. // Range: The IP range to advertise. The value must be a CIDR-formatted
  19581. // string.
  19582. Range string `json:"range,omitempty"`
  19583. // ForceSendFields is a list of field names (e.g. "Description") to
  19584. // unconditionally include in API requests. By default, fields with
  19585. // empty values are omitted from API requests. However, any non-pointer,
  19586. // non-interface field appearing in ForceSendFields will be sent to the
  19587. // server regardless of whether the field is empty or not. This may be
  19588. // used to include empty fields in Patch requests.
  19589. ForceSendFields []string `json:"-"`
  19590. // NullFields is a list of field names (e.g. "Description") to include
  19591. // in API requests with the JSON null value. By default, fields with
  19592. // empty values are omitted from API requests. However, any field with
  19593. // an empty value appearing in NullFields will be sent to the server as
  19594. // null. It is an error if a field in this list has a non-empty value.
  19595. // This may be used to include null fields in Patch requests.
  19596. NullFields []string `json:"-"`
  19597. }
  19598. func (s *RouterAdvertisedIpRange) MarshalJSON() ([]byte, error) {
  19599. type NoMethod RouterAdvertisedIpRange
  19600. raw := NoMethod(*s)
  19601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19602. }
  19603. // RouterAggregatedList: Contains a list of routers.
  19604. type RouterAggregatedList struct {
  19605. // Id: [Output Only] Unique identifier for the resource; defined by the
  19606. // server.
  19607. Id string `json:"id,omitempty"`
  19608. // Items: A list of Router resources.
  19609. Items map[string]RoutersScopedList `json:"items,omitempty"`
  19610. // Kind: Type of resource.
  19611. Kind string `json:"kind,omitempty"`
  19612. // NextPageToken: [Output Only] This token allows you to get the next
  19613. // page of results for list requests. If the number of results is larger
  19614. // than maxResults, use the nextPageToken as a value for the query
  19615. // parameter pageToken in the next list request. Subsequent list
  19616. // requests will have their own nextPageToken to continue paging through
  19617. // the results.
  19618. NextPageToken string `json:"nextPageToken,omitempty"`
  19619. // SelfLink: [Output Only] Server-defined URL for this resource.
  19620. SelfLink string `json:"selfLink,omitempty"`
  19621. // Warning: [Output Only] Informational warning message.
  19622. Warning *RouterAggregatedListWarning `json:"warning,omitempty"`
  19623. // ServerResponse contains the HTTP response code and headers from the
  19624. // server.
  19625. googleapi.ServerResponse `json:"-"`
  19626. // ForceSendFields is a list of field names (e.g. "Id") to
  19627. // unconditionally include in API requests. By default, fields with
  19628. // empty values are omitted from API requests. However, any non-pointer,
  19629. // non-interface field appearing in ForceSendFields will be sent to the
  19630. // server regardless of whether the field is empty or not. This may be
  19631. // used to include empty fields in Patch requests.
  19632. ForceSendFields []string `json:"-"`
  19633. // NullFields is a list of field names (e.g. "Id") to include in API
  19634. // requests with the JSON null value. By default, fields with empty
  19635. // values are omitted from API requests. However, any field with an
  19636. // empty value appearing in NullFields will be sent to the server as
  19637. // null. It is an error if a field in this list has a non-empty value.
  19638. // This may be used to include null fields in Patch requests.
  19639. NullFields []string `json:"-"`
  19640. }
  19641. func (s *RouterAggregatedList) MarshalJSON() ([]byte, error) {
  19642. type NoMethod RouterAggregatedList
  19643. raw := NoMethod(*s)
  19644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19645. }
  19646. // RouterAggregatedListWarning: [Output Only] Informational warning
  19647. // message.
  19648. type RouterAggregatedListWarning struct {
  19649. // Code: [Output Only] A warning code, if applicable. For example,
  19650. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19651. // the response.
  19652. //
  19653. // Possible values:
  19654. // "CLEANUP_FAILED"
  19655. // "DEPRECATED_RESOURCE_USED"
  19656. // "DEPRECATED_TYPE_USED"
  19657. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19658. // "EXPERIMENTAL_TYPE_USED"
  19659. // "EXTERNAL_API_WARNING"
  19660. // "FIELD_VALUE_OVERRIDEN"
  19661. // "INJECTED_KERNELS_DEPRECATED"
  19662. // "MISSING_TYPE_DEPENDENCY"
  19663. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19664. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19665. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19666. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19667. // "NEXT_HOP_NOT_RUNNING"
  19668. // "NOT_CRITICAL_ERROR"
  19669. // "NO_RESULTS_ON_PAGE"
  19670. // "REQUIRED_TOS_AGREEMENT"
  19671. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19672. // "RESOURCE_NOT_DELETED"
  19673. // "SCHEMA_VALIDATION_IGNORED"
  19674. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19675. // "UNDECLARED_PROPERTIES"
  19676. // "UNREACHABLE"
  19677. Code string `json:"code,omitempty"`
  19678. // Data: [Output Only] Metadata about this warning in key: value format.
  19679. // For example:
  19680. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19681. Data []*RouterAggregatedListWarningData `json:"data,omitempty"`
  19682. // Message: [Output Only] A human-readable description of the warning
  19683. // code.
  19684. Message string `json:"message,omitempty"`
  19685. // ForceSendFields is a list of field names (e.g. "Code") to
  19686. // unconditionally include in API requests. By default, fields with
  19687. // empty values are omitted from API requests. However, any non-pointer,
  19688. // non-interface field appearing in ForceSendFields will be sent to the
  19689. // server regardless of whether the field is empty or not. This may be
  19690. // used to include empty fields in Patch requests.
  19691. ForceSendFields []string `json:"-"`
  19692. // NullFields is a list of field names (e.g. "Code") to include in API
  19693. // requests with the JSON null value. By default, fields with empty
  19694. // values are omitted from API requests. However, any field with an
  19695. // empty value appearing in NullFields will be sent to the server as
  19696. // null. It is an error if a field in this list has a non-empty value.
  19697. // This may be used to include null fields in Patch requests.
  19698. NullFields []string `json:"-"`
  19699. }
  19700. func (s *RouterAggregatedListWarning) MarshalJSON() ([]byte, error) {
  19701. type NoMethod RouterAggregatedListWarning
  19702. raw := NoMethod(*s)
  19703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19704. }
  19705. type RouterAggregatedListWarningData struct {
  19706. // Key: [Output Only] A key that provides more detail on the warning
  19707. // being returned. For example, for warnings where there are no results
  19708. // in a list request for a particular zone, this key might be scope and
  19709. // the key value might be the zone name. Other examples might be a key
  19710. // indicating a deprecated resource and a suggested replacement, or a
  19711. // warning about invalid network settings (for example, if an instance
  19712. // attempts to perform IP forwarding but is not enabled for IP
  19713. // forwarding).
  19714. Key string `json:"key,omitempty"`
  19715. // Value: [Output Only] A warning data value corresponding to the key.
  19716. Value string `json:"value,omitempty"`
  19717. // ForceSendFields is a list of field names (e.g. "Key") to
  19718. // unconditionally include in API requests. By default, fields with
  19719. // empty values are omitted from API requests. However, any non-pointer,
  19720. // non-interface field appearing in ForceSendFields will be sent to the
  19721. // server regardless of whether the field is empty or not. This may be
  19722. // used to include empty fields in Patch requests.
  19723. ForceSendFields []string `json:"-"`
  19724. // NullFields is a list of field names (e.g. "Key") to include in API
  19725. // requests with the JSON null value. By default, fields with empty
  19726. // values are omitted from API requests. However, any field with an
  19727. // empty value appearing in NullFields will be sent to the server as
  19728. // null. It is an error if a field in this list has a non-empty value.
  19729. // This may be used to include null fields in Patch requests.
  19730. NullFields []string `json:"-"`
  19731. }
  19732. func (s *RouterAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  19733. type NoMethod RouterAggregatedListWarningData
  19734. raw := NoMethod(*s)
  19735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19736. }
  19737. type RouterBgp struct {
  19738. // AdvertiseMode: User-specified flag to indicate which mode to use for
  19739. // advertisement. The options are DEFAULT or CUSTOM.
  19740. //
  19741. // Possible values:
  19742. // "CUSTOM"
  19743. // "DEFAULT"
  19744. AdvertiseMode string `json:"advertiseMode,omitempty"`
  19745. // AdvertisedGroups: User-specified list of prefix groups to advertise
  19746. // in custom mode. This field can only be populated if advertise_mode is
  19747. // CUSTOM and is advertised to all peers of the router. These groups
  19748. // will be advertised in addition to any specified prefixes. Leave this
  19749. // field blank to advertise no custom groups.
  19750. //
  19751. // Possible values:
  19752. // "ALL_SUBNETS"
  19753. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  19754. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  19755. // advertise in custom mode. This field can only be populated if
  19756. // advertise_mode is CUSTOM and is advertised to all peers of the
  19757. // router. These IP ranges will be advertised in addition to any
  19758. // specified groups. Leave this field blank to advertise no custom IP
  19759. // ranges.
  19760. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  19761. // Asn: Local BGP Autonomous System Number (ASN). Must be an RFC6996
  19762. // private ASN, either 16-bit or 32-bit. The value will be fixed for
  19763. // this router resource. All VPN tunnels that link to this router will
  19764. // have the same local ASN.
  19765. Asn int64 `json:"asn,omitempty"`
  19766. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  19767. // unconditionally include in API requests. By default, fields with
  19768. // empty values are omitted from API requests. However, any non-pointer,
  19769. // non-interface field appearing in ForceSendFields will be sent to the
  19770. // server regardless of whether the field is empty or not. This may be
  19771. // used to include empty fields in Patch requests.
  19772. ForceSendFields []string `json:"-"`
  19773. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  19774. // in API requests with the JSON null value. By default, fields with
  19775. // empty values are omitted from API requests. However, any field with
  19776. // an empty value appearing in NullFields will be sent to the server as
  19777. // null. It is an error if a field in this list has a non-empty value.
  19778. // This may be used to include null fields in Patch requests.
  19779. NullFields []string `json:"-"`
  19780. }
  19781. func (s *RouterBgp) MarshalJSON() ([]byte, error) {
  19782. type NoMethod RouterBgp
  19783. raw := NoMethod(*s)
  19784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19785. }
  19786. type RouterBgpPeer struct {
  19787. // AdvertiseMode: User-specified flag to indicate which mode to use for
  19788. // advertisement.
  19789. //
  19790. // Possible values:
  19791. // "CUSTOM"
  19792. // "DEFAULT"
  19793. AdvertiseMode string `json:"advertiseMode,omitempty"`
  19794. // AdvertisedGroups: User-specified list of prefix groups to advertise
  19795. // in custom mode, which can take one of the following options:
  19796. // - ALL_SUBNETS: Advertises all available subnets, including peer VPC
  19797. // subnets.
  19798. // - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets.
  19799. // - ALL_PEER_VPC_SUBNETS: Advertises peer subnets of the router's VPC
  19800. // network. Note that this field can only be populated if advertise_mode
  19801. // is CUSTOM and overrides the list defined for the router (in the "bgp"
  19802. // message). These groups are advertised in addition to any specified
  19803. // prefixes. Leave this field blank to advertise no custom groups.
  19804. //
  19805. // Possible values:
  19806. // "ALL_SUBNETS"
  19807. AdvertisedGroups []string `json:"advertisedGroups,omitempty"`
  19808. // AdvertisedIpRanges: User-specified list of individual IP ranges to
  19809. // advertise in custom mode. This field can only be populated if
  19810. // advertise_mode is CUSTOM and overrides the list defined for the
  19811. // router (in the "bgp" message). These IP ranges are advertised in
  19812. // addition to any specified groups. Leave this field blank to advertise
  19813. // no custom IP ranges.
  19814. AdvertisedIpRanges []*RouterAdvertisedIpRange `json:"advertisedIpRanges,omitempty"`
  19815. // AdvertisedRoutePriority: The priority of routes advertised to this
  19816. // BGP peer. Where there is more than one matching route of maximum
  19817. // length, the routes with the lowest priority value win.
  19818. AdvertisedRoutePriority int64 `json:"advertisedRoutePriority,omitempty"`
  19819. // InterfaceName: Name of the interface the BGP peer is associated with.
  19820. InterfaceName string `json:"interfaceName,omitempty"`
  19821. // IpAddress: IP address of the interface inside Google Cloud Platform.
  19822. // Only IPv4 is supported.
  19823. IpAddress string `json:"ipAddress,omitempty"`
  19824. // ManagementType: [Output Only] The resource that configures and
  19825. // manages this BGP peer.
  19826. // - MANAGED_BY_USER is the default value and can be managed by you or
  19827. // other users
  19828. // - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed
  19829. // by Cloud Interconnect, specifically by an InterconnectAttachment of
  19830. // type PARTNER. Google automatically creates, updates, and deletes this
  19831. // type of BGP peer when the PARTNER InterconnectAttachment is created,
  19832. // updated, or deleted.
  19833. //
  19834. // Possible values:
  19835. // "MANAGED_BY_ATTACHMENT"
  19836. // "MANAGED_BY_USER"
  19837. ManagementType string `json:"managementType,omitempty"`
  19838. // Name: Name of this BGP peer. The name must be 1-63 characters long
  19839. // and comply with RFC1035.
  19840. Name string `json:"name,omitempty"`
  19841. // PeerAsn: Peer BGP Autonomous System Number (ASN). Each BGP interface
  19842. // may use a different value.
  19843. PeerAsn int64 `json:"peerAsn,omitempty"`
  19844. // PeerIpAddress: IP address of the BGP interface outside Google Cloud
  19845. // Platform. Only IPv4 is supported.
  19846. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  19847. // ForceSendFields is a list of field names (e.g. "AdvertiseMode") to
  19848. // unconditionally include in API requests. By default, fields with
  19849. // empty values are omitted from API requests. However, any non-pointer,
  19850. // non-interface field appearing in ForceSendFields will be sent to the
  19851. // server regardless of whether the field is empty or not. This may be
  19852. // used to include empty fields in Patch requests.
  19853. ForceSendFields []string `json:"-"`
  19854. // NullFields is a list of field names (e.g. "AdvertiseMode") to include
  19855. // in API requests with the JSON null value. By default, fields with
  19856. // empty values are omitted from API requests. However, any field with
  19857. // an empty value appearing in NullFields will be sent to the server as
  19858. // null. It is an error if a field in this list has a non-empty value.
  19859. // This may be used to include null fields in Patch requests.
  19860. NullFields []string `json:"-"`
  19861. }
  19862. func (s *RouterBgpPeer) MarshalJSON() ([]byte, error) {
  19863. type NoMethod RouterBgpPeer
  19864. raw := NoMethod(*s)
  19865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19866. }
  19867. type RouterInterface struct {
  19868. // IpRange: IP address and range of the interface. The IP range must be
  19869. // in the RFC3927 link-local IP address space. The value must be a
  19870. // CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not
  19871. // truncate the address as it represents the IP address of the
  19872. // interface.
  19873. IpRange string `json:"ipRange,omitempty"`
  19874. // LinkedInterconnectAttachment: URI of the linked Interconnect
  19875. // attachment. It must be in the same region as the router. Each
  19876. // interface can have one linked resource, which can be either be a VPN
  19877. // tunnel or an Interconnect attachment.
  19878. LinkedInterconnectAttachment string `json:"linkedInterconnectAttachment,omitempty"`
  19879. // LinkedVpnTunnel: URI of the linked VPN tunnel, which must be in the
  19880. // same region as the router. Each interface can have one linked
  19881. // resource, which can be either a VPN tunnel or an Interconnect
  19882. // attachment.
  19883. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  19884. // ManagementType: [Output Only] The resource that configures and
  19885. // manages this interface.
  19886. // - MANAGED_BY_USER is the default value and can be managed directly by
  19887. // users.
  19888. // - MANAGED_BY_ATTACHMENT is an interface that is configured and
  19889. // managed by Cloud Interconnect, specifically, by an
  19890. // InterconnectAttachment of type PARTNER. Google automatically creates,
  19891. // updates, and deletes this type of interface when the PARTNER
  19892. // InterconnectAttachment is created, updated, or deleted.
  19893. //
  19894. // Possible values:
  19895. // "MANAGED_BY_ATTACHMENT"
  19896. // "MANAGED_BY_USER"
  19897. ManagementType string `json:"managementType,omitempty"`
  19898. // Name: Name of this interface entry. The name must be 1-63 characters
  19899. // long and comply with RFC1035.
  19900. Name string `json:"name,omitempty"`
  19901. // ForceSendFields is a list of field names (e.g. "IpRange") to
  19902. // unconditionally include in API requests. By default, fields with
  19903. // empty values are omitted from API requests. However, any non-pointer,
  19904. // non-interface field appearing in ForceSendFields will be sent to the
  19905. // server regardless of whether the field is empty or not. This may be
  19906. // used to include empty fields in Patch requests.
  19907. ForceSendFields []string `json:"-"`
  19908. // NullFields is a list of field names (e.g. "IpRange") to include in
  19909. // API requests with the JSON null value. By default, fields with empty
  19910. // values are omitted from API requests. However, any field with an
  19911. // empty value appearing in NullFields will be sent to the server as
  19912. // null. It is an error if a field in this list has a non-empty value.
  19913. // This may be used to include null fields in Patch requests.
  19914. NullFields []string `json:"-"`
  19915. }
  19916. func (s *RouterInterface) MarshalJSON() ([]byte, error) {
  19917. type NoMethod RouterInterface
  19918. raw := NoMethod(*s)
  19919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19920. }
  19921. // RouterList: Contains a list of Router resources.
  19922. type RouterList struct {
  19923. // Id: [Output Only] Unique identifier for the resource; defined by the
  19924. // server.
  19925. Id string `json:"id,omitempty"`
  19926. // Items: A list of Router resources.
  19927. Items []*Router `json:"items,omitempty"`
  19928. // Kind: [Output Only] Type of resource. Always compute#router for
  19929. // routers.
  19930. Kind string `json:"kind,omitempty"`
  19931. // NextPageToken: [Output Only] This token allows you to get the next
  19932. // page of results for list requests. If the number of results is larger
  19933. // than maxResults, use the nextPageToken as a value for the query
  19934. // parameter pageToken in the next list request. Subsequent list
  19935. // requests will have their own nextPageToken to continue paging through
  19936. // the results.
  19937. NextPageToken string `json:"nextPageToken,omitempty"`
  19938. // SelfLink: [Output Only] Server-defined URL for this resource.
  19939. SelfLink string `json:"selfLink,omitempty"`
  19940. // Warning: [Output Only] Informational warning message.
  19941. Warning *RouterListWarning `json:"warning,omitempty"`
  19942. // ServerResponse contains the HTTP response code and headers from the
  19943. // server.
  19944. googleapi.ServerResponse `json:"-"`
  19945. // ForceSendFields is a list of field names (e.g. "Id") to
  19946. // unconditionally include in API requests. By default, fields with
  19947. // empty values are omitted from API requests. However, any non-pointer,
  19948. // non-interface field appearing in ForceSendFields will be sent to the
  19949. // server regardless of whether the field is empty or not. This may be
  19950. // used to include empty fields in Patch requests.
  19951. ForceSendFields []string `json:"-"`
  19952. // NullFields is a list of field names (e.g. "Id") to include in API
  19953. // requests with the JSON null value. By default, fields with empty
  19954. // values are omitted from API requests. However, any field with an
  19955. // empty value appearing in NullFields will be sent to the server as
  19956. // null. It is an error if a field in this list has a non-empty value.
  19957. // This may be used to include null fields in Patch requests.
  19958. NullFields []string `json:"-"`
  19959. }
  19960. func (s *RouterList) MarshalJSON() ([]byte, error) {
  19961. type NoMethod RouterList
  19962. raw := NoMethod(*s)
  19963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  19964. }
  19965. // RouterListWarning: [Output Only] Informational warning message.
  19966. type RouterListWarning struct {
  19967. // Code: [Output Only] A warning code, if applicable. For example,
  19968. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  19969. // the response.
  19970. //
  19971. // Possible values:
  19972. // "CLEANUP_FAILED"
  19973. // "DEPRECATED_RESOURCE_USED"
  19974. // "DEPRECATED_TYPE_USED"
  19975. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  19976. // "EXPERIMENTAL_TYPE_USED"
  19977. // "EXTERNAL_API_WARNING"
  19978. // "FIELD_VALUE_OVERRIDEN"
  19979. // "INJECTED_KERNELS_DEPRECATED"
  19980. // "MISSING_TYPE_DEPENDENCY"
  19981. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  19982. // "NEXT_HOP_CANNOT_IP_FORWARD"
  19983. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  19984. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  19985. // "NEXT_HOP_NOT_RUNNING"
  19986. // "NOT_CRITICAL_ERROR"
  19987. // "NO_RESULTS_ON_PAGE"
  19988. // "REQUIRED_TOS_AGREEMENT"
  19989. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  19990. // "RESOURCE_NOT_DELETED"
  19991. // "SCHEMA_VALIDATION_IGNORED"
  19992. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  19993. // "UNDECLARED_PROPERTIES"
  19994. // "UNREACHABLE"
  19995. Code string `json:"code,omitempty"`
  19996. // Data: [Output Only] Metadata about this warning in key: value format.
  19997. // For example:
  19998. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  19999. Data []*RouterListWarningData `json:"data,omitempty"`
  20000. // Message: [Output Only] A human-readable description of the warning
  20001. // code.
  20002. Message string `json:"message,omitempty"`
  20003. // ForceSendFields is a list of field names (e.g. "Code") to
  20004. // unconditionally include in API requests. By default, fields with
  20005. // empty values are omitted from API requests. However, any non-pointer,
  20006. // non-interface field appearing in ForceSendFields will be sent to the
  20007. // server regardless of whether the field is empty or not. This may be
  20008. // used to include empty fields in Patch requests.
  20009. ForceSendFields []string `json:"-"`
  20010. // NullFields is a list of field names (e.g. "Code") to include in API
  20011. // requests with the JSON null value. By default, fields with empty
  20012. // values are omitted from API requests. However, any field with an
  20013. // empty value appearing in NullFields will be sent to the server as
  20014. // null. It is an error if a field in this list has a non-empty value.
  20015. // This may be used to include null fields in Patch requests.
  20016. NullFields []string `json:"-"`
  20017. }
  20018. func (s *RouterListWarning) MarshalJSON() ([]byte, error) {
  20019. type NoMethod RouterListWarning
  20020. raw := NoMethod(*s)
  20021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20022. }
  20023. type RouterListWarningData struct {
  20024. // Key: [Output Only] A key that provides more detail on the warning
  20025. // being returned. For example, for warnings where there are no results
  20026. // in a list request for a particular zone, this key might be scope and
  20027. // the key value might be the zone name. Other examples might be a key
  20028. // indicating a deprecated resource and a suggested replacement, or a
  20029. // warning about invalid network settings (for example, if an instance
  20030. // attempts to perform IP forwarding but is not enabled for IP
  20031. // forwarding).
  20032. Key string `json:"key,omitempty"`
  20033. // Value: [Output Only] A warning data value corresponding to the key.
  20034. Value string `json:"value,omitempty"`
  20035. // ForceSendFields is a list of field names (e.g. "Key") to
  20036. // unconditionally include in API requests. By default, fields with
  20037. // empty values are omitted from API requests. However, any non-pointer,
  20038. // non-interface field appearing in ForceSendFields will be sent to the
  20039. // server regardless of whether the field is empty or not. This may be
  20040. // used to include empty fields in Patch requests.
  20041. ForceSendFields []string `json:"-"`
  20042. // NullFields is a list of field names (e.g. "Key") to include in API
  20043. // requests with the JSON null value. By default, fields with empty
  20044. // values are omitted from API requests. However, any field with an
  20045. // empty value appearing in NullFields will be sent to the server as
  20046. // null. It is an error if a field in this list has a non-empty value.
  20047. // This may be used to include null fields in Patch requests.
  20048. NullFields []string `json:"-"`
  20049. }
  20050. func (s *RouterListWarningData) MarshalJSON() ([]byte, error) {
  20051. type NoMethod RouterListWarningData
  20052. raw := NoMethod(*s)
  20053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20054. }
  20055. // RouterNat: Represents a Nat resource. It enables the VMs within the
  20056. // specified subnetworks to access Internet without external IP
  20057. // addresses. It specifies a list of subnetworks (and the ranges within)
  20058. // that want to use NAT. Customers can also provide the external IPs
  20059. // that would be used for NAT. GCP would auto-allocate ephemeral IPs if
  20060. // no external IPs are provided.
  20061. type RouterNat struct {
  20062. // IcmpIdleTimeoutSec: Timeout (in seconds) for ICMP connections.
  20063. // Defaults to 30s if not set.
  20064. IcmpIdleTimeoutSec int64 `json:"icmpIdleTimeoutSec,omitempty"`
  20065. // LogConfig: Configure logging on this NAT.
  20066. LogConfig *RouterNatLogConfig `json:"logConfig,omitempty"`
  20067. // MinPortsPerVm: Minimum number of ports allocated to a VM from this
  20068. // NAT config. If not set, a default number of ports is allocated to a
  20069. // VM. This is rounded up to the nearest power of 2. For example, if the
  20070. // value of this field is 50, at least 64 ports are allocated to a VM.
  20071. MinPortsPerVm int64 `json:"minPortsPerVm,omitempty"`
  20072. // Name: Unique name of this Nat service. The name must be 1-63
  20073. // characters long and comply with RFC1035.
  20074. Name string `json:"name,omitempty"`
  20075. // NatIpAllocateOption: Specify the NatIpAllocateOption, which can take
  20076. // one of the following values:
  20077. // - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When
  20078. // there are not enough specified Nat IPs, the Nat service fails for new
  20079. // VMs.
  20080. // - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform;
  20081. // customers can't specify any Nat IPs. When choosing AUTO_ONLY, then
  20082. // nat_ip should be empty.
  20083. //
  20084. // Possible values:
  20085. // "AUTO_ONLY"
  20086. // "MANUAL_ONLY"
  20087. NatIpAllocateOption string `json:"natIpAllocateOption,omitempty"`
  20088. // NatIps: A list of URLs of the IP resources used for this Nat service.
  20089. // These IP addresses must be valid static external IP addresses
  20090. // assigned to the project.
  20091. NatIps []string `json:"natIps,omitempty"`
  20092. // SourceSubnetworkIpRangesToNat: Specify the Nat option, which can take
  20093. // one of the following values:
  20094. // - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every
  20095. // Subnetwork are allowed to Nat.
  20096. // - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges
  20097. // in every Subnetwork are allowed to Nat.
  20098. // - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat
  20099. // (specified in the field subnetwork below) The default is
  20100. // SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this
  20101. // field contains ALL_SUBNETWORKS_ALL_IP_RANGES or
  20102. // ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any
  20103. // other Router.Nat section in any Router for this network in this
  20104. // region.
  20105. //
  20106. // Possible values:
  20107. // "ALL_SUBNETWORKS_ALL_IP_RANGES"
  20108. // "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"
  20109. // "LIST_OF_SUBNETWORKS"
  20110. SourceSubnetworkIpRangesToNat string `json:"sourceSubnetworkIpRangesToNat,omitempty"`
  20111. // Subnetworks: A list of Subnetwork resources whose traffic should be
  20112. // translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS
  20113. // is selected for the SubnetworkIpRangeToNatOption above.
  20114. Subnetworks []*RouterNatSubnetworkToNat `json:"subnetworks,omitempty"`
  20115. // TcpEstablishedIdleTimeoutSec: Timeout (in seconds) for TCP
  20116. // established connections. Defaults to 1200s if not set.
  20117. TcpEstablishedIdleTimeoutSec int64 `json:"tcpEstablishedIdleTimeoutSec,omitempty"`
  20118. // TcpTransitoryIdleTimeoutSec: Timeout (in seconds) for TCP transitory
  20119. // connections. Defaults to 30s if not set.
  20120. TcpTransitoryIdleTimeoutSec int64 `json:"tcpTransitoryIdleTimeoutSec,omitempty"`
  20121. // UdpIdleTimeoutSec: Timeout (in seconds) for UDP connections. Defaults
  20122. // to 30s if not set.
  20123. UdpIdleTimeoutSec int64 `json:"udpIdleTimeoutSec,omitempty"`
  20124. // ForceSendFields is a list of field names (e.g. "IcmpIdleTimeoutSec")
  20125. // to unconditionally include in API requests. By default, fields with
  20126. // empty values are omitted from API requests. However, any non-pointer,
  20127. // non-interface field appearing in ForceSendFields will be sent to the
  20128. // server regardless of whether the field is empty or not. This may be
  20129. // used to include empty fields in Patch requests.
  20130. ForceSendFields []string `json:"-"`
  20131. // NullFields is a list of field names (e.g. "IcmpIdleTimeoutSec") to
  20132. // include in API requests with the JSON null value. By default, fields
  20133. // with empty values are omitted from API requests. However, any field
  20134. // with an empty value appearing in NullFields will be sent to the
  20135. // server as null. It is an error if a field in this list has a
  20136. // non-empty value. This may be used to include null fields in Patch
  20137. // requests.
  20138. NullFields []string `json:"-"`
  20139. }
  20140. func (s *RouterNat) MarshalJSON() ([]byte, error) {
  20141. type NoMethod RouterNat
  20142. raw := NoMethod(*s)
  20143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20144. }
  20145. // RouterNatLogConfig: Configuration of logging on a NAT.
  20146. type RouterNatLogConfig struct {
  20147. // Enable: Indicates whether or not to export logs. This is false by
  20148. // default.
  20149. Enable bool `json:"enable,omitempty"`
  20150. // Filter: Specifies the desired filtering of logs on this NAT. If
  20151. // unspecified, logs are exported for all connections handled by this
  20152. // NAT.
  20153. //
  20154. // Possible values:
  20155. // "ALL"
  20156. // "ERRORS_ONLY"
  20157. // "TRANSLATIONS_ONLY"
  20158. Filter string `json:"filter,omitempty"`
  20159. // ForceSendFields is a list of field names (e.g. "Enable") to
  20160. // unconditionally include in API requests. By default, fields with
  20161. // empty values are omitted from API requests. However, any non-pointer,
  20162. // non-interface field appearing in ForceSendFields will be sent to the
  20163. // server regardless of whether the field is empty or not. This may be
  20164. // used to include empty fields in Patch requests.
  20165. ForceSendFields []string `json:"-"`
  20166. // NullFields is a list of field names (e.g. "Enable") to include in API
  20167. // requests with the JSON null value. By default, fields with empty
  20168. // values are omitted from API requests. However, any field with an
  20169. // empty value appearing in NullFields will be sent to the server as
  20170. // null. It is an error if a field in this list has a non-empty value.
  20171. // This may be used to include null fields in Patch requests.
  20172. NullFields []string `json:"-"`
  20173. }
  20174. func (s *RouterNatLogConfig) MarshalJSON() ([]byte, error) {
  20175. type NoMethod RouterNatLogConfig
  20176. raw := NoMethod(*s)
  20177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20178. }
  20179. // RouterNatSubnetworkToNat: Defines the IP ranges that want to use NAT
  20180. // for a subnetwork.
  20181. type RouterNatSubnetworkToNat struct {
  20182. // Name: URL for the subnetwork resource that will use NAT.
  20183. Name string `json:"name,omitempty"`
  20184. // SecondaryIpRangeNames: A list of the secondary ranges of the
  20185. // Subnetwork that are allowed to use NAT. This can be populated only if
  20186. // "LIST_OF_SECONDARY_IP_RANGES" is one of the values in
  20187. // source_ip_ranges_to_nat.
  20188. SecondaryIpRangeNames []string `json:"secondaryIpRangeNames,omitempty"`
  20189. // SourceIpRangesToNat: Specify the options for NAT ranges in the
  20190. // Subnetwork. All options of a single value are valid except
  20191. // NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple
  20192. // values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"]
  20193. // Default: [ALL_IP_RANGES]
  20194. //
  20195. // Possible values:
  20196. // "ALL_IP_RANGES"
  20197. // "LIST_OF_SECONDARY_IP_RANGES"
  20198. // "PRIMARY_IP_RANGE"
  20199. SourceIpRangesToNat []string `json:"sourceIpRangesToNat,omitempty"`
  20200. // ForceSendFields is a list of field names (e.g. "Name") to
  20201. // unconditionally include in API requests. By default, fields with
  20202. // empty values are omitted from API requests. However, any non-pointer,
  20203. // non-interface field appearing in ForceSendFields will be sent to the
  20204. // server regardless of whether the field is empty or not. This may be
  20205. // used to include empty fields in Patch requests.
  20206. ForceSendFields []string `json:"-"`
  20207. // NullFields is a list of field names (e.g. "Name") to include in API
  20208. // requests with the JSON null value. By default, fields with empty
  20209. // values are omitted from API requests. However, any field with an
  20210. // empty value appearing in NullFields will be sent to the server as
  20211. // null. It is an error if a field in this list has a non-empty value.
  20212. // This may be used to include null fields in Patch requests.
  20213. NullFields []string `json:"-"`
  20214. }
  20215. func (s *RouterNatSubnetworkToNat) MarshalJSON() ([]byte, error) {
  20216. type NoMethod RouterNatSubnetworkToNat
  20217. raw := NoMethod(*s)
  20218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20219. }
  20220. type RouterStatus struct {
  20221. // BestRoutes: Best routes for this router's network.
  20222. BestRoutes []*Route `json:"bestRoutes,omitempty"`
  20223. // BestRoutesForRouter: Best routes learned by this router.
  20224. BestRoutesForRouter []*Route `json:"bestRoutesForRouter,omitempty"`
  20225. BgpPeerStatus []*RouterStatusBgpPeerStatus `json:"bgpPeerStatus,omitempty"`
  20226. NatStatus []*RouterStatusNatStatus `json:"natStatus,omitempty"`
  20227. // Network: URI of the network to which this router belongs.
  20228. Network string `json:"network,omitempty"`
  20229. // ForceSendFields is a list of field names (e.g. "BestRoutes") to
  20230. // unconditionally include in API requests. By default, fields with
  20231. // empty values are omitted from API requests. However, any non-pointer,
  20232. // non-interface field appearing in ForceSendFields will be sent to the
  20233. // server regardless of whether the field is empty or not. This may be
  20234. // used to include empty fields in Patch requests.
  20235. ForceSendFields []string `json:"-"`
  20236. // NullFields is a list of field names (e.g. "BestRoutes") to include in
  20237. // API requests with the JSON null value. By default, fields with empty
  20238. // values are omitted from API requests. However, any field with an
  20239. // empty value appearing in NullFields will be sent to the server as
  20240. // null. It is an error if a field in this list has a non-empty value.
  20241. // This may be used to include null fields in Patch requests.
  20242. NullFields []string `json:"-"`
  20243. }
  20244. func (s *RouterStatus) MarshalJSON() ([]byte, error) {
  20245. type NoMethod RouterStatus
  20246. raw := NoMethod(*s)
  20247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20248. }
  20249. type RouterStatusBgpPeerStatus struct {
  20250. // AdvertisedRoutes: Routes that were advertised to the remote BGP peer
  20251. AdvertisedRoutes []*Route `json:"advertisedRoutes,omitempty"`
  20252. // IpAddress: IP address of the local BGP interface.
  20253. IpAddress string `json:"ipAddress,omitempty"`
  20254. // LinkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
  20255. LinkedVpnTunnel string `json:"linkedVpnTunnel,omitempty"`
  20256. // Name: Name of this BGP peer. Unique within the Routers resource.
  20257. Name string `json:"name,omitempty"`
  20258. // NumLearnedRoutes: Number of routes learned from the remote BGP Peer.
  20259. NumLearnedRoutes int64 `json:"numLearnedRoutes,omitempty"`
  20260. // PeerIpAddress: IP address of the remote BGP interface.
  20261. PeerIpAddress string `json:"peerIpAddress,omitempty"`
  20262. // State: BGP state as specified in RFC1771.
  20263. State string `json:"state,omitempty"`
  20264. // Status: Status of the BGP peer: {UP, DOWN}
  20265. //
  20266. // Possible values:
  20267. // "DOWN"
  20268. // "UNKNOWN"
  20269. // "UP"
  20270. Status string `json:"status,omitempty"`
  20271. // Uptime: Time this session has been up. Format: 14 years, 51 weeks, 6
  20272. // days, 23 hours, 59 minutes, 59 seconds
  20273. Uptime string `json:"uptime,omitempty"`
  20274. // UptimeSeconds: Time this session has been up, in seconds. Format: 145
  20275. UptimeSeconds string `json:"uptimeSeconds,omitempty"`
  20276. // ForceSendFields is a list of field names (e.g. "AdvertisedRoutes") to
  20277. // unconditionally include in API requests. By default, fields with
  20278. // empty values are omitted from API requests. However, any non-pointer,
  20279. // non-interface field appearing in ForceSendFields will be sent to the
  20280. // server regardless of whether the field is empty or not. This may be
  20281. // used to include empty fields in Patch requests.
  20282. ForceSendFields []string `json:"-"`
  20283. // NullFields is a list of field names (e.g. "AdvertisedRoutes") to
  20284. // include in API requests with the JSON null value. By default, fields
  20285. // with empty values are omitted from API requests. However, any field
  20286. // with an empty value appearing in NullFields will be sent to the
  20287. // server as null. It is an error if a field in this list has a
  20288. // non-empty value. This may be used to include null fields in Patch
  20289. // requests.
  20290. NullFields []string `json:"-"`
  20291. }
  20292. func (s *RouterStatusBgpPeerStatus) MarshalJSON() ([]byte, error) {
  20293. type NoMethod RouterStatusBgpPeerStatus
  20294. raw := NoMethod(*s)
  20295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20296. }
  20297. // RouterStatusNatStatus: Status of a NAT contained in this router. Next
  20298. // tag: 9
  20299. type RouterStatusNatStatus struct {
  20300. // AutoAllocatedNatIps: A list of IPs auto-allocated for NAT. Example:
  20301. // ["1.1.1.1", "129.2.16.89"]
  20302. AutoAllocatedNatIps []string `json:"autoAllocatedNatIps,omitempty"`
  20303. // MinExtraNatIpsNeeded: The number of extra IPs to allocate. This will
  20304. // be greater than 0 only if user-specified IPs are NOT enough to allow
  20305. // all configured VMs to use NAT. This value is meaningful only when
  20306. // auto-allocation of NAT IPs is *not* used.
  20307. MinExtraNatIpsNeeded int64 `json:"minExtraNatIpsNeeded,omitempty"`
  20308. // Name: Unique name of this NAT.
  20309. Name string `json:"name,omitempty"`
  20310. // NumVmEndpointsWithNatMappings: Number of VM endpoints (i.e., Nics)
  20311. // that can use NAT.
  20312. NumVmEndpointsWithNatMappings int64 `json:"numVmEndpointsWithNatMappings,omitempty"`
  20313. // UserAllocatedNatIpResources: A list of fully qualified URLs of
  20314. // reserved IP address resources.
  20315. UserAllocatedNatIpResources []string `json:"userAllocatedNatIpResources,omitempty"`
  20316. // UserAllocatedNatIps: A list of IPs user-allocated for NAT. They will
  20317. // be raw IP strings like "179.12.26.133".
  20318. UserAllocatedNatIps []string `json:"userAllocatedNatIps,omitempty"`
  20319. // ForceSendFields is a list of field names (e.g. "AutoAllocatedNatIps")
  20320. // to unconditionally include in API requests. By default, fields with
  20321. // empty values are omitted from API requests. However, any non-pointer,
  20322. // non-interface field appearing in ForceSendFields will be sent to the
  20323. // server regardless of whether the field is empty or not. This may be
  20324. // used to include empty fields in Patch requests.
  20325. ForceSendFields []string `json:"-"`
  20326. // NullFields is a list of field names (e.g. "AutoAllocatedNatIps") to
  20327. // include in API requests with the JSON null value. By default, fields
  20328. // with empty values are omitted from API requests. However, any field
  20329. // with an empty value appearing in NullFields will be sent to the
  20330. // server as null. It is an error if a field in this list has a
  20331. // non-empty value. This may be used to include null fields in Patch
  20332. // requests.
  20333. NullFields []string `json:"-"`
  20334. }
  20335. func (s *RouterStatusNatStatus) MarshalJSON() ([]byte, error) {
  20336. type NoMethod RouterStatusNatStatus
  20337. raw := NoMethod(*s)
  20338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20339. }
  20340. type RouterStatusResponse struct {
  20341. // Kind: Type of resource.
  20342. Kind string `json:"kind,omitempty"`
  20343. Result *RouterStatus `json:"result,omitempty"`
  20344. // ServerResponse contains the HTTP response code and headers from the
  20345. // server.
  20346. googleapi.ServerResponse `json:"-"`
  20347. // ForceSendFields is a list of field names (e.g. "Kind") to
  20348. // unconditionally include in API requests. By default, fields with
  20349. // empty values are omitted from API requests. However, any non-pointer,
  20350. // non-interface field appearing in ForceSendFields will be sent to the
  20351. // server regardless of whether the field is empty or not. This may be
  20352. // used to include empty fields in Patch requests.
  20353. ForceSendFields []string `json:"-"`
  20354. // NullFields is a list of field names (e.g. "Kind") to include in API
  20355. // requests with the JSON null value. By default, fields with empty
  20356. // values are omitted from API requests. However, any field with an
  20357. // empty value appearing in NullFields will be sent to the server as
  20358. // null. It is an error if a field in this list has a non-empty value.
  20359. // This may be used to include null fields in Patch requests.
  20360. NullFields []string `json:"-"`
  20361. }
  20362. func (s *RouterStatusResponse) MarshalJSON() ([]byte, error) {
  20363. type NoMethod RouterStatusResponse
  20364. raw := NoMethod(*s)
  20365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20366. }
  20367. type RoutersPreviewResponse struct {
  20368. // Resource: Preview of given router.
  20369. Resource *Router `json:"resource,omitempty"`
  20370. // ServerResponse contains the HTTP response code and headers from the
  20371. // server.
  20372. googleapi.ServerResponse `json:"-"`
  20373. // ForceSendFields is a list of field names (e.g. "Resource") to
  20374. // unconditionally include in API requests. By default, fields with
  20375. // empty values are omitted from API requests. However, any non-pointer,
  20376. // non-interface field appearing in ForceSendFields will be sent to the
  20377. // server regardless of whether the field is empty or not. This may be
  20378. // used to include empty fields in Patch requests.
  20379. ForceSendFields []string `json:"-"`
  20380. // NullFields is a list of field names (e.g. "Resource") to include in
  20381. // API requests with the JSON null value. By default, fields with empty
  20382. // values are omitted from API requests. However, any field with an
  20383. // empty value appearing in NullFields will be sent to the server as
  20384. // null. It is an error if a field in this list has a non-empty value.
  20385. // This may be used to include null fields in Patch requests.
  20386. NullFields []string `json:"-"`
  20387. }
  20388. func (s *RoutersPreviewResponse) MarshalJSON() ([]byte, error) {
  20389. type NoMethod RoutersPreviewResponse
  20390. raw := NoMethod(*s)
  20391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20392. }
  20393. type RoutersScopedList struct {
  20394. // Routers: A list of routers contained in this scope.
  20395. Routers []*Router `json:"routers,omitempty"`
  20396. // Warning: Informational warning which replaces the list of routers
  20397. // when the list is empty.
  20398. Warning *RoutersScopedListWarning `json:"warning,omitempty"`
  20399. // ForceSendFields is a list of field names (e.g. "Routers") to
  20400. // unconditionally include in API requests. By default, fields with
  20401. // empty values are omitted from API requests. However, any non-pointer,
  20402. // non-interface field appearing in ForceSendFields will be sent to the
  20403. // server regardless of whether the field is empty or not. This may be
  20404. // used to include empty fields in Patch requests.
  20405. ForceSendFields []string `json:"-"`
  20406. // NullFields is a list of field names (e.g. "Routers") to include in
  20407. // API requests with the JSON null value. By default, fields with empty
  20408. // values are omitted from API requests. However, any field with an
  20409. // empty value appearing in NullFields will be sent to the server as
  20410. // null. It is an error if a field in this list has a non-empty value.
  20411. // This may be used to include null fields in Patch requests.
  20412. NullFields []string `json:"-"`
  20413. }
  20414. func (s *RoutersScopedList) MarshalJSON() ([]byte, error) {
  20415. type NoMethod RoutersScopedList
  20416. raw := NoMethod(*s)
  20417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20418. }
  20419. // RoutersScopedListWarning: Informational warning which replaces the
  20420. // list of routers when the list is empty.
  20421. type RoutersScopedListWarning struct {
  20422. // Code: [Output Only] A warning code, if applicable. For example,
  20423. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20424. // the response.
  20425. //
  20426. // Possible values:
  20427. // "CLEANUP_FAILED"
  20428. // "DEPRECATED_RESOURCE_USED"
  20429. // "DEPRECATED_TYPE_USED"
  20430. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20431. // "EXPERIMENTAL_TYPE_USED"
  20432. // "EXTERNAL_API_WARNING"
  20433. // "FIELD_VALUE_OVERRIDEN"
  20434. // "INJECTED_KERNELS_DEPRECATED"
  20435. // "MISSING_TYPE_DEPENDENCY"
  20436. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20437. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20438. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20439. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20440. // "NEXT_HOP_NOT_RUNNING"
  20441. // "NOT_CRITICAL_ERROR"
  20442. // "NO_RESULTS_ON_PAGE"
  20443. // "REQUIRED_TOS_AGREEMENT"
  20444. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20445. // "RESOURCE_NOT_DELETED"
  20446. // "SCHEMA_VALIDATION_IGNORED"
  20447. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20448. // "UNDECLARED_PROPERTIES"
  20449. // "UNREACHABLE"
  20450. Code string `json:"code,omitempty"`
  20451. // Data: [Output Only] Metadata about this warning in key: value format.
  20452. // For example:
  20453. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20454. Data []*RoutersScopedListWarningData `json:"data,omitempty"`
  20455. // Message: [Output Only] A human-readable description of the warning
  20456. // code.
  20457. Message string `json:"message,omitempty"`
  20458. // ForceSendFields is a list of field names (e.g. "Code") to
  20459. // unconditionally include in API requests. By default, fields with
  20460. // empty values are omitted from API requests. However, any non-pointer,
  20461. // non-interface field appearing in ForceSendFields will be sent to the
  20462. // server regardless of whether the field is empty or not. This may be
  20463. // used to include empty fields in Patch requests.
  20464. ForceSendFields []string `json:"-"`
  20465. // NullFields is a list of field names (e.g. "Code") to include in API
  20466. // requests with the JSON null value. By default, fields with empty
  20467. // values are omitted from API requests. However, any field with an
  20468. // empty value appearing in NullFields will be sent to the server as
  20469. // null. It is an error if a field in this list has a non-empty value.
  20470. // This may be used to include null fields in Patch requests.
  20471. NullFields []string `json:"-"`
  20472. }
  20473. func (s *RoutersScopedListWarning) MarshalJSON() ([]byte, error) {
  20474. type NoMethod RoutersScopedListWarning
  20475. raw := NoMethod(*s)
  20476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20477. }
  20478. type RoutersScopedListWarningData struct {
  20479. // Key: [Output Only] A key that provides more detail on the warning
  20480. // being returned. For example, for warnings where there are no results
  20481. // in a list request for a particular zone, this key might be scope and
  20482. // the key value might be the zone name. Other examples might be a key
  20483. // indicating a deprecated resource and a suggested replacement, or a
  20484. // warning about invalid network settings (for example, if an instance
  20485. // attempts to perform IP forwarding but is not enabled for IP
  20486. // forwarding).
  20487. Key string `json:"key,omitempty"`
  20488. // Value: [Output Only] A warning data value corresponding to the key.
  20489. Value string `json:"value,omitempty"`
  20490. // ForceSendFields is a list of field names (e.g. "Key") to
  20491. // unconditionally include in API requests. By default, fields with
  20492. // empty values are omitted from API requests. However, any non-pointer,
  20493. // non-interface field appearing in ForceSendFields will be sent to the
  20494. // server regardless of whether the field is empty or not. This may be
  20495. // used to include empty fields in Patch requests.
  20496. ForceSendFields []string `json:"-"`
  20497. // NullFields is a list of field names (e.g. "Key") to include in API
  20498. // requests with the JSON null value. By default, fields with empty
  20499. // values are omitted from API requests. However, any field with an
  20500. // empty value appearing in NullFields will be sent to the server as
  20501. // null. It is an error if a field in this list has a non-empty value.
  20502. // This may be used to include null fields in Patch requests.
  20503. NullFields []string `json:"-"`
  20504. }
  20505. func (s *RoutersScopedListWarningData) MarshalJSON() ([]byte, error) {
  20506. type NoMethod RoutersScopedListWarningData
  20507. raw := NoMethod(*s)
  20508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20509. }
  20510. // Rule: A rule to be applied in a Policy.
  20511. type Rule struct {
  20512. // Action: Required
  20513. //
  20514. // Possible values:
  20515. // "ALLOW"
  20516. // "ALLOW_WITH_LOG"
  20517. // "DENY"
  20518. // "DENY_WITH_LOG"
  20519. // "LOG"
  20520. // "NO_ACTION"
  20521. Action string `json:"action,omitempty"`
  20522. // Conditions: Additional restrictions that must be met. All conditions
  20523. // must pass for the rule to match.
  20524. Conditions []*Condition `json:"conditions,omitempty"`
  20525. // Description: Human-readable description of the rule.
  20526. Description string `json:"description,omitempty"`
  20527. // Ins: If one or more 'in' clauses are specified, the rule matches if
  20528. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  20529. Ins []string `json:"ins,omitempty"`
  20530. // LogConfigs: The config returned to callers of
  20531. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  20532. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  20533. // NotIns: If one or more 'not_in' clauses are specified, the rule
  20534. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  20535. // entries.
  20536. NotIns []string `json:"notIns,omitempty"`
  20537. // Permissions: A permission is a string of form '..' (e.g.,
  20538. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  20539. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  20540. Permissions []string `json:"permissions,omitempty"`
  20541. // ForceSendFields is a list of field names (e.g. "Action") to
  20542. // unconditionally include in API requests. By default, fields with
  20543. // empty values are omitted from API requests. However, any non-pointer,
  20544. // non-interface field appearing in ForceSendFields will be sent to the
  20545. // server regardless of whether the field is empty or not. This may be
  20546. // used to include empty fields in Patch requests.
  20547. ForceSendFields []string `json:"-"`
  20548. // NullFields is a list of field names (e.g. "Action") to include in API
  20549. // requests with the JSON null value. By default, fields with empty
  20550. // values are omitted from API requests. However, any field with an
  20551. // empty value appearing in NullFields will be sent to the server as
  20552. // null. It is an error if a field in this list has a non-empty value.
  20553. // This may be used to include null fields in Patch requests.
  20554. NullFields []string `json:"-"`
  20555. }
  20556. func (s *Rule) MarshalJSON() ([]byte, error) {
  20557. type NoMethod Rule
  20558. raw := NoMethod(*s)
  20559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20560. }
  20561. type SSLHealthCheck struct {
  20562. // Port: The TCP port number for the health check request. The default
  20563. // value is 443. Valid values are 1 through 65535.
  20564. Port int64 `json:"port,omitempty"`
  20565. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  20566. // both port and port_name are defined, port takes precedence.
  20567. PortName string `json:"portName,omitempty"`
  20568. // PortSpecification: Specifies how port is selected for health
  20569. // checking, can be one of following values:
  20570. // USE_FIXED_PORT: The port number in
  20571. // port
  20572. // is used for health checking.
  20573. // USE_NAMED_PORT: The
  20574. // portName
  20575. // is used for health checking.
  20576. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  20577. // each network endpoint is used for health checking. For other
  20578. // backends, the port or named port specified in the Backend Service is
  20579. // used for health checking.
  20580. //
  20581. //
  20582. // If not specified, SSL health check follows behavior specified
  20583. // in
  20584. // port
  20585. // and
  20586. // portName
  20587. // fields.
  20588. //
  20589. // Possible values:
  20590. // "USE_FIXED_PORT"
  20591. // "USE_NAMED_PORT"
  20592. // "USE_SERVING_PORT"
  20593. PortSpecification string `json:"portSpecification,omitempty"`
  20594. // ProxyHeader: Specifies the type of proxy header to append before
  20595. // sending data to the backend, either NONE or PROXY_V1. The default is
  20596. // NONE.
  20597. //
  20598. // Possible values:
  20599. // "NONE"
  20600. // "PROXY_V1"
  20601. ProxyHeader string `json:"proxyHeader,omitempty"`
  20602. // Request: The application data to send once the SSL connection has
  20603. // been established (default value is empty). If both request and
  20604. // response are empty, the connection establishment alone will indicate
  20605. // health. The request data can only be ASCII.
  20606. Request string `json:"request,omitempty"`
  20607. // Response: The bytes to match against the beginning of the response
  20608. // data. If left empty (the default value), any response will indicate
  20609. // health. The response data can only be ASCII.
  20610. Response string `json:"response,omitempty"`
  20611. // ForceSendFields is a list of field names (e.g. "Port") to
  20612. // unconditionally include in API requests. By default, fields with
  20613. // empty values are omitted from API requests. However, any non-pointer,
  20614. // non-interface field appearing in ForceSendFields will be sent to the
  20615. // server regardless of whether the field is empty or not. This may be
  20616. // used to include empty fields in Patch requests.
  20617. ForceSendFields []string `json:"-"`
  20618. // NullFields is a list of field names (e.g. "Port") to include in API
  20619. // requests with the JSON null value. By default, fields with empty
  20620. // values are omitted from API requests. However, any field with an
  20621. // empty value appearing in NullFields will be sent to the server as
  20622. // null. It is an error if a field in this list has a non-empty value.
  20623. // This may be used to include null fields in Patch requests.
  20624. NullFields []string `json:"-"`
  20625. }
  20626. func (s *SSLHealthCheck) MarshalJSON() ([]byte, error) {
  20627. type NoMethod SSLHealthCheck
  20628. raw := NoMethod(*s)
  20629. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20630. }
  20631. // Scheduling: Sets the scheduling options for an Instance.
  20632. type Scheduling struct {
  20633. // AutomaticRestart: Specifies whether the instance should be
  20634. // automatically restarted if it is terminated by Compute Engine (not
  20635. // terminated by a user). You can only set the automatic restart option
  20636. // for standard instances. Preemptible instances cannot be automatically
  20637. // restarted.
  20638. //
  20639. // By default, this is set to true so an instance is automatically
  20640. // restarted if it is terminated by Compute Engine.
  20641. AutomaticRestart *bool `json:"automaticRestart,omitempty"`
  20642. // NodeAffinities: A set of node affinity and anti-affinity.
  20643. NodeAffinities []*SchedulingNodeAffinity `json:"nodeAffinities,omitempty"`
  20644. // OnHostMaintenance: Defines the maintenance behavior for this
  20645. // instance. For standard instances, the default behavior is MIGRATE.
  20646. // For preemptible instances, the default and only possible behavior is
  20647. // TERMINATE. For more information, see Setting Instance Scheduling
  20648. // Options.
  20649. //
  20650. // Possible values:
  20651. // "MIGRATE"
  20652. // "TERMINATE"
  20653. OnHostMaintenance string `json:"onHostMaintenance,omitempty"`
  20654. // Preemptible: Defines whether the instance is preemptible. This can
  20655. // only be set during instance creation, it cannot be set or changed
  20656. // after the instance has been created.
  20657. Preemptible bool `json:"preemptible,omitempty"`
  20658. // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to
  20659. // unconditionally include in API requests. By default, fields with
  20660. // empty values are omitted from API requests. However, any non-pointer,
  20661. // non-interface field appearing in ForceSendFields will be sent to the
  20662. // server regardless of whether the field is empty or not. This may be
  20663. // used to include empty fields in Patch requests.
  20664. ForceSendFields []string `json:"-"`
  20665. // NullFields is a list of field names (e.g. "AutomaticRestart") to
  20666. // include in API requests with the JSON null value. By default, fields
  20667. // with empty values are omitted from API requests. However, any field
  20668. // with an empty value appearing in NullFields will be sent to the
  20669. // server as null. It is an error if a field in this list has a
  20670. // non-empty value. This may be used to include null fields in Patch
  20671. // requests.
  20672. NullFields []string `json:"-"`
  20673. }
  20674. func (s *Scheduling) MarshalJSON() ([]byte, error) {
  20675. type NoMethod Scheduling
  20676. raw := NoMethod(*s)
  20677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20678. }
  20679. // SchedulingNodeAffinity: Node Affinity: the configuration of desired
  20680. // nodes onto which this Instance could be scheduled.
  20681. type SchedulingNodeAffinity struct {
  20682. // Key: Corresponds to the label key of Node resource.
  20683. Key string `json:"key,omitempty"`
  20684. // Operator: Defines the operation of node selection.
  20685. //
  20686. // Possible values:
  20687. // "IN"
  20688. // "NOT_IN"
  20689. // "OPERATOR_UNSPECIFIED"
  20690. Operator string `json:"operator,omitempty"`
  20691. // Values: Corresponds to the label values of Node resource.
  20692. Values []string `json:"values,omitempty"`
  20693. // ForceSendFields is a list of field names (e.g. "Key") to
  20694. // unconditionally include in API requests. By default, fields with
  20695. // empty values are omitted from API requests. However, any non-pointer,
  20696. // non-interface field appearing in ForceSendFields will be sent to the
  20697. // server regardless of whether the field is empty or not. This may be
  20698. // used to include empty fields in Patch requests.
  20699. ForceSendFields []string `json:"-"`
  20700. // NullFields is a list of field names (e.g. "Key") to include in API
  20701. // requests with the JSON null value. By default, fields with empty
  20702. // values are omitted from API requests. However, any field with an
  20703. // empty value appearing in NullFields will be sent to the server as
  20704. // null. It is an error if a field in this list has a non-empty value.
  20705. // This may be used to include null fields in Patch requests.
  20706. NullFields []string `json:"-"`
  20707. }
  20708. func (s *SchedulingNodeAffinity) MarshalJSON() ([]byte, error) {
  20709. type NoMethod SchedulingNodeAffinity
  20710. raw := NoMethod(*s)
  20711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20712. }
  20713. // SecurityPolicy: A security policy is comprised of one or more rules.
  20714. // It can also be associated with one or more 'targets'. (==
  20715. // resource_for v1.securityPolicies ==) (== resource_for
  20716. // beta.securityPolicies ==)
  20717. type SecurityPolicy struct {
  20718. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  20719. // format.
  20720. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  20721. // Description: An optional description of this resource. Provide this
  20722. // property when you create the resource.
  20723. Description string `json:"description,omitempty"`
  20724. // Fingerprint: Specifies a fingerprint for this resource, which is
  20725. // essentially a hash of the metadata's contents and used for optimistic
  20726. // locking. The fingerprint is initially generated by Compute Engine and
  20727. // changes after every request to modify or update metadata. You must
  20728. // always provide an up-to-date fingerprint hash in order to update or
  20729. // change metadata, otherwise the request will fail with error 412
  20730. // conditionNotMet.
  20731. //
  20732. // To see the latest fingerprint, make get() request to the security
  20733. // policy.
  20734. Fingerprint string `json:"fingerprint,omitempty"`
  20735. // Id: [Output Only] The unique identifier for the resource. This
  20736. // identifier is defined by the server.
  20737. Id uint64 `json:"id,omitempty,string"`
  20738. // Kind: [Output only] Type of the resource. Always
  20739. // compute#securityPolicyfor security policies
  20740. Kind string `json:"kind,omitempty"`
  20741. // Name: Name of the resource. Provided by the client when the resource
  20742. // is created. The name must be 1-63 characters long, and comply with
  20743. // RFC1035. Specifically, the name must be 1-63 characters long and
  20744. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  20745. // the first character must be a lowercase letter, and all following
  20746. // characters must be a dash, lowercase letter, or digit, except the
  20747. // last character, which cannot be a dash.
  20748. Name string `json:"name,omitempty"`
  20749. // Rules: A list of rules that belong to this policy. There must always
  20750. // be a default rule (rule with priority 2147483647 and match "*"). If
  20751. // no rules are provided when creating a security policy, a default rule
  20752. // with action "allow" will be added.
  20753. Rules []*SecurityPolicyRule `json:"rules,omitempty"`
  20754. // SelfLink: [Output Only] Server-defined URL for the resource.
  20755. SelfLink string `json:"selfLink,omitempty"`
  20756. // ServerResponse contains the HTTP response code and headers from the
  20757. // server.
  20758. googleapi.ServerResponse `json:"-"`
  20759. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  20760. // to unconditionally include in API requests. By default, fields with
  20761. // empty values are omitted from API requests. However, any non-pointer,
  20762. // non-interface field appearing in ForceSendFields will be sent to the
  20763. // server regardless of whether the field is empty or not. This may be
  20764. // used to include empty fields in Patch requests.
  20765. ForceSendFields []string `json:"-"`
  20766. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  20767. // include in API requests with the JSON null value. By default, fields
  20768. // with empty values are omitted from API requests. However, any field
  20769. // with an empty value appearing in NullFields will be sent to the
  20770. // server as null. It is an error if a field in this list has a
  20771. // non-empty value. This may be used to include null fields in Patch
  20772. // requests.
  20773. NullFields []string `json:"-"`
  20774. }
  20775. func (s *SecurityPolicy) MarshalJSON() ([]byte, error) {
  20776. type NoMethod SecurityPolicy
  20777. raw := NoMethod(*s)
  20778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20779. }
  20780. type SecurityPolicyList struct {
  20781. // Id: [Output Only] Unique identifier for the resource; defined by the
  20782. // server.
  20783. Id string `json:"id,omitempty"`
  20784. // Items: A list of SecurityPolicy resources.
  20785. Items []*SecurityPolicy `json:"items,omitempty"`
  20786. // Kind: [Output Only] Type of resource. Always
  20787. // compute#securityPolicyList for listsof securityPolicies
  20788. Kind string `json:"kind,omitempty"`
  20789. // NextPageToken: [Output Only] This token allows you to get the next
  20790. // page of results for list requests. If the number of results is larger
  20791. // than maxResults, use the nextPageToken as a value for the query
  20792. // parameter pageToken in the next list request. Subsequent list
  20793. // requests will have their own nextPageToken to continue paging through
  20794. // the results.
  20795. NextPageToken string `json:"nextPageToken,omitempty"`
  20796. // Warning: [Output Only] Informational warning message.
  20797. Warning *SecurityPolicyListWarning `json:"warning,omitempty"`
  20798. // ServerResponse contains the HTTP response code and headers from the
  20799. // server.
  20800. googleapi.ServerResponse `json:"-"`
  20801. // ForceSendFields is a list of field names (e.g. "Id") to
  20802. // unconditionally include in API requests. By default, fields with
  20803. // empty values are omitted from API requests. However, any non-pointer,
  20804. // non-interface field appearing in ForceSendFields will be sent to the
  20805. // server regardless of whether the field is empty or not. This may be
  20806. // used to include empty fields in Patch requests.
  20807. ForceSendFields []string `json:"-"`
  20808. // NullFields is a list of field names (e.g. "Id") to include in API
  20809. // requests with the JSON null value. By default, fields with empty
  20810. // values are omitted from API requests. However, any field with an
  20811. // empty value appearing in NullFields will be sent to the server as
  20812. // null. It is an error if a field in this list has a non-empty value.
  20813. // This may be used to include null fields in Patch requests.
  20814. NullFields []string `json:"-"`
  20815. }
  20816. func (s *SecurityPolicyList) MarshalJSON() ([]byte, error) {
  20817. type NoMethod SecurityPolicyList
  20818. raw := NoMethod(*s)
  20819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20820. }
  20821. // SecurityPolicyListWarning: [Output Only] Informational warning
  20822. // message.
  20823. type SecurityPolicyListWarning struct {
  20824. // Code: [Output Only] A warning code, if applicable. For example,
  20825. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  20826. // the response.
  20827. //
  20828. // Possible values:
  20829. // "CLEANUP_FAILED"
  20830. // "DEPRECATED_RESOURCE_USED"
  20831. // "DEPRECATED_TYPE_USED"
  20832. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  20833. // "EXPERIMENTAL_TYPE_USED"
  20834. // "EXTERNAL_API_WARNING"
  20835. // "FIELD_VALUE_OVERRIDEN"
  20836. // "INJECTED_KERNELS_DEPRECATED"
  20837. // "MISSING_TYPE_DEPENDENCY"
  20838. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  20839. // "NEXT_HOP_CANNOT_IP_FORWARD"
  20840. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  20841. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  20842. // "NEXT_HOP_NOT_RUNNING"
  20843. // "NOT_CRITICAL_ERROR"
  20844. // "NO_RESULTS_ON_PAGE"
  20845. // "REQUIRED_TOS_AGREEMENT"
  20846. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  20847. // "RESOURCE_NOT_DELETED"
  20848. // "SCHEMA_VALIDATION_IGNORED"
  20849. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  20850. // "UNDECLARED_PROPERTIES"
  20851. // "UNREACHABLE"
  20852. Code string `json:"code,omitempty"`
  20853. // Data: [Output Only] Metadata about this warning in key: value format.
  20854. // For example:
  20855. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  20856. Data []*SecurityPolicyListWarningData `json:"data,omitempty"`
  20857. // Message: [Output Only] A human-readable description of the warning
  20858. // code.
  20859. Message string `json:"message,omitempty"`
  20860. // ForceSendFields is a list of field names (e.g. "Code") to
  20861. // unconditionally include in API requests. By default, fields with
  20862. // empty values are omitted from API requests. However, any non-pointer,
  20863. // non-interface field appearing in ForceSendFields will be sent to the
  20864. // server regardless of whether the field is empty or not. This may be
  20865. // used to include empty fields in Patch requests.
  20866. ForceSendFields []string `json:"-"`
  20867. // NullFields is a list of field names (e.g. "Code") to include in API
  20868. // requests with the JSON null value. By default, fields with empty
  20869. // values are omitted from API requests. However, any field with an
  20870. // empty value appearing in NullFields will be sent to the server as
  20871. // null. It is an error if a field in this list has a non-empty value.
  20872. // This may be used to include null fields in Patch requests.
  20873. NullFields []string `json:"-"`
  20874. }
  20875. func (s *SecurityPolicyListWarning) MarshalJSON() ([]byte, error) {
  20876. type NoMethod SecurityPolicyListWarning
  20877. raw := NoMethod(*s)
  20878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20879. }
  20880. type SecurityPolicyListWarningData struct {
  20881. // Key: [Output Only] A key that provides more detail on the warning
  20882. // being returned. For example, for warnings where there are no results
  20883. // in a list request for a particular zone, this key might be scope and
  20884. // the key value might be the zone name. Other examples might be a key
  20885. // indicating a deprecated resource and a suggested replacement, or a
  20886. // warning about invalid network settings (for example, if an instance
  20887. // attempts to perform IP forwarding but is not enabled for IP
  20888. // forwarding).
  20889. Key string `json:"key,omitempty"`
  20890. // Value: [Output Only] A warning data value corresponding to the key.
  20891. Value string `json:"value,omitempty"`
  20892. // ForceSendFields is a list of field names (e.g. "Key") to
  20893. // unconditionally include in API requests. By default, fields with
  20894. // empty values are omitted from API requests. However, any non-pointer,
  20895. // non-interface field appearing in ForceSendFields will be sent to the
  20896. // server regardless of whether the field is empty or not. This may be
  20897. // used to include empty fields in Patch requests.
  20898. ForceSendFields []string `json:"-"`
  20899. // NullFields is a list of field names (e.g. "Key") to include in API
  20900. // requests with the JSON null value. By default, fields with empty
  20901. // values are omitted from API requests. However, any field with an
  20902. // empty value appearing in NullFields will be sent to the server as
  20903. // null. It is an error if a field in this list has a non-empty value.
  20904. // This may be used to include null fields in Patch requests.
  20905. NullFields []string `json:"-"`
  20906. }
  20907. func (s *SecurityPolicyListWarningData) MarshalJSON() ([]byte, error) {
  20908. type NoMethod SecurityPolicyListWarningData
  20909. raw := NoMethod(*s)
  20910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20911. }
  20912. type SecurityPolicyReference struct {
  20913. SecurityPolicy string `json:"securityPolicy,omitempty"`
  20914. // ForceSendFields is a list of field names (e.g. "SecurityPolicy") to
  20915. // unconditionally include in API requests. By default, fields with
  20916. // empty values are omitted from API requests. However, any non-pointer,
  20917. // non-interface field appearing in ForceSendFields will be sent to the
  20918. // server regardless of whether the field is empty or not. This may be
  20919. // used to include empty fields in Patch requests.
  20920. ForceSendFields []string `json:"-"`
  20921. // NullFields is a list of field names (e.g. "SecurityPolicy") to
  20922. // include in API requests with the JSON null value. By default, fields
  20923. // with empty values are omitted from API requests. However, any field
  20924. // with an empty value appearing in NullFields will be sent to the
  20925. // server as null. It is an error if a field in this list has a
  20926. // non-empty value. This may be used to include null fields in Patch
  20927. // requests.
  20928. NullFields []string `json:"-"`
  20929. }
  20930. func (s *SecurityPolicyReference) MarshalJSON() ([]byte, error) {
  20931. type NoMethod SecurityPolicyReference
  20932. raw := NoMethod(*s)
  20933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20934. }
  20935. // SecurityPolicyRule: Represents a rule that describes one or more
  20936. // match conditions along with the action to be taken when traffic
  20937. // matches this condition (allow or deny).
  20938. type SecurityPolicyRule struct {
  20939. // Action: The Action to preform when the client connection triggers the
  20940. // rule. Can currently be either "allow" or "deny()" where valid values
  20941. // for status are 403, 404, and 502.
  20942. Action string `json:"action,omitempty"`
  20943. // Description: An optional description of this resource. Provide this
  20944. // property when you create the resource.
  20945. Description string `json:"description,omitempty"`
  20946. // Kind: [Output only] Type of the resource. Always
  20947. // compute#securityPolicyRule for security policy rules
  20948. Kind string `json:"kind,omitempty"`
  20949. // Match: A match condition that incoming traffic is evaluated against.
  20950. // If it evaluates to true, the corresponding ?action? is enforced.
  20951. Match *SecurityPolicyRuleMatcher `json:"match,omitempty"`
  20952. // Preview: If set to true, the specified action is not enforced.
  20953. Preview bool `json:"preview,omitempty"`
  20954. // Priority: An integer indicating the priority of a rule in the list.
  20955. // The priority must be a positive value between 0 and 2147483647. Rules
  20956. // are evaluated from highest to lowest priority where 0 is the highest
  20957. // priority and 2147483647 is the lowest prority.
  20958. Priority int64 `json:"priority,omitempty"`
  20959. // ServerResponse contains the HTTP response code and headers from the
  20960. // server.
  20961. googleapi.ServerResponse `json:"-"`
  20962. // ForceSendFields is a list of field names (e.g. "Action") to
  20963. // unconditionally include in API requests. By default, fields with
  20964. // empty values are omitted from API requests. However, any non-pointer,
  20965. // non-interface field appearing in ForceSendFields will be sent to the
  20966. // server regardless of whether the field is empty or not. This may be
  20967. // used to include empty fields in Patch requests.
  20968. ForceSendFields []string `json:"-"`
  20969. // NullFields is a list of field names (e.g. "Action") to include in API
  20970. // requests with the JSON null value. By default, fields with empty
  20971. // values are omitted from API requests. However, any field with an
  20972. // empty value appearing in NullFields will be sent to the server as
  20973. // null. It is an error if a field in this list has a non-empty value.
  20974. // This may be used to include null fields in Patch requests.
  20975. NullFields []string `json:"-"`
  20976. }
  20977. func (s *SecurityPolicyRule) MarshalJSON() ([]byte, error) {
  20978. type NoMethod SecurityPolicyRule
  20979. raw := NoMethod(*s)
  20980. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  20981. }
  20982. // SecurityPolicyRuleMatcher: Represents a match condition that incoming
  20983. // traffic is evaluated against. Exactly one field must be specified.
  20984. type SecurityPolicyRuleMatcher struct {
  20985. // Config: The configuration options available when specifying
  20986. // versioned_expr. This field must be specified if versioned_expr is
  20987. // specified and cannot be specified if versioned_expr is not specified.
  20988. Config *SecurityPolicyRuleMatcherConfig `json:"config,omitempty"`
  20989. // VersionedExpr: Preconfigured versioned expression. If this field is
  20990. // specified, config must also be specified. Available preconfigured
  20991. // expressions along with their requirements are: SRC_IPS_V1 - must
  20992. // specify the corresponding src_ip_range field in config.
  20993. //
  20994. // Possible values:
  20995. // "SRC_IPS_V1"
  20996. VersionedExpr string `json:"versionedExpr,omitempty"`
  20997. // ForceSendFields is a list of field names (e.g. "Config") to
  20998. // unconditionally include in API requests. By default, fields with
  20999. // empty values are omitted from API requests. However, any non-pointer,
  21000. // non-interface field appearing in ForceSendFields will be sent to the
  21001. // server regardless of whether the field is empty or not. This may be
  21002. // used to include empty fields in Patch requests.
  21003. ForceSendFields []string `json:"-"`
  21004. // NullFields is a list of field names (e.g. "Config") to include in API
  21005. // requests with the JSON null value. By default, fields with empty
  21006. // values are omitted from API requests. However, any field with an
  21007. // empty value appearing in NullFields will be sent to the server as
  21008. // null. It is an error if a field in this list has a non-empty value.
  21009. // This may be used to include null fields in Patch requests.
  21010. NullFields []string `json:"-"`
  21011. }
  21012. func (s *SecurityPolicyRuleMatcher) MarshalJSON() ([]byte, error) {
  21013. type NoMethod SecurityPolicyRuleMatcher
  21014. raw := NoMethod(*s)
  21015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21016. }
  21017. type SecurityPolicyRuleMatcherConfig struct {
  21018. // SrcIpRanges: CIDR IP address range.
  21019. SrcIpRanges []string `json:"srcIpRanges,omitempty"`
  21020. // ForceSendFields is a list of field names (e.g. "SrcIpRanges") to
  21021. // unconditionally include in API requests. By default, fields with
  21022. // empty values are omitted from API requests. However, any non-pointer,
  21023. // non-interface field appearing in ForceSendFields will be sent to the
  21024. // server regardless of whether the field is empty or not. This may be
  21025. // used to include empty fields in Patch requests.
  21026. ForceSendFields []string `json:"-"`
  21027. // NullFields is a list of field names (e.g. "SrcIpRanges") to include
  21028. // in API requests with the JSON null value. By default, fields with
  21029. // empty values are omitted from API requests. However, any field with
  21030. // an empty value appearing in NullFields will be sent to the server as
  21031. // null. It is an error if a field in this list has a non-empty value.
  21032. // This may be used to include null fields in Patch requests.
  21033. NullFields []string `json:"-"`
  21034. }
  21035. func (s *SecurityPolicyRuleMatcherConfig) MarshalJSON() ([]byte, error) {
  21036. type NoMethod SecurityPolicyRuleMatcherConfig
  21037. raw := NoMethod(*s)
  21038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21039. }
  21040. // SerialPortOutput: An instance's serial console output.
  21041. type SerialPortOutput struct {
  21042. // Contents: [Output Only] The contents of the console output.
  21043. Contents string `json:"contents,omitempty"`
  21044. // Kind: [Output Only] Type of the resource. Always
  21045. // compute#serialPortOutput for serial port output.
  21046. Kind string `json:"kind,omitempty"`
  21047. // Next: [Output Only] The position of the next byte of content from the
  21048. // serial console output. Use this value in the next request as the
  21049. // start parameter.
  21050. Next int64 `json:"next,omitempty,string"`
  21051. // SelfLink: [Output Only] Server-defined URL for this resource.
  21052. SelfLink string `json:"selfLink,omitempty"`
  21053. // Start: The starting byte position of the output that was returned.
  21054. // This should match the start parameter sent with the request. If the
  21055. // serial console output exceeds the size of the buffer, older output
  21056. // will be overwritten by newer content and the start values will be
  21057. // mismatched.
  21058. Start int64 `json:"start,omitempty,string"`
  21059. // ServerResponse contains the HTTP response code and headers from the
  21060. // server.
  21061. googleapi.ServerResponse `json:"-"`
  21062. // ForceSendFields is a list of field names (e.g. "Contents") to
  21063. // unconditionally include in API requests. By default, fields with
  21064. // empty values are omitted from API requests. However, any non-pointer,
  21065. // non-interface field appearing in ForceSendFields will be sent to the
  21066. // server regardless of whether the field is empty or not. This may be
  21067. // used to include empty fields in Patch requests.
  21068. ForceSendFields []string `json:"-"`
  21069. // NullFields is a list of field names (e.g. "Contents") to include in
  21070. // API requests with the JSON null value. By default, fields with empty
  21071. // values are omitted from API requests. However, any field with an
  21072. // empty value appearing in NullFields will be sent to the server as
  21073. // null. It is an error if a field in this list has a non-empty value.
  21074. // This may be used to include null fields in Patch requests.
  21075. NullFields []string `json:"-"`
  21076. }
  21077. func (s *SerialPortOutput) MarshalJSON() ([]byte, error) {
  21078. type NoMethod SerialPortOutput
  21079. raw := NoMethod(*s)
  21080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21081. }
  21082. // ServiceAccount: A service account.
  21083. type ServiceAccount struct {
  21084. // Email: Email address of the service account.
  21085. Email string `json:"email,omitempty"`
  21086. // Scopes: The list of scopes to be made available for this service
  21087. // account.
  21088. Scopes []string `json:"scopes,omitempty"`
  21089. // ForceSendFields is a list of field names (e.g. "Email") to
  21090. // unconditionally include in API requests. By default, fields with
  21091. // empty values are omitted from API requests. However, any non-pointer,
  21092. // non-interface field appearing in ForceSendFields will be sent to the
  21093. // server regardless of whether the field is empty or not. This may be
  21094. // used to include empty fields in Patch requests.
  21095. ForceSendFields []string `json:"-"`
  21096. // NullFields is a list of field names (e.g. "Email") to include in API
  21097. // requests with the JSON null value. By default, fields with empty
  21098. // values are omitted from API requests. However, any field with an
  21099. // empty value appearing in NullFields will be sent to the server as
  21100. // null. It is an error if a field in this list has a non-empty value.
  21101. // This may be used to include null fields in Patch requests.
  21102. NullFields []string `json:"-"`
  21103. }
  21104. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  21105. type NoMethod ServiceAccount
  21106. raw := NoMethod(*s)
  21107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21108. }
  21109. // ShieldedInstanceConfig: A set of Shielded Instance options.
  21110. type ShieldedInstanceConfig struct {
  21111. // EnableIntegrityMonitoring: Defines whether the instance has integrity
  21112. // monitoring enabled.
  21113. EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  21114. // EnableSecureBoot: Defines whether the instance has Secure Boot
  21115. // enabled.
  21116. EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  21117. // EnableVtpm: Defines whether the instance has the vTPM enabled.
  21118. EnableVtpm bool `json:"enableVtpm,omitempty"`
  21119. // ForceSendFields is a list of field names (e.g.
  21120. // "EnableIntegrityMonitoring") to unconditionally include in API
  21121. // requests. By default, fields with empty values are omitted from API
  21122. // requests. However, any non-pointer, non-interface field appearing in
  21123. // ForceSendFields will be sent to the server regardless of whether the
  21124. // field is empty or not. This may be used to include empty fields in
  21125. // Patch requests.
  21126. ForceSendFields []string `json:"-"`
  21127. // NullFields is a list of field names (e.g.
  21128. // "EnableIntegrityMonitoring") to include in API requests with the JSON
  21129. // null value. By default, fields with empty values are omitted from API
  21130. // requests. However, any field with an empty value appearing in
  21131. // NullFields will be sent to the server as null. It is an error if a
  21132. // field in this list has a non-empty value. This may be used to include
  21133. // null fields in Patch requests.
  21134. NullFields []string `json:"-"`
  21135. }
  21136. func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
  21137. type NoMethod ShieldedInstanceConfig
  21138. raw := NoMethod(*s)
  21139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21140. }
  21141. // ShieldedInstanceIdentity: A shielded Instance identity entry.
  21142. type ShieldedInstanceIdentity struct {
  21143. // EncryptionKey: An Endorsement Key (EK) issued to the Shielded
  21144. // Instance's vTPM.
  21145. EncryptionKey *ShieldedInstanceIdentityEntry `json:"encryptionKey,omitempty"`
  21146. // Kind: [Output Only] Type of the resource. Always
  21147. // compute#shieldedInstanceIdentity for shielded Instance identity
  21148. // entry.
  21149. Kind string `json:"kind,omitempty"`
  21150. // SigningKey: An Attestation Key (AK) issued to the Shielded Instance's
  21151. // vTPM.
  21152. SigningKey *ShieldedInstanceIdentityEntry `json:"signingKey,omitempty"`
  21153. // ServerResponse contains the HTTP response code and headers from the
  21154. // server.
  21155. googleapi.ServerResponse `json:"-"`
  21156. // ForceSendFields is a list of field names (e.g. "EncryptionKey") to
  21157. // unconditionally include in API requests. By default, fields with
  21158. // empty values are omitted from API requests. However, any non-pointer,
  21159. // non-interface field appearing in ForceSendFields will be sent to the
  21160. // server regardless of whether the field is empty or not. This may be
  21161. // used to include empty fields in Patch requests.
  21162. ForceSendFields []string `json:"-"`
  21163. // NullFields is a list of field names (e.g. "EncryptionKey") to include
  21164. // in API requests with the JSON null value. By default, fields with
  21165. // empty values are omitted from API requests. However, any field with
  21166. // an empty value appearing in NullFields will be sent to the server as
  21167. // null. It is an error if a field in this list has a non-empty value.
  21168. // This may be used to include null fields in Patch requests.
  21169. NullFields []string `json:"-"`
  21170. }
  21171. func (s *ShieldedInstanceIdentity) MarshalJSON() ([]byte, error) {
  21172. type NoMethod ShieldedInstanceIdentity
  21173. raw := NoMethod(*s)
  21174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21175. }
  21176. // ShieldedInstanceIdentityEntry: A Shielded Instance Identity Entry.
  21177. type ShieldedInstanceIdentityEntry struct {
  21178. // EkCert: A PEM-encoded X.509 certificate. This field can be empty.
  21179. EkCert string `json:"ekCert,omitempty"`
  21180. // EkPub: A PEM-encoded public key.
  21181. EkPub string `json:"ekPub,omitempty"`
  21182. // ForceSendFields is a list of field names (e.g. "EkCert") to
  21183. // unconditionally include in API requests. By default, fields with
  21184. // empty values are omitted from API requests. However, any non-pointer,
  21185. // non-interface field appearing in ForceSendFields will be sent to the
  21186. // server regardless of whether the field is empty or not. This may be
  21187. // used to include empty fields in Patch requests.
  21188. ForceSendFields []string `json:"-"`
  21189. // NullFields is a list of field names (e.g. "EkCert") to include in API
  21190. // requests with the JSON null value. By default, fields with empty
  21191. // values are omitted from API requests. However, any field with an
  21192. // empty value appearing in NullFields will be sent to the server as
  21193. // null. It is an error if a field in this list has a non-empty value.
  21194. // This may be used to include null fields in Patch requests.
  21195. NullFields []string `json:"-"`
  21196. }
  21197. func (s *ShieldedInstanceIdentityEntry) MarshalJSON() ([]byte, error) {
  21198. type NoMethod ShieldedInstanceIdentityEntry
  21199. raw := NoMethod(*s)
  21200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21201. }
  21202. // ShieldedInstanceIntegrityPolicy: The policy describes the baseline
  21203. // against which Instance boot integrity is measured.
  21204. type ShieldedInstanceIntegrityPolicy struct {
  21205. // UpdateAutoLearnPolicy: Updates the integrity policy baseline using
  21206. // the measurements from the VM instance's most recent boot.
  21207. UpdateAutoLearnPolicy bool `json:"updateAutoLearnPolicy,omitempty"`
  21208. // ForceSendFields is a list of field names (e.g.
  21209. // "UpdateAutoLearnPolicy") to unconditionally include in API requests.
  21210. // By default, fields with empty values are omitted from API requests.
  21211. // However, any non-pointer, non-interface field appearing in
  21212. // ForceSendFields will be sent to the server regardless of whether the
  21213. // field is empty or not. This may be used to include empty fields in
  21214. // Patch requests.
  21215. ForceSendFields []string `json:"-"`
  21216. // NullFields is a list of field names (e.g. "UpdateAutoLearnPolicy") to
  21217. // include in API requests with the JSON null value. By default, fields
  21218. // with empty values are omitted from API requests. However, any field
  21219. // with an empty value appearing in NullFields will be sent to the
  21220. // server as null. It is an error if a field in this list has a
  21221. // non-empty value. This may be used to include null fields in Patch
  21222. // requests.
  21223. NullFields []string `json:"-"`
  21224. }
  21225. func (s *ShieldedInstanceIntegrityPolicy) MarshalJSON() ([]byte, error) {
  21226. type NoMethod ShieldedInstanceIntegrityPolicy
  21227. raw := NoMethod(*s)
  21228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21229. }
  21230. // SignedUrlKey: Represents a customer-supplied Signing Key used by
  21231. // Cloud CDN Signed URLs
  21232. type SignedUrlKey struct {
  21233. // KeyName: Name of the key. The name must be 1-63 characters long, and
  21234. // comply with RFC1035. Specifically, the name must be 1-63 characters
  21235. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  21236. // which means the first character must be a lowercase letter, and all
  21237. // following characters must be a dash, lowercase letter, or digit,
  21238. // except the last character, which cannot be a dash.
  21239. KeyName string `json:"keyName,omitempty"`
  21240. // KeyValue: 128-bit key value used for signing the URL. The key value
  21241. // must be a valid RFC 4648 Section 5 base64url encoded string.
  21242. KeyValue string `json:"keyValue,omitempty"`
  21243. // ForceSendFields is a list of field names (e.g. "KeyName") to
  21244. // unconditionally include in API requests. By default, fields with
  21245. // empty values are omitted from API requests. However, any non-pointer,
  21246. // non-interface field appearing in ForceSendFields will be sent to the
  21247. // server regardless of whether the field is empty or not. This may be
  21248. // used to include empty fields in Patch requests.
  21249. ForceSendFields []string `json:"-"`
  21250. // NullFields is a list of field names (e.g. "KeyName") to include in
  21251. // API requests with the JSON null value. By default, fields with empty
  21252. // values are omitted from API requests. However, any field with an
  21253. // empty value appearing in NullFields will be sent to the server as
  21254. // null. It is an error if a field in this list has a non-empty value.
  21255. // This may be used to include null fields in Patch requests.
  21256. NullFields []string `json:"-"`
  21257. }
  21258. func (s *SignedUrlKey) MarshalJSON() ([]byte, error) {
  21259. type NoMethod SignedUrlKey
  21260. raw := NoMethod(*s)
  21261. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21262. }
  21263. // Snapshot: A persistent disk snapshot resource. (== resource_for
  21264. // beta.snapshots ==) (== resource_for v1.snapshots ==)
  21265. type Snapshot struct {
  21266. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21267. // format.
  21268. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21269. // Description: An optional description of this resource. Provide this
  21270. // property when you create the resource.
  21271. Description string `json:"description,omitempty"`
  21272. // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB.
  21273. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
  21274. // Id: [Output Only] The unique identifier for the resource. This
  21275. // identifier is defined by the server.
  21276. Id uint64 `json:"id,omitempty,string"`
  21277. // Kind: [Output Only] Type of the resource. Always compute#snapshot for
  21278. // Snapshot resources.
  21279. Kind string `json:"kind,omitempty"`
  21280. // LabelFingerprint: A fingerprint for the labels being applied to this
  21281. // snapshot, which is essentially a hash of the labels set used for
  21282. // optimistic locking. The fingerprint is initially generated by Compute
  21283. // Engine and changes after every request to modify or update labels.
  21284. // You must always provide an up-to-date fingerprint hash in order to
  21285. // update or change labels, otherwise the request will fail with error
  21286. // 412 conditionNotMet.
  21287. //
  21288. // To see the latest fingerprint, make a get() request to retrieve a
  21289. // snapshot.
  21290. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  21291. // Labels: Labels to apply to this snapshot. These can be later modified
  21292. // by the setLabels method. Label values may be empty.
  21293. Labels map[string]string `json:"labels,omitempty"`
  21294. // LicenseCodes: [Output Only] Integer license codes indicating which
  21295. // licenses are attached to this snapshot.
  21296. LicenseCodes googleapi.Int64s `json:"licenseCodes,omitempty"`
  21297. // Licenses: [Output Only] A list of public visible licenses that apply
  21298. // to this snapshot. This can be because the original image had licenses
  21299. // attached (such as a Windows image).
  21300. Licenses []string `json:"licenses,omitempty"`
  21301. // Name: Name of the resource; provided by the client when the resource
  21302. // is created. The name must be 1-63 characters long, and comply with
  21303. // RFC1035. Specifically, the name must be 1-63 characters long and
  21304. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21305. // the first character must be a lowercase letter, and all following
  21306. // characters must be a dash, lowercase letter, or digit, except the
  21307. // last character, which cannot be a dash.
  21308. Name string `json:"name,omitempty"`
  21309. // SelfLink: [Output Only] Server-defined URL for the resource.
  21310. SelfLink string `json:"selfLink,omitempty"`
  21311. // SnapshotEncryptionKey: Encrypts the snapshot using a
  21312. // customer-supplied encryption key.
  21313. //
  21314. // After you encrypt a snapshot using a customer-supplied key, you must
  21315. // provide the same key if you use the snapshot later. For example, you
  21316. // must provide the encryption key when you create a disk from the
  21317. // encrypted snapshot in a future request.
  21318. //
  21319. // Customer-supplied encryption keys do not protect access to metadata
  21320. // of the snapshot.
  21321. //
  21322. // If you do not provide an encryption key when creating the snapshot,
  21323. // then the snapshot will be encrypted using an automatically generated
  21324. // key and you do not need to provide a key to use the snapshot later.
  21325. SnapshotEncryptionKey *CustomerEncryptionKey `json:"snapshotEncryptionKey,omitempty"`
  21326. // SourceDisk: [Output Only] The source disk used to create this
  21327. // snapshot.
  21328. SourceDisk string `json:"sourceDisk,omitempty"`
  21329. // SourceDiskEncryptionKey: The customer-supplied encryption key of the
  21330. // source disk. Required if the source disk is protected by a
  21331. // customer-supplied encryption key.
  21332. SourceDiskEncryptionKey *CustomerEncryptionKey `json:"sourceDiskEncryptionKey,omitempty"`
  21333. // SourceDiskId: [Output Only] The ID value of the disk used to create
  21334. // this snapshot. This value may be used to determine whether the
  21335. // snapshot was taken from the current or a previous instance of a given
  21336. // disk name.
  21337. SourceDiskId string `json:"sourceDiskId,omitempty"`
  21338. // Status: [Output Only] The status of the snapshot. This can be
  21339. // CREATING, DELETING, FAILED, READY, or UPLOADING.
  21340. //
  21341. // Possible values:
  21342. // "CREATING"
  21343. // "DELETING"
  21344. // "FAILED"
  21345. // "READY"
  21346. // "UPLOADING"
  21347. Status string `json:"status,omitempty"`
  21348. // StorageBytes: [Output Only] A size of the storage used by the
  21349. // snapshot. As snapshots share storage, this number is expected to
  21350. // change with snapshot creation/deletion.
  21351. StorageBytes int64 `json:"storageBytes,omitempty,string"`
  21352. // StorageBytesStatus: [Output Only] An indicator whether storageBytes
  21353. // is in a stable state or it is being adjusted as a result of shared
  21354. // storage reallocation. This status can either be UPDATING, meaning the
  21355. // size of the snapshot is being updated, or UP_TO_DATE, meaning the
  21356. // size of the snapshot is up-to-date.
  21357. //
  21358. // Possible values:
  21359. // "UPDATING"
  21360. // "UP_TO_DATE"
  21361. StorageBytesStatus string `json:"storageBytesStatus,omitempty"`
  21362. // StorageLocations: GCS bucket storage location of the snapshot
  21363. // (regional or multi-regional).
  21364. StorageLocations []string `json:"storageLocations,omitempty"`
  21365. // ServerResponse contains the HTTP response code and headers from the
  21366. // server.
  21367. googleapi.ServerResponse `json:"-"`
  21368. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21369. // to unconditionally include in API requests. By default, fields with
  21370. // empty values are omitted from API requests. However, any non-pointer,
  21371. // non-interface field appearing in ForceSendFields will be sent to the
  21372. // server regardless of whether the field is empty or not. This may be
  21373. // used to include empty fields in Patch requests.
  21374. ForceSendFields []string `json:"-"`
  21375. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21376. // include in API requests with the JSON null value. By default, fields
  21377. // with empty values are omitted from API requests. However, any field
  21378. // with an empty value appearing in NullFields will be sent to the
  21379. // server as null. It is an error if a field in this list has a
  21380. // non-empty value. This may be used to include null fields in Patch
  21381. // requests.
  21382. NullFields []string `json:"-"`
  21383. }
  21384. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  21385. type NoMethod Snapshot
  21386. raw := NoMethod(*s)
  21387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21388. }
  21389. // SnapshotList: Contains a list of Snapshot resources.
  21390. type SnapshotList struct {
  21391. // Id: [Output Only] Unique identifier for the resource; defined by the
  21392. // server.
  21393. Id string `json:"id,omitempty"`
  21394. // Items: A list of Snapshot resources.
  21395. Items []*Snapshot `json:"items,omitempty"`
  21396. // Kind: Type of resource.
  21397. Kind string `json:"kind,omitempty"`
  21398. // NextPageToken: [Output Only] This token allows you to get the next
  21399. // page of results for list requests. If the number of results is larger
  21400. // than maxResults, use the nextPageToken as a value for the query
  21401. // parameter pageToken in the next list request. Subsequent list
  21402. // requests will have their own nextPageToken to continue paging through
  21403. // the results.
  21404. NextPageToken string `json:"nextPageToken,omitempty"`
  21405. // SelfLink: [Output Only] Server-defined URL for this resource.
  21406. SelfLink string `json:"selfLink,omitempty"`
  21407. // Warning: [Output Only] Informational warning message.
  21408. Warning *SnapshotListWarning `json:"warning,omitempty"`
  21409. // ServerResponse contains the HTTP response code and headers from the
  21410. // server.
  21411. googleapi.ServerResponse `json:"-"`
  21412. // ForceSendFields is a list of field names (e.g. "Id") to
  21413. // unconditionally include in API requests. By default, fields with
  21414. // empty values are omitted from API requests. However, any non-pointer,
  21415. // non-interface field appearing in ForceSendFields will be sent to the
  21416. // server regardless of whether the field is empty or not. This may be
  21417. // used to include empty fields in Patch requests.
  21418. ForceSendFields []string `json:"-"`
  21419. // NullFields is a list of field names (e.g. "Id") to include in API
  21420. // requests with the JSON null value. By default, fields with empty
  21421. // values are omitted from API requests. However, any field with an
  21422. // empty value appearing in NullFields will be sent to the server as
  21423. // null. It is an error if a field in this list has a non-empty value.
  21424. // This may be used to include null fields in Patch requests.
  21425. NullFields []string `json:"-"`
  21426. }
  21427. func (s *SnapshotList) MarshalJSON() ([]byte, error) {
  21428. type NoMethod SnapshotList
  21429. raw := NoMethod(*s)
  21430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21431. }
  21432. // SnapshotListWarning: [Output Only] Informational warning message.
  21433. type SnapshotListWarning struct {
  21434. // Code: [Output Only] A warning code, if applicable. For example,
  21435. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21436. // the response.
  21437. //
  21438. // Possible values:
  21439. // "CLEANUP_FAILED"
  21440. // "DEPRECATED_RESOURCE_USED"
  21441. // "DEPRECATED_TYPE_USED"
  21442. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21443. // "EXPERIMENTAL_TYPE_USED"
  21444. // "EXTERNAL_API_WARNING"
  21445. // "FIELD_VALUE_OVERRIDEN"
  21446. // "INJECTED_KERNELS_DEPRECATED"
  21447. // "MISSING_TYPE_DEPENDENCY"
  21448. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21449. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21450. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21451. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21452. // "NEXT_HOP_NOT_RUNNING"
  21453. // "NOT_CRITICAL_ERROR"
  21454. // "NO_RESULTS_ON_PAGE"
  21455. // "REQUIRED_TOS_AGREEMENT"
  21456. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21457. // "RESOURCE_NOT_DELETED"
  21458. // "SCHEMA_VALIDATION_IGNORED"
  21459. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21460. // "UNDECLARED_PROPERTIES"
  21461. // "UNREACHABLE"
  21462. Code string `json:"code,omitempty"`
  21463. // Data: [Output Only] Metadata about this warning in key: value format.
  21464. // For example:
  21465. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21466. Data []*SnapshotListWarningData `json:"data,omitempty"`
  21467. // Message: [Output Only] A human-readable description of the warning
  21468. // code.
  21469. Message string `json:"message,omitempty"`
  21470. // ForceSendFields is a list of field names (e.g. "Code") to
  21471. // unconditionally include in API requests. By default, fields with
  21472. // empty values are omitted from API requests. However, any non-pointer,
  21473. // non-interface field appearing in ForceSendFields will be sent to the
  21474. // server regardless of whether the field is empty or not. This may be
  21475. // used to include empty fields in Patch requests.
  21476. ForceSendFields []string `json:"-"`
  21477. // NullFields is a list of field names (e.g. "Code") to include in API
  21478. // requests with the JSON null value. By default, fields with empty
  21479. // values are omitted from API requests. However, any field with an
  21480. // empty value appearing in NullFields will be sent to the server as
  21481. // null. It is an error if a field in this list has a non-empty value.
  21482. // This may be used to include null fields in Patch requests.
  21483. NullFields []string `json:"-"`
  21484. }
  21485. func (s *SnapshotListWarning) MarshalJSON() ([]byte, error) {
  21486. type NoMethod SnapshotListWarning
  21487. raw := NoMethod(*s)
  21488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21489. }
  21490. type SnapshotListWarningData struct {
  21491. // Key: [Output Only] A key that provides more detail on the warning
  21492. // being returned. For example, for warnings where there are no results
  21493. // in a list request for a particular zone, this key might be scope and
  21494. // the key value might be the zone name. Other examples might be a key
  21495. // indicating a deprecated resource and a suggested replacement, or a
  21496. // warning about invalid network settings (for example, if an instance
  21497. // attempts to perform IP forwarding but is not enabled for IP
  21498. // forwarding).
  21499. Key string `json:"key,omitempty"`
  21500. // Value: [Output Only] A warning data value corresponding to the key.
  21501. Value string `json:"value,omitempty"`
  21502. // ForceSendFields is a list of field names (e.g. "Key") to
  21503. // unconditionally include in API requests. By default, fields with
  21504. // empty values are omitted from API requests. However, any non-pointer,
  21505. // non-interface field appearing in ForceSendFields will be sent to the
  21506. // server regardless of whether the field is empty or not. This may be
  21507. // used to include empty fields in Patch requests.
  21508. ForceSendFields []string `json:"-"`
  21509. // NullFields is a list of field names (e.g. "Key") to include in API
  21510. // requests with the JSON null value. By default, fields with empty
  21511. // values are omitted from API requests. However, any field with an
  21512. // empty value appearing in NullFields will be sent to the server as
  21513. // null. It is an error if a field in this list has a non-empty value.
  21514. // This may be used to include null fields in Patch requests.
  21515. NullFields []string `json:"-"`
  21516. }
  21517. func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) {
  21518. type NoMethod SnapshotListWarningData
  21519. raw := NoMethod(*s)
  21520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21521. }
  21522. // SourceInstanceParams: A specification of the parameters to use when
  21523. // creating the instance template from a source instance.
  21524. type SourceInstanceParams struct {
  21525. // DiskConfigs: Attached disks configuration. If not provided, defaults
  21526. // are applied: For boot disk and any other R/W disks, new custom images
  21527. // will be created from each disk. For read-only disks, they will be
  21528. // attached in read-only mode. Local SSD disks will be created as blank
  21529. // volumes.
  21530. DiskConfigs []*DiskInstantiationConfig `json:"diskConfigs,omitempty"`
  21531. // ForceSendFields is a list of field names (e.g. "DiskConfigs") to
  21532. // unconditionally include in API requests. By default, fields with
  21533. // empty values are omitted from API requests. However, any non-pointer,
  21534. // non-interface field appearing in ForceSendFields will be sent to the
  21535. // server regardless of whether the field is empty or not. This may be
  21536. // used to include empty fields in Patch requests.
  21537. ForceSendFields []string `json:"-"`
  21538. // NullFields is a list of field names (e.g. "DiskConfigs") to include
  21539. // in API requests with the JSON null value. By default, fields with
  21540. // empty values are omitted from API requests. However, any field with
  21541. // an empty value appearing in NullFields will be sent to the server as
  21542. // null. It is an error if a field in this list has a non-empty value.
  21543. // This may be used to include null fields in Patch requests.
  21544. NullFields []string `json:"-"`
  21545. }
  21546. func (s *SourceInstanceParams) MarshalJSON() ([]byte, error) {
  21547. type NoMethod SourceInstanceParams
  21548. raw := NoMethod(*s)
  21549. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21550. }
  21551. // SslCertificate: An SslCertificate resource. This resource provides a
  21552. // mechanism to upload an SSL key and certificate to the load balancer
  21553. // to serve secure connections from the user. (== resource_for
  21554. // beta.sslCertificates ==) (== resource_for v1.sslCertificates ==)
  21555. type SslCertificate struct {
  21556. // Certificate: A local certificate file. The certificate must be in PEM
  21557. // format. The certificate chain must be no greater than 5 certs long.
  21558. // The chain must include at least one intermediate cert.
  21559. Certificate string `json:"certificate,omitempty"`
  21560. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21561. // format.
  21562. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21563. // Description: An optional description of this resource. Provide this
  21564. // property when you create the resource.
  21565. Description string `json:"description,omitempty"`
  21566. // Id: [Output Only] The unique identifier for the resource. This
  21567. // identifier is defined by the server.
  21568. Id uint64 `json:"id,omitempty,string"`
  21569. // Kind: [Output Only] Type of the resource. Always
  21570. // compute#sslCertificate for SSL certificates.
  21571. Kind string `json:"kind,omitempty"`
  21572. // Name: Name of the resource. Provided by the client when the resource
  21573. // is created. The name must be 1-63 characters long, and comply with
  21574. // RFC1035. Specifically, the name must be 1-63 characters long and
  21575. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  21576. // the first character must be a lowercase letter, and all following
  21577. // characters must be a dash, lowercase letter, or digit, except the
  21578. // last character, which cannot be a dash.
  21579. Name string `json:"name,omitempty"`
  21580. // PrivateKey: A write-only private key in PEM format. Only insert
  21581. // requests will include this field.
  21582. PrivateKey string `json:"privateKey,omitempty"`
  21583. // SelfLink: [Output only] Server-defined URL for the resource.
  21584. SelfLink string `json:"selfLink,omitempty"`
  21585. // ServerResponse contains the HTTP response code and headers from the
  21586. // server.
  21587. googleapi.ServerResponse `json:"-"`
  21588. // ForceSendFields is a list of field names (e.g. "Certificate") to
  21589. // unconditionally include in API requests. By default, fields with
  21590. // empty values are omitted from API requests. However, any non-pointer,
  21591. // non-interface field appearing in ForceSendFields will be sent to the
  21592. // server regardless of whether the field is empty or not. This may be
  21593. // used to include empty fields in Patch requests.
  21594. ForceSendFields []string `json:"-"`
  21595. // NullFields is a list of field names (e.g. "Certificate") to include
  21596. // in API requests with the JSON null value. By default, fields with
  21597. // empty values are omitted from API requests. However, any field with
  21598. // an empty value appearing in NullFields will be sent to the server as
  21599. // null. It is an error if a field in this list has a non-empty value.
  21600. // This may be used to include null fields in Patch requests.
  21601. NullFields []string `json:"-"`
  21602. }
  21603. func (s *SslCertificate) MarshalJSON() ([]byte, error) {
  21604. type NoMethod SslCertificate
  21605. raw := NoMethod(*s)
  21606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21607. }
  21608. // SslCertificateList: Contains a list of SslCertificate resources.
  21609. type SslCertificateList struct {
  21610. // Id: [Output Only] Unique identifier for the resource; defined by the
  21611. // server.
  21612. Id string `json:"id,omitempty"`
  21613. // Items: A list of SslCertificate resources.
  21614. Items []*SslCertificate `json:"items,omitempty"`
  21615. // Kind: Type of resource.
  21616. Kind string `json:"kind,omitempty"`
  21617. // NextPageToken: [Output Only] This token allows you to get the next
  21618. // page of results for list requests. If the number of results is larger
  21619. // than maxResults, use the nextPageToken as a value for the query
  21620. // parameter pageToken in the next list request. Subsequent list
  21621. // requests will have their own nextPageToken to continue paging through
  21622. // the results.
  21623. NextPageToken string `json:"nextPageToken,omitempty"`
  21624. // SelfLink: [Output Only] Server-defined URL for this resource.
  21625. SelfLink string `json:"selfLink,omitempty"`
  21626. // Warning: [Output Only] Informational warning message.
  21627. Warning *SslCertificateListWarning `json:"warning,omitempty"`
  21628. // ServerResponse contains the HTTP response code and headers from the
  21629. // server.
  21630. googleapi.ServerResponse `json:"-"`
  21631. // ForceSendFields is a list of field names (e.g. "Id") to
  21632. // unconditionally include in API requests. By default, fields with
  21633. // empty values are omitted from API requests. However, any non-pointer,
  21634. // non-interface field appearing in ForceSendFields will be sent to the
  21635. // server regardless of whether the field is empty or not. This may be
  21636. // used to include empty fields in Patch requests.
  21637. ForceSendFields []string `json:"-"`
  21638. // NullFields is a list of field names (e.g. "Id") to include in API
  21639. // requests with the JSON null value. By default, fields with empty
  21640. // values are omitted from API requests. However, any field with an
  21641. // empty value appearing in NullFields will be sent to the server as
  21642. // null. It is an error if a field in this list has a non-empty value.
  21643. // This may be used to include null fields in Patch requests.
  21644. NullFields []string `json:"-"`
  21645. }
  21646. func (s *SslCertificateList) MarshalJSON() ([]byte, error) {
  21647. type NoMethod SslCertificateList
  21648. raw := NoMethod(*s)
  21649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21650. }
  21651. // SslCertificateListWarning: [Output Only] Informational warning
  21652. // message.
  21653. type SslCertificateListWarning struct {
  21654. // Code: [Output Only] A warning code, if applicable. For example,
  21655. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21656. // the response.
  21657. //
  21658. // Possible values:
  21659. // "CLEANUP_FAILED"
  21660. // "DEPRECATED_RESOURCE_USED"
  21661. // "DEPRECATED_TYPE_USED"
  21662. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21663. // "EXPERIMENTAL_TYPE_USED"
  21664. // "EXTERNAL_API_WARNING"
  21665. // "FIELD_VALUE_OVERRIDEN"
  21666. // "INJECTED_KERNELS_DEPRECATED"
  21667. // "MISSING_TYPE_DEPENDENCY"
  21668. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21669. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21670. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21671. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21672. // "NEXT_HOP_NOT_RUNNING"
  21673. // "NOT_CRITICAL_ERROR"
  21674. // "NO_RESULTS_ON_PAGE"
  21675. // "REQUIRED_TOS_AGREEMENT"
  21676. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21677. // "RESOURCE_NOT_DELETED"
  21678. // "SCHEMA_VALIDATION_IGNORED"
  21679. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21680. // "UNDECLARED_PROPERTIES"
  21681. // "UNREACHABLE"
  21682. Code string `json:"code,omitempty"`
  21683. // Data: [Output Only] Metadata about this warning in key: value format.
  21684. // For example:
  21685. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21686. Data []*SslCertificateListWarningData `json:"data,omitempty"`
  21687. // Message: [Output Only] A human-readable description of the warning
  21688. // code.
  21689. Message string `json:"message,omitempty"`
  21690. // ForceSendFields is a list of field names (e.g. "Code") to
  21691. // unconditionally include in API requests. By default, fields with
  21692. // empty values are omitted from API requests. However, any non-pointer,
  21693. // non-interface field appearing in ForceSendFields will be sent to the
  21694. // server regardless of whether the field is empty or not. This may be
  21695. // used to include empty fields in Patch requests.
  21696. ForceSendFields []string `json:"-"`
  21697. // NullFields is a list of field names (e.g. "Code") to include in API
  21698. // requests with the JSON null value. By default, fields with empty
  21699. // values are omitted from API requests. However, any field with an
  21700. // empty value appearing in NullFields will be sent to the server as
  21701. // null. It is an error if a field in this list has a non-empty value.
  21702. // This may be used to include null fields in Patch requests.
  21703. NullFields []string `json:"-"`
  21704. }
  21705. func (s *SslCertificateListWarning) MarshalJSON() ([]byte, error) {
  21706. type NoMethod SslCertificateListWarning
  21707. raw := NoMethod(*s)
  21708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21709. }
  21710. type SslCertificateListWarningData struct {
  21711. // Key: [Output Only] A key that provides more detail on the warning
  21712. // being returned. For example, for warnings where there are no results
  21713. // in a list request for a particular zone, this key might be scope and
  21714. // the key value might be the zone name. Other examples might be a key
  21715. // indicating a deprecated resource and a suggested replacement, or a
  21716. // warning about invalid network settings (for example, if an instance
  21717. // attempts to perform IP forwarding but is not enabled for IP
  21718. // forwarding).
  21719. Key string `json:"key,omitempty"`
  21720. // Value: [Output Only] A warning data value corresponding to the key.
  21721. Value string `json:"value,omitempty"`
  21722. // ForceSendFields is a list of field names (e.g. "Key") to
  21723. // unconditionally include in API requests. By default, fields with
  21724. // empty values are omitted from API requests. However, any non-pointer,
  21725. // non-interface field appearing in ForceSendFields will be sent to the
  21726. // server regardless of whether the field is empty or not. This may be
  21727. // used to include empty fields in Patch requests.
  21728. ForceSendFields []string `json:"-"`
  21729. // NullFields is a list of field names (e.g. "Key") to include in API
  21730. // requests with the JSON null value. By default, fields with empty
  21731. // values are omitted from API requests. However, any field with an
  21732. // empty value appearing in NullFields will be sent to the server as
  21733. // null. It is an error if a field in this list has a non-empty value.
  21734. // This may be used to include null fields in Patch requests.
  21735. NullFields []string `json:"-"`
  21736. }
  21737. func (s *SslCertificateListWarningData) MarshalJSON() ([]byte, error) {
  21738. type NoMethod SslCertificateListWarningData
  21739. raw := NoMethod(*s)
  21740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21741. }
  21742. type SslPoliciesList struct {
  21743. // Id: [Output Only] Unique identifier for the resource; defined by the
  21744. // server.
  21745. Id string `json:"id,omitempty"`
  21746. // Items: A list of SslPolicy resources.
  21747. Items []*SslPolicy `json:"items,omitempty"`
  21748. // Kind: [Output Only] Type of the resource. Always
  21749. // compute#sslPoliciesList for lists of sslPolicies.
  21750. Kind string `json:"kind,omitempty"`
  21751. // NextPageToken: [Output Only] This token allows you to get the next
  21752. // page of results for list requests. If the number of results is larger
  21753. // than maxResults, use the nextPageToken as a value for the query
  21754. // parameter pageToken in the next list request. Subsequent list
  21755. // requests will have their own nextPageToken to continue paging through
  21756. // the results.
  21757. NextPageToken string `json:"nextPageToken,omitempty"`
  21758. // SelfLink: [Output Only] Server-defined URL for this resource.
  21759. SelfLink string `json:"selfLink,omitempty"`
  21760. // Warning: [Output Only] Informational warning message.
  21761. Warning *SslPoliciesListWarning `json:"warning,omitempty"`
  21762. // ServerResponse contains the HTTP response code and headers from the
  21763. // server.
  21764. googleapi.ServerResponse `json:"-"`
  21765. // ForceSendFields is a list of field names (e.g. "Id") to
  21766. // unconditionally include in API requests. By default, fields with
  21767. // empty values are omitted from API requests. However, any non-pointer,
  21768. // non-interface field appearing in ForceSendFields will be sent to the
  21769. // server regardless of whether the field is empty or not. This may be
  21770. // used to include empty fields in Patch requests.
  21771. ForceSendFields []string `json:"-"`
  21772. // NullFields is a list of field names (e.g. "Id") to include in API
  21773. // requests with the JSON null value. By default, fields with empty
  21774. // values are omitted from API requests. However, any field with an
  21775. // empty value appearing in NullFields will be sent to the server as
  21776. // null. It is an error if a field in this list has a non-empty value.
  21777. // This may be used to include null fields in Patch requests.
  21778. NullFields []string `json:"-"`
  21779. }
  21780. func (s *SslPoliciesList) MarshalJSON() ([]byte, error) {
  21781. type NoMethod SslPoliciesList
  21782. raw := NoMethod(*s)
  21783. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21784. }
  21785. // SslPoliciesListWarning: [Output Only] Informational warning message.
  21786. type SslPoliciesListWarning struct {
  21787. // Code: [Output Only] A warning code, if applicable. For example,
  21788. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21789. // the response.
  21790. //
  21791. // Possible values:
  21792. // "CLEANUP_FAILED"
  21793. // "DEPRECATED_RESOURCE_USED"
  21794. // "DEPRECATED_TYPE_USED"
  21795. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  21796. // "EXPERIMENTAL_TYPE_USED"
  21797. // "EXTERNAL_API_WARNING"
  21798. // "FIELD_VALUE_OVERRIDEN"
  21799. // "INJECTED_KERNELS_DEPRECATED"
  21800. // "MISSING_TYPE_DEPENDENCY"
  21801. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  21802. // "NEXT_HOP_CANNOT_IP_FORWARD"
  21803. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  21804. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  21805. // "NEXT_HOP_NOT_RUNNING"
  21806. // "NOT_CRITICAL_ERROR"
  21807. // "NO_RESULTS_ON_PAGE"
  21808. // "REQUIRED_TOS_AGREEMENT"
  21809. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  21810. // "RESOURCE_NOT_DELETED"
  21811. // "SCHEMA_VALIDATION_IGNORED"
  21812. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  21813. // "UNDECLARED_PROPERTIES"
  21814. // "UNREACHABLE"
  21815. Code string `json:"code,omitempty"`
  21816. // Data: [Output Only] Metadata about this warning in key: value format.
  21817. // For example:
  21818. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  21819. Data []*SslPoliciesListWarningData `json:"data,omitempty"`
  21820. // Message: [Output Only] A human-readable description of the warning
  21821. // code.
  21822. Message string `json:"message,omitempty"`
  21823. // ForceSendFields is a list of field names (e.g. "Code") to
  21824. // unconditionally include in API requests. By default, fields with
  21825. // empty values are omitted from API requests. However, any non-pointer,
  21826. // non-interface field appearing in ForceSendFields will be sent to the
  21827. // server regardless of whether the field is empty or not. This may be
  21828. // used to include empty fields in Patch requests.
  21829. ForceSendFields []string `json:"-"`
  21830. // NullFields is a list of field names (e.g. "Code") to include in API
  21831. // requests with the JSON null value. By default, fields with empty
  21832. // values are omitted from API requests. However, any field with an
  21833. // empty value appearing in NullFields will be sent to the server as
  21834. // null. It is an error if a field in this list has a non-empty value.
  21835. // This may be used to include null fields in Patch requests.
  21836. NullFields []string `json:"-"`
  21837. }
  21838. func (s *SslPoliciesListWarning) MarshalJSON() ([]byte, error) {
  21839. type NoMethod SslPoliciesListWarning
  21840. raw := NoMethod(*s)
  21841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21842. }
  21843. type SslPoliciesListWarningData struct {
  21844. // Key: [Output Only] A key that provides more detail on the warning
  21845. // being returned. For example, for warnings where there are no results
  21846. // in a list request for a particular zone, this key might be scope and
  21847. // the key value might be the zone name. Other examples might be a key
  21848. // indicating a deprecated resource and a suggested replacement, or a
  21849. // warning about invalid network settings (for example, if an instance
  21850. // attempts to perform IP forwarding but is not enabled for IP
  21851. // forwarding).
  21852. Key string `json:"key,omitempty"`
  21853. // Value: [Output Only] A warning data value corresponding to the key.
  21854. Value string `json:"value,omitempty"`
  21855. // ForceSendFields is a list of field names (e.g. "Key") to
  21856. // unconditionally include in API requests. By default, fields with
  21857. // empty values are omitted from API requests. However, any non-pointer,
  21858. // non-interface field appearing in ForceSendFields will be sent to the
  21859. // server regardless of whether the field is empty or not. This may be
  21860. // used to include empty fields in Patch requests.
  21861. ForceSendFields []string `json:"-"`
  21862. // NullFields is a list of field names (e.g. "Key") to include in API
  21863. // requests with the JSON null value. By default, fields with empty
  21864. // values are omitted from API requests. However, any field with an
  21865. // empty value appearing in NullFields will be sent to the server as
  21866. // null. It is an error if a field in this list has a non-empty value.
  21867. // This may be used to include null fields in Patch requests.
  21868. NullFields []string `json:"-"`
  21869. }
  21870. func (s *SslPoliciesListWarningData) MarshalJSON() ([]byte, error) {
  21871. type NoMethod SslPoliciesListWarningData
  21872. raw := NoMethod(*s)
  21873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21874. }
  21875. type SslPoliciesListAvailableFeaturesResponse struct {
  21876. Features []string `json:"features,omitempty"`
  21877. // ServerResponse contains the HTTP response code and headers from the
  21878. // server.
  21879. googleapi.ServerResponse `json:"-"`
  21880. // ForceSendFields is a list of field names (e.g. "Features") to
  21881. // unconditionally include in API requests. By default, fields with
  21882. // empty values are omitted from API requests. However, any non-pointer,
  21883. // non-interface field appearing in ForceSendFields will be sent to the
  21884. // server regardless of whether the field is empty or not. This may be
  21885. // used to include empty fields in Patch requests.
  21886. ForceSendFields []string `json:"-"`
  21887. // NullFields is a list of field names (e.g. "Features") to include in
  21888. // API requests with the JSON null value. By default, fields with empty
  21889. // values are omitted from API requests. However, any field with an
  21890. // empty value appearing in NullFields will be sent to the server as
  21891. // null. It is an error if a field in this list has a non-empty value.
  21892. // This may be used to include null fields in Patch requests.
  21893. NullFields []string `json:"-"`
  21894. }
  21895. func (s *SslPoliciesListAvailableFeaturesResponse) MarshalJSON() ([]byte, error) {
  21896. type NoMethod SslPoliciesListAvailableFeaturesResponse
  21897. raw := NoMethod(*s)
  21898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21899. }
  21900. // SslPolicy: A SSL policy specifies the server-side support for SSL
  21901. // features. This can be attached to a TargetHttpsProxy or a
  21902. // TargetSslProxy. This affects connections between clients and the
  21903. // HTTPS or SSL proxy load balancer. They do not affect the connection
  21904. // between the load balancers and the backends.
  21905. type SslPolicy struct {
  21906. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  21907. // format.
  21908. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  21909. // CustomFeatures: A list of features enabled when the selected profile
  21910. // is CUSTOM. The
  21911. // - method returns the set of features that can be specified in this
  21912. // list. This field must be empty if the profile is not CUSTOM.
  21913. CustomFeatures []string `json:"customFeatures,omitempty"`
  21914. // Description: An optional description of this resource. Provide this
  21915. // property when you create the resource.
  21916. Description string `json:"description,omitempty"`
  21917. // EnabledFeatures: [Output Only] The list of features enabled in the
  21918. // SSL policy.
  21919. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  21920. // Fingerprint: Fingerprint of this resource. A hash of the contents
  21921. // stored in this object. This field is used in optimistic locking. This
  21922. // field will be ignored when inserting a SslPolicy. An up-to-date
  21923. // fingerprint must be provided in order to update the SslPolicy,
  21924. // otherwise the request will fail with error 412 conditionNotMet.
  21925. //
  21926. // To see the latest fingerprint, make a get() request to retrieve an
  21927. // SslPolicy.
  21928. Fingerprint string `json:"fingerprint,omitempty"`
  21929. // Id: [Output Only] The unique identifier for the resource. This
  21930. // identifier is defined by the server.
  21931. Id uint64 `json:"id,omitempty,string"`
  21932. // Kind: [Output only] Type of the resource. Always compute#sslPolicyfor
  21933. // SSL policies.
  21934. Kind string `json:"kind,omitempty"`
  21935. // MinTlsVersion: The minimum version of SSL protocol that can be used
  21936. // by the clients to establish a connection with the load balancer. This
  21937. // can be one of TLS_1_0, TLS_1_1, TLS_1_2.
  21938. //
  21939. // Possible values:
  21940. // "TLS_1_0"
  21941. // "TLS_1_1"
  21942. // "TLS_1_2"
  21943. MinTlsVersion string `json:"minTlsVersion,omitempty"`
  21944. // Name: Name of the resource. The name must be 1-63 characters long,
  21945. // and comply with RFC1035. Specifically, the name must be 1-63
  21946. // characters long and match the regular expression
  21947. // `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be
  21948. // a lowercase letter, and all following characters must be a dash,
  21949. // lowercase letter, or digit, except the last character, which cannot
  21950. // be a dash.
  21951. Name string `json:"name,omitempty"`
  21952. // Profile: Profile specifies the set of SSL features that can be used
  21953. // by the load balancer when negotiating SSL with clients. This can be
  21954. // one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM,
  21955. // the set of SSL features to enable must be specified in the
  21956. // customFeatures field.
  21957. //
  21958. // Possible values:
  21959. // "COMPATIBLE"
  21960. // "CUSTOM"
  21961. // "MODERN"
  21962. // "RESTRICTED"
  21963. Profile string `json:"profile,omitempty"`
  21964. // SelfLink: [Output Only] Server-defined URL for the resource.
  21965. SelfLink string `json:"selfLink,omitempty"`
  21966. // Warnings: [Output Only] If potential misconfigurations are detected
  21967. // for this SSL policy, this field will be populated with warning
  21968. // messages.
  21969. Warnings []*SslPolicyWarnings `json:"warnings,omitempty"`
  21970. // ServerResponse contains the HTTP response code and headers from the
  21971. // server.
  21972. googleapi.ServerResponse `json:"-"`
  21973. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  21974. // to unconditionally include in API requests. By default, fields with
  21975. // empty values are omitted from API requests. However, any non-pointer,
  21976. // non-interface field appearing in ForceSendFields will be sent to the
  21977. // server regardless of whether the field is empty or not. This may be
  21978. // used to include empty fields in Patch requests.
  21979. ForceSendFields []string `json:"-"`
  21980. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  21981. // include in API requests with the JSON null value. By default, fields
  21982. // with empty values are omitted from API requests. However, any field
  21983. // with an empty value appearing in NullFields will be sent to the
  21984. // server as null. It is an error if a field in this list has a
  21985. // non-empty value. This may be used to include null fields in Patch
  21986. // requests.
  21987. NullFields []string `json:"-"`
  21988. }
  21989. func (s *SslPolicy) MarshalJSON() ([]byte, error) {
  21990. type NoMethod SslPolicy
  21991. raw := NoMethod(*s)
  21992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  21993. }
  21994. type SslPolicyWarnings struct {
  21995. // Code: [Output Only] A warning code, if applicable. For example,
  21996. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  21997. // the response.
  21998. //
  21999. // Possible values:
  22000. // "CLEANUP_FAILED"
  22001. // "DEPRECATED_RESOURCE_USED"
  22002. // "DEPRECATED_TYPE_USED"
  22003. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22004. // "EXPERIMENTAL_TYPE_USED"
  22005. // "EXTERNAL_API_WARNING"
  22006. // "FIELD_VALUE_OVERRIDEN"
  22007. // "INJECTED_KERNELS_DEPRECATED"
  22008. // "MISSING_TYPE_DEPENDENCY"
  22009. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22010. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22011. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22012. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22013. // "NEXT_HOP_NOT_RUNNING"
  22014. // "NOT_CRITICAL_ERROR"
  22015. // "NO_RESULTS_ON_PAGE"
  22016. // "REQUIRED_TOS_AGREEMENT"
  22017. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22018. // "RESOURCE_NOT_DELETED"
  22019. // "SCHEMA_VALIDATION_IGNORED"
  22020. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22021. // "UNDECLARED_PROPERTIES"
  22022. // "UNREACHABLE"
  22023. Code string `json:"code,omitempty"`
  22024. // Data: [Output Only] Metadata about this warning in key: value format.
  22025. // For example:
  22026. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22027. Data []*SslPolicyWarningsData `json:"data,omitempty"`
  22028. // Message: [Output Only] A human-readable description of the warning
  22029. // code.
  22030. Message string `json:"message,omitempty"`
  22031. // ForceSendFields is a list of field names (e.g. "Code") to
  22032. // unconditionally include in API requests. By default, fields with
  22033. // empty values are omitted from API requests. However, any non-pointer,
  22034. // non-interface field appearing in ForceSendFields will be sent to the
  22035. // server regardless of whether the field is empty or not. This may be
  22036. // used to include empty fields in Patch requests.
  22037. ForceSendFields []string `json:"-"`
  22038. // NullFields is a list of field names (e.g. "Code") to include in API
  22039. // requests with the JSON null value. By default, fields with empty
  22040. // values are omitted from API requests. However, any field with an
  22041. // empty value appearing in NullFields will be sent to the server as
  22042. // null. It is an error if a field in this list has a non-empty value.
  22043. // This may be used to include null fields in Patch requests.
  22044. NullFields []string `json:"-"`
  22045. }
  22046. func (s *SslPolicyWarnings) MarshalJSON() ([]byte, error) {
  22047. type NoMethod SslPolicyWarnings
  22048. raw := NoMethod(*s)
  22049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22050. }
  22051. type SslPolicyWarningsData struct {
  22052. // Key: [Output Only] A key that provides more detail on the warning
  22053. // being returned. For example, for warnings where there are no results
  22054. // in a list request for a particular zone, this key might be scope and
  22055. // the key value might be the zone name. Other examples might be a key
  22056. // indicating a deprecated resource and a suggested replacement, or a
  22057. // warning about invalid network settings (for example, if an instance
  22058. // attempts to perform IP forwarding but is not enabled for IP
  22059. // forwarding).
  22060. Key string `json:"key,omitempty"`
  22061. // Value: [Output Only] A warning data value corresponding to the key.
  22062. Value string `json:"value,omitempty"`
  22063. // ForceSendFields is a list of field names (e.g. "Key") to
  22064. // unconditionally include in API requests. By default, fields with
  22065. // empty values are omitted from API requests. However, any non-pointer,
  22066. // non-interface field appearing in ForceSendFields will be sent to the
  22067. // server regardless of whether the field is empty or not. This may be
  22068. // used to include empty fields in Patch requests.
  22069. ForceSendFields []string `json:"-"`
  22070. // NullFields is a list of field names (e.g. "Key") to include in API
  22071. // requests with the JSON null value. By default, fields with empty
  22072. // values are omitted from API requests. However, any field with an
  22073. // empty value appearing in NullFields will be sent to the server as
  22074. // null. It is an error if a field in this list has a non-empty value.
  22075. // This may be used to include null fields in Patch requests.
  22076. NullFields []string `json:"-"`
  22077. }
  22078. func (s *SslPolicyWarningsData) MarshalJSON() ([]byte, error) {
  22079. type NoMethod SslPolicyWarningsData
  22080. raw := NoMethod(*s)
  22081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22082. }
  22083. type SslPolicyReference struct {
  22084. // SslPolicy: URL of the SSL policy resource. Set this to empty string
  22085. // to clear any existing SSL policy associated with the target proxy
  22086. // resource.
  22087. SslPolicy string `json:"sslPolicy,omitempty"`
  22088. // ForceSendFields is a list of field names (e.g. "SslPolicy") to
  22089. // unconditionally include in API requests. By default, fields with
  22090. // empty values are omitted from API requests. However, any non-pointer,
  22091. // non-interface field appearing in ForceSendFields will be sent to the
  22092. // server regardless of whether the field is empty or not. This may be
  22093. // used to include empty fields in Patch requests.
  22094. ForceSendFields []string `json:"-"`
  22095. // NullFields is a list of field names (e.g. "SslPolicy") to include in
  22096. // API requests with the JSON null value. By default, fields with empty
  22097. // values are omitted from API requests. However, any field with an
  22098. // empty value appearing in NullFields will be sent to the server as
  22099. // null. It is an error if a field in this list has a non-empty value.
  22100. // This may be used to include null fields in Patch requests.
  22101. NullFields []string `json:"-"`
  22102. }
  22103. func (s *SslPolicyReference) MarshalJSON() ([]byte, error) {
  22104. type NoMethod SslPolicyReference
  22105. raw := NoMethod(*s)
  22106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22107. }
  22108. // Subnetwork: A Subnetwork resource. (== resource_for beta.subnetworks
  22109. // ==) (== resource_for v1.subnetworks ==)
  22110. type Subnetwork struct {
  22111. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22112. // format.
  22113. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22114. // Description: An optional description of this resource. Provide this
  22115. // property when you create the resource. This field can be set only at
  22116. // resource creation time.
  22117. Description string `json:"description,omitempty"`
  22118. // EnableFlowLogs: Whether to enable flow logging for this subnetwork.
  22119. // If this field is not explicitly set, it will not appear in get
  22120. // listings. If not set the default behavior is to disable flow logging.
  22121. EnableFlowLogs bool `json:"enableFlowLogs,omitempty"`
  22122. // Fingerprint: Fingerprint of this resource. A hash of the contents
  22123. // stored in this object. This field is used in optimistic locking. This
  22124. // field will be ignored when inserting a Subnetwork. An up-to-date
  22125. // fingerprint must be provided in order to update the Subnetwork,
  22126. // otherwise the request will fail with error 412 conditionNotMet.
  22127. //
  22128. // To see the latest fingerprint, make a get() request to retrieve a
  22129. // Subnetwork.
  22130. Fingerprint string `json:"fingerprint,omitempty"`
  22131. // GatewayAddress: [Output Only] The gateway address for default routes
  22132. // to reach destination addresses outside this subnetwork.
  22133. GatewayAddress string `json:"gatewayAddress,omitempty"`
  22134. // Id: [Output Only] The unique identifier for the resource. This
  22135. // identifier is defined by the server.
  22136. Id uint64 `json:"id,omitempty,string"`
  22137. // IpCidrRange: The range of internal addresses that are owned by this
  22138. // subnetwork. Provide this property when you create the subnetwork. For
  22139. // example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and
  22140. // non-overlapping within a network. Only IPv4 is supported. This field
  22141. // can be set only at resource creation time.
  22142. IpCidrRange string `json:"ipCidrRange,omitempty"`
  22143. // Kind: [Output Only] Type of the resource. Always compute#subnetwork
  22144. // for Subnetwork resources.
  22145. Kind string `json:"kind,omitempty"`
  22146. // Name: The name of the resource, provided by the client when initially
  22147. // creating the resource. The name must be 1-63 characters long, and
  22148. // comply with RFC1035. Specifically, the name must be 1-63 characters
  22149. // long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`
  22150. // which means the first character must be a lowercase letter, and all
  22151. // following characters must be a dash, lowercase letter, or digit,
  22152. // except the last character, which cannot be a dash.
  22153. Name string `json:"name,omitempty"`
  22154. // Network: The URL of the network to which this subnetwork belongs,
  22155. // provided by the client when initially creating the subnetwork. Only
  22156. // networks that are in the distributed mode can have subnetworks. This
  22157. // field can be set only at resource creation time.
  22158. Network string `json:"network,omitempty"`
  22159. // PrivateIpGoogleAccess: Whether the VMs in this subnet can access
  22160. // Google services without assigned external IP addresses. This field
  22161. // can be both set at resource creation time and updated using
  22162. // setPrivateIpGoogleAccess.
  22163. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  22164. // Region: URL of the region where the Subnetwork resides. This field
  22165. // can be set only at resource creation time.
  22166. Region string `json:"region,omitempty"`
  22167. // SecondaryIpRanges: An array of configurations for secondary IP ranges
  22168. // for VM instances contained in this subnetwork. The primary IP of such
  22169. // VM must belong to the primary ipCidrRange of the subnetwork. The
  22170. // alias IPs may belong to either primary or secondary ranges. This
  22171. // field can be updated with a patch request.
  22172. SecondaryIpRanges []*SubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  22173. // SelfLink: [Output Only] Server-defined URL for the resource.
  22174. SelfLink string `json:"selfLink,omitempty"`
  22175. // ServerResponse contains the HTTP response code and headers from the
  22176. // server.
  22177. googleapi.ServerResponse `json:"-"`
  22178. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22179. // to unconditionally include in API requests. By default, fields with
  22180. // empty values are omitted from API requests. However, any non-pointer,
  22181. // non-interface field appearing in ForceSendFields will be sent to the
  22182. // server regardless of whether the field is empty or not. This may be
  22183. // used to include empty fields in Patch requests.
  22184. ForceSendFields []string `json:"-"`
  22185. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22186. // include in API requests with the JSON null value. By default, fields
  22187. // with empty values are omitted from API requests. However, any field
  22188. // with an empty value appearing in NullFields will be sent to the
  22189. // server as null. It is an error if a field in this list has a
  22190. // non-empty value. This may be used to include null fields in Patch
  22191. // requests.
  22192. NullFields []string `json:"-"`
  22193. }
  22194. func (s *Subnetwork) MarshalJSON() ([]byte, error) {
  22195. type NoMethod Subnetwork
  22196. raw := NoMethod(*s)
  22197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22198. }
  22199. type SubnetworkAggregatedList struct {
  22200. // Id: [Output Only] Unique identifier for the resource; defined by the
  22201. // server.
  22202. Id string `json:"id,omitempty"`
  22203. // Items: A list of SubnetworksScopedList resources.
  22204. Items map[string]SubnetworksScopedList `json:"items,omitempty"`
  22205. // Kind: [Output Only] Type of resource. Always
  22206. // compute#subnetworkAggregatedList for aggregated lists of subnetworks.
  22207. Kind string `json:"kind,omitempty"`
  22208. // NextPageToken: [Output Only] This token allows you to get the next
  22209. // page of results for list requests. If the number of results is larger
  22210. // than maxResults, use the nextPageToken as a value for the query
  22211. // parameter pageToken in the next list request. Subsequent list
  22212. // requests will have their own nextPageToken to continue paging through
  22213. // the results.
  22214. NextPageToken string `json:"nextPageToken,omitempty"`
  22215. // SelfLink: [Output Only] Server-defined URL for this resource.
  22216. SelfLink string `json:"selfLink,omitempty"`
  22217. // Warning: [Output Only] Informational warning message.
  22218. Warning *SubnetworkAggregatedListWarning `json:"warning,omitempty"`
  22219. // ServerResponse contains the HTTP response code and headers from the
  22220. // server.
  22221. googleapi.ServerResponse `json:"-"`
  22222. // ForceSendFields is a list of field names (e.g. "Id") to
  22223. // unconditionally include in API requests. By default, fields with
  22224. // empty values are omitted from API requests. However, any non-pointer,
  22225. // non-interface field appearing in ForceSendFields will be sent to the
  22226. // server regardless of whether the field is empty or not. This may be
  22227. // used to include empty fields in Patch requests.
  22228. ForceSendFields []string `json:"-"`
  22229. // NullFields is a list of field names (e.g. "Id") to include in API
  22230. // requests with the JSON null value. By default, fields with empty
  22231. // values are omitted from API requests. However, any field with an
  22232. // empty value appearing in NullFields will be sent to the server as
  22233. // null. It is an error if a field in this list has a non-empty value.
  22234. // This may be used to include null fields in Patch requests.
  22235. NullFields []string `json:"-"`
  22236. }
  22237. func (s *SubnetworkAggregatedList) MarshalJSON() ([]byte, error) {
  22238. type NoMethod SubnetworkAggregatedList
  22239. raw := NoMethod(*s)
  22240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22241. }
  22242. // SubnetworkAggregatedListWarning: [Output Only] Informational warning
  22243. // message.
  22244. type SubnetworkAggregatedListWarning struct {
  22245. // Code: [Output Only] A warning code, if applicable. For example,
  22246. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22247. // the response.
  22248. //
  22249. // Possible values:
  22250. // "CLEANUP_FAILED"
  22251. // "DEPRECATED_RESOURCE_USED"
  22252. // "DEPRECATED_TYPE_USED"
  22253. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22254. // "EXPERIMENTAL_TYPE_USED"
  22255. // "EXTERNAL_API_WARNING"
  22256. // "FIELD_VALUE_OVERRIDEN"
  22257. // "INJECTED_KERNELS_DEPRECATED"
  22258. // "MISSING_TYPE_DEPENDENCY"
  22259. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22260. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22261. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22262. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22263. // "NEXT_HOP_NOT_RUNNING"
  22264. // "NOT_CRITICAL_ERROR"
  22265. // "NO_RESULTS_ON_PAGE"
  22266. // "REQUIRED_TOS_AGREEMENT"
  22267. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22268. // "RESOURCE_NOT_DELETED"
  22269. // "SCHEMA_VALIDATION_IGNORED"
  22270. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22271. // "UNDECLARED_PROPERTIES"
  22272. // "UNREACHABLE"
  22273. Code string `json:"code,omitempty"`
  22274. // Data: [Output Only] Metadata about this warning in key: value format.
  22275. // For example:
  22276. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22277. Data []*SubnetworkAggregatedListWarningData `json:"data,omitempty"`
  22278. // Message: [Output Only] A human-readable description of the warning
  22279. // code.
  22280. Message string `json:"message,omitempty"`
  22281. // ForceSendFields is a list of field names (e.g. "Code") to
  22282. // unconditionally include in API requests. By default, fields with
  22283. // empty values are omitted from API requests. However, any non-pointer,
  22284. // non-interface field appearing in ForceSendFields will be sent to the
  22285. // server regardless of whether the field is empty or not. This may be
  22286. // used to include empty fields in Patch requests.
  22287. ForceSendFields []string `json:"-"`
  22288. // NullFields is a list of field names (e.g. "Code") to include in API
  22289. // requests with the JSON null value. By default, fields with empty
  22290. // values are omitted from API requests. However, any field with an
  22291. // empty value appearing in NullFields will be sent to the server as
  22292. // null. It is an error if a field in this list has a non-empty value.
  22293. // This may be used to include null fields in Patch requests.
  22294. NullFields []string `json:"-"`
  22295. }
  22296. func (s *SubnetworkAggregatedListWarning) MarshalJSON() ([]byte, error) {
  22297. type NoMethod SubnetworkAggregatedListWarning
  22298. raw := NoMethod(*s)
  22299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22300. }
  22301. type SubnetworkAggregatedListWarningData struct {
  22302. // Key: [Output Only] A key that provides more detail on the warning
  22303. // being returned. For example, for warnings where there are no results
  22304. // in a list request for a particular zone, this key might be scope and
  22305. // the key value might be the zone name. Other examples might be a key
  22306. // indicating a deprecated resource and a suggested replacement, or a
  22307. // warning about invalid network settings (for example, if an instance
  22308. // attempts to perform IP forwarding but is not enabled for IP
  22309. // forwarding).
  22310. Key string `json:"key,omitempty"`
  22311. // Value: [Output Only] A warning data value corresponding to the key.
  22312. Value string `json:"value,omitempty"`
  22313. // ForceSendFields is a list of field names (e.g. "Key") to
  22314. // unconditionally include in API requests. By default, fields with
  22315. // empty values are omitted from API requests. However, any non-pointer,
  22316. // non-interface field appearing in ForceSendFields will be sent to the
  22317. // server regardless of whether the field is empty or not. This may be
  22318. // used to include empty fields in Patch requests.
  22319. ForceSendFields []string `json:"-"`
  22320. // NullFields is a list of field names (e.g. "Key") to include in API
  22321. // requests with the JSON null value. By default, fields with empty
  22322. // values are omitted from API requests. However, any field with an
  22323. // empty value appearing in NullFields will be sent to the server as
  22324. // null. It is an error if a field in this list has a non-empty value.
  22325. // This may be used to include null fields in Patch requests.
  22326. NullFields []string `json:"-"`
  22327. }
  22328. func (s *SubnetworkAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  22329. type NoMethod SubnetworkAggregatedListWarningData
  22330. raw := NoMethod(*s)
  22331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22332. }
  22333. // SubnetworkList: Contains a list of Subnetwork resources.
  22334. type SubnetworkList struct {
  22335. // Id: [Output Only] Unique identifier for the resource; defined by the
  22336. // server.
  22337. Id string `json:"id,omitempty"`
  22338. // Items: A list of Subnetwork resources.
  22339. Items []*Subnetwork `json:"items,omitempty"`
  22340. // Kind: [Output Only] Type of resource. Always compute#subnetworkList
  22341. // for lists of subnetworks.
  22342. Kind string `json:"kind,omitempty"`
  22343. // NextPageToken: [Output Only] This token allows you to get the next
  22344. // page of results for list requests. If the number of results is larger
  22345. // than maxResults, use the nextPageToken as a value for the query
  22346. // parameter pageToken in the next list request. Subsequent list
  22347. // requests will have their own nextPageToken to continue paging through
  22348. // the results.
  22349. NextPageToken string `json:"nextPageToken,omitempty"`
  22350. // SelfLink: [Output Only] Server-defined URL for this resource.
  22351. SelfLink string `json:"selfLink,omitempty"`
  22352. // Warning: [Output Only] Informational warning message.
  22353. Warning *SubnetworkListWarning `json:"warning,omitempty"`
  22354. // ServerResponse contains the HTTP response code and headers from the
  22355. // server.
  22356. googleapi.ServerResponse `json:"-"`
  22357. // ForceSendFields is a list of field names (e.g. "Id") to
  22358. // unconditionally include in API requests. By default, fields with
  22359. // empty values are omitted from API requests. However, any non-pointer,
  22360. // non-interface field appearing in ForceSendFields will be sent to the
  22361. // server regardless of whether the field is empty or not. This may be
  22362. // used to include empty fields in Patch requests.
  22363. ForceSendFields []string `json:"-"`
  22364. // NullFields is a list of field names (e.g. "Id") to include in API
  22365. // requests with the JSON null value. By default, fields with empty
  22366. // values are omitted from API requests. However, any field with an
  22367. // empty value appearing in NullFields will be sent to the server as
  22368. // null. It is an error if a field in this list has a non-empty value.
  22369. // This may be used to include null fields in Patch requests.
  22370. NullFields []string `json:"-"`
  22371. }
  22372. func (s *SubnetworkList) MarshalJSON() ([]byte, error) {
  22373. type NoMethod SubnetworkList
  22374. raw := NoMethod(*s)
  22375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22376. }
  22377. // SubnetworkListWarning: [Output Only] Informational warning message.
  22378. type SubnetworkListWarning struct {
  22379. // Code: [Output Only] A warning code, if applicable. For example,
  22380. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22381. // the response.
  22382. //
  22383. // Possible values:
  22384. // "CLEANUP_FAILED"
  22385. // "DEPRECATED_RESOURCE_USED"
  22386. // "DEPRECATED_TYPE_USED"
  22387. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22388. // "EXPERIMENTAL_TYPE_USED"
  22389. // "EXTERNAL_API_WARNING"
  22390. // "FIELD_VALUE_OVERRIDEN"
  22391. // "INJECTED_KERNELS_DEPRECATED"
  22392. // "MISSING_TYPE_DEPENDENCY"
  22393. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22394. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22395. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22396. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22397. // "NEXT_HOP_NOT_RUNNING"
  22398. // "NOT_CRITICAL_ERROR"
  22399. // "NO_RESULTS_ON_PAGE"
  22400. // "REQUIRED_TOS_AGREEMENT"
  22401. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22402. // "RESOURCE_NOT_DELETED"
  22403. // "SCHEMA_VALIDATION_IGNORED"
  22404. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22405. // "UNDECLARED_PROPERTIES"
  22406. // "UNREACHABLE"
  22407. Code string `json:"code,omitempty"`
  22408. // Data: [Output Only] Metadata about this warning in key: value format.
  22409. // For example:
  22410. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22411. Data []*SubnetworkListWarningData `json:"data,omitempty"`
  22412. // Message: [Output Only] A human-readable description of the warning
  22413. // code.
  22414. Message string `json:"message,omitempty"`
  22415. // ForceSendFields is a list of field names (e.g. "Code") to
  22416. // unconditionally include in API requests. By default, fields with
  22417. // empty values are omitted from API requests. However, any non-pointer,
  22418. // non-interface field appearing in ForceSendFields will be sent to the
  22419. // server regardless of whether the field is empty or not. This may be
  22420. // used to include empty fields in Patch requests.
  22421. ForceSendFields []string `json:"-"`
  22422. // NullFields is a list of field names (e.g. "Code") to include in API
  22423. // requests with the JSON null value. By default, fields with empty
  22424. // values are omitted from API requests. However, any field with an
  22425. // empty value appearing in NullFields will be sent to the server as
  22426. // null. It is an error if a field in this list has a non-empty value.
  22427. // This may be used to include null fields in Patch requests.
  22428. NullFields []string `json:"-"`
  22429. }
  22430. func (s *SubnetworkListWarning) MarshalJSON() ([]byte, error) {
  22431. type NoMethod SubnetworkListWarning
  22432. raw := NoMethod(*s)
  22433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22434. }
  22435. type SubnetworkListWarningData struct {
  22436. // Key: [Output Only] A key that provides more detail on the warning
  22437. // being returned. For example, for warnings where there are no results
  22438. // in a list request for a particular zone, this key might be scope and
  22439. // the key value might be the zone name. Other examples might be a key
  22440. // indicating a deprecated resource and a suggested replacement, or a
  22441. // warning about invalid network settings (for example, if an instance
  22442. // attempts to perform IP forwarding but is not enabled for IP
  22443. // forwarding).
  22444. Key string `json:"key,omitempty"`
  22445. // Value: [Output Only] A warning data value corresponding to the key.
  22446. Value string `json:"value,omitempty"`
  22447. // ForceSendFields is a list of field names (e.g. "Key") to
  22448. // unconditionally include in API requests. By default, fields with
  22449. // empty values are omitted from API requests. However, any non-pointer,
  22450. // non-interface field appearing in ForceSendFields will be sent to the
  22451. // server regardless of whether the field is empty or not. This may be
  22452. // used to include empty fields in Patch requests.
  22453. ForceSendFields []string `json:"-"`
  22454. // NullFields is a list of field names (e.g. "Key") to include in API
  22455. // requests with the JSON null value. By default, fields with empty
  22456. // values are omitted from API requests. However, any field with an
  22457. // empty value appearing in NullFields will be sent to the server as
  22458. // null. It is an error if a field in this list has a non-empty value.
  22459. // This may be used to include null fields in Patch requests.
  22460. NullFields []string `json:"-"`
  22461. }
  22462. func (s *SubnetworkListWarningData) MarshalJSON() ([]byte, error) {
  22463. type NoMethod SubnetworkListWarningData
  22464. raw := NoMethod(*s)
  22465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22466. }
  22467. // SubnetworkSecondaryRange: Represents a secondary IP range of a
  22468. // subnetwork.
  22469. type SubnetworkSecondaryRange struct {
  22470. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  22471. // secondary range. Provide this property when you create the
  22472. // subnetwork. Ranges must be unique and non-overlapping with all
  22473. // primary and secondary IP ranges within a network. Only IPv4 is
  22474. // supported.
  22475. IpCidrRange string `json:"ipCidrRange,omitempty"`
  22476. // RangeName: The name associated with this subnetwork secondary range,
  22477. // used when adding an alias IP range to a VM instance. The name must be
  22478. // 1-63 characters long, and comply with RFC1035. The name must be
  22479. // unique within the subnetwork.
  22480. RangeName string `json:"rangeName,omitempty"`
  22481. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  22482. // unconditionally include in API requests. By default, fields with
  22483. // empty values are omitted from API requests. However, any non-pointer,
  22484. // non-interface field appearing in ForceSendFields will be sent to the
  22485. // server regardless of whether the field is empty or not. This may be
  22486. // used to include empty fields in Patch requests.
  22487. ForceSendFields []string `json:"-"`
  22488. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  22489. // in API requests with the JSON null value. By default, fields with
  22490. // empty values are omitted from API requests. However, any field with
  22491. // an empty value appearing in NullFields will be sent to the server as
  22492. // null. It is an error if a field in this list has a non-empty value.
  22493. // This may be used to include null fields in Patch requests.
  22494. NullFields []string `json:"-"`
  22495. }
  22496. func (s *SubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  22497. type NoMethod SubnetworkSecondaryRange
  22498. raw := NoMethod(*s)
  22499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22500. }
  22501. type SubnetworksExpandIpCidrRangeRequest struct {
  22502. // IpCidrRange: The IP (in CIDR format or netmask) of internal addresses
  22503. // that are legal on this Subnetwork. This range should be disjoint from
  22504. // other subnetworks within this network. This range can only be larger
  22505. // than (i.e. a superset of) the range previously defined before the
  22506. // update.
  22507. IpCidrRange string `json:"ipCidrRange,omitempty"`
  22508. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  22509. // unconditionally include in API requests. By default, fields with
  22510. // empty values are omitted from API requests. However, any non-pointer,
  22511. // non-interface field appearing in ForceSendFields will be sent to the
  22512. // server regardless of whether the field is empty or not. This may be
  22513. // used to include empty fields in Patch requests.
  22514. ForceSendFields []string `json:"-"`
  22515. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  22516. // in API requests with the JSON null value. By default, fields with
  22517. // empty values are omitted from API requests. However, any field with
  22518. // an empty value appearing in NullFields will be sent to the server as
  22519. // null. It is an error if a field in this list has a non-empty value.
  22520. // This may be used to include null fields in Patch requests.
  22521. NullFields []string `json:"-"`
  22522. }
  22523. func (s *SubnetworksExpandIpCidrRangeRequest) MarshalJSON() ([]byte, error) {
  22524. type NoMethod SubnetworksExpandIpCidrRangeRequest
  22525. raw := NoMethod(*s)
  22526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22527. }
  22528. type SubnetworksScopedList struct {
  22529. // Subnetworks: A list of subnetworks contained in this scope.
  22530. Subnetworks []*Subnetwork `json:"subnetworks,omitempty"`
  22531. // Warning: An informational warning that appears when the list of
  22532. // addresses is empty.
  22533. Warning *SubnetworksScopedListWarning `json:"warning,omitempty"`
  22534. // ForceSendFields is a list of field names (e.g. "Subnetworks") to
  22535. // unconditionally include in API requests. By default, fields with
  22536. // empty values are omitted from API requests. However, any non-pointer,
  22537. // non-interface field appearing in ForceSendFields will be sent to the
  22538. // server regardless of whether the field is empty or not. This may be
  22539. // used to include empty fields in Patch requests.
  22540. ForceSendFields []string `json:"-"`
  22541. // NullFields is a list of field names (e.g. "Subnetworks") to include
  22542. // in API requests with the JSON null value. By default, fields with
  22543. // empty values are omitted from API requests. However, any field with
  22544. // an empty value appearing in NullFields will be sent to the server as
  22545. // null. It is an error if a field in this list has a non-empty value.
  22546. // This may be used to include null fields in Patch requests.
  22547. NullFields []string `json:"-"`
  22548. }
  22549. func (s *SubnetworksScopedList) MarshalJSON() ([]byte, error) {
  22550. type NoMethod SubnetworksScopedList
  22551. raw := NoMethod(*s)
  22552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22553. }
  22554. // SubnetworksScopedListWarning: An informational warning that appears
  22555. // when the list of addresses is empty.
  22556. type SubnetworksScopedListWarning struct {
  22557. // Code: [Output Only] A warning code, if applicable. For example,
  22558. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22559. // the response.
  22560. //
  22561. // Possible values:
  22562. // "CLEANUP_FAILED"
  22563. // "DEPRECATED_RESOURCE_USED"
  22564. // "DEPRECATED_TYPE_USED"
  22565. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22566. // "EXPERIMENTAL_TYPE_USED"
  22567. // "EXTERNAL_API_WARNING"
  22568. // "FIELD_VALUE_OVERRIDEN"
  22569. // "INJECTED_KERNELS_DEPRECATED"
  22570. // "MISSING_TYPE_DEPENDENCY"
  22571. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22572. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22573. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22574. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22575. // "NEXT_HOP_NOT_RUNNING"
  22576. // "NOT_CRITICAL_ERROR"
  22577. // "NO_RESULTS_ON_PAGE"
  22578. // "REQUIRED_TOS_AGREEMENT"
  22579. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22580. // "RESOURCE_NOT_DELETED"
  22581. // "SCHEMA_VALIDATION_IGNORED"
  22582. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22583. // "UNDECLARED_PROPERTIES"
  22584. // "UNREACHABLE"
  22585. Code string `json:"code,omitempty"`
  22586. // Data: [Output Only] Metadata about this warning in key: value format.
  22587. // For example:
  22588. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22589. Data []*SubnetworksScopedListWarningData `json:"data,omitempty"`
  22590. // Message: [Output Only] A human-readable description of the warning
  22591. // code.
  22592. Message string `json:"message,omitempty"`
  22593. // ForceSendFields is a list of field names (e.g. "Code") to
  22594. // unconditionally include in API requests. By default, fields with
  22595. // empty values are omitted from API requests. However, any non-pointer,
  22596. // non-interface field appearing in ForceSendFields will be sent to the
  22597. // server regardless of whether the field is empty or not. This may be
  22598. // used to include empty fields in Patch requests.
  22599. ForceSendFields []string `json:"-"`
  22600. // NullFields is a list of field names (e.g. "Code") to include in API
  22601. // requests with the JSON null value. By default, fields with empty
  22602. // values are omitted from API requests. However, any field with an
  22603. // empty value appearing in NullFields will be sent to the server as
  22604. // null. It is an error if a field in this list has a non-empty value.
  22605. // This may be used to include null fields in Patch requests.
  22606. NullFields []string `json:"-"`
  22607. }
  22608. func (s *SubnetworksScopedListWarning) MarshalJSON() ([]byte, error) {
  22609. type NoMethod SubnetworksScopedListWarning
  22610. raw := NoMethod(*s)
  22611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22612. }
  22613. type SubnetworksScopedListWarningData struct {
  22614. // Key: [Output Only] A key that provides more detail on the warning
  22615. // being returned. For example, for warnings where there are no results
  22616. // in a list request for a particular zone, this key might be scope and
  22617. // the key value might be the zone name. Other examples might be a key
  22618. // indicating a deprecated resource and a suggested replacement, or a
  22619. // warning about invalid network settings (for example, if an instance
  22620. // attempts to perform IP forwarding but is not enabled for IP
  22621. // forwarding).
  22622. Key string `json:"key,omitempty"`
  22623. // Value: [Output Only] A warning data value corresponding to the key.
  22624. Value string `json:"value,omitempty"`
  22625. // ForceSendFields is a list of field names (e.g. "Key") to
  22626. // unconditionally include in API requests. By default, fields with
  22627. // empty values are omitted from API requests. However, any non-pointer,
  22628. // non-interface field appearing in ForceSendFields will be sent to the
  22629. // server regardless of whether the field is empty or not. This may be
  22630. // used to include empty fields in Patch requests.
  22631. ForceSendFields []string `json:"-"`
  22632. // NullFields is a list of field names (e.g. "Key") to include in API
  22633. // requests with the JSON null value. By default, fields with empty
  22634. // values are omitted from API requests. However, any field with an
  22635. // empty value appearing in NullFields will be sent to the server as
  22636. // null. It is an error if a field in this list has a non-empty value.
  22637. // This may be used to include null fields in Patch requests.
  22638. NullFields []string `json:"-"`
  22639. }
  22640. func (s *SubnetworksScopedListWarningData) MarshalJSON() ([]byte, error) {
  22641. type NoMethod SubnetworksScopedListWarningData
  22642. raw := NoMethod(*s)
  22643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22644. }
  22645. type SubnetworksSetPrivateIpGoogleAccessRequest struct {
  22646. PrivateIpGoogleAccess bool `json:"privateIpGoogleAccess,omitempty"`
  22647. // ForceSendFields is a list of field names (e.g.
  22648. // "PrivateIpGoogleAccess") to unconditionally include in API requests.
  22649. // By default, fields with empty values are omitted from API requests.
  22650. // However, any non-pointer, non-interface field appearing in
  22651. // ForceSendFields will be sent to the server regardless of whether the
  22652. // field is empty or not. This may be used to include empty fields in
  22653. // Patch requests.
  22654. ForceSendFields []string `json:"-"`
  22655. // NullFields is a list of field names (e.g. "PrivateIpGoogleAccess") to
  22656. // include in API requests with the JSON null value. By default, fields
  22657. // with empty values are omitted from API requests. However, any field
  22658. // with an empty value appearing in NullFields will be sent to the
  22659. // server as null. It is an error if a field in this list has a
  22660. // non-empty value. This may be used to include null fields in Patch
  22661. // requests.
  22662. NullFields []string `json:"-"`
  22663. }
  22664. func (s *SubnetworksSetPrivateIpGoogleAccessRequest) MarshalJSON() ([]byte, error) {
  22665. type NoMethod SubnetworksSetPrivateIpGoogleAccessRequest
  22666. raw := NoMethod(*s)
  22667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22668. }
  22669. type TCPHealthCheck struct {
  22670. // Port: The TCP port number for the health check request. The default
  22671. // value is 80. Valid values are 1 through 65535.
  22672. Port int64 `json:"port,omitempty"`
  22673. // PortName: Port name as defined in InstanceGroup#NamedPort#name. If
  22674. // both port and port_name are defined, port takes precedence.
  22675. PortName string `json:"portName,omitempty"`
  22676. // PortSpecification: Specifies how port is selected for health
  22677. // checking, can be one of following values:
  22678. // USE_FIXED_PORT: The port number in
  22679. // port
  22680. // is used for health checking.
  22681. // USE_NAMED_PORT: The
  22682. // portName
  22683. // is used for health checking.
  22684. // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for
  22685. // each network endpoint is used for health checking. For other
  22686. // backends, the port or named port specified in the Backend Service is
  22687. // used for health checking.
  22688. //
  22689. //
  22690. // If not specified, TCP health check follows behavior specified
  22691. // in
  22692. // port
  22693. // and
  22694. // portName
  22695. // fields.
  22696. //
  22697. // Possible values:
  22698. // "USE_FIXED_PORT"
  22699. // "USE_NAMED_PORT"
  22700. // "USE_SERVING_PORT"
  22701. PortSpecification string `json:"portSpecification,omitempty"`
  22702. // ProxyHeader: Specifies the type of proxy header to append before
  22703. // sending data to the backend, either NONE or PROXY_V1. The default is
  22704. // NONE.
  22705. //
  22706. // Possible values:
  22707. // "NONE"
  22708. // "PROXY_V1"
  22709. ProxyHeader string `json:"proxyHeader,omitempty"`
  22710. // Request: The application data to send once the TCP connection has
  22711. // been established (default value is empty). If both request and
  22712. // response are empty, the connection establishment alone will indicate
  22713. // health. The request data can only be ASCII.
  22714. Request string `json:"request,omitempty"`
  22715. // Response: The bytes to match against the beginning of the response
  22716. // data. If left empty (the default value), any response will indicate
  22717. // health. The response data can only be ASCII.
  22718. Response string `json:"response,omitempty"`
  22719. // ForceSendFields is a list of field names (e.g. "Port") to
  22720. // unconditionally include in API requests. By default, fields with
  22721. // empty values are omitted from API requests. However, any non-pointer,
  22722. // non-interface field appearing in ForceSendFields will be sent to the
  22723. // server regardless of whether the field is empty or not. This may be
  22724. // used to include empty fields in Patch requests.
  22725. ForceSendFields []string `json:"-"`
  22726. // NullFields is a list of field names (e.g. "Port") to include in API
  22727. // requests with the JSON null value. By default, fields with empty
  22728. // values are omitted from API requests. However, any field with an
  22729. // empty value appearing in NullFields will be sent to the server as
  22730. // null. It is an error if a field in this list has a non-empty value.
  22731. // This may be used to include null fields in Patch requests.
  22732. NullFields []string `json:"-"`
  22733. }
  22734. func (s *TCPHealthCheck) MarshalJSON() ([]byte, error) {
  22735. type NoMethod TCPHealthCheck
  22736. raw := NoMethod(*s)
  22737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22738. }
  22739. // Tags: A set of instance tags.
  22740. type Tags struct {
  22741. // Fingerprint: Specifies a fingerprint for this request, which is
  22742. // essentially a hash of the tags' contents and used for optimistic
  22743. // locking. The fingerprint is initially generated by Compute Engine and
  22744. // changes after every request to modify or update tags. You must always
  22745. // provide an up-to-date fingerprint hash in order to update or change
  22746. // tags.
  22747. //
  22748. // To see the latest fingerprint, make get() request to the instance.
  22749. Fingerprint string `json:"fingerprint,omitempty"`
  22750. // Items: An array of tags. Each tag must be 1-63 characters long, and
  22751. // comply with RFC1035.
  22752. Items []string `json:"items,omitempty"`
  22753. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  22754. // unconditionally include in API requests. By default, fields with
  22755. // empty values are omitted from API requests. However, any non-pointer,
  22756. // non-interface field appearing in ForceSendFields will be sent to the
  22757. // server regardless of whether the field is empty or not. This may be
  22758. // used to include empty fields in Patch requests.
  22759. ForceSendFields []string `json:"-"`
  22760. // NullFields is a list of field names (e.g. "Fingerprint") to include
  22761. // in API requests with the JSON null value. By default, fields with
  22762. // empty values are omitted from API requests. However, any field with
  22763. // an empty value appearing in NullFields will be sent to the server as
  22764. // null. It is an error if a field in this list has a non-empty value.
  22765. // This may be used to include null fields in Patch requests.
  22766. NullFields []string `json:"-"`
  22767. }
  22768. func (s *Tags) MarshalJSON() ([]byte, error) {
  22769. type NoMethod Tags
  22770. raw := NoMethod(*s)
  22771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22772. }
  22773. // TargetHttpProxy: A TargetHttpProxy resource. This resource defines an
  22774. // HTTP proxy. (== resource_for beta.targetHttpProxies ==) (==
  22775. // resource_for v1.targetHttpProxies ==)
  22776. type TargetHttpProxy struct {
  22777. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  22778. // format.
  22779. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  22780. // Description: An optional description of this resource. Provide this
  22781. // property when you create the resource.
  22782. Description string `json:"description,omitempty"`
  22783. // Id: [Output Only] The unique identifier for the resource. This
  22784. // identifier is defined by the server.
  22785. Id uint64 `json:"id,omitempty,string"`
  22786. // Kind: [Output Only] Type of resource. Always compute#targetHttpProxy
  22787. // for target HTTP proxies.
  22788. Kind string `json:"kind,omitempty"`
  22789. // Name: Name of the resource. Provided by the client when the resource
  22790. // is created. The name must be 1-63 characters long, and comply with
  22791. // RFC1035. Specifically, the name must be 1-63 characters long and
  22792. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  22793. // the first character must be a lowercase letter, and all following
  22794. // characters must be a dash, lowercase letter, or digit, except the
  22795. // last character, which cannot be a dash.
  22796. Name string `json:"name,omitempty"`
  22797. // SelfLink: [Output Only] Server-defined URL for the resource.
  22798. SelfLink string `json:"selfLink,omitempty"`
  22799. // UrlMap: URL to the UrlMap resource that defines the mapping from URL
  22800. // to the BackendService.
  22801. UrlMap string `json:"urlMap,omitempty"`
  22802. // ServerResponse contains the HTTP response code and headers from the
  22803. // server.
  22804. googleapi.ServerResponse `json:"-"`
  22805. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  22806. // to unconditionally include in API requests. By default, fields with
  22807. // empty values are omitted from API requests. However, any non-pointer,
  22808. // non-interface field appearing in ForceSendFields will be sent to the
  22809. // server regardless of whether the field is empty or not. This may be
  22810. // used to include empty fields in Patch requests.
  22811. ForceSendFields []string `json:"-"`
  22812. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  22813. // include in API requests with the JSON null value. By default, fields
  22814. // with empty values are omitted from API requests. However, any field
  22815. // with an empty value appearing in NullFields will be sent to the
  22816. // server as null. It is an error if a field in this list has a
  22817. // non-empty value. This may be used to include null fields in Patch
  22818. // requests.
  22819. NullFields []string `json:"-"`
  22820. }
  22821. func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) {
  22822. type NoMethod TargetHttpProxy
  22823. raw := NoMethod(*s)
  22824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22825. }
  22826. // TargetHttpProxyList: A list of TargetHttpProxy resources.
  22827. type TargetHttpProxyList struct {
  22828. // Id: [Output Only] Unique identifier for the resource; defined by the
  22829. // server.
  22830. Id string `json:"id,omitempty"`
  22831. // Items: A list of TargetHttpProxy resources.
  22832. Items []*TargetHttpProxy `json:"items,omitempty"`
  22833. // Kind: Type of resource. Always compute#targetHttpProxyList for lists
  22834. // of target HTTP proxies.
  22835. Kind string `json:"kind,omitempty"`
  22836. // NextPageToken: [Output Only] This token allows you to get the next
  22837. // page of results for list requests. If the number of results is larger
  22838. // than maxResults, use the nextPageToken as a value for the query
  22839. // parameter pageToken in the next list request. Subsequent list
  22840. // requests will have their own nextPageToken to continue paging through
  22841. // the results.
  22842. NextPageToken string `json:"nextPageToken,omitempty"`
  22843. // SelfLink: [Output Only] Server-defined URL for this resource.
  22844. SelfLink string `json:"selfLink,omitempty"`
  22845. // Warning: [Output Only] Informational warning message.
  22846. Warning *TargetHttpProxyListWarning `json:"warning,omitempty"`
  22847. // ServerResponse contains the HTTP response code and headers from the
  22848. // server.
  22849. googleapi.ServerResponse `json:"-"`
  22850. // ForceSendFields is a list of field names (e.g. "Id") to
  22851. // unconditionally include in API requests. By default, fields with
  22852. // empty values are omitted from API requests. However, any non-pointer,
  22853. // non-interface field appearing in ForceSendFields will be sent to the
  22854. // server regardless of whether the field is empty or not. This may be
  22855. // used to include empty fields in Patch requests.
  22856. ForceSendFields []string `json:"-"`
  22857. // NullFields is a list of field names (e.g. "Id") to include in API
  22858. // requests with the JSON null value. By default, fields with empty
  22859. // values are omitted from API requests. However, any field with an
  22860. // empty value appearing in NullFields will be sent to the server as
  22861. // null. It is an error if a field in this list has a non-empty value.
  22862. // This may be used to include null fields in Patch requests.
  22863. NullFields []string `json:"-"`
  22864. }
  22865. func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) {
  22866. type NoMethod TargetHttpProxyList
  22867. raw := NoMethod(*s)
  22868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22869. }
  22870. // TargetHttpProxyListWarning: [Output Only] Informational warning
  22871. // message.
  22872. type TargetHttpProxyListWarning struct {
  22873. // Code: [Output Only] A warning code, if applicable. For example,
  22874. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  22875. // the response.
  22876. //
  22877. // Possible values:
  22878. // "CLEANUP_FAILED"
  22879. // "DEPRECATED_RESOURCE_USED"
  22880. // "DEPRECATED_TYPE_USED"
  22881. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  22882. // "EXPERIMENTAL_TYPE_USED"
  22883. // "EXTERNAL_API_WARNING"
  22884. // "FIELD_VALUE_OVERRIDEN"
  22885. // "INJECTED_KERNELS_DEPRECATED"
  22886. // "MISSING_TYPE_DEPENDENCY"
  22887. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  22888. // "NEXT_HOP_CANNOT_IP_FORWARD"
  22889. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  22890. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  22891. // "NEXT_HOP_NOT_RUNNING"
  22892. // "NOT_CRITICAL_ERROR"
  22893. // "NO_RESULTS_ON_PAGE"
  22894. // "REQUIRED_TOS_AGREEMENT"
  22895. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  22896. // "RESOURCE_NOT_DELETED"
  22897. // "SCHEMA_VALIDATION_IGNORED"
  22898. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  22899. // "UNDECLARED_PROPERTIES"
  22900. // "UNREACHABLE"
  22901. Code string `json:"code,omitempty"`
  22902. // Data: [Output Only] Metadata about this warning in key: value format.
  22903. // For example:
  22904. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  22905. Data []*TargetHttpProxyListWarningData `json:"data,omitempty"`
  22906. // Message: [Output Only] A human-readable description of the warning
  22907. // code.
  22908. Message string `json:"message,omitempty"`
  22909. // ForceSendFields is a list of field names (e.g. "Code") to
  22910. // unconditionally include in API requests. By default, fields with
  22911. // empty values are omitted from API requests. However, any non-pointer,
  22912. // non-interface field appearing in ForceSendFields will be sent to the
  22913. // server regardless of whether the field is empty or not. This may be
  22914. // used to include empty fields in Patch requests.
  22915. ForceSendFields []string `json:"-"`
  22916. // NullFields is a list of field names (e.g. "Code") to include in API
  22917. // requests with the JSON null value. By default, fields with empty
  22918. // values are omitted from API requests. However, any field with an
  22919. // empty value appearing in NullFields will be sent to the server as
  22920. // null. It is an error if a field in this list has a non-empty value.
  22921. // This may be used to include null fields in Patch requests.
  22922. NullFields []string `json:"-"`
  22923. }
  22924. func (s *TargetHttpProxyListWarning) MarshalJSON() ([]byte, error) {
  22925. type NoMethod TargetHttpProxyListWarning
  22926. raw := NoMethod(*s)
  22927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22928. }
  22929. type TargetHttpProxyListWarningData struct {
  22930. // Key: [Output Only] A key that provides more detail on the warning
  22931. // being returned. For example, for warnings where there are no results
  22932. // in a list request for a particular zone, this key might be scope and
  22933. // the key value might be the zone name. Other examples might be a key
  22934. // indicating a deprecated resource and a suggested replacement, or a
  22935. // warning about invalid network settings (for example, if an instance
  22936. // attempts to perform IP forwarding but is not enabled for IP
  22937. // forwarding).
  22938. Key string `json:"key,omitempty"`
  22939. // Value: [Output Only] A warning data value corresponding to the key.
  22940. Value string `json:"value,omitempty"`
  22941. // ForceSendFields is a list of field names (e.g. "Key") to
  22942. // unconditionally include in API requests. By default, fields with
  22943. // empty values are omitted from API requests. However, any non-pointer,
  22944. // non-interface field appearing in ForceSendFields will be sent to the
  22945. // server regardless of whether the field is empty or not. This may be
  22946. // used to include empty fields in Patch requests.
  22947. ForceSendFields []string `json:"-"`
  22948. // NullFields is a list of field names (e.g. "Key") to include in API
  22949. // requests with the JSON null value. By default, fields with empty
  22950. // values are omitted from API requests. However, any field with an
  22951. // empty value appearing in NullFields will be sent to the server as
  22952. // null. It is an error if a field in this list has a non-empty value.
  22953. // This may be used to include null fields in Patch requests.
  22954. NullFields []string `json:"-"`
  22955. }
  22956. func (s *TargetHttpProxyListWarningData) MarshalJSON() ([]byte, error) {
  22957. type NoMethod TargetHttpProxyListWarningData
  22958. raw := NoMethod(*s)
  22959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22960. }
  22961. type TargetHttpsProxiesSetQuicOverrideRequest struct {
  22962. // QuicOverride: QUIC policy for the TargetHttpsProxy resource.
  22963. //
  22964. // Possible values:
  22965. // "DISABLE"
  22966. // "ENABLE"
  22967. // "NONE"
  22968. QuicOverride string `json:"quicOverride,omitempty"`
  22969. // ForceSendFields is a list of field names (e.g. "QuicOverride") to
  22970. // unconditionally include in API requests. By default, fields with
  22971. // empty values are omitted from API requests. However, any non-pointer,
  22972. // non-interface field appearing in ForceSendFields will be sent to the
  22973. // server regardless of whether the field is empty or not. This may be
  22974. // used to include empty fields in Patch requests.
  22975. ForceSendFields []string `json:"-"`
  22976. // NullFields is a list of field names (e.g. "QuicOverride") to include
  22977. // in API requests with the JSON null value. By default, fields with
  22978. // empty values are omitted from API requests. However, any field with
  22979. // an empty value appearing in NullFields will be sent to the server as
  22980. // null. It is an error if a field in this list has a non-empty value.
  22981. // This may be used to include null fields in Patch requests.
  22982. NullFields []string `json:"-"`
  22983. }
  22984. func (s *TargetHttpsProxiesSetQuicOverrideRequest) MarshalJSON() ([]byte, error) {
  22985. type NoMethod TargetHttpsProxiesSetQuicOverrideRequest
  22986. raw := NoMethod(*s)
  22987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  22988. }
  22989. type TargetHttpsProxiesSetSslCertificatesRequest struct {
  22990. // SslCertificates: New set of SslCertificate resources to associate
  22991. // with this TargetHttpsProxy resource. Currently exactly one
  22992. // SslCertificate resource must be specified.
  22993. SslCertificates []string `json:"sslCertificates,omitempty"`
  22994. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  22995. // 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. "SslCertificates") 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 *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  23011. type NoMethod TargetHttpsProxiesSetSslCertificatesRequest
  23012. raw := NoMethod(*s)
  23013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23014. }
  23015. // TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines
  23016. // an HTTPS proxy. (== resource_for beta.targetHttpsProxies ==) (==
  23017. // resource_for v1.targetHttpsProxies ==)
  23018. type TargetHttpsProxy struct {
  23019. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23020. // format.
  23021. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23022. // Description: An optional description of this resource. Provide this
  23023. // property when you create the resource.
  23024. Description string `json:"description,omitempty"`
  23025. // Id: [Output Only] The unique identifier for the resource. This
  23026. // identifier is defined by the server.
  23027. Id uint64 `json:"id,omitempty,string"`
  23028. // Kind: [Output Only] Type of resource. Always compute#targetHttpsProxy
  23029. // for target HTTPS proxies.
  23030. Kind string `json:"kind,omitempty"`
  23031. // Name: Name of the resource. Provided by the client when the resource
  23032. // is created. The name must be 1-63 characters long, and comply with
  23033. // RFC1035. Specifically, the name must be 1-63 characters long and
  23034. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23035. // the first character must be a lowercase letter, and all following
  23036. // characters must be a dash, lowercase letter, or digit, except the
  23037. // last character, which cannot be a dash.
  23038. Name string `json:"name,omitempty"`
  23039. // QuicOverride: Specifies the QUIC override policy for this
  23040. // TargetHttpsProxy resource. This determines whether the load balancer
  23041. // will attempt to negotiate QUIC with clients or not. Can specify one
  23042. // of NONE, ENABLE, or DISABLE. Specify ENABLE to always enable QUIC,
  23043. // Enables QUIC when set to ENABLE, and disables QUIC when set to
  23044. // DISABLE. If NONE is specified, uses the QUIC policy with no user
  23045. // overrides, which is equivalent to DISABLE. Not specifying this field
  23046. // is equivalent to specifying NONE.
  23047. //
  23048. // Possible values:
  23049. // "DISABLE"
  23050. // "ENABLE"
  23051. // "NONE"
  23052. QuicOverride string `json:"quicOverride,omitempty"`
  23053. // SelfLink: [Output Only] Server-defined URL for the resource.
  23054. SelfLink string `json:"selfLink,omitempty"`
  23055. // SslCertificates: URLs to SslCertificate resources that are used to
  23056. // authenticate connections between users and the load balancer. At
  23057. // least one SSL certificate must be specified. Currently, you may
  23058. // specify up to 15 SSL certificates.
  23059. SslCertificates []string `json:"sslCertificates,omitempty"`
  23060. // SslPolicy: URL of SslPolicy resource that will be associated with the
  23061. // TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource
  23062. // will not have any SSL policy configured.
  23063. SslPolicy string `json:"sslPolicy,omitempty"`
  23064. // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource
  23065. // that defines the mapping from URL to the BackendService. For example,
  23066. // the following are all valid URLs for specifying a URL map:
  23067. // -
  23068. // https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map
  23069. // - projects/project/global/urlMaps/url-map
  23070. // - global/urlMaps/url-map
  23071. UrlMap string `json:"urlMap,omitempty"`
  23072. // ServerResponse contains the HTTP response code and headers from the
  23073. // server.
  23074. googleapi.ServerResponse `json:"-"`
  23075. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23076. // to unconditionally include in API requests. By default, fields with
  23077. // empty values are omitted from API requests. However, any non-pointer,
  23078. // non-interface field appearing in ForceSendFields will be sent to the
  23079. // server regardless of whether the field is empty or not. This may be
  23080. // used to include empty fields in Patch requests.
  23081. ForceSendFields []string `json:"-"`
  23082. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23083. // include in API requests with the JSON null value. By default, fields
  23084. // with empty values are omitted from API requests. However, any field
  23085. // with an empty value appearing in NullFields will be sent to the
  23086. // server as null. It is an error if a field in this list has a
  23087. // non-empty value. This may be used to include null fields in Patch
  23088. // requests.
  23089. NullFields []string `json:"-"`
  23090. }
  23091. func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) {
  23092. type NoMethod TargetHttpsProxy
  23093. raw := NoMethod(*s)
  23094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23095. }
  23096. // TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources.
  23097. type TargetHttpsProxyList struct {
  23098. // Id: [Output Only] Unique identifier for the resource; defined by the
  23099. // server.
  23100. Id string `json:"id,omitempty"`
  23101. // Items: A list of TargetHttpsProxy resources.
  23102. Items []*TargetHttpsProxy `json:"items,omitempty"`
  23103. // Kind: Type of resource. Always compute#targetHttpsProxyList for lists
  23104. // of target HTTPS proxies.
  23105. Kind string `json:"kind,omitempty"`
  23106. // NextPageToken: [Output Only] This token allows you to get the next
  23107. // page of results for list requests. If the number of results is larger
  23108. // than maxResults, use the nextPageToken as a value for the query
  23109. // parameter pageToken in the next list request. Subsequent list
  23110. // requests will have their own nextPageToken to continue paging through
  23111. // the results.
  23112. NextPageToken string `json:"nextPageToken,omitempty"`
  23113. // SelfLink: [Output Only] Server-defined URL for this resource.
  23114. SelfLink string `json:"selfLink,omitempty"`
  23115. // Warning: [Output Only] Informational warning message.
  23116. Warning *TargetHttpsProxyListWarning `json:"warning,omitempty"`
  23117. // ServerResponse contains the HTTP response code and headers from the
  23118. // server.
  23119. googleapi.ServerResponse `json:"-"`
  23120. // ForceSendFields is a list of field names (e.g. "Id") to
  23121. // unconditionally include in API requests. By default, fields with
  23122. // empty values are omitted from API requests. However, any non-pointer,
  23123. // non-interface field appearing in ForceSendFields will be sent to the
  23124. // server regardless of whether the field is empty or not. This may be
  23125. // used to include empty fields in Patch requests.
  23126. ForceSendFields []string `json:"-"`
  23127. // NullFields is a list of field names (e.g. "Id") to include in API
  23128. // requests with the JSON null value. By default, fields with empty
  23129. // values are omitted from API requests. However, any field with an
  23130. // empty value appearing in NullFields will be sent to the server as
  23131. // null. It is an error if a field in this list has a non-empty value.
  23132. // This may be used to include null fields in Patch requests.
  23133. NullFields []string `json:"-"`
  23134. }
  23135. func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) {
  23136. type NoMethod TargetHttpsProxyList
  23137. raw := NoMethod(*s)
  23138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23139. }
  23140. // TargetHttpsProxyListWarning: [Output Only] Informational warning
  23141. // message.
  23142. type TargetHttpsProxyListWarning struct {
  23143. // Code: [Output Only] A warning code, if applicable. For example,
  23144. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23145. // the response.
  23146. //
  23147. // Possible values:
  23148. // "CLEANUP_FAILED"
  23149. // "DEPRECATED_RESOURCE_USED"
  23150. // "DEPRECATED_TYPE_USED"
  23151. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23152. // "EXPERIMENTAL_TYPE_USED"
  23153. // "EXTERNAL_API_WARNING"
  23154. // "FIELD_VALUE_OVERRIDEN"
  23155. // "INJECTED_KERNELS_DEPRECATED"
  23156. // "MISSING_TYPE_DEPENDENCY"
  23157. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23158. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23159. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23160. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23161. // "NEXT_HOP_NOT_RUNNING"
  23162. // "NOT_CRITICAL_ERROR"
  23163. // "NO_RESULTS_ON_PAGE"
  23164. // "REQUIRED_TOS_AGREEMENT"
  23165. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23166. // "RESOURCE_NOT_DELETED"
  23167. // "SCHEMA_VALIDATION_IGNORED"
  23168. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23169. // "UNDECLARED_PROPERTIES"
  23170. // "UNREACHABLE"
  23171. Code string `json:"code,omitempty"`
  23172. // Data: [Output Only] Metadata about this warning in key: value format.
  23173. // For example:
  23174. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23175. Data []*TargetHttpsProxyListWarningData `json:"data,omitempty"`
  23176. // Message: [Output Only] A human-readable description of the warning
  23177. // code.
  23178. Message string `json:"message,omitempty"`
  23179. // ForceSendFields is a list of field names (e.g. "Code") to
  23180. // unconditionally include in API requests. By default, fields with
  23181. // empty values are omitted from API requests. However, any non-pointer,
  23182. // non-interface field appearing in ForceSendFields will be sent to the
  23183. // server regardless of whether the field is empty or not. This may be
  23184. // used to include empty fields in Patch requests.
  23185. ForceSendFields []string `json:"-"`
  23186. // NullFields is a list of field names (e.g. "Code") to include in API
  23187. // requests with the JSON null value. By default, fields with empty
  23188. // values are omitted from API requests. However, any field with an
  23189. // empty value appearing in NullFields will be sent to the server as
  23190. // null. It is an error if a field in this list has a non-empty value.
  23191. // This may be used to include null fields in Patch requests.
  23192. NullFields []string `json:"-"`
  23193. }
  23194. func (s *TargetHttpsProxyListWarning) MarshalJSON() ([]byte, error) {
  23195. type NoMethod TargetHttpsProxyListWarning
  23196. raw := NoMethod(*s)
  23197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23198. }
  23199. type TargetHttpsProxyListWarningData struct {
  23200. // Key: [Output Only] A key that provides more detail on the warning
  23201. // being returned. For example, for warnings where there are no results
  23202. // in a list request for a particular zone, this key might be scope and
  23203. // the key value might be the zone name. Other examples might be a key
  23204. // indicating a deprecated resource and a suggested replacement, or a
  23205. // warning about invalid network settings (for example, if an instance
  23206. // attempts to perform IP forwarding but is not enabled for IP
  23207. // forwarding).
  23208. Key string `json:"key,omitempty"`
  23209. // Value: [Output Only] A warning data value corresponding to the key.
  23210. Value string `json:"value,omitempty"`
  23211. // ForceSendFields is a list of field names (e.g. "Key") to
  23212. // unconditionally include in API requests. By default, fields with
  23213. // empty values are omitted from API requests. However, any non-pointer,
  23214. // non-interface field appearing in ForceSendFields will be sent to the
  23215. // server regardless of whether the field is empty or not. This may be
  23216. // used to include empty fields in Patch requests.
  23217. ForceSendFields []string `json:"-"`
  23218. // NullFields is a list of field names (e.g. "Key") to include in API
  23219. // requests with the JSON null value. By default, fields with empty
  23220. // values are omitted from API requests. However, any field with an
  23221. // empty value appearing in NullFields will be sent to the server as
  23222. // null. It is an error if a field in this list has a non-empty value.
  23223. // This may be used to include null fields in Patch requests.
  23224. NullFields []string `json:"-"`
  23225. }
  23226. func (s *TargetHttpsProxyListWarningData) MarshalJSON() ([]byte, error) {
  23227. type NoMethod TargetHttpsProxyListWarningData
  23228. raw := NoMethod(*s)
  23229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23230. }
  23231. // TargetInstance: A TargetInstance resource. This resource defines an
  23232. // endpoint instance that terminates traffic of certain protocols. (==
  23233. // resource_for beta.targetInstances ==) (== resource_for
  23234. // v1.targetInstances ==)
  23235. type TargetInstance struct {
  23236. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23237. // format.
  23238. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23239. // Description: An optional description of this resource. Provide this
  23240. // property when you create the resource.
  23241. Description string `json:"description,omitempty"`
  23242. // Id: [Output Only] The unique identifier for the resource. This
  23243. // identifier is defined by the server.
  23244. Id uint64 `json:"id,omitempty,string"`
  23245. // Instance: A URL to the virtual machine instance that handles traffic
  23246. // for this target instance. When creating a target instance, you can
  23247. // provide the fully-qualified URL or a valid partial URL to the desired
  23248. // virtual machine. For example, the following are all valid URLs:
  23249. // -
  23250. // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
  23251. // - projects/project/zones/zone/instances/instance
  23252. // - zones/zone/instances/instance
  23253. Instance string `json:"instance,omitempty"`
  23254. // Kind: [Output Only] The type of the resource. Always
  23255. // compute#targetInstance for target instances.
  23256. Kind string `json:"kind,omitempty"`
  23257. // Name: Name of the resource. Provided by the client when the resource
  23258. // is created. The name must be 1-63 characters long, and comply with
  23259. // RFC1035. Specifically, the name must be 1-63 characters long and
  23260. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23261. // the first character must be a lowercase letter, and all following
  23262. // characters must be a dash, lowercase letter, or digit, except the
  23263. // last character, which cannot be a dash.
  23264. Name string `json:"name,omitempty"`
  23265. // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance.
  23266. // Currently only NO_NAT (default value) is supported.
  23267. //
  23268. // Possible values:
  23269. // "NO_NAT"
  23270. NatPolicy string `json:"natPolicy,omitempty"`
  23271. // SelfLink: [Output Only] Server-defined URL for the resource.
  23272. SelfLink string `json:"selfLink,omitempty"`
  23273. // Zone: [Output Only] URL of the zone where the target instance
  23274. // resides. You must specify this field as part of the HTTP request URL.
  23275. // It is not settable as a field in the request body.
  23276. Zone string `json:"zone,omitempty"`
  23277. // ServerResponse contains the HTTP response code and headers from the
  23278. // server.
  23279. googleapi.ServerResponse `json:"-"`
  23280. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  23281. // to unconditionally include in API requests. By default, fields with
  23282. // empty values are omitted from API requests. However, any non-pointer,
  23283. // non-interface field appearing in ForceSendFields will be sent to the
  23284. // server regardless of whether the field is empty or not. This may be
  23285. // used to include empty fields in Patch requests.
  23286. ForceSendFields []string `json:"-"`
  23287. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  23288. // include in API requests with the JSON null value. By default, fields
  23289. // with empty values are omitted from API requests. However, any field
  23290. // with an empty value appearing in NullFields will be sent to the
  23291. // server as null. It is an error if a field in this list has a
  23292. // non-empty value. This may be used to include null fields in Patch
  23293. // requests.
  23294. NullFields []string `json:"-"`
  23295. }
  23296. func (s *TargetInstance) MarshalJSON() ([]byte, error) {
  23297. type NoMethod TargetInstance
  23298. raw := NoMethod(*s)
  23299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23300. }
  23301. type TargetInstanceAggregatedList struct {
  23302. // Id: [Output Only] Unique identifier for the resource; defined by the
  23303. // server.
  23304. Id string `json:"id,omitempty"`
  23305. // Items: A list of TargetInstance resources.
  23306. Items map[string]TargetInstancesScopedList `json:"items,omitempty"`
  23307. // Kind: Type of resource.
  23308. Kind string `json:"kind,omitempty"`
  23309. // NextPageToken: [Output Only] This token allows you to get the next
  23310. // page of results for list requests. If the number of results is larger
  23311. // than maxResults, use the nextPageToken as a value for the query
  23312. // parameter pageToken in the next list request. Subsequent list
  23313. // requests will have their own nextPageToken to continue paging through
  23314. // the results.
  23315. NextPageToken string `json:"nextPageToken,omitempty"`
  23316. // SelfLink: [Output Only] Server-defined URL for this resource.
  23317. SelfLink string `json:"selfLink,omitempty"`
  23318. // Warning: [Output Only] Informational warning message.
  23319. Warning *TargetInstanceAggregatedListWarning `json:"warning,omitempty"`
  23320. // ServerResponse contains the HTTP response code and headers from the
  23321. // server.
  23322. googleapi.ServerResponse `json:"-"`
  23323. // ForceSendFields is a list of field names (e.g. "Id") to
  23324. // unconditionally include in API requests. By default, fields with
  23325. // empty values are omitted from API requests. However, any non-pointer,
  23326. // non-interface field appearing in ForceSendFields will be sent to the
  23327. // server regardless of whether the field is empty or not. This may be
  23328. // used to include empty fields in Patch requests.
  23329. ForceSendFields []string `json:"-"`
  23330. // NullFields is a list of field names (e.g. "Id") to include in API
  23331. // requests with the JSON null value. By default, fields with empty
  23332. // values are omitted from API requests. However, any field with an
  23333. // empty value appearing in NullFields will be sent to the server as
  23334. // null. It is an error if a field in this list has a non-empty value.
  23335. // This may be used to include null fields in Patch requests.
  23336. NullFields []string `json:"-"`
  23337. }
  23338. func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) {
  23339. type NoMethod TargetInstanceAggregatedList
  23340. raw := NoMethod(*s)
  23341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23342. }
  23343. // TargetInstanceAggregatedListWarning: [Output Only] Informational
  23344. // warning message.
  23345. type TargetInstanceAggregatedListWarning struct {
  23346. // Code: [Output Only] A warning code, if applicable. For example,
  23347. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23348. // the response.
  23349. //
  23350. // Possible values:
  23351. // "CLEANUP_FAILED"
  23352. // "DEPRECATED_RESOURCE_USED"
  23353. // "DEPRECATED_TYPE_USED"
  23354. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23355. // "EXPERIMENTAL_TYPE_USED"
  23356. // "EXTERNAL_API_WARNING"
  23357. // "FIELD_VALUE_OVERRIDEN"
  23358. // "INJECTED_KERNELS_DEPRECATED"
  23359. // "MISSING_TYPE_DEPENDENCY"
  23360. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23361. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23362. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23363. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23364. // "NEXT_HOP_NOT_RUNNING"
  23365. // "NOT_CRITICAL_ERROR"
  23366. // "NO_RESULTS_ON_PAGE"
  23367. // "REQUIRED_TOS_AGREEMENT"
  23368. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23369. // "RESOURCE_NOT_DELETED"
  23370. // "SCHEMA_VALIDATION_IGNORED"
  23371. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23372. // "UNDECLARED_PROPERTIES"
  23373. // "UNREACHABLE"
  23374. Code string `json:"code,omitempty"`
  23375. // Data: [Output Only] Metadata about this warning in key: value format.
  23376. // For example:
  23377. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23378. Data []*TargetInstanceAggregatedListWarningData `json:"data,omitempty"`
  23379. // Message: [Output Only] A human-readable description of the warning
  23380. // code.
  23381. Message string `json:"message,omitempty"`
  23382. // ForceSendFields is a list of field names (e.g. "Code") to
  23383. // unconditionally include in API requests. By default, fields with
  23384. // empty values are omitted from API requests. However, any non-pointer,
  23385. // non-interface field appearing in ForceSendFields will be sent to the
  23386. // server regardless of whether the field is empty or not. This may be
  23387. // used to include empty fields in Patch requests.
  23388. ForceSendFields []string `json:"-"`
  23389. // NullFields is a list of field names (e.g. "Code") to include in API
  23390. // requests with the JSON null value. By default, fields with empty
  23391. // values are omitted from API requests. However, any field with an
  23392. // empty value appearing in NullFields will be sent to the server as
  23393. // null. It is an error if a field in this list has a non-empty value.
  23394. // This may be used to include null fields in Patch requests.
  23395. NullFields []string `json:"-"`
  23396. }
  23397. func (s *TargetInstanceAggregatedListWarning) MarshalJSON() ([]byte, error) {
  23398. type NoMethod TargetInstanceAggregatedListWarning
  23399. raw := NoMethod(*s)
  23400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23401. }
  23402. type TargetInstanceAggregatedListWarningData struct {
  23403. // Key: [Output Only] A key that provides more detail on the warning
  23404. // being returned. For example, for warnings where there are no results
  23405. // in a list request for a particular zone, this key might be scope and
  23406. // the key value might be the zone name. Other examples might be a key
  23407. // indicating a deprecated resource and a suggested replacement, or a
  23408. // warning about invalid network settings (for example, if an instance
  23409. // attempts to perform IP forwarding but is not enabled for IP
  23410. // forwarding).
  23411. Key string `json:"key,omitempty"`
  23412. // Value: [Output Only] A warning data value corresponding to the key.
  23413. Value string `json:"value,omitempty"`
  23414. // ForceSendFields is a list of field names (e.g. "Key") to
  23415. // unconditionally include in API requests. By default, fields with
  23416. // empty values are omitted from API requests. However, any non-pointer,
  23417. // non-interface field appearing in ForceSendFields will be sent to the
  23418. // server regardless of whether the field is empty or not. This may be
  23419. // used to include empty fields in Patch requests.
  23420. ForceSendFields []string `json:"-"`
  23421. // NullFields is a list of field names (e.g. "Key") to include in API
  23422. // requests with the JSON null value. By default, fields with empty
  23423. // values are omitted from API requests. However, any field with an
  23424. // empty value appearing in NullFields will be sent to the server as
  23425. // null. It is an error if a field in this list has a non-empty value.
  23426. // This may be used to include null fields in Patch requests.
  23427. NullFields []string `json:"-"`
  23428. }
  23429. func (s *TargetInstanceAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  23430. type NoMethod TargetInstanceAggregatedListWarningData
  23431. raw := NoMethod(*s)
  23432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23433. }
  23434. // TargetInstanceList: Contains a list of TargetInstance resources.
  23435. type TargetInstanceList struct {
  23436. // Id: [Output Only] Unique identifier for the resource; defined by the
  23437. // server.
  23438. Id string `json:"id,omitempty"`
  23439. // Items: A list of TargetInstance resources.
  23440. Items []*TargetInstance `json:"items,omitempty"`
  23441. // Kind: Type of resource.
  23442. Kind string `json:"kind,omitempty"`
  23443. // NextPageToken: [Output Only] This token allows you to get the next
  23444. // page of results for list requests. If the number of results is larger
  23445. // than maxResults, use the nextPageToken as a value for the query
  23446. // parameter pageToken in the next list request. Subsequent list
  23447. // requests will have their own nextPageToken to continue paging through
  23448. // the results.
  23449. NextPageToken string `json:"nextPageToken,omitempty"`
  23450. // SelfLink: [Output Only] Server-defined URL for this resource.
  23451. SelfLink string `json:"selfLink,omitempty"`
  23452. // Warning: [Output Only] Informational warning message.
  23453. Warning *TargetInstanceListWarning `json:"warning,omitempty"`
  23454. // ServerResponse contains the HTTP response code and headers from the
  23455. // server.
  23456. googleapi.ServerResponse `json:"-"`
  23457. // ForceSendFields is a list of field names (e.g. "Id") to
  23458. // unconditionally include in API requests. By default, fields with
  23459. // empty values are omitted from API requests. However, any non-pointer,
  23460. // non-interface field appearing in ForceSendFields will be sent to the
  23461. // server regardless of whether the field is empty or not. This may be
  23462. // used to include empty fields in Patch requests.
  23463. ForceSendFields []string `json:"-"`
  23464. // NullFields is a list of field names (e.g. "Id") to include in API
  23465. // requests with the JSON null value. By default, fields with empty
  23466. // values are omitted from API requests. However, any field with an
  23467. // empty value appearing in NullFields will be sent to the server as
  23468. // null. It is an error if a field in this list has a non-empty value.
  23469. // This may be used to include null fields in Patch requests.
  23470. NullFields []string `json:"-"`
  23471. }
  23472. func (s *TargetInstanceList) MarshalJSON() ([]byte, error) {
  23473. type NoMethod TargetInstanceList
  23474. raw := NoMethod(*s)
  23475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23476. }
  23477. // TargetInstanceListWarning: [Output Only] Informational warning
  23478. // message.
  23479. type TargetInstanceListWarning struct {
  23480. // Code: [Output Only] A warning code, if applicable. For example,
  23481. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23482. // the response.
  23483. //
  23484. // Possible values:
  23485. // "CLEANUP_FAILED"
  23486. // "DEPRECATED_RESOURCE_USED"
  23487. // "DEPRECATED_TYPE_USED"
  23488. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23489. // "EXPERIMENTAL_TYPE_USED"
  23490. // "EXTERNAL_API_WARNING"
  23491. // "FIELD_VALUE_OVERRIDEN"
  23492. // "INJECTED_KERNELS_DEPRECATED"
  23493. // "MISSING_TYPE_DEPENDENCY"
  23494. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23495. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23496. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23497. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23498. // "NEXT_HOP_NOT_RUNNING"
  23499. // "NOT_CRITICAL_ERROR"
  23500. // "NO_RESULTS_ON_PAGE"
  23501. // "REQUIRED_TOS_AGREEMENT"
  23502. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23503. // "RESOURCE_NOT_DELETED"
  23504. // "SCHEMA_VALIDATION_IGNORED"
  23505. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23506. // "UNDECLARED_PROPERTIES"
  23507. // "UNREACHABLE"
  23508. Code string `json:"code,omitempty"`
  23509. // Data: [Output Only] Metadata about this warning in key: value format.
  23510. // For example:
  23511. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23512. Data []*TargetInstanceListWarningData `json:"data,omitempty"`
  23513. // Message: [Output Only] A human-readable description of the warning
  23514. // code.
  23515. Message string `json:"message,omitempty"`
  23516. // ForceSendFields is a list of field names (e.g. "Code") to
  23517. // unconditionally include in API requests. By default, fields with
  23518. // empty values are omitted from API requests. However, any non-pointer,
  23519. // non-interface field appearing in ForceSendFields will be sent to the
  23520. // server regardless of whether the field is empty or not. This may be
  23521. // used to include empty fields in Patch requests.
  23522. ForceSendFields []string `json:"-"`
  23523. // NullFields is a list of field names (e.g. "Code") to include in API
  23524. // requests with the JSON null value. By default, fields with empty
  23525. // values are omitted from API requests. However, any field with an
  23526. // empty value appearing in NullFields will be sent to the server as
  23527. // null. It is an error if a field in this list has a non-empty value.
  23528. // This may be used to include null fields in Patch requests.
  23529. NullFields []string `json:"-"`
  23530. }
  23531. func (s *TargetInstanceListWarning) MarshalJSON() ([]byte, error) {
  23532. type NoMethod TargetInstanceListWarning
  23533. raw := NoMethod(*s)
  23534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23535. }
  23536. type TargetInstanceListWarningData struct {
  23537. // Key: [Output Only] A key that provides more detail on the warning
  23538. // being returned. For example, for warnings where there are no results
  23539. // in a list request for a particular zone, this key might be scope and
  23540. // the key value might be the zone name. Other examples might be a key
  23541. // indicating a deprecated resource and a suggested replacement, or a
  23542. // warning about invalid network settings (for example, if an instance
  23543. // attempts to perform IP forwarding but is not enabled for IP
  23544. // forwarding).
  23545. Key string `json:"key,omitempty"`
  23546. // Value: [Output Only] A warning data value corresponding to the key.
  23547. Value string `json:"value,omitempty"`
  23548. // ForceSendFields is a list of field names (e.g. "Key") to
  23549. // unconditionally include in API requests. By default, fields with
  23550. // empty values are omitted from API requests. However, any non-pointer,
  23551. // non-interface field appearing in ForceSendFields will be sent to the
  23552. // server regardless of whether the field is empty or not. This may be
  23553. // used to include empty fields in Patch requests.
  23554. ForceSendFields []string `json:"-"`
  23555. // NullFields is a list of field names (e.g. "Key") to include in API
  23556. // requests with the JSON null value. By default, fields with empty
  23557. // values are omitted from API requests. However, any field with an
  23558. // empty value appearing in NullFields will be sent to the server as
  23559. // null. It is an error if a field in this list has a non-empty value.
  23560. // This may be used to include null fields in Patch requests.
  23561. NullFields []string `json:"-"`
  23562. }
  23563. func (s *TargetInstanceListWarningData) MarshalJSON() ([]byte, error) {
  23564. type NoMethod TargetInstanceListWarningData
  23565. raw := NoMethod(*s)
  23566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23567. }
  23568. type TargetInstancesScopedList struct {
  23569. // TargetInstances: A list of target instances contained in this scope.
  23570. TargetInstances []*TargetInstance `json:"targetInstances,omitempty"`
  23571. // Warning: Informational warning which replaces the list of addresses
  23572. // when the list is empty.
  23573. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"`
  23574. // ForceSendFields is a list of field names (e.g. "TargetInstances") to
  23575. // unconditionally include in API requests. By default, fields with
  23576. // empty values are omitted from API requests. However, any non-pointer,
  23577. // non-interface field appearing in ForceSendFields will be sent to the
  23578. // server regardless of whether the field is empty or not. This may be
  23579. // used to include empty fields in Patch requests.
  23580. ForceSendFields []string `json:"-"`
  23581. // NullFields is a list of field names (e.g. "TargetInstances") to
  23582. // include in API requests with the JSON null value. By default, fields
  23583. // with empty values are omitted from API requests. However, any field
  23584. // with an empty value appearing in NullFields will be sent to the
  23585. // server as null. It is an error if a field in this list has a
  23586. // non-empty value. This may be used to include null fields in Patch
  23587. // requests.
  23588. NullFields []string `json:"-"`
  23589. }
  23590. func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) {
  23591. type NoMethod TargetInstancesScopedList
  23592. raw := NoMethod(*s)
  23593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23594. }
  23595. // TargetInstancesScopedListWarning: Informational warning which
  23596. // replaces the list of addresses when the list is empty.
  23597. type TargetInstancesScopedListWarning struct {
  23598. // Code: [Output Only] A warning code, if applicable. For example,
  23599. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23600. // the response.
  23601. //
  23602. // Possible values:
  23603. // "CLEANUP_FAILED"
  23604. // "DEPRECATED_RESOURCE_USED"
  23605. // "DEPRECATED_TYPE_USED"
  23606. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23607. // "EXPERIMENTAL_TYPE_USED"
  23608. // "EXTERNAL_API_WARNING"
  23609. // "FIELD_VALUE_OVERRIDEN"
  23610. // "INJECTED_KERNELS_DEPRECATED"
  23611. // "MISSING_TYPE_DEPENDENCY"
  23612. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23613. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23614. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23615. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23616. // "NEXT_HOP_NOT_RUNNING"
  23617. // "NOT_CRITICAL_ERROR"
  23618. // "NO_RESULTS_ON_PAGE"
  23619. // "REQUIRED_TOS_AGREEMENT"
  23620. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23621. // "RESOURCE_NOT_DELETED"
  23622. // "SCHEMA_VALIDATION_IGNORED"
  23623. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23624. // "UNDECLARED_PROPERTIES"
  23625. // "UNREACHABLE"
  23626. Code string `json:"code,omitempty"`
  23627. // Data: [Output Only] Metadata about this warning in key: value format.
  23628. // For example:
  23629. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23630. Data []*TargetInstancesScopedListWarningData `json:"data,omitempty"`
  23631. // Message: [Output Only] A human-readable description of the warning
  23632. // code.
  23633. Message string `json:"message,omitempty"`
  23634. // ForceSendFields is a list of field names (e.g. "Code") to
  23635. // unconditionally include in API requests. By default, fields with
  23636. // empty values are omitted from API requests. However, any non-pointer,
  23637. // non-interface field appearing in ForceSendFields will be sent to the
  23638. // server regardless of whether the field is empty or not. This may be
  23639. // used to include empty fields in Patch requests.
  23640. ForceSendFields []string `json:"-"`
  23641. // NullFields is a list of field names (e.g. "Code") to include in API
  23642. // requests with the JSON null value. By default, fields with empty
  23643. // values are omitted from API requests. However, any field with an
  23644. // empty value appearing in NullFields will be sent to the server as
  23645. // null. It is an error if a field in this list has a non-empty value.
  23646. // This may be used to include null fields in Patch requests.
  23647. NullFields []string `json:"-"`
  23648. }
  23649. func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) {
  23650. type NoMethod TargetInstancesScopedListWarning
  23651. raw := NoMethod(*s)
  23652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23653. }
  23654. type TargetInstancesScopedListWarningData struct {
  23655. // Key: [Output Only] A key that provides more detail on the warning
  23656. // being returned. For example, for warnings where there are no results
  23657. // in a list request for a particular zone, this key might be scope and
  23658. // the key value might be the zone name. Other examples might be a key
  23659. // indicating a deprecated resource and a suggested replacement, or a
  23660. // warning about invalid network settings (for example, if an instance
  23661. // attempts to perform IP forwarding but is not enabled for IP
  23662. // forwarding).
  23663. Key string `json:"key,omitempty"`
  23664. // Value: [Output Only] A warning data value corresponding to the key.
  23665. Value string `json:"value,omitempty"`
  23666. // ForceSendFields is a list of field names (e.g. "Key") to
  23667. // unconditionally include in API requests. By default, fields with
  23668. // empty values are omitted from API requests. However, any non-pointer,
  23669. // non-interface field appearing in ForceSendFields will be sent to the
  23670. // server regardless of whether the field is empty or not. This may be
  23671. // used to include empty fields in Patch requests.
  23672. ForceSendFields []string `json:"-"`
  23673. // NullFields is a list of field names (e.g. "Key") to include in API
  23674. // requests with the JSON null value. By default, fields with empty
  23675. // values are omitted from API requests. However, any field with an
  23676. // empty value appearing in NullFields will be sent to the server as
  23677. // null. It is an error if a field in this list has a non-empty value.
  23678. // This may be used to include null fields in Patch requests.
  23679. NullFields []string `json:"-"`
  23680. }
  23681. func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) {
  23682. type NoMethod TargetInstancesScopedListWarningData
  23683. raw := NoMethod(*s)
  23684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23685. }
  23686. // TargetPool: A TargetPool resource. This resource defines a pool of
  23687. // instances, an associated HttpHealthCheck resource, and the fallback
  23688. // target pool. (== resource_for beta.targetPools ==) (== resource_for
  23689. // v1.targetPools ==)
  23690. type TargetPool struct {
  23691. // BackupPool: This field is applicable only when the containing target
  23692. // pool is serving a forwarding rule as the primary pool, and its
  23693. // failoverRatio field is properly set to a value between [0,
  23694. // 1].
  23695. //
  23696. // backupPool and failoverRatio together define the fallback behavior of
  23697. // the primary target pool: if the ratio of the healthy instances in the
  23698. // primary pool is at or below failoverRatio, traffic arriving at the
  23699. // load-balanced IP will be directed to the backup pool.
  23700. //
  23701. // In case where failoverRatio and backupPool are not set, or all the
  23702. // instances in the backup pool are unhealthy, the traffic will be
  23703. // directed back to the primary pool in the "force" mode, where traffic
  23704. // will be spread to the healthy instances with the best effort, or to
  23705. // all instances when no instance is healthy.
  23706. BackupPool string `json:"backupPool,omitempty"`
  23707. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  23708. // format.
  23709. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  23710. // Description: An optional description of this resource. Provide this
  23711. // property when you create the resource.
  23712. Description string `json:"description,omitempty"`
  23713. // FailoverRatio: This field is applicable only when the containing
  23714. // target pool is serving a forwarding rule as the primary pool (i.e.,
  23715. // not as a backup pool to some other target pool). The value of the
  23716. // field must be in [0, 1].
  23717. //
  23718. // If set, backupPool must also be set. They together define the
  23719. // fallback behavior of the primary target pool: if the ratio of the
  23720. // healthy instances in the primary pool is at or below this number,
  23721. // traffic arriving at the load-balanced IP will be directed to the
  23722. // backup pool.
  23723. //
  23724. // In case where failoverRatio is not set or all the instances in the
  23725. // backup pool are unhealthy, the traffic will be directed back to the
  23726. // primary pool in the "force" mode, where traffic will be spread to the
  23727. // healthy instances with the best effort, or to all instances when no
  23728. // instance is healthy.
  23729. FailoverRatio float64 `json:"failoverRatio,omitempty"`
  23730. // HealthChecks: The URL of the HttpHealthCheck resource. A member
  23731. // instance in this pool is considered healthy if and only if the health
  23732. // checks pass. An empty list means all member instances will be
  23733. // considered healthy at all times. Only HttpHealthChecks are supported.
  23734. // Only one health check may be specified.
  23735. HealthChecks []string `json:"healthChecks,omitempty"`
  23736. // Id: [Output Only] The unique identifier for the resource. This
  23737. // identifier is defined by the server.
  23738. Id uint64 `json:"id,omitempty,string"`
  23739. // Instances: A list of resource URLs to the virtual machine instances
  23740. // serving this pool. They must live in zones contained in the same
  23741. // region as this pool.
  23742. Instances []string `json:"instances,omitempty"`
  23743. // Kind: [Output Only] Type of the resource. Always compute#targetPool
  23744. // for target pools.
  23745. Kind string `json:"kind,omitempty"`
  23746. // Name: Name of the resource. Provided by the client when the resource
  23747. // is created. The name must be 1-63 characters long, and comply with
  23748. // RFC1035. Specifically, the name must be 1-63 characters long and
  23749. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  23750. // the first character must be a lowercase letter, and all following
  23751. // characters must be a dash, lowercase letter, or digit, except the
  23752. // last character, which cannot be a dash.
  23753. Name string `json:"name,omitempty"`
  23754. // Region: [Output Only] URL of the region where the target pool
  23755. // resides.
  23756. Region string `json:"region,omitempty"`
  23757. // SelfLink: [Output Only] Server-defined URL for the resource.
  23758. SelfLink string `json:"selfLink,omitempty"`
  23759. // SessionAffinity: Session affinity option, must be one of the
  23760. // following values:
  23761. // NONE: Connections from the same client IP may go to any instance in
  23762. // the pool.
  23763. // CLIENT_IP: Connections from the same client IP will go to the same
  23764. // instance in the pool while that instance remains
  23765. // healthy.
  23766. // CLIENT_IP_PROTO: Connections from the same client IP with the same IP
  23767. // protocol will go to the same instance in the pool while that instance
  23768. // remains healthy.
  23769. //
  23770. // Possible values:
  23771. // "CLIENT_IP"
  23772. // "CLIENT_IP_PORT_PROTO"
  23773. // "CLIENT_IP_PROTO"
  23774. // "GENERATED_COOKIE"
  23775. // "NONE"
  23776. SessionAffinity string `json:"sessionAffinity,omitempty"`
  23777. // ServerResponse contains the HTTP response code and headers from the
  23778. // server.
  23779. googleapi.ServerResponse `json:"-"`
  23780. // ForceSendFields is a list of field names (e.g. "BackupPool") to
  23781. // unconditionally include in API requests. By default, fields with
  23782. // empty values are omitted from API requests. However, any non-pointer,
  23783. // non-interface field appearing in ForceSendFields will be sent to the
  23784. // server regardless of whether the field is empty or not. This may be
  23785. // used to include empty fields in Patch requests.
  23786. ForceSendFields []string `json:"-"`
  23787. // NullFields is a list of field names (e.g. "BackupPool") to include in
  23788. // API requests with the JSON null value. By default, fields with empty
  23789. // values are omitted from API requests. However, any field with an
  23790. // empty value appearing in NullFields will be sent to the server as
  23791. // null. It is an error if a field in this list has a non-empty value.
  23792. // This may be used to include null fields in Patch requests.
  23793. NullFields []string `json:"-"`
  23794. }
  23795. func (s *TargetPool) MarshalJSON() ([]byte, error) {
  23796. type NoMethod TargetPool
  23797. raw := NoMethod(*s)
  23798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23799. }
  23800. func (s *TargetPool) UnmarshalJSON(data []byte) error {
  23801. type NoMethod TargetPool
  23802. var s1 struct {
  23803. FailoverRatio gensupport.JSONFloat64 `json:"failoverRatio"`
  23804. *NoMethod
  23805. }
  23806. s1.NoMethod = (*NoMethod)(s)
  23807. if err := json.Unmarshal(data, &s1); err != nil {
  23808. return err
  23809. }
  23810. s.FailoverRatio = float64(s1.FailoverRatio)
  23811. return nil
  23812. }
  23813. type TargetPoolAggregatedList struct {
  23814. // Id: [Output Only] Unique identifier for the resource; defined by the
  23815. // server.
  23816. Id string `json:"id,omitempty"`
  23817. // Items: A list of TargetPool resources.
  23818. Items map[string]TargetPoolsScopedList `json:"items,omitempty"`
  23819. // Kind: [Output Only] Type of resource. Always
  23820. // compute#targetPoolAggregatedList for aggregated lists of target
  23821. // pools.
  23822. Kind string `json:"kind,omitempty"`
  23823. // NextPageToken: [Output Only] This token allows you to get the next
  23824. // page of results for list requests. If the number of results is larger
  23825. // than maxResults, use the nextPageToken as a value for the query
  23826. // parameter pageToken in the next list request. Subsequent list
  23827. // requests will have their own nextPageToken to continue paging through
  23828. // the results.
  23829. NextPageToken string `json:"nextPageToken,omitempty"`
  23830. // SelfLink: [Output Only] Server-defined URL for this resource.
  23831. SelfLink string `json:"selfLink,omitempty"`
  23832. // Warning: [Output Only] Informational warning message.
  23833. Warning *TargetPoolAggregatedListWarning `json:"warning,omitempty"`
  23834. // ServerResponse contains the HTTP response code and headers from the
  23835. // server.
  23836. googleapi.ServerResponse `json:"-"`
  23837. // ForceSendFields is a list of field names (e.g. "Id") to
  23838. // unconditionally include in API requests. By default, fields with
  23839. // empty values are omitted from API requests. However, any non-pointer,
  23840. // non-interface field appearing in ForceSendFields will be sent to the
  23841. // server regardless of whether the field is empty or not. This may be
  23842. // used to include empty fields in Patch requests.
  23843. ForceSendFields []string `json:"-"`
  23844. // NullFields is a list of field names (e.g. "Id") to include in API
  23845. // requests with the JSON null value. By default, fields with empty
  23846. // values are omitted from API requests. However, any field with an
  23847. // empty value appearing in NullFields will be sent to the server as
  23848. // null. It is an error if a field in this list has a non-empty value.
  23849. // This may be used to include null fields in Patch requests.
  23850. NullFields []string `json:"-"`
  23851. }
  23852. func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) {
  23853. type NoMethod TargetPoolAggregatedList
  23854. raw := NoMethod(*s)
  23855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23856. }
  23857. // TargetPoolAggregatedListWarning: [Output Only] Informational warning
  23858. // message.
  23859. type TargetPoolAggregatedListWarning struct {
  23860. // Code: [Output Only] A warning code, if applicable. For example,
  23861. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  23862. // the response.
  23863. //
  23864. // Possible values:
  23865. // "CLEANUP_FAILED"
  23866. // "DEPRECATED_RESOURCE_USED"
  23867. // "DEPRECATED_TYPE_USED"
  23868. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  23869. // "EXPERIMENTAL_TYPE_USED"
  23870. // "EXTERNAL_API_WARNING"
  23871. // "FIELD_VALUE_OVERRIDEN"
  23872. // "INJECTED_KERNELS_DEPRECATED"
  23873. // "MISSING_TYPE_DEPENDENCY"
  23874. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  23875. // "NEXT_HOP_CANNOT_IP_FORWARD"
  23876. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  23877. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  23878. // "NEXT_HOP_NOT_RUNNING"
  23879. // "NOT_CRITICAL_ERROR"
  23880. // "NO_RESULTS_ON_PAGE"
  23881. // "REQUIRED_TOS_AGREEMENT"
  23882. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  23883. // "RESOURCE_NOT_DELETED"
  23884. // "SCHEMA_VALIDATION_IGNORED"
  23885. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  23886. // "UNDECLARED_PROPERTIES"
  23887. // "UNREACHABLE"
  23888. Code string `json:"code,omitempty"`
  23889. // Data: [Output Only] Metadata about this warning in key: value format.
  23890. // For example:
  23891. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  23892. Data []*TargetPoolAggregatedListWarningData `json:"data,omitempty"`
  23893. // Message: [Output Only] A human-readable description of the warning
  23894. // code.
  23895. Message string `json:"message,omitempty"`
  23896. // ForceSendFields is a list of field names (e.g. "Code") to
  23897. // unconditionally include in API requests. By default, fields with
  23898. // empty values are omitted from API requests. However, any non-pointer,
  23899. // non-interface field appearing in ForceSendFields will be sent to the
  23900. // server regardless of whether the field is empty or not. This may be
  23901. // used to include empty fields in Patch requests.
  23902. ForceSendFields []string `json:"-"`
  23903. // NullFields is a list of field names (e.g. "Code") to include in API
  23904. // requests with the JSON null value. By default, fields with empty
  23905. // values are omitted from API requests. However, any field with an
  23906. // empty value appearing in NullFields will be sent to the server as
  23907. // null. It is an error if a field in this list has a non-empty value.
  23908. // This may be used to include null fields in Patch requests.
  23909. NullFields []string `json:"-"`
  23910. }
  23911. func (s *TargetPoolAggregatedListWarning) MarshalJSON() ([]byte, error) {
  23912. type NoMethod TargetPoolAggregatedListWarning
  23913. raw := NoMethod(*s)
  23914. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23915. }
  23916. type TargetPoolAggregatedListWarningData struct {
  23917. // Key: [Output Only] A key that provides more detail on the warning
  23918. // being returned. For example, for warnings where there are no results
  23919. // in a list request for a particular zone, this key might be scope and
  23920. // the key value might be the zone name. Other examples might be a key
  23921. // indicating a deprecated resource and a suggested replacement, or a
  23922. // warning about invalid network settings (for example, if an instance
  23923. // attempts to perform IP forwarding but is not enabled for IP
  23924. // forwarding).
  23925. Key string `json:"key,omitempty"`
  23926. // Value: [Output Only] A warning data value corresponding to the key.
  23927. Value string `json:"value,omitempty"`
  23928. // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") to include in API
  23936. // requests with the JSON null value. By default, fields with empty
  23937. // values are omitted from API requests. However, any field with an
  23938. // 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 *TargetPoolAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  23944. type NoMethod TargetPoolAggregatedListWarningData
  23945. raw := NoMethod(*s)
  23946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23947. }
  23948. type TargetPoolInstanceHealth struct {
  23949. HealthStatus []*HealthStatus `json:"healthStatus,omitempty"`
  23950. // Kind: [Output Only] Type of resource. Always
  23951. // compute#targetPoolInstanceHealth when checking the health of an
  23952. // instance.
  23953. Kind string `json:"kind,omitempty"`
  23954. // ServerResponse contains the HTTP response code and headers from the
  23955. // server.
  23956. googleapi.ServerResponse `json:"-"`
  23957. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  23958. // unconditionally include in API requests. By default, fields with
  23959. // empty values are omitted from API requests. However, any non-pointer,
  23960. // non-interface field appearing in ForceSendFields will be sent to the
  23961. // server regardless of whether the field is empty or not. This may be
  23962. // used to include empty fields in Patch requests.
  23963. ForceSendFields []string `json:"-"`
  23964. // NullFields is a list of field names (e.g. "HealthStatus") to include
  23965. // in API requests with the JSON null value. By default, fields with
  23966. // empty values are omitted from API requests. However, any field with
  23967. // an empty value appearing in NullFields will be sent to the server as
  23968. // null. It is an error if a field in this list has a non-empty value.
  23969. // This may be used to include null fields in Patch requests.
  23970. NullFields []string `json:"-"`
  23971. }
  23972. func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) {
  23973. type NoMethod TargetPoolInstanceHealth
  23974. raw := NoMethod(*s)
  23975. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  23976. }
  23977. // TargetPoolList: Contains a list of TargetPool resources.
  23978. type TargetPoolList struct {
  23979. // Id: [Output Only] Unique identifier for the resource; defined by the
  23980. // server.
  23981. Id string `json:"id,omitempty"`
  23982. // Items: A list of TargetPool resources.
  23983. Items []*TargetPool `json:"items,omitempty"`
  23984. // Kind: [Output Only] Type of resource. Always compute#targetPoolList
  23985. // for lists of target pools.
  23986. Kind string `json:"kind,omitempty"`
  23987. // NextPageToken: [Output Only] This token allows you to get the next
  23988. // page of results for list requests. If the number of results is larger
  23989. // than maxResults, use the nextPageToken as a value for the query
  23990. // parameter pageToken in the next list request. Subsequent list
  23991. // requests will have their own nextPageToken to continue paging through
  23992. // the results.
  23993. NextPageToken string `json:"nextPageToken,omitempty"`
  23994. // SelfLink: [Output Only] Server-defined URL for this resource.
  23995. SelfLink string `json:"selfLink,omitempty"`
  23996. // Warning: [Output Only] Informational warning message.
  23997. Warning *TargetPoolListWarning `json:"warning,omitempty"`
  23998. // ServerResponse contains the HTTP response code and headers from the
  23999. // server.
  24000. googleapi.ServerResponse `json:"-"`
  24001. // ForceSendFields is a list of field names (e.g. "Id") to
  24002. // unconditionally include in API requests. By default, fields with
  24003. // empty values are omitted from API requests. However, any non-pointer,
  24004. // non-interface field appearing in ForceSendFields will be sent to the
  24005. // server regardless of whether the field is empty or not. This may be
  24006. // used to include empty fields in Patch requests.
  24007. ForceSendFields []string `json:"-"`
  24008. // NullFields is a list of field names (e.g. "Id") to include in API
  24009. // requests with the JSON null value. By default, fields with empty
  24010. // values are omitted from API requests. However, any field with an
  24011. // empty value appearing in NullFields will be sent to the server as
  24012. // null. It is an error if a field in this list has a non-empty value.
  24013. // This may be used to include null fields in Patch requests.
  24014. NullFields []string `json:"-"`
  24015. }
  24016. func (s *TargetPoolList) MarshalJSON() ([]byte, error) {
  24017. type NoMethod TargetPoolList
  24018. raw := NoMethod(*s)
  24019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24020. }
  24021. // TargetPoolListWarning: [Output Only] Informational warning message.
  24022. type TargetPoolListWarning struct {
  24023. // Code: [Output Only] A warning code, if applicable. For example,
  24024. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24025. // the response.
  24026. //
  24027. // Possible values:
  24028. // "CLEANUP_FAILED"
  24029. // "DEPRECATED_RESOURCE_USED"
  24030. // "DEPRECATED_TYPE_USED"
  24031. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24032. // "EXPERIMENTAL_TYPE_USED"
  24033. // "EXTERNAL_API_WARNING"
  24034. // "FIELD_VALUE_OVERRIDEN"
  24035. // "INJECTED_KERNELS_DEPRECATED"
  24036. // "MISSING_TYPE_DEPENDENCY"
  24037. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24038. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24039. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24040. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24041. // "NEXT_HOP_NOT_RUNNING"
  24042. // "NOT_CRITICAL_ERROR"
  24043. // "NO_RESULTS_ON_PAGE"
  24044. // "REQUIRED_TOS_AGREEMENT"
  24045. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24046. // "RESOURCE_NOT_DELETED"
  24047. // "SCHEMA_VALIDATION_IGNORED"
  24048. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24049. // "UNDECLARED_PROPERTIES"
  24050. // "UNREACHABLE"
  24051. Code string `json:"code,omitempty"`
  24052. // Data: [Output Only] Metadata about this warning in key: value format.
  24053. // For example:
  24054. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24055. Data []*TargetPoolListWarningData `json:"data,omitempty"`
  24056. // Message: [Output Only] A human-readable description of the warning
  24057. // code.
  24058. Message string `json:"message,omitempty"`
  24059. // ForceSendFields is a list of field names (e.g. "Code") to
  24060. // unconditionally include in API requests. By default, fields with
  24061. // empty values are omitted from API requests. However, any non-pointer,
  24062. // non-interface field appearing in ForceSendFields will be sent to the
  24063. // server regardless of whether the field is empty or not. This may be
  24064. // used to include empty fields in Patch requests.
  24065. ForceSendFields []string `json:"-"`
  24066. // NullFields is a list of field names (e.g. "Code") to include in API
  24067. // requests with the JSON null value. By default, fields with empty
  24068. // values are omitted from API requests. However, any field with an
  24069. // empty value appearing in NullFields will be sent to the server as
  24070. // null. It is an error if a field in this list has a non-empty value.
  24071. // This may be used to include null fields in Patch requests.
  24072. NullFields []string `json:"-"`
  24073. }
  24074. func (s *TargetPoolListWarning) MarshalJSON() ([]byte, error) {
  24075. type NoMethod TargetPoolListWarning
  24076. raw := NoMethod(*s)
  24077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24078. }
  24079. type TargetPoolListWarningData struct {
  24080. // Key: [Output Only] A key that provides more detail on the warning
  24081. // being returned. For example, for warnings where there are no results
  24082. // in a list request for a particular zone, this key might be scope and
  24083. // the key value might be the zone name. Other examples might be a key
  24084. // indicating a deprecated resource and a suggested replacement, or a
  24085. // warning about invalid network settings (for example, if an instance
  24086. // attempts to perform IP forwarding but is not enabled for IP
  24087. // forwarding).
  24088. Key string `json:"key,omitempty"`
  24089. // Value: [Output Only] A warning data value corresponding to the key.
  24090. Value string `json:"value,omitempty"`
  24091. // ForceSendFields is a list of field names (e.g. "Key") to
  24092. // unconditionally include in API requests. By default, fields with
  24093. // empty values are omitted from API requests. However, any non-pointer,
  24094. // non-interface field appearing in ForceSendFields will be sent to the
  24095. // server regardless of whether the field is empty or not. This may be
  24096. // used to include empty fields in Patch requests.
  24097. ForceSendFields []string `json:"-"`
  24098. // NullFields is a list of field names (e.g. "Key") to include in API
  24099. // requests with the JSON null value. By default, fields with empty
  24100. // values are omitted from API requests. However, any field with an
  24101. // empty value appearing in NullFields will be sent to the server as
  24102. // null. It is an error if a field in this list has a non-empty value.
  24103. // This may be used to include null fields in Patch requests.
  24104. NullFields []string `json:"-"`
  24105. }
  24106. func (s *TargetPoolListWarningData) MarshalJSON() ([]byte, error) {
  24107. type NoMethod TargetPoolListWarningData
  24108. raw := NoMethod(*s)
  24109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24110. }
  24111. type TargetPoolsAddHealthCheckRequest struct {
  24112. // HealthChecks: The HttpHealthCheck to add to the target pool.
  24113. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  24114. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  24115. // unconditionally include in API requests. By default, fields with
  24116. // empty values are omitted from API requests. However, any non-pointer,
  24117. // non-interface field appearing in ForceSendFields will be sent to the
  24118. // server regardless of whether the field is empty or not. This may be
  24119. // used to include empty fields in Patch requests.
  24120. ForceSendFields []string `json:"-"`
  24121. // NullFields is a list of field names (e.g. "HealthChecks") to include
  24122. // in API requests with the JSON null value. By default, fields with
  24123. // empty values are omitted from API requests. However, any field with
  24124. // an empty value appearing in NullFields will be sent to the server as
  24125. // null. It is an error if a field in this list has a non-empty value.
  24126. // This may be used to include null fields in Patch requests.
  24127. NullFields []string `json:"-"`
  24128. }
  24129. func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) {
  24130. type NoMethod TargetPoolsAddHealthCheckRequest
  24131. raw := NoMethod(*s)
  24132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24133. }
  24134. type TargetPoolsAddInstanceRequest struct {
  24135. // Instances: A full or partial URL to an instance to add to this target
  24136. // pool. This can be a full or partial URL. For example, the following
  24137. // are valid URLs:
  24138. // -
  24139. // https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name
  24140. // - projects/project-id/zones/zone/instances/instance-name
  24141. // - zones/zone/instances/instance-name
  24142. Instances []*InstanceReference `json:"instances,omitempty"`
  24143. // ForceSendFields is a list of field names (e.g. "Instances") to
  24144. // unconditionally include in API requests. By default, fields with
  24145. // empty values are omitted from API requests. However, any non-pointer,
  24146. // non-interface field appearing in ForceSendFields will be sent to the
  24147. // server regardless of whether the field is empty or not. This may be
  24148. // used to include empty fields in Patch requests.
  24149. ForceSendFields []string `json:"-"`
  24150. // NullFields is a list of field names (e.g. "Instances") to include in
  24151. // API requests with the JSON null value. By default, fields with empty
  24152. // values are omitted from API requests. However, any field with an
  24153. // empty value appearing in NullFields will be sent to the server as
  24154. // null. It is an error if a field in this list has a non-empty value.
  24155. // This may be used to include null fields in Patch requests.
  24156. NullFields []string `json:"-"`
  24157. }
  24158. func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) {
  24159. type NoMethod TargetPoolsAddInstanceRequest
  24160. raw := NoMethod(*s)
  24161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24162. }
  24163. type TargetPoolsRemoveHealthCheckRequest struct {
  24164. // HealthChecks: Health check URL to be removed. This can be a full or
  24165. // valid partial URL. For example, the following are valid URLs:
  24166. // -
  24167. // https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check
  24168. // - projects/project/global/httpHealthChecks/health-check
  24169. // - global/httpHealthChecks/health-check
  24170. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"`
  24171. // ForceSendFields is a list of field names (e.g. "HealthChecks") to
  24172. // unconditionally include in API requests. By default, fields with
  24173. // empty values are omitted from API requests. However, any non-pointer,
  24174. // non-interface field appearing in ForceSendFields will be sent to the
  24175. // server regardless of whether the field is empty or not. This may be
  24176. // used to include empty fields in Patch requests.
  24177. ForceSendFields []string `json:"-"`
  24178. // NullFields is a list of field names (e.g. "HealthChecks") to include
  24179. // in API requests with the JSON null value. By default, fields with
  24180. // empty values are omitted from API requests. However, any field with
  24181. // an empty value appearing in NullFields will be sent to the server as
  24182. // null. It is an error if a field in this list has a non-empty value.
  24183. // This may be used to include null fields in Patch requests.
  24184. NullFields []string `json:"-"`
  24185. }
  24186. func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) {
  24187. type NoMethod TargetPoolsRemoveHealthCheckRequest
  24188. raw := NoMethod(*s)
  24189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24190. }
  24191. type TargetPoolsRemoveInstanceRequest struct {
  24192. // Instances: URLs of the instances to be removed from target pool.
  24193. Instances []*InstanceReference `json:"instances,omitempty"`
  24194. // ForceSendFields is a list of field names (e.g. "Instances") to
  24195. // unconditionally include in API requests. By default, fields with
  24196. // empty values are omitted from API requests. However, any non-pointer,
  24197. // non-interface field appearing in ForceSendFields will be sent to the
  24198. // server regardless of whether the field is empty or not. This may be
  24199. // used to include empty fields in Patch requests.
  24200. ForceSendFields []string `json:"-"`
  24201. // NullFields is a list of field names (e.g. "Instances") to include in
  24202. // API requests with the JSON null value. By default, fields with empty
  24203. // values are omitted from API requests. However, any field with an
  24204. // empty value appearing in NullFields will be sent to the server as
  24205. // null. It is an error if a field in this list has a non-empty value.
  24206. // This may be used to include null fields in Patch requests.
  24207. NullFields []string `json:"-"`
  24208. }
  24209. func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) {
  24210. type NoMethod TargetPoolsRemoveInstanceRequest
  24211. raw := NoMethod(*s)
  24212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24213. }
  24214. type TargetPoolsScopedList struct {
  24215. // TargetPools: A list of target pools contained in this scope.
  24216. TargetPools []*TargetPool `json:"targetPools,omitempty"`
  24217. // Warning: Informational warning which replaces the list of addresses
  24218. // when the list is empty.
  24219. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"`
  24220. // ForceSendFields is a list of field names (e.g. "TargetPools") to
  24221. // unconditionally include in API requests. By default, fields with
  24222. // empty values are omitted from API requests. However, any non-pointer,
  24223. // non-interface field appearing in ForceSendFields will be sent to the
  24224. // server regardless of whether the field is empty or not. This may be
  24225. // used to include empty fields in Patch requests.
  24226. ForceSendFields []string `json:"-"`
  24227. // NullFields is a list of field names (e.g. "TargetPools") to include
  24228. // in API requests with the JSON null value. By default, fields with
  24229. // empty values are omitted from API requests. However, any field with
  24230. // an empty value appearing in NullFields will be sent to the server as
  24231. // null. It is an error if a field in this list has a non-empty value.
  24232. // This may be used to include null fields in Patch requests.
  24233. NullFields []string `json:"-"`
  24234. }
  24235. func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) {
  24236. type NoMethod TargetPoolsScopedList
  24237. raw := NoMethod(*s)
  24238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24239. }
  24240. // TargetPoolsScopedListWarning: Informational warning which replaces
  24241. // the list of addresses when the list is empty.
  24242. type TargetPoolsScopedListWarning struct {
  24243. // Code: [Output Only] A warning code, if applicable. For example,
  24244. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24245. // the response.
  24246. //
  24247. // Possible values:
  24248. // "CLEANUP_FAILED"
  24249. // "DEPRECATED_RESOURCE_USED"
  24250. // "DEPRECATED_TYPE_USED"
  24251. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24252. // "EXPERIMENTAL_TYPE_USED"
  24253. // "EXTERNAL_API_WARNING"
  24254. // "FIELD_VALUE_OVERRIDEN"
  24255. // "INJECTED_KERNELS_DEPRECATED"
  24256. // "MISSING_TYPE_DEPENDENCY"
  24257. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24258. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24259. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24260. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24261. // "NEXT_HOP_NOT_RUNNING"
  24262. // "NOT_CRITICAL_ERROR"
  24263. // "NO_RESULTS_ON_PAGE"
  24264. // "REQUIRED_TOS_AGREEMENT"
  24265. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24266. // "RESOURCE_NOT_DELETED"
  24267. // "SCHEMA_VALIDATION_IGNORED"
  24268. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24269. // "UNDECLARED_PROPERTIES"
  24270. // "UNREACHABLE"
  24271. Code string `json:"code,omitempty"`
  24272. // Data: [Output Only] Metadata about this warning in key: value format.
  24273. // For example:
  24274. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24275. Data []*TargetPoolsScopedListWarningData `json:"data,omitempty"`
  24276. // Message: [Output Only] A human-readable description of the warning
  24277. // code.
  24278. Message string `json:"message,omitempty"`
  24279. // ForceSendFields is a list of field names (e.g. "Code") to
  24280. // unconditionally include in API requests. By default, fields with
  24281. // empty values are omitted from API requests. However, any non-pointer,
  24282. // non-interface field appearing in ForceSendFields will be sent to the
  24283. // server regardless of whether the field is empty or not. This may be
  24284. // used to include empty fields in Patch requests.
  24285. ForceSendFields []string `json:"-"`
  24286. // NullFields is a list of field names (e.g. "Code") to include in API
  24287. // requests with the JSON null value. By default, fields with empty
  24288. // values are omitted from API requests. However, any field with an
  24289. // empty value appearing in NullFields will be sent to the server as
  24290. // null. It is an error if a field in this list has a non-empty value.
  24291. // This may be used to include null fields in Patch requests.
  24292. NullFields []string `json:"-"`
  24293. }
  24294. func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) {
  24295. type NoMethod TargetPoolsScopedListWarning
  24296. raw := NoMethod(*s)
  24297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24298. }
  24299. type TargetPoolsScopedListWarningData struct {
  24300. // Key: [Output Only] A key that provides more detail on the warning
  24301. // being returned. For example, for warnings where there are no results
  24302. // in a list request for a particular zone, this key might be scope and
  24303. // the key value might be the zone name. Other examples might be a key
  24304. // indicating a deprecated resource and a suggested replacement, or a
  24305. // warning about invalid network settings (for example, if an instance
  24306. // attempts to perform IP forwarding but is not enabled for IP
  24307. // forwarding).
  24308. Key string `json:"key,omitempty"`
  24309. // Value: [Output Only] A warning data value corresponding to the key.
  24310. Value string `json:"value,omitempty"`
  24311. // ForceSendFields is a list of field names (e.g. "Key") to
  24312. // unconditionally include in API requests. By default, fields with
  24313. // empty values are omitted from API requests. However, any non-pointer,
  24314. // non-interface field appearing in ForceSendFields will be sent to the
  24315. // server regardless of whether the field is empty or not. This may be
  24316. // used to include empty fields in Patch requests.
  24317. ForceSendFields []string `json:"-"`
  24318. // NullFields is a list of field names (e.g. "Key") to include in API
  24319. // requests with the JSON null value. By default, fields with empty
  24320. // values are omitted from API requests. However, any field with an
  24321. // empty value appearing in NullFields will be sent to the server as
  24322. // null. It is an error if a field in this list has a non-empty value.
  24323. // This may be used to include null fields in Patch requests.
  24324. NullFields []string `json:"-"`
  24325. }
  24326. func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) {
  24327. type NoMethod TargetPoolsScopedListWarningData
  24328. raw := NoMethod(*s)
  24329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24330. }
  24331. type TargetReference struct {
  24332. Target string `json:"target,omitempty"`
  24333. // ForceSendFields is a list of field names (e.g. "Target") to
  24334. // unconditionally include in API requests. By default, fields with
  24335. // empty values are omitted from API requests. However, any non-pointer,
  24336. // non-interface field appearing in ForceSendFields will be sent to the
  24337. // server regardless of whether the field is empty or not. This may be
  24338. // used to include empty fields in Patch requests.
  24339. ForceSendFields []string `json:"-"`
  24340. // NullFields is a list of field names (e.g. "Target") to include in API
  24341. // requests with the JSON null value. By default, fields with empty
  24342. // values are omitted from API requests. However, any field with an
  24343. // empty value appearing in NullFields will be sent to the server as
  24344. // null. It is an error if a field in this list has a non-empty value.
  24345. // This may be used to include null fields in Patch requests.
  24346. NullFields []string `json:"-"`
  24347. }
  24348. func (s *TargetReference) MarshalJSON() ([]byte, error) {
  24349. type NoMethod TargetReference
  24350. raw := NoMethod(*s)
  24351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24352. }
  24353. type TargetSslProxiesSetBackendServiceRequest struct {
  24354. // Service: The URL of the new BackendService resource for the
  24355. // targetSslProxy.
  24356. Service string `json:"service,omitempty"`
  24357. // ForceSendFields is a list of field names (e.g. "Service") to
  24358. // unconditionally include in API requests. By default, fields with
  24359. // empty values are omitted from API requests. However, any non-pointer,
  24360. // non-interface field appearing in ForceSendFields will be sent to the
  24361. // server regardless of whether the field is empty or not. This may be
  24362. // used to include empty fields in Patch requests.
  24363. ForceSendFields []string `json:"-"`
  24364. // NullFields is a list of field names (e.g. "Service") to include in
  24365. // API requests with the JSON null value. By default, fields with empty
  24366. // values are omitted from API requests. However, any field with an
  24367. // empty value appearing in NullFields will be sent to the server as
  24368. // null. It is an error if a field in this list has a non-empty value.
  24369. // This may be used to include null fields in Patch requests.
  24370. NullFields []string `json:"-"`
  24371. }
  24372. func (s *TargetSslProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  24373. type NoMethod TargetSslProxiesSetBackendServiceRequest
  24374. raw := NoMethod(*s)
  24375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24376. }
  24377. type TargetSslProxiesSetProxyHeaderRequest struct {
  24378. // ProxyHeader: The new type of proxy header to append before sending
  24379. // data to the backend. NONE or PROXY_V1 are allowed.
  24380. //
  24381. // Possible values:
  24382. // "NONE"
  24383. // "PROXY_V1"
  24384. ProxyHeader string `json:"proxyHeader,omitempty"`
  24385. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  24386. // unconditionally include in API requests. By default, fields with
  24387. // empty values are omitted from API requests. However, any non-pointer,
  24388. // non-interface field appearing in ForceSendFields will be sent to the
  24389. // server regardless of whether the field is empty or not. This may be
  24390. // used to include empty fields in Patch requests.
  24391. ForceSendFields []string `json:"-"`
  24392. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  24393. // in API requests with the JSON null value. By default, fields with
  24394. // empty values are omitted from API requests. However, any field with
  24395. // an empty value appearing in NullFields will be sent to the server as
  24396. // null. It is an error if a field in this list has a non-empty value.
  24397. // This may be used to include null fields in Patch requests.
  24398. NullFields []string `json:"-"`
  24399. }
  24400. func (s *TargetSslProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  24401. type NoMethod TargetSslProxiesSetProxyHeaderRequest
  24402. raw := NoMethod(*s)
  24403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24404. }
  24405. type TargetSslProxiesSetSslCertificatesRequest struct {
  24406. // SslCertificates: New set of URLs to SslCertificate resources to
  24407. // associate with this TargetSslProxy. Currently exactly one ssl
  24408. // certificate must be specified.
  24409. SslCertificates []string `json:"sslCertificates,omitempty"`
  24410. // ForceSendFields is a list of field names (e.g. "SslCertificates") to
  24411. // unconditionally include in API requests. By default, fields with
  24412. // empty values are omitted from API requests. However, any non-pointer,
  24413. // non-interface field appearing in ForceSendFields will be sent to the
  24414. // server regardless of whether the field is empty or not. This may be
  24415. // used to include empty fields in Patch requests.
  24416. ForceSendFields []string `json:"-"`
  24417. // NullFields is a list of field names (e.g. "SslCertificates") to
  24418. // include in API requests with the JSON null value. By default, fields
  24419. // with empty values are omitted from API requests. However, any field
  24420. // with an empty value appearing in NullFields will be sent to the
  24421. // server as null. It is an error if a field in this list has a
  24422. // non-empty value. This may be used to include null fields in Patch
  24423. // requests.
  24424. NullFields []string `json:"-"`
  24425. }
  24426. func (s *TargetSslProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) {
  24427. type NoMethod TargetSslProxiesSetSslCertificatesRequest
  24428. raw := NoMethod(*s)
  24429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24430. }
  24431. // TargetSslProxy: A TargetSslProxy resource. This resource defines an
  24432. // SSL proxy. (== resource_for beta.targetSslProxies ==) (==
  24433. // resource_for v1.targetSslProxies ==)
  24434. type TargetSslProxy struct {
  24435. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24436. // format.
  24437. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24438. // Description: An optional description of this resource. Provide this
  24439. // property when you create the resource.
  24440. Description string `json:"description,omitempty"`
  24441. // Id: [Output Only] The unique identifier for the resource. This
  24442. // identifier is defined by the server.
  24443. Id uint64 `json:"id,omitempty,string"`
  24444. // Kind: [Output Only] Type of the resource. Always
  24445. // compute#targetSslProxy for target SSL proxies.
  24446. Kind string `json:"kind,omitempty"`
  24447. // Name: Name of the resource. Provided by the client when the resource
  24448. // is created. The name must be 1-63 characters long, and comply with
  24449. // RFC1035. Specifically, the name must be 1-63 characters long and
  24450. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24451. // the first character must be a lowercase letter, and all following
  24452. // characters must be a dash, lowercase letter, or digit, except the
  24453. // last character, which cannot be a dash.
  24454. Name string `json:"name,omitempty"`
  24455. // ProxyHeader: Specifies the type of proxy header to append before
  24456. // sending data to the backend, either NONE or PROXY_V1. The default is
  24457. // NONE.
  24458. //
  24459. // Possible values:
  24460. // "NONE"
  24461. // "PROXY_V1"
  24462. ProxyHeader string `json:"proxyHeader,omitempty"`
  24463. // SelfLink: [Output Only] Server-defined URL for the resource.
  24464. SelfLink string `json:"selfLink,omitempty"`
  24465. // Service: URL to the BackendService resource.
  24466. Service string `json:"service,omitempty"`
  24467. // SslCertificates: URLs to SslCertificate resources that are used to
  24468. // authenticate connections to Backends. At least one SSL certificate
  24469. // must be specified. Currently, you may specify up to 15 SSL
  24470. // certificates.
  24471. SslCertificates []string `json:"sslCertificates,omitempty"`
  24472. // SslPolicy: URL of SslPolicy resource that will be associated with the
  24473. // TargetSslProxy resource. If not set, the TargetSslProxy resource will
  24474. // not have any SSL policy configured.
  24475. SslPolicy string `json:"sslPolicy,omitempty"`
  24476. // ServerResponse contains the HTTP response code and headers from the
  24477. // server.
  24478. googleapi.ServerResponse `json:"-"`
  24479. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24480. // to unconditionally include in API requests. By default, fields with
  24481. // empty values are omitted from API requests. However, any non-pointer,
  24482. // non-interface field appearing in ForceSendFields will be sent to the
  24483. // server regardless of whether the field is empty or not. This may be
  24484. // used to include empty fields in Patch requests.
  24485. ForceSendFields []string `json:"-"`
  24486. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24487. // include in API requests with the JSON null value. By default, fields
  24488. // with empty values are omitted from API requests. However, any field
  24489. // with an empty value appearing in NullFields will be sent to the
  24490. // server as null. It is an error if a field in this list has a
  24491. // non-empty value. This may be used to include null fields in Patch
  24492. // requests.
  24493. NullFields []string `json:"-"`
  24494. }
  24495. func (s *TargetSslProxy) MarshalJSON() ([]byte, error) {
  24496. type NoMethod TargetSslProxy
  24497. raw := NoMethod(*s)
  24498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24499. }
  24500. // TargetSslProxyList: Contains a list of TargetSslProxy resources.
  24501. type TargetSslProxyList struct {
  24502. // Id: [Output Only] Unique identifier for the resource; defined by the
  24503. // server.
  24504. Id string `json:"id,omitempty"`
  24505. // Items: A list of TargetSslProxy resources.
  24506. Items []*TargetSslProxy `json:"items,omitempty"`
  24507. // Kind: Type of resource.
  24508. Kind string `json:"kind,omitempty"`
  24509. // NextPageToken: [Output Only] This token allows you to get the next
  24510. // page of results for list requests. If the number of results is larger
  24511. // than maxResults, use the nextPageToken as a value for the query
  24512. // parameter pageToken in the next list request. Subsequent list
  24513. // requests will have their own nextPageToken to continue paging through
  24514. // the results.
  24515. NextPageToken string `json:"nextPageToken,omitempty"`
  24516. // SelfLink: [Output Only] Server-defined URL for this resource.
  24517. SelfLink string `json:"selfLink,omitempty"`
  24518. // Warning: [Output Only] Informational warning message.
  24519. Warning *TargetSslProxyListWarning `json:"warning,omitempty"`
  24520. // ServerResponse contains the HTTP response code and headers from the
  24521. // server.
  24522. googleapi.ServerResponse `json:"-"`
  24523. // ForceSendFields is a list of field names (e.g. "Id") to
  24524. // unconditionally include in API requests. By default, fields with
  24525. // empty values are omitted from API requests. However, any non-pointer,
  24526. // non-interface field appearing in ForceSendFields will be sent to the
  24527. // server regardless of whether the field is empty or not. This may be
  24528. // used to include empty fields in Patch requests.
  24529. ForceSendFields []string `json:"-"`
  24530. // NullFields is a list of field names (e.g. "Id") to include in API
  24531. // requests with the JSON null value. By default, fields with empty
  24532. // values are omitted from API requests. However, any field with an
  24533. // empty value appearing in NullFields will be sent to the server as
  24534. // null. It is an error if a field in this list has a non-empty value.
  24535. // This may be used to include null fields in Patch requests.
  24536. NullFields []string `json:"-"`
  24537. }
  24538. func (s *TargetSslProxyList) MarshalJSON() ([]byte, error) {
  24539. type NoMethod TargetSslProxyList
  24540. raw := NoMethod(*s)
  24541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24542. }
  24543. // TargetSslProxyListWarning: [Output Only] Informational warning
  24544. // message.
  24545. type TargetSslProxyListWarning struct {
  24546. // Code: [Output Only] A warning code, if applicable. For example,
  24547. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24548. // the response.
  24549. //
  24550. // Possible values:
  24551. // "CLEANUP_FAILED"
  24552. // "DEPRECATED_RESOURCE_USED"
  24553. // "DEPRECATED_TYPE_USED"
  24554. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24555. // "EXPERIMENTAL_TYPE_USED"
  24556. // "EXTERNAL_API_WARNING"
  24557. // "FIELD_VALUE_OVERRIDEN"
  24558. // "INJECTED_KERNELS_DEPRECATED"
  24559. // "MISSING_TYPE_DEPENDENCY"
  24560. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24561. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24562. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24563. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24564. // "NEXT_HOP_NOT_RUNNING"
  24565. // "NOT_CRITICAL_ERROR"
  24566. // "NO_RESULTS_ON_PAGE"
  24567. // "REQUIRED_TOS_AGREEMENT"
  24568. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24569. // "RESOURCE_NOT_DELETED"
  24570. // "SCHEMA_VALIDATION_IGNORED"
  24571. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24572. // "UNDECLARED_PROPERTIES"
  24573. // "UNREACHABLE"
  24574. Code string `json:"code,omitempty"`
  24575. // Data: [Output Only] Metadata about this warning in key: value format.
  24576. // For example:
  24577. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24578. Data []*TargetSslProxyListWarningData `json:"data,omitempty"`
  24579. // Message: [Output Only] A human-readable description of the warning
  24580. // code.
  24581. Message string `json:"message,omitempty"`
  24582. // ForceSendFields is a list of field names (e.g. "Code") to
  24583. // unconditionally include in API requests. By default, fields with
  24584. // empty values are omitted from API requests. However, any non-pointer,
  24585. // non-interface field appearing in ForceSendFields will be sent to the
  24586. // server regardless of whether the field is empty or not. This may be
  24587. // used to include empty fields in Patch requests.
  24588. ForceSendFields []string `json:"-"`
  24589. // NullFields is a list of field names (e.g. "Code") to include in API
  24590. // requests with the JSON null value. By default, fields with empty
  24591. // values are omitted from API requests. However, any field with an
  24592. // empty value appearing in NullFields will be sent to the server as
  24593. // null. It is an error if a field in this list has a non-empty value.
  24594. // This may be used to include null fields in Patch requests.
  24595. NullFields []string `json:"-"`
  24596. }
  24597. func (s *TargetSslProxyListWarning) MarshalJSON() ([]byte, error) {
  24598. type NoMethod TargetSslProxyListWarning
  24599. raw := NoMethod(*s)
  24600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24601. }
  24602. type TargetSslProxyListWarningData struct {
  24603. // Key: [Output Only] A key that provides more detail on the warning
  24604. // being returned. For example, for warnings where there are no results
  24605. // in a list request for a particular zone, this key might be scope and
  24606. // the key value might be the zone name. Other examples might be a key
  24607. // indicating a deprecated resource and a suggested replacement, or a
  24608. // warning about invalid network settings (for example, if an instance
  24609. // attempts to perform IP forwarding but is not enabled for IP
  24610. // forwarding).
  24611. Key string `json:"key,omitempty"`
  24612. // Value: [Output Only] A warning data value corresponding to the key.
  24613. Value string `json:"value,omitempty"`
  24614. // ForceSendFields is a list of field names (e.g. "Key") to
  24615. // unconditionally include in API requests. By default, fields with
  24616. // empty values are omitted from API requests. However, any non-pointer,
  24617. // non-interface field appearing in ForceSendFields will be sent to the
  24618. // server regardless of whether the field is empty or not. This may be
  24619. // used to include empty fields in Patch requests.
  24620. ForceSendFields []string `json:"-"`
  24621. // NullFields is a list of field names (e.g. "Key") to include in API
  24622. // requests with the JSON null value. By default, fields with empty
  24623. // values are omitted from API requests. However, any field with an
  24624. // empty value appearing in NullFields will be sent to the server as
  24625. // null. It is an error if a field in this list has a non-empty value.
  24626. // This may be used to include null fields in Patch requests.
  24627. NullFields []string `json:"-"`
  24628. }
  24629. func (s *TargetSslProxyListWarningData) MarshalJSON() ([]byte, error) {
  24630. type NoMethod TargetSslProxyListWarningData
  24631. raw := NoMethod(*s)
  24632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24633. }
  24634. type TargetTcpProxiesSetBackendServiceRequest struct {
  24635. // Service: The URL of the new BackendService resource for the
  24636. // targetTcpProxy.
  24637. Service string `json:"service,omitempty"`
  24638. // ForceSendFields is a list of field names (e.g. "Service") to
  24639. // unconditionally include in API requests. By default, fields with
  24640. // empty values are omitted from API requests. However, any non-pointer,
  24641. // non-interface field appearing in ForceSendFields will be sent to the
  24642. // server regardless of whether the field is empty or not. This may be
  24643. // used to include empty fields in Patch requests.
  24644. ForceSendFields []string `json:"-"`
  24645. // NullFields is a list of field names (e.g. "Service") to include in
  24646. // API requests with the JSON null value. By default, fields with empty
  24647. // values are omitted from API requests. However, any field with an
  24648. // empty value appearing in NullFields will be sent to the server as
  24649. // null. It is an error if a field in this list has a non-empty value.
  24650. // This may be used to include null fields in Patch requests.
  24651. NullFields []string `json:"-"`
  24652. }
  24653. func (s *TargetTcpProxiesSetBackendServiceRequest) MarshalJSON() ([]byte, error) {
  24654. type NoMethod TargetTcpProxiesSetBackendServiceRequest
  24655. raw := NoMethod(*s)
  24656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24657. }
  24658. type TargetTcpProxiesSetProxyHeaderRequest struct {
  24659. // ProxyHeader: The new type of proxy header to append before sending
  24660. // data to the backend. NONE or PROXY_V1 are allowed.
  24661. //
  24662. // Possible values:
  24663. // "NONE"
  24664. // "PROXY_V1"
  24665. ProxyHeader string `json:"proxyHeader,omitempty"`
  24666. // ForceSendFields is a list of field names (e.g. "ProxyHeader") to
  24667. // unconditionally include in API requests. By default, fields with
  24668. // empty values are omitted from API requests. However, any non-pointer,
  24669. // non-interface field appearing in ForceSendFields will be sent to the
  24670. // server regardless of whether the field is empty or not. This may be
  24671. // used to include empty fields in Patch requests.
  24672. ForceSendFields []string `json:"-"`
  24673. // NullFields is a list of field names (e.g. "ProxyHeader") to include
  24674. // in API requests with the JSON null value. By default, fields with
  24675. // empty values are omitted from API requests. However, any field with
  24676. // an empty value appearing in NullFields will be sent to the server as
  24677. // null. It is an error if a field in this list has a non-empty value.
  24678. // This may be used to include null fields in Patch requests.
  24679. NullFields []string `json:"-"`
  24680. }
  24681. func (s *TargetTcpProxiesSetProxyHeaderRequest) MarshalJSON() ([]byte, error) {
  24682. type NoMethod TargetTcpProxiesSetProxyHeaderRequest
  24683. raw := NoMethod(*s)
  24684. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24685. }
  24686. // TargetTcpProxy: A TargetTcpProxy resource. This resource defines a
  24687. // TCP proxy. (== resource_for beta.targetTcpProxies ==) (==
  24688. // resource_for v1.targetTcpProxies ==)
  24689. type TargetTcpProxy struct {
  24690. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24691. // format.
  24692. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24693. // Description: An optional description of this resource. Provide this
  24694. // property when you create the resource.
  24695. Description string `json:"description,omitempty"`
  24696. // Id: [Output Only] The unique identifier for the resource. This
  24697. // identifier is defined by the server.
  24698. Id uint64 `json:"id,omitempty,string"`
  24699. // Kind: [Output Only] Type of the resource. Always
  24700. // compute#targetTcpProxy for target TCP proxies.
  24701. Kind string `json:"kind,omitempty"`
  24702. // Name: Name of the resource. Provided by the client when the resource
  24703. // is created. The name must be 1-63 characters long, and comply with
  24704. // RFC1035. Specifically, the name must be 1-63 characters long and
  24705. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24706. // the first character must be a lowercase letter, and all following
  24707. // characters must be a dash, lowercase letter, or digit, except the
  24708. // last character, which cannot be a dash.
  24709. Name string `json:"name,omitempty"`
  24710. // ProxyHeader: Specifies the type of proxy header to append before
  24711. // sending data to the backend, either NONE or PROXY_V1. The default is
  24712. // NONE.
  24713. //
  24714. // Possible values:
  24715. // "NONE"
  24716. // "PROXY_V1"
  24717. ProxyHeader string `json:"proxyHeader,omitempty"`
  24718. // SelfLink: [Output Only] Server-defined URL for the resource.
  24719. SelfLink string `json:"selfLink,omitempty"`
  24720. // Service: URL to the BackendService resource.
  24721. Service string `json:"service,omitempty"`
  24722. // ServerResponse contains the HTTP response code and headers from the
  24723. // server.
  24724. googleapi.ServerResponse `json:"-"`
  24725. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24726. // to unconditionally include in API requests. By default, fields with
  24727. // empty values are omitted from API requests. However, any non-pointer,
  24728. // non-interface field appearing in ForceSendFields will be sent to the
  24729. // server regardless of whether the field is empty or not. This may be
  24730. // used to include empty fields in Patch requests.
  24731. ForceSendFields []string `json:"-"`
  24732. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24733. // include in API requests with the JSON null value. By default, fields
  24734. // with empty values are omitted from API requests. However, any field
  24735. // with an empty value appearing in NullFields will be sent to the
  24736. // server as null. It is an error if a field in this list has a
  24737. // non-empty value. This may be used to include null fields in Patch
  24738. // requests.
  24739. NullFields []string `json:"-"`
  24740. }
  24741. func (s *TargetTcpProxy) MarshalJSON() ([]byte, error) {
  24742. type NoMethod TargetTcpProxy
  24743. raw := NoMethod(*s)
  24744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24745. }
  24746. // TargetTcpProxyList: Contains a list of TargetTcpProxy resources.
  24747. type TargetTcpProxyList struct {
  24748. // Id: [Output Only] Unique identifier for the resource; defined by the
  24749. // server.
  24750. Id string `json:"id,omitempty"`
  24751. // Items: A list of TargetTcpProxy resources.
  24752. Items []*TargetTcpProxy `json:"items,omitempty"`
  24753. // Kind: Type of resource.
  24754. Kind string `json:"kind,omitempty"`
  24755. // NextPageToken: [Output Only] This token allows you to get the next
  24756. // page of results for list requests. If the number of results is larger
  24757. // than maxResults, use the nextPageToken as a value for the query
  24758. // parameter pageToken in the next list request. Subsequent list
  24759. // requests will have their own nextPageToken to continue paging through
  24760. // the results.
  24761. NextPageToken string `json:"nextPageToken,omitempty"`
  24762. // SelfLink: [Output Only] Server-defined URL for this resource.
  24763. SelfLink string `json:"selfLink,omitempty"`
  24764. // Warning: [Output Only] Informational warning message.
  24765. Warning *TargetTcpProxyListWarning `json:"warning,omitempty"`
  24766. // ServerResponse contains the HTTP response code and headers from the
  24767. // server.
  24768. googleapi.ServerResponse `json:"-"`
  24769. // ForceSendFields is a list of field names (e.g. "Id") to
  24770. // unconditionally include in API requests. By default, fields with
  24771. // empty values are omitted from API requests. However, any non-pointer,
  24772. // non-interface field appearing in ForceSendFields will be sent to the
  24773. // server regardless of whether the field is empty or not. This may be
  24774. // used to include empty fields in Patch requests.
  24775. ForceSendFields []string `json:"-"`
  24776. // NullFields is a list of field names (e.g. "Id") to include in API
  24777. // requests with the JSON null value. By default, fields with empty
  24778. // values are omitted from API requests. However, any field with an
  24779. // empty value appearing in NullFields will be sent to the server as
  24780. // null. It is an error if a field in this list has a non-empty value.
  24781. // This may be used to include null fields in Patch requests.
  24782. NullFields []string `json:"-"`
  24783. }
  24784. func (s *TargetTcpProxyList) MarshalJSON() ([]byte, error) {
  24785. type NoMethod TargetTcpProxyList
  24786. raw := NoMethod(*s)
  24787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24788. }
  24789. // TargetTcpProxyListWarning: [Output Only] Informational warning
  24790. // message.
  24791. type TargetTcpProxyListWarning struct {
  24792. // Code: [Output Only] A warning code, if applicable. For example,
  24793. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  24794. // the response.
  24795. //
  24796. // Possible values:
  24797. // "CLEANUP_FAILED"
  24798. // "DEPRECATED_RESOURCE_USED"
  24799. // "DEPRECATED_TYPE_USED"
  24800. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  24801. // "EXPERIMENTAL_TYPE_USED"
  24802. // "EXTERNAL_API_WARNING"
  24803. // "FIELD_VALUE_OVERRIDEN"
  24804. // "INJECTED_KERNELS_DEPRECATED"
  24805. // "MISSING_TYPE_DEPENDENCY"
  24806. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  24807. // "NEXT_HOP_CANNOT_IP_FORWARD"
  24808. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  24809. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  24810. // "NEXT_HOP_NOT_RUNNING"
  24811. // "NOT_CRITICAL_ERROR"
  24812. // "NO_RESULTS_ON_PAGE"
  24813. // "REQUIRED_TOS_AGREEMENT"
  24814. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  24815. // "RESOURCE_NOT_DELETED"
  24816. // "SCHEMA_VALIDATION_IGNORED"
  24817. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  24818. // "UNDECLARED_PROPERTIES"
  24819. // "UNREACHABLE"
  24820. Code string `json:"code,omitempty"`
  24821. // Data: [Output Only] Metadata about this warning in key: value format.
  24822. // For example:
  24823. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  24824. Data []*TargetTcpProxyListWarningData `json:"data,omitempty"`
  24825. // Message: [Output Only] A human-readable description of the warning
  24826. // code.
  24827. Message string `json:"message,omitempty"`
  24828. // ForceSendFields is a list of field names (e.g. "Code") to
  24829. // unconditionally include in API requests. By default, fields with
  24830. // empty values are omitted from API requests. However, any non-pointer,
  24831. // non-interface field appearing in ForceSendFields will be sent to the
  24832. // server regardless of whether the field is empty or not. This may be
  24833. // used to include empty fields in Patch requests.
  24834. ForceSendFields []string `json:"-"`
  24835. // NullFields is a list of field names (e.g. "Code") to include in API
  24836. // requests with the JSON null value. By default, fields with empty
  24837. // values are omitted from API requests. However, any field with an
  24838. // empty value appearing in NullFields will be sent to the server as
  24839. // null. It is an error if a field in this list has a non-empty value.
  24840. // This may be used to include null fields in Patch requests.
  24841. NullFields []string `json:"-"`
  24842. }
  24843. func (s *TargetTcpProxyListWarning) MarshalJSON() ([]byte, error) {
  24844. type NoMethod TargetTcpProxyListWarning
  24845. raw := NoMethod(*s)
  24846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24847. }
  24848. type TargetTcpProxyListWarningData struct {
  24849. // Key: [Output Only] A key that provides more detail on the warning
  24850. // being returned. For example, for warnings where there are no results
  24851. // in a list request for a particular zone, this key might be scope and
  24852. // the key value might be the zone name. Other examples might be a key
  24853. // indicating a deprecated resource and a suggested replacement, or a
  24854. // warning about invalid network settings (for example, if an instance
  24855. // attempts to perform IP forwarding but is not enabled for IP
  24856. // forwarding).
  24857. Key string `json:"key,omitempty"`
  24858. // Value: [Output Only] A warning data value corresponding to the key.
  24859. Value string `json:"value,omitempty"`
  24860. // ForceSendFields is a list of field names (e.g. "Key") to
  24861. // unconditionally include in API requests. By default, fields with
  24862. // empty values are omitted from API requests. However, any non-pointer,
  24863. // non-interface field appearing in ForceSendFields will be sent to the
  24864. // server regardless of whether the field is empty or not. This may be
  24865. // used to include empty fields in Patch requests.
  24866. ForceSendFields []string `json:"-"`
  24867. // NullFields is a list of field names (e.g. "Key") to include in API
  24868. // requests with the JSON null value. By default, fields with empty
  24869. // values are omitted from API requests. However, any field with an
  24870. // empty value appearing in NullFields will be sent to the server as
  24871. // null. It is an error if a field in this list has a non-empty value.
  24872. // This may be used to include null fields in Patch requests.
  24873. NullFields []string `json:"-"`
  24874. }
  24875. func (s *TargetTcpProxyListWarningData) MarshalJSON() ([]byte, error) {
  24876. type NoMethod TargetTcpProxyListWarningData
  24877. raw := NoMethod(*s)
  24878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24879. }
  24880. // TargetVpnGateway: Represents a Target VPN gateway resource. (==
  24881. // resource_for beta.targetVpnGateways ==) (== resource_for
  24882. // v1.targetVpnGateways ==)
  24883. type TargetVpnGateway struct {
  24884. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  24885. // format.
  24886. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  24887. // Description: An optional description of this resource. Provide this
  24888. // property when you create the resource.
  24889. Description string `json:"description,omitempty"`
  24890. // ForwardingRules: [Output Only] A list of URLs to the ForwardingRule
  24891. // resources. ForwardingRules are created using
  24892. // compute.forwardingRules.insert and associated with a VPN gateway.
  24893. ForwardingRules []string `json:"forwardingRules,omitempty"`
  24894. // Id: [Output Only] The unique identifier for the resource. This
  24895. // identifier is defined by the server.
  24896. Id uint64 `json:"id,omitempty,string"`
  24897. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  24898. // for target VPN gateways.
  24899. Kind string `json:"kind,omitempty"`
  24900. // Name: Name of the resource. Provided by the client when the resource
  24901. // is created. The name must be 1-63 characters long, and comply with
  24902. // RFC1035. Specifically, the name must be 1-63 characters long and
  24903. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  24904. // the first character must be a lowercase letter, and all following
  24905. // characters must be a dash, lowercase letter, or digit, except the
  24906. // last character, which cannot be a dash.
  24907. Name string `json:"name,omitempty"`
  24908. // Network: URL of the network to which this VPN gateway is attached.
  24909. // Provided by the client when the VPN gateway is created.
  24910. Network string `json:"network,omitempty"`
  24911. // Region: [Output Only] URL of the region where the target VPN gateway
  24912. // resides. You must specify this field as part of the HTTP request URL.
  24913. // It is not settable as a field in the request body.
  24914. Region string `json:"region,omitempty"`
  24915. // SelfLink: [Output Only] Server-defined URL for the resource.
  24916. SelfLink string `json:"selfLink,omitempty"`
  24917. // Status: [Output Only] The status of the VPN gateway, which can be one
  24918. // of the following: CREATING, READY, FAILED, or DELETING.
  24919. //
  24920. // Possible values:
  24921. // "CREATING"
  24922. // "DELETING"
  24923. // "FAILED"
  24924. // "READY"
  24925. Status string `json:"status,omitempty"`
  24926. // Tunnels: [Output Only] A list of URLs to VpnTunnel resources.
  24927. // VpnTunnels are created using the compute.vpntunnels.insert method and
  24928. // associated with a VPN gateway.
  24929. Tunnels []string `json:"tunnels,omitempty"`
  24930. // ServerResponse contains the HTTP response code and headers from the
  24931. // server.
  24932. googleapi.ServerResponse `json:"-"`
  24933. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  24934. // to unconditionally include in API requests. By default, fields with
  24935. // empty values are omitted from API requests. However, any non-pointer,
  24936. // non-interface field appearing in ForceSendFields will be sent to the
  24937. // server regardless of whether the field is empty or not. This may be
  24938. // used to include empty fields in Patch requests.
  24939. ForceSendFields []string `json:"-"`
  24940. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  24941. // include in API requests with the JSON null value. By default, fields
  24942. // with empty values are omitted from API requests. However, any field
  24943. // with an empty value appearing in NullFields will be sent to the
  24944. // server as null. It is an error if a field in this list has a
  24945. // non-empty value. This may be used to include null fields in Patch
  24946. // requests.
  24947. NullFields []string `json:"-"`
  24948. }
  24949. func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) {
  24950. type NoMethod TargetVpnGateway
  24951. raw := NoMethod(*s)
  24952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24953. }
  24954. type TargetVpnGatewayAggregatedList struct {
  24955. // Id: [Output Only] Unique identifier for the resource; defined by the
  24956. // server.
  24957. Id string `json:"id,omitempty"`
  24958. // Items: A list of TargetVpnGateway resources.
  24959. Items map[string]TargetVpnGatewaysScopedList `json:"items,omitempty"`
  24960. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  24961. // for target VPN gateways.
  24962. Kind string `json:"kind,omitempty"`
  24963. // NextPageToken: [Output Only] This token allows you to get the next
  24964. // page of results for list requests. If the number of results is larger
  24965. // than maxResults, use the nextPageToken as a value for the query
  24966. // parameter pageToken in the next list request. Subsequent list
  24967. // requests will have their own nextPageToken to continue paging through
  24968. // the results.
  24969. NextPageToken string `json:"nextPageToken,omitempty"`
  24970. // SelfLink: [Output Only] Server-defined URL for this resource.
  24971. SelfLink string `json:"selfLink,omitempty"`
  24972. // Warning: [Output Only] Informational warning message.
  24973. Warning *TargetVpnGatewayAggregatedListWarning `json:"warning,omitempty"`
  24974. // ServerResponse contains the HTTP response code and headers from the
  24975. // server.
  24976. googleapi.ServerResponse `json:"-"`
  24977. // ForceSendFields is a list of field names (e.g. "Id") to
  24978. // unconditionally include in API requests. By default, fields with
  24979. // empty values are omitted from API requests. However, any non-pointer,
  24980. // non-interface field appearing in ForceSendFields will be sent to the
  24981. // server regardless of whether the field is empty or not. This may be
  24982. // used to include empty fields in Patch requests.
  24983. ForceSendFields []string `json:"-"`
  24984. // NullFields is a list of field names (e.g. "Id") to include in API
  24985. // requests with the JSON null value. By default, fields with empty
  24986. // values are omitted from API requests. However, any field with an
  24987. // empty value appearing in NullFields will be sent to the server as
  24988. // null. It is an error if a field in this list has a non-empty value.
  24989. // This may be used to include null fields in Patch requests.
  24990. NullFields []string `json:"-"`
  24991. }
  24992. func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) {
  24993. type NoMethod TargetVpnGatewayAggregatedList
  24994. raw := NoMethod(*s)
  24995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  24996. }
  24997. // TargetVpnGatewayAggregatedListWarning: [Output Only] Informational
  24998. // warning message.
  24999. type TargetVpnGatewayAggregatedListWarning struct {
  25000. // Code: [Output Only] A warning code, if applicable. For example,
  25001. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25002. // the response.
  25003. //
  25004. // Possible values:
  25005. // "CLEANUP_FAILED"
  25006. // "DEPRECATED_RESOURCE_USED"
  25007. // "DEPRECATED_TYPE_USED"
  25008. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25009. // "EXPERIMENTAL_TYPE_USED"
  25010. // "EXTERNAL_API_WARNING"
  25011. // "FIELD_VALUE_OVERRIDEN"
  25012. // "INJECTED_KERNELS_DEPRECATED"
  25013. // "MISSING_TYPE_DEPENDENCY"
  25014. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25015. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25016. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25017. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25018. // "NEXT_HOP_NOT_RUNNING"
  25019. // "NOT_CRITICAL_ERROR"
  25020. // "NO_RESULTS_ON_PAGE"
  25021. // "REQUIRED_TOS_AGREEMENT"
  25022. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25023. // "RESOURCE_NOT_DELETED"
  25024. // "SCHEMA_VALIDATION_IGNORED"
  25025. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25026. // "UNDECLARED_PROPERTIES"
  25027. // "UNREACHABLE"
  25028. Code string `json:"code,omitempty"`
  25029. // Data: [Output Only] Metadata about this warning in key: value format.
  25030. // For example:
  25031. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25032. Data []*TargetVpnGatewayAggregatedListWarningData `json:"data,omitempty"`
  25033. // Message: [Output Only] A human-readable description of the warning
  25034. // code.
  25035. Message string `json:"message,omitempty"`
  25036. // ForceSendFields is a list of field names (e.g. "Code") to
  25037. // unconditionally include in API requests. By default, fields with
  25038. // empty values are omitted from API requests. However, any non-pointer,
  25039. // non-interface field appearing in ForceSendFields will be sent to the
  25040. // server regardless of whether the field is empty or not. This may be
  25041. // used to include empty fields in Patch requests.
  25042. ForceSendFields []string `json:"-"`
  25043. // NullFields is a list of field names (e.g. "Code") to include in API
  25044. // requests with the JSON null value. By default, fields with empty
  25045. // values are omitted from API requests. However, any field with an
  25046. // empty value appearing in NullFields will be sent to the server as
  25047. // null. It is an error if a field in this list has a non-empty value.
  25048. // This may be used to include null fields in Patch requests.
  25049. NullFields []string `json:"-"`
  25050. }
  25051. func (s *TargetVpnGatewayAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25052. type NoMethod TargetVpnGatewayAggregatedListWarning
  25053. raw := NoMethod(*s)
  25054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25055. }
  25056. type TargetVpnGatewayAggregatedListWarningData struct {
  25057. // Key: [Output Only] A key that provides more detail on the warning
  25058. // being returned. For example, for warnings where there are no results
  25059. // in a list request for a particular zone, this key might be scope and
  25060. // the key value might be the zone name. Other examples might be a key
  25061. // indicating a deprecated resource and a suggested replacement, or a
  25062. // warning about invalid network settings (for example, if an instance
  25063. // attempts to perform IP forwarding but is not enabled for IP
  25064. // forwarding).
  25065. Key string `json:"key,omitempty"`
  25066. // Value: [Output Only] A warning data value corresponding to the key.
  25067. Value string `json:"value,omitempty"`
  25068. // ForceSendFields is a list of field names (e.g. "Key") to
  25069. // unconditionally include in API requests. By default, fields with
  25070. // empty values are omitted from API requests. However, any non-pointer,
  25071. // non-interface field appearing in ForceSendFields will be sent to the
  25072. // server regardless of whether the field is empty or not. This may be
  25073. // used to include empty fields in Patch requests.
  25074. ForceSendFields []string `json:"-"`
  25075. // NullFields is a list of field names (e.g. "Key") to include in API
  25076. // requests with the JSON null value. By default, fields with empty
  25077. // values are omitted from API requests. However, any field with an
  25078. // empty value appearing in NullFields will be sent to the server as
  25079. // null. It is an error if a field in this list has a non-empty value.
  25080. // This may be used to include null fields in Patch requests.
  25081. NullFields []string `json:"-"`
  25082. }
  25083. func (s *TargetVpnGatewayAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25084. type NoMethod TargetVpnGatewayAggregatedListWarningData
  25085. raw := NoMethod(*s)
  25086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25087. }
  25088. // TargetVpnGatewayList: Contains a list of TargetVpnGateway resources.
  25089. type TargetVpnGatewayList struct {
  25090. // Id: [Output Only] Unique identifier for the resource; defined by the
  25091. // server.
  25092. Id string `json:"id,omitempty"`
  25093. // Items: A list of TargetVpnGateway resources.
  25094. Items []*TargetVpnGateway `json:"items,omitempty"`
  25095. // Kind: [Output Only] Type of resource. Always compute#targetVpnGateway
  25096. // for target VPN gateways.
  25097. Kind string `json:"kind,omitempty"`
  25098. // NextPageToken: [Output Only] This token allows you to get the next
  25099. // page of results for list requests. If the number of results is larger
  25100. // than maxResults, use the nextPageToken as a value for the query
  25101. // parameter pageToken in the next list request. Subsequent list
  25102. // requests will have their own nextPageToken to continue paging through
  25103. // the results.
  25104. NextPageToken string `json:"nextPageToken,omitempty"`
  25105. // SelfLink: [Output Only] Server-defined URL for this resource.
  25106. SelfLink string `json:"selfLink,omitempty"`
  25107. // Warning: [Output Only] Informational warning message.
  25108. Warning *TargetVpnGatewayListWarning `json:"warning,omitempty"`
  25109. // ServerResponse contains the HTTP response code and headers from the
  25110. // server.
  25111. googleapi.ServerResponse `json:"-"`
  25112. // ForceSendFields is a list of field names (e.g. "Id") to
  25113. // unconditionally include in API requests. By default, fields with
  25114. // empty values are omitted from API requests. However, any non-pointer,
  25115. // non-interface field appearing in ForceSendFields will be sent to the
  25116. // server regardless of whether the field is empty or not. This may be
  25117. // used to include empty fields in Patch requests.
  25118. ForceSendFields []string `json:"-"`
  25119. // NullFields is a list of field names (e.g. "Id") to include in API
  25120. // requests with the JSON null value. By default, fields with empty
  25121. // values are omitted from API requests. However, any field with an
  25122. // empty value appearing in NullFields will be sent to the server as
  25123. // null. It is an error if a field in this list has a non-empty value.
  25124. // This may be used to include null fields in Patch requests.
  25125. NullFields []string `json:"-"`
  25126. }
  25127. func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) {
  25128. type NoMethod TargetVpnGatewayList
  25129. raw := NoMethod(*s)
  25130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25131. }
  25132. // TargetVpnGatewayListWarning: [Output Only] Informational warning
  25133. // message.
  25134. type TargetVpnGatewayListWarning struct {
  25135. // Code: [Output Only] A warning code, if applicable. For example,
  25136. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25137. // the response.
  25138. //
  25139. // Possible values:
  25140. // "CLEANUP_FAILED"
  25141. // "DEPRECATED_RESOURCE_USED"
  25142. // "DEPRECATED_TYPE_USED"
  25143. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25144. // "EXPERIMENTAL_TYPE_USED"
  25145. // "EXTERNAL_API_WARNING"
  25146. // "FIELD_VALUE_OVERRIDEN"
  25147. // "INJECTED_KERNELS_DEPRECATED"
  25148. // "MISSING_TYPE_DEPENDENCY"
  25149. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25150. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25151. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25152. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25153. // "NEXT_HOP_NOT_RUNNING"
  25154. // "NOT_CRITICAL_ERROR"
  25155. // "NO_RESULTS_ON_PAGE"
  25156. // "REQUIRED_TOS_AGREEMENT"
  25157. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25158. // "RESOURCE_NOT_DELETED"
  25159. // "SCHEMA_VALIDATION_IGNORED"
  25160. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25161. // "UNDECLARED_PROPERTIES"
  25162. // "UNREACHABLE"
  25163. Code string `json:"code,omitempty"`
  25164. // Data: [Output Only] Metadata about this warning in key: value format.
  25165. // For example:
  25166. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25167. Data []*TargetVpnGatewayListWarningData `json:"data,omitempty"`
  25168. // Message: [Output Only] A human-readable description of the warning
  25169. // code.
  25170. Message string `json:"message,omitempty"`
  25171. // ForceSendFields is a list of field names (e.g. "Code") to
  25172. // unconditionally include in API requests. By default, fields with
  25173. // empty values are omitted from API requests. However, any non-pointer,
  25174. // non-interface field appearing in ForceSendFields will be sent to the
  25175. // server regardless of whether the field is empty or not. This may be
  25176. // used to include empty fields in Patch requests.
  25177. ForceSendFields []string `json:"-"`
  25178. // NullFields is a list of field names (e.g. "Code") to include in API
  25179. // requests with the JSON null value. By default, fields with empty
  25180. // values are omitted from API requests. However, any field with an
  25181. // empty value appearing in NullFields will be sent to the server as
  25182. // null. It is an error if a field in this list has a non-empty value.
  25183. // This may be used to include null fields in Patch requests.
  25184. NullFields []string `json:"-"`
  25185. }
  25186. func (s *TargetVpnGatewayListWarning) MarshalJSON() ([]byte, error) {
  25187. type NoMethod TargetVpnGatewayListWarning
  25188. raw := NoMethod(*s)
  25189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25190. }
  25191. type TargetVpnGatewayListWarningData struct {
  25192. // Key: [Output Only] A key that provides more detail on the warning
  25193. // being returned. For example, for warnings where there are no results
  25194. // in a list request for a particular zone, this key might be scope and
  25195. // the key value might be the zone name. Other examples might be a key
  25196. // indicating a deprecated resource and a suggested replacement, or a
  25197. // warning about invalid network settings (for example, if an instance
  25198. // attempts to perform IP forwarding but is not enabled for IP
  25199. // forwarding).
  25200. Key string `json:"key,omitempty"`
  25201. // Value: [Output Only] A warning data value corresponding to the key.
  25202. Value string `json:"value,omitempty"`
  25203. // ForceSendFields is a list of field names (e.g. "Key") to
  25204. // unconditionally include in API requests. By default, fields with
  25205. // empty values are omitted from API requests. However, any non-pointer,
  25206. // non-interface field appearing in ForceSendFields will be sent to the
  25207. // server regardless of whether the field is empty or not. This may be
  25208. // used to include empty fields in Patch requests.
  25209. ForceSendFields []string `json:"-"`
  25210. // NullFields is a list of field names (e.g. "Key") to include in API
  25211. // requests with the JSON null value. By default, fields with empty
  25212. // values are omitted from API requests. However, any field with an
  25213. // empty value appearing in NullFields will be sent to the server as
  25214. // null. It is an error if a field in this list has a non-empty value.
  25215. // This may be used to include null fields in Patch requests.
  25216. NullFields []string `json:"-"`
  25217. }
  25218. func (s *TargetVpnGatewayListWarningData) MarshalJSON() ([]byte, error) {
  25219. type NoMethod TargetVpnGatewayListWarningData
  25220. raw := NoMethod(*s)
  25221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25222. }
  25223. type TargetVpnGatewaysScopedList struct {
  25224. // TargetVpnGateways: [Output Only] A list of target VPN gateways
  25225. // contained in this scope.
  25226. TargetVpnGateways []*TargetVpnGateway `json:"targetVpnGateways,omitempty"`
  25227. // Warning: [Output Only] Informational warning which replaces the list
  25228. // of addresses when the list is empty.
  25229. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"`
  25230. // ForceSendFields is a list of field names (e.g. "TargetVpnGateways")
  25231. // to unconditionally include in API requests. By default, fields with
  25232. // empty values are omitted from API requests. However, any non-pointer,
  25233. // non-interface field appearing in ForceSendFields will be sent to the
  25234. // server regardless of whether the field is empty or not. This may be
  25235. // used to include empty fields in Patch requests.
  25236. ForceSendFields []string `json:"-"`
  25237. // NullFields is a list of field names (e.g. "TargetVpnGateways") to
  25238. // include in API requests with the JSON null value. By default, fields
  25239. // with empty values are omitted from API requests. However, any field
  25240. // with an empty value appearing in NullFields will be sent to the
  25241. // server as null. It is an error if a field in this list has a
  25242. // non-empty value. This may be used to include null fields in Patch
  25243. // requests.
  25244. NullFields []string `json:"-"`
  25245. }
  25246. func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) {
  25247. type NoMethod TargetVpnGatewaysScopedList
  25248. raw := NoMethod(*s)
  25249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25250. }
  25251. // TargetVpnGatewaysScopedListWarning: [Output Only] Informational
  25252. // warning which replaces the list of addresses when the list is empty.
  25253. type TargetVpnGatewaysScopedListWarning struct {
  25254. // Code: [Output Only] A warning code, if applicable. For example,
  25255. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25256. // the response.
  25257. //
  25258. // Possible values:
  25259. // "CLEANUP_FAILED"
  25260. // "DEPRECATED_RESOURCE_USED"
  25261. // "DEPRECATED_TYPE_USED"
  25262. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25263. // "EXPERIMENTAL_TYPE_USED"
  25264. // "EXTERNAL_API_WARNING"
  25265. // "FIELD_VALUE_OVERRIDEN"
  25266. // "INJECTED_KERNELS_DEPRECATED"
  25267. // "MISSING_TYPE_DEPENDENCY"
  25268. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25269. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25270. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25271. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25272. // "NEXT_HOP_NOT_RUNNING"
  25273. // "NOT_CRITICAL_ERROR"
  25274. // "NO_RESULTS_ON_PAGE"
  25275. // "REQUIRED_TOS_AGREEMENT"
  25276. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25277. // "RESOURCE_NOT_DELETED"
  25278. // "SCHEMA_VALIDATION_IGNORED"
  25279. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25280. // "UNDECLARED_PROPERTIES"
  25281. // "UNREACHABLE"
  25282. Code string `json:"code,omitempty"`
  25283. // Data: [Output Only] Metadata about this warning in key: value format.
  25284. // For example:
  25285. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25286. Data []*TargetVpnGatewaysScopedListWarningData `json:"data,omitempty"`
  25287. // Message: [Output Only] A human-readable description of the warning
  25288. // code.
  25289. Message string `json:"message,omitempty"`
  25290. // ForceSendFields is a list of field names (e.g. "Code") to
  25291. // unconditionally include in API requests. By default, fields with
  25292. // empty values are omitted from API requests. However, any non-pointer,
  25293. // non-interface field appearing in ForceSendFields will be sent to the
  25294. // server regardless of whether the field is empty or not. This may be
  25295. // used to include empty fields in Patch requests.
  25296. ForceSendFields []string `json:"-"`
  25297. // NullFields is a list of field names (e.g. "Code") to include in API
  25298. // requests with the JSON null value. By default, fields with empty
  25299. // values are omitted from API requests. However, any field with an
  25300. // empty value appearing in NullFields will be sent to the server as
  25301. // null. It is an error if a field in this list has a non-empty value.
  25302. // This may be used to include null fields in Patch requests.
  25303. NullFields []string `json:"-"`
  25304. }
  25305. func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) {
  25306. type NoMethod TargetVpnGatewaysScopedListWarning
  25307. raw := NoMethod(*s)
  25308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25309. }
  25310. type TargetVpnGatewaysScopedListWarningData struct {
  25311. // Key: [Output Only] A key that provides more detail on the warning
  25312. // being returned. For example, for warnings where there are no results
  25313. // in a list request for a particular zone, this key might be scope and
  25314. // the key value might be the zone name. Other examples might be a key
  25315. // indicating a deprecated resource and a suggested replacement, or a
  25316. // warning about invalid network settings (for example, if an instance
  25317. // attempts to perform IP forwarding but is not enabled for IP
  25318. // forwarding).
  25319. Key string `json:"key,omitempty"`
  25320. // Value: [Output Only] A warning data value corresponding to the key.
  25321. Value string `json:"value,omitempty"`
  25322. // ForceSendFields is a list of field names (e.g. "Key") to
  25323. // unconditionally include in API requests. By default, fields with
  25324. // empty values are omitted from API requests. However, any non-pointer,
  25325. // non-interface field appearing in ForceSendFields will be sent to the
  25326. // server regardless of whether the field is empty or not. This may be
  25327. // used to include empty fields in Patch requests.
  25328. ForceSendFields []string `json:"-"`
  25329. // NullFields is a list of field names (e.g. "Key") to include in API
  25330. // requests with the JSON null value. By default, fields with empty
  25331. // values are omitted from API requests. However, any field with an
  25332. // empty value appearing in NullFields will be sent to the server as
  25333. // null. It is an error if a field in this list has a non-empty value.
  25334. // This may be used to include null fields in Patch requests.
  25335. NullFields []string `json:"-"`
  25336. }
  25337. func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) {
  25338. type NoMethod TargetVpnGatewaysScopedListWarningData
  25339. raw := NoMethod(*s)
  25340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25341. }
  25342. type TestFailure struct {
  25343. ActualService string `json:"actualService,omitempty"`
  25344. ExpectedService string `json:"expectedService,omitempty"`
  25345. Host string `json:"host,omitempty"`
  25346. Path string `json:"path,omitempty"`
  25347. // ForceSendFields is a list of field names (e.g. "ActualService") to
  25348. // unconditionally include in API requests. By default, fields with
  25349. // empty values are omitted from API requests. However, any non-pointer,
  25350. // non-interface field appearing in ForceSendFields will be sent to the
  25351. // server regardless of whether the field is empty or not. This may be
  25352. // used to include empty fields in Patch requests.
  25353. ForceSendFields []string `json:"-"`
  25354. // NullFields is a list of field names (e.g. "ActualService") to include
  25355. // in API requests with the JSON null value. By default, fields with
  25356. // empty values are omitted from API requests. However, any field with
  25357. // an empty value appearing in NullFields will be sent to the server as
  25358. // null. It is an error if a field in this list has a non-empty value.
  25359. // This may be used to include null fields in Patch requests.
  25360. NullFields []string `json:"-"`
  25361. }
  25362. func (s *TestFailure) MarshalJSON() ([]byte, error) {
  25363. type NoMethod TestFailure
  25364. raw := NoMethod(*s)
  25365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25366. }
  25367. type TestPermissionsRequest struct {
  25368. // Permissions: The set of permissions to check for the 'resource'.
  25369. // Permissions with wildcards (such as '*' or 'storage.*') are not
  25370. // allowed.
  25371. Permissions []string `json:"permissions,omitempty"`
  25372. // ForceSendFields is a list of field names (e.g. "Permissions") to
  25373. // unconditionally include in API requests. By default, fields with
  25374. // empty values are omitted from API requests. However, any non-pointer,
  25375. // non-interface field appearing in ForceSendFields will be sent to the
  25376. // server regardless of whether the field is empty or not. This may be
  25377. // used to include empty fields in Patch requests.
  25378. ForceSendFields []string `json:"-"`
  25379. // NullFields is a list of field names (e.g. "Permissions") to include
  25380. // in API requests with the JSON null value. By default, fields with
  25381. // empty values are omitted from API requests. However, any field with
  25382. // an empty value appearing in NullFields will be sent to the server as
  25383. // null. It is an error if a field in this list has a non-empty value.
  25384. // This may be used to include null fields in Patch requests.
  25385. NullFields []string `json:"-"`
  25386. }
  25387. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  25388. type NoMethod TestPermissionsRequest
  25389. raw := NoMethod(*s)
  25390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25391. }
  25392. type TestPermissionsResponse struct {
  25393. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  25394. // the caller is allowed.
  25395. Permissions []string `json:"permissions,omitempty"`
  25396. // ServerResponse contains the HTTP response code and headers from the
  25397. // server.
  25398. googleapi.ServerResponse `json:"-"`
  25399. // ForceSendFields is a list of field names (e.g. "Permissions") to
  25400. // unconditionally include in API requests. By default, fields with
  25401. // empty values are omitted from API requests. However, any non-pointer,
  25402. // non-interface field appearing in ForceSendFields will be sent to the
  25403. // server regardless of whether the field is empty or not. This may be
  25404. // used to include empty fields in Patch requests.
  25405. ForceSendFields []string `json:"-"`
  25406. // NullFields is a list of field names (e.g. "Permissions") to include
  25407. // in API requests with the JSON null value. By default, fields with
  25408. // empty values are omitted from API requests. However, any field with
  25409. // an empty value appearing in NullFields will be sent to the server as
  25410. // null. It is an error if a field in this list has a non-empty value.
  25411. // This may be used to include null fields in Patch requests.
  25412. NullFields []string `json:"-"`
  25413. }
  25414. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  25415. type NoMethod TestPermissionsResponse
  25416. raw := NoMethod(*s)
  25417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25418. }
  25419. // UrlMap: A UrlMap resource. This resource defines the mapping from URL
  25420. // to the BackendService resource, based on the "longest-match" of the
  25421. // URL's host and path.
  25422. type UrlMap struct {
  25423. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  25424. // format.
  25425. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  25426. // DefaultService: The full or partial URL of the defaultService
  25427. // resource to which traffic is directed if none of the hostRules match.
  25428. // If defaultRouteAction is additionally specified, advanced routing
  25429. // actions like URL Rewrites, etc. take effect prior to sending the
  25430. // request to the backend. However, if defaultService is specified,
  25431. // defaultRouteAction cannot contain any weightedBackendServices.
  25432. // Conversely, if routeAction specifies any weightedBackendServices,
  25433. // service must not be specified.
  25434. // Only one of defaultService, defaultUrlRedirect or
  25435. // defaultRouteAction.weightedBackendService must be set.
  25436. DefaultService string `json:"defaultService,omitempty"`
  25437. // Description: An optional description of this resource. Provide this
  25438. // property when you create the resource.
  25439. Description string `json:"description,omitempty"`
  25440. // Fingerprint: Fingerprint of this resource. A hash of the contents
  25441. // stored in this object. This field is used in optimistic locking. This
  25442. // field will be ignored when inserting a UrlMap. An up-to-date
  25443. // fingerprint must be provided in order to update the UrlMap, otherwise
  25444. // the request will fail with error 412 conditionNotMet.
  25445. //
  25446. // To see the latest fingerprint, make a get() request to retrieve a
  25447. // UrlMap.
  25448. Fingerprint string `json:"fingerprint,omitempty"`
  25449. // HostRules: The list of HostRules to use against the URL.
  25450. HostRules []*HostRule `json:"hostRules,omitempty"`
  25451. // Id: [Output Only] The unique identifier for the resource. This
  25452. // identifier is defined by the server.
  25453. Id uint64 `json:"id,omitempty,string"`
  25454. // Kind: [Output Only] Type of the resource. Always compute#urlMaps for
  25455. // url maps.
  25456. Kind string `json:"kind,omitempty"`
  25457. // Name: Name of the resource. Provided by the client when the resource
  25458. // is created. The name must be 1-63 characters long, and comply with
  25459. // RFC1035. Specifically, the name must be 1-63 characters long and
  25460. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  25461. // the first character must be a lowercase letter, and all following
  25462. // characters must be a dash, lowercase letter, or digit, except the
  25463. // last character, which cannot be a dash.
  25464. Name string `json:"name,omitempty"`
  25465. // PathMatchers: The list of named PathMatchers to use against the URL.
  25466. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"`
  25467. // SelfLink: [Output Only] Server-defined URL for the resource.
  25468. SelfLink string `json:"selfLink,omitempty"`
  25469. // Tests: The list of expected URL mapping tests. Request to update this
  25470. // UrlMap will succeed only if all of the test cases pass. You can
  25471. // specify a maximum of 100 tests per UrlMap.
  25472. Tests []*UrlMapTest `json:"tests,omitempty"`
  25473. // ServerResponse contains the HTTP response code and headers from the
  25474. // server.
  25475. googleapi.ServerResponse `json:"-"`
  25476. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  25477. // to unconditionally include in API requests. By default, fields with
  25478. // empty values are omitted from API requests. However, any non-pointer,
  25479. // non-interface field appearing in ForceSendFields will be sent to the
  25480. // server regardless of whether the field is empty or not. This may be
  25481. // used to include empty fields in Patch requests.
  25482. ForceSendFields []string `json:"-"`
  25483. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  25484. // include in API requests with the JSON null value. By default, fields
  25485. // with empty values are omitted from API requests. However, any field
  25486. // with an empty value appearing in NullFields will be sent to the
  25487. // server as null. It is an error if a field in this list has a
  25488. // non-empty value. This may be used to include null fields in Patch
  25489. // requests.
  25490. NullFields []string `json:"-"`
  25491. }
  25492. func (s *UrlMap) MarshalJSON() ([]byte, error) {
  25493. type NoMethod UrlMap
  25494. raw := NoMethod(*s)
  25495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25496. }
  25497. // UrlMapList: Contains a list of UrlMap resources.
  25498. type UrlMapList struct {
  25499. // Id: [Output Only] Unique identifier for the resource; defined by the
  25500. // server.
  25501. Id string `json:"id,omitempty"`
  25502. // Items: A list of UrlMap resources.
  25503. Items []*UrlMap `json:"items,omitempty"`
  25504. // Kind: Type of resource.
  25505. Kind string `json:"kind,omitempty"`
  25506. // NextPageToken: [Output Only] This token allows you to get the next
  25507. // page of results for list requests. If the number of results is larger
  25508. // than maxResults, use the nextPageToken as a value for the query
  25509. // parameter pageToken in the next list request. Subsequent list
  25510. // requests will have their own nextPageToken to continue paging through
  25511. // the results.
  25512. NextPageToken string `json:"nextPageToken,omitempty"`
  25513. // SelfLink: [Output Only] Server-defined URL for this resource.
  25514. SelfLink string `json:"selfLink,omitempty"`
  25515. // Warning: [Output Only] Informational warning message.
  25516. Warning *UrlMapListWarning `json:"warning,omitempty"`
  25517. // ServerResponse contains the HTTP response code and headers from the
  25518. // server.
  25519. googleapi.ServerResponse `json:"-"`
  25520. // ForceSendFields is a list of field names (e.g. "Id") to
  25521. // unconditionally include in API requests. By default, fields with
  25522. // empty values are omitted from API requests. However, any non-pointer,
  25523. // non-interface field appearing in ForceSendFields will be sent to the
  25524. // server regardless of whether the field is empty or not. This may be
  25525. // used to include empty fields in Patch requests.
  25526. ForceSendFields []string `json:"-"`
  25527. // NullFields is a list of field names (e.g. "Id") to include in API
  25528. // requests with the JSON null value. By default, fields with empty
  25529. // values are omitted from API requests. However, any field with an
  25530. // empty value appearing in NullFields will be sent to the server as
  25531. // null. It is an error if a field in this list has a non-empty value.
  25532. // This may be used to include null fields in Patch requests.
  25533. NullFields []string `json:"-"`
  25534. }
  25535. func (s *UrlMapList) MarshalJSON() ([]byte, error) {
  25536. type NoMethod UrlMapList
  25537. raw := NoMethod(*s)
  25538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25539. }
  25540. // UrlMapListWarning: [Output Only] Informational warning message.
  25541. type UrlMapListWarning struct {
  25542. // Code: [Output Only] A warning code, if applicable. For example,
  25543. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25544. // the response.
  25545. //
  25546. // Possible values:
  25547. // "CLEANUP_FAILED"
  25548. // "DEPRECATED_RESOURCE_USED"
  25549. // "DEPRECATED_TYPE_USED"
  25550. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25551. // "EXPERIMENTAL_TYPE_USED"
  25552. // "EXTERNAL_API_WARNING"
  25553. // "FIELD_VALUE_OVERRIDEN"
  25554. // "INJECTED_KERNELS_DEPRECATED"
  25555. // "MISSING_TYPE_DEPENDENCY"
  25556. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25557. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25558. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25559. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25560. // "NEXT_HOP_NOT_RUNNING"
  25561. // "NOT_CRITICAL_ERROR"
  25562. // "NO_RESULTS_ON_PAGE"
  25563. // "REQUIRED_TOS_AGREEMENT"
  25564. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25565. // "RESOURCE_NOT_DELETED"
  25566. // "SCHEMA_VALIDATION_IGNORED"
  25567. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25568. // "UNDECLARED_PROPERTIES"
  25569. // "UNREACHABLE"
  25570. Code string `json:"code,omitempty"`
  25571. // Data: [Output Only] Metadata about this warning in key: value format.
  25572. // For example:
  25573. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25574. Data []*UrlMapListWarningData `json:"data,omitempty"`
  25575. // Message: [Output Only] A human-readable description of the warning
  25576. // code.
  25577. Message string `json:"message,omitempty"`
  25578. // ForceSendFields is a list of field names (e.g. "Code") to
  25579. // unconditionally include in API requests. By default, fields with
  25580. // empty values are omitted from API requests. However, any non-pointer,
  25581. // non-interface field appearing in ForceSendFields will be sent to the
  25582. // server regardless of whether the field is empty or not. This may be
  25583. // used to include empty fields in Patch requests.
  25584. ForceSendFields []string `json:"-"`
  25585. // NullFields is a list of field names (e.g. "Code") to include in API
  25586. // requests with the JSON null value. By default, fields with empty
  25587. // values are omitted from API requests. However, any field with an
  25588. // empty value appearing in NullFields will be sent to the server as
  25589. // null. It is an error if a field in this list has a non-empty value.
  25590. // This may be used to include null fields in Patch requests.
  25591. NullFields []string `json:"-"`
  25592. }
  25593. func (s *UrlMapListWarning) MarshalJSON() ([]byte, error) {
  25594. type NoMethod UrlMapListWarning
  25595. raw := NoMethod(*s)
  25596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25597. }
  25598. type UrlMapListWarningData struct {
  25599. // Key: [Output Only] A key that provides more detail on the warning
  25600. // being returned. For example, for warnings where there are no results
  25601. // in a list request for a particular zone, this key might be scope and
  25602. // the key value might be the zone name. Other examples might be a key
  25603. // indicating a deprecated resource and a suggested replacement, or a
  25604. // warning about invalid network settings (for example, if an instance
  25605. // attempts to perform IP forwarding but is not enabled for IP
  25606. // forwarding).
  25607. Key string `json:"key,omitempty"`
  25608. // Value: [Output Only] A warning data value corresponding to the key.
  25609. Value string `json:"value,omitempty"`
  25610. // ForceSendFields is a list of field names (e.g. "Key") to
  25611. // unconditionally include in API requests. By default, fields with
  25612. // empty values are omitted from API requests. However, any non-pointer,
  25613. // non-interface field appearing in ForceSendFields will be sent to the
  25614. // server regardless of whether the field is empty or not. This may be
  25615. // used to include empty fields in Patch requests.
  25616. ForceSendFields []string `json:"-"`
  25617. // NullFields is a list of field names (e.g. "Key") to include in API
  25618. // requests with the JSON null value. By default, fields with empty
  25619. // values are omitted from API requests. However, any field with an
  25620. // empty value appearing in NullFields will be sent to the server as
  25621. // null. It is an error if a field in this list has a non-empty value.
  25622. // This may be used to include null fields in Patch requests.
  25623. NullFields []string `json:"-"`
  25624. }
  25625. func (s *UrlMapListWarningData) MarshalJSON() ([]byte, error) {
  25626. type NoMethod UrlMapListWarningData
  25627. raw := NoMethod(*s)
  25628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25629. }
  25630. type UrlMapReference struct {
  25631. UrlMap string `json:"urlMap,omitempty"`
  25632. // ForceSendFields is a list of field names (e.g. "UrlMap") to
  25633. // unconditionally include in API requests. By default, fields with
  25634. // empty values are omitted from API requests. However, any non-pointer,
  25635. // non-interface field appearing in ForceSendFields will be sent to the
  25636. // server regardless of whether the field is empty or not. This may be
  25637. // used to include empty fields in Patch requests.
  25638. ForceSendFields []string `json:"-"`
  25639. // NullFields is a list of field names (e.g. "UrlMap") to include in API
  25640. // requests with the JSON null value. By default, fields with empty
  25641. // values are omitted from API requests. However, any field with an
  25642. // empty value appearing in NullFields will be sent to the server as
  25643. // null. It is an error if a field in this list has a non-empty value.
  25644. // This may be used to include null fields in Patch requests.
  25645. NullFields []string `json:"-"`
  25646. }
  25647. func (s *UrlMapReference) MarshalJSON() ([]byte, error) {
  25648. type NoMethod UrlMapReference
  25649. raw := NoMethod(*s)
  25650. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25651. }
  25652. // UrlMapTest: Message for the expected URL mappings.
  25653. type UrlMapTest struct {
  25654. // Description: Description of this test case.
  25655. Description string `json:"description,omitempty"`
  25656. // Host: Host portion of the URL.
  25657. Host string `json:"host,omitempty"`
  25658. // Path: Path portion of the URL.
  25659. Path string `json:"path,omitempty"`
  25660. // Service: Expected BackendService resource the given URL should be
  25661. // mapped to.
  25662. Service string `json:"service,omitempty"`
  25663. // ForceSendFields is a list of field names (e.g. "Description") to
  25664. // unconditionally include in API requests. By default, fields with
  25665. // empty values are omitted from API requests. However, any non-pointer,
  25666. // non-interface field appearing in ForceSendFields will be sent to the
  25667. // server regardless of whether the field is empty or not. This may be
  25668. // used to include empty fields in Patch requests.
  25669. ForceSendFields []string `json:"-"`
  25670. // NullFields is a list of field names (e.g. "Description") to include
  25671. // in API requests with the JSON null value. By default, fields with
  25672. // empty values are omitted from API requests. However, any field with
  25673. // an empty value appearing in NullFields will be sent to the server as
  25674. // null. It is an error if a field in this list has a non-empty value.
  25675. // This may be used to include null fields in Patch requests.
  25676. NullFields []string `json:"-"`
  25677. }
  25678. func (s *UrlMapTest) MarshalJSON() ([]byte, error) {
  25679. type NoMethod UrlMapTest
  25680. raw := NoMethod(*s)
  25681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25682. }
  25683. // UrlMapValidationResult: Message representing the validation result
  25684. // for a UrlMap.
  25685. type UrlMapValidationResult struct {
  25686. LoadErrors []string `json:"loadErrors,omitempty"`
  25687. // LoadSucceeded: Whether the given UrlMap can be successfully loaded.
  25688. // If false, 'loadErrors' indicates the reasons.
  25689. LoadSucceeded bool `json:"loadSucceeded,omitempty"`
  25690. TestFailures []*TestFailure `json:"testFailures,omitempty"`
  25691. // TestPassed: If successfully loaded, this field indicates whether the
  25692. // test passed. If false, 'testFailures's indicate the reason of
  25693. // failure.
  25694. TestPassed bool `json:"testPassed,omitempty"`
  25695. // ForceSendFields is a list of field names (e.g. "LoadErrors") to
  25696. // unconditionally include in API requests. By default, fields with
  25697. // empty values are omitted from API requests. However, any non-pointer,
  25698. // non-interface field appearing in ForceSendFields will be sent to the
  25699. // server regardless of whether the field is empty or not. This may be
  25700. // used to include empty fields in Patch requests.
  25701. ForceSendFields []string `json:"-"`
  25702. // NullFields is a list of field names (e.g. "LoadErrors") to include in
  25703. // API requests with the JSON null value. By default, fields with empty
  25704. // values are omitted from API requests. However, any field with an
  25705. // empty value appearing in NullFields will be sent to the server as
  25706. // null. It is an error if a field in this list has a non-empty value.
  25707. // This may be used to include null fields in Patch requests.
  25708. NullFields []string `json:"-"`
  25709. }
  25710. func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) {
  25711. type NoMethod UrlMapValidationResult
  25712. raw := NoMethod(*s)
  25713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25714. }
  25715. type UrlMapsValidateRequest struct {
  25716. // Resource: Content of the UrlMap to be validated.
  25717. Resource *UrlMap `json:"resource,omitempty"`
  25718. // ForceSendFields is a list of field names (e.g. "Resource") to
  25719. // unconditionally include in API requests. By default, fields with
  25720. // empty values are omitted from API requests. However, any non-pointer,
  25721. // non-interface field appearing in ForceSendFields will be sent to the
  25722. // server regardless of whether the field is empty or not. This may be
  25723. // used to include empty fields in Patch requests.
  25724. ForceSendFields []string `json:"-"`
  25725. // NullFields is a list of field names (e.g. "Resource") to include in
  25726. // API requests with the JSON null value. By default, fields with empty
  25727. // values are omitted from API requests. However, any field with an
  25728. // empty value appearing in NullFields will be sent to the server as
  25729. // null. It is an error if a field in this list has a non-empty value.
  25730. // This may be used to include null fields in Patch requests.
  25731. NullFields []string `json:"-"`
  25732. }
  25733. func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) {
  25734. type NoMethod UrlMapsValidateRequest
  25735. raw := NoMethod(*s)
  25736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25737. }
  25738. type UrlMapsValidateResponse struct {
  25739. Result *UrlMapValidationResult `json:"result,omitempty"`
  25740. // ServerResponse contains the HTTP response code and headers from the
  25741. // server.
  25742. googleapi.ServerResponse `json:"-"`
  25743. // ForceSendFields is a list of field names (e.g. "Result") to
  25744. // unconditionally include in API requests. By default, fields with
  25745. // empty values are omitted from API requests. However, any non-pointer,
  25746. // non-interface field appearing in ForceSendFields will be sent to the
  25747. // server regardless of whether the field is empty or not. This may be
  25748. // used to include empty fields in Patch requests.
  25749. ForceSendFields []string `json:"-"`
  25750. // NullFields is a list of field names (e.g. "Result") to include in API
  25751. // requests with the JSON null value. By default, fields with empty
  25752. // values are omitted from API requests. However, any field with an
  25753. // empty value appearing in NullFields will be sent to the server as
  25754. // null. It is an error if a field in this list has a non-empty value.
  25755. // This may be used to include null fields in Patch requests.
  25756. NullFields []string `json:"-"`
  25757. }
  25758. func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) {
  25759. type NoMethod UrlMapsValidateResponse
  25760. raw := NoMethod(*s)
  25761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25762. }
  25763. // UsableSubnetwork: Subnetwork which the current user has
  25764. // compute.subnetworks.use permission on.
  25765. type UsableSubnetwork struct {
  25766. // IpCidrRange: The range of internal addresses that are owned by this
  25767. // subnetwork.
  25768. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25769. // Network: Network URL.
  25770. Network string `json:"network,omitempty"`
  25771. // SecondaryIpRanges: Secondary IP ranges.
  25772. SecondaryIpRanges []*UsableSubnetworkSecondaryRange `json:"secondaryIpRanges,omitempty"`
  25773. // Subnetwork: Subnetwork URL.
  25774. Subnetwork string `json:"subnetwork,omitempty"`
  25775. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25776. // unconditionally include in API requests. By default, fields with
  25777. // empty values are omitted from API requests. However, any non-pointer,
  25778. // non-interface field appearing in ForceSendFields will be sent to the
  25779. // server regardless of whether the field is empty or not. This may be
  25780. // used to include empty fields in Patch requests.
  25781. ForceSendFields []string `json:"-"`
  25782. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25783. // in API requests with the JSON null value. By default, fields with
  25784. // empty values are omitted from API requests. However, any field with
  25785. // an empty value appearing in NullFields will be sent to the server as
  25786. // null. It is an error if a field in this list has a non-empty value.
  25787. // This may be used to include null fields in Patch requests.
  25788. NullFields []string `json:"-"`
  25789. }
  25790. func (s *UsableSubnetwork) MarshalJSON() ([]byte, error) {
  25791. type NoMethod UsableSubnetwork
  25792. raw := NoMethod(*s)
  25793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25794. }
  25795. // UsableSubnetworkSecondaryRange: Secondary IP range of a usable
  25796. // subnetwork.
  25797. type UsableSubnetworkSecondaryRange struct {
  25798. // IpCidrRange: The range of IP addresses belonging to this subnetwork
  25799. // secondary range.
  25800. IpCidrRange string `json:"ipCidrRange,omitempty"`
  25801. // RangeName: The name associated with this subnetwork secondary range,
  25802. // used when adding an alias IP range to a VM instance. The name must be
  25803. // 1-63 characters long, and comply with RFC1035. The name must be
  25804. // unique within the subnetwork.
  25805. RangeName string `json:"rangeName,omitempty"`
  25806. // ForceSendFields is a list of field names (e.g. "IpCidrRange") to
  25807. // unconditionally include in API requests. By default, fields with
  25808. // empty values are omitted from API requests. However, any non-pointer,
  25809. // non-interface field appearing in ForceSendFields will be sent to the
  25810. // server regardless of whether the field is empty or not. This may be
  25811. // used to include empty fields in Patch requests.
  25812. ForceSendFields []string `json:"-"`
  25813. // NullFields is a list of field names (e.g. "IpCidrRange") to include
  25814. // in API requests with the JSON null value. By default, fields with
  25815. // empty values are omitted from API requests. However, any field with
  25816. // an empty value appearing in NullFields will be sent to the server as
  25817. // null. It is an error if a field in this list has a non-empty value.
  25818. // This may be used to include null fields in Patch requests.
  25819. NullFields []string `json:"-"`
  25820. }
  25821. func (s *UsableSubnetworkSecondaryRange) MarshalJSON() ([]byte, error) {
  25822. type NoMethod UsableSubnetworkSecondaryRange
  25823. raw := NoMethod(*s)
  25824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25825. }
  25826. type UsableSubnetworksAggregatedList struct {
  25827. // Id: [Output Only] The unique identifier for the resource. This
  25828. // identifier is defined by the server.
  25829. Id string `json:"id,omitempty"`
  25830. // Items: [Output] A list of usable subnetwork URLs.
  25831. Items []*UsableSubnetwork `json:"items,omitempty"`
  25832. // Kind: [Output Only] Type of resource. Always
  25833. // compute#usableSubnetworksAggregatedList for aggregated lists of
  25834. // usable subnetworks.
  25835. Kind string `json:"kind,omitempty"`
  25836. // NextPageToken: [Output Only] This token allows you to get the next
  25837. // page of results for list requests. If the number of results is larger
  25838. // than maxResults, use the nextPageToken as a value for the query
  25839. // parameter pageToken in the next list request. Subsequent list
  25840. // requests will have their own nextPageToken to continue paging through
  25841. // the results.
  25842. NextPageToken string `json:"nextPageToken,omitempty"`
  25843. // SelfLink: [Output Only] Server-defined URL for this resource.
  25844. SelfLink string `json:"selfLink,omitempty"`
  25845. // Warning: [Output Only] Informational warning message.
  25846. Warning *UsableSubnetworksAggregatedListWarning `json:"warning,omitempty"`
  25847. // ServerResponse contains the HTTP response code and headers from the
  25848. // server.
  25849. googleapi.ServerResponse `json:"-"`
  25850. // ForceSendFields is a list of field names (e.g. "Id") to
  25851. // unconditionally include in API requests. By default, fields with
  25852. // empty values are omitted from API requests. However, any non-pointer,
  25853. // non-interface field appearing in ForceSendFields will be sent to the
  25854. // server regardless of whether the field is empty or not. This may be
  25855. // used to include empty fields in Patch requests.
  25856. ForceSendFields []string `json:"-"`
  25857. // NullFields is a list of field names (e.g. "Id") to include in API
  25858. // requests with the JSON null value. By default, fields with empty
  25859. // values are omitted from API requests. However, any field with an
  25860. // empty value appearing in NullFields will be sent to the server as
  25861. // null. It is an error if a field in this list has a non-empty value.
  25862. // This may be used to include null fields in Patch requests.
  25863. NullFields []string `json:"-"`
  25864. }
  25865. func (s *UsableSubnetworksAggregatedList) MarshalJSON() ([]byte, error) {
  25866. type NoMethod UsableSubnetworksAggregatedList
  25867. raw := NoMethod(*s)
  25868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25869. }
  25870. // UsableSubnetworksAggregatedListWarning: [Output Only] Informational
  25871. // warning message.
  25872. type UsableSubnetworksAggregatedListWarning struct {
  25873. // Code: [Output Only] A warning code, if applicable. For example,
  25874. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  25875. // the response.
  25876. //
  25877. // Possible values:
  25878. // "CLEANUP_FAILED"
  25879. // "DEPRECATED_RESOURCE_USED"
  25880. // "DEPRECATED_TYPE_USED"
  25881. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  25882. // "EXPERIMENTAL_TYPE_USED"
  25883. // "EXTERNAL_API_WARNING"
  25884. // "FIELD_VALUE_OVERRIDEN"
  25885. // "INJECTED_KERNELS_DEPRECATED"
  25886. // "MISSING_TYPE_DEPENDENCY"
  25887. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  25888. // "NEXT_HOP_CANNOT_IP_FORWARD"
  25889. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  25890. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  25891. // "NEXT_HOP_NOT_RUNNING"
  25892. // "NOT_CRITICAL_ERROR"
  25893. // "NO_RESULTS_ON_PAGE"
  25894. // "REQUIRED_TOS_AGREEMENT"
  25895. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  25896. // "RESOURCE_NOT_DELETED"
  25897. // "SCHEMA_VALIDATION_IGNORED"
  25898. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  25899. // "UNDECLARED_PROPERTIES"
  25900. // "UNREACHABLE"
  25901. Code string `json:"code,omitempty"`
  25902. // Data: [Output Only] Metadata about this warning in key: value format.
  25903. // For example:
  25904. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  25905. Data []*UsableSubnetworksAggregatedListWarningData `json:"data,omitempty"`
  25906. // Message: [Output Only] A human-readable description of the warning
  25907. // code.
  25908. Message string `json:"message,omitempty"`
  25909. // ForceSendFields is a list of field names (e.g. "Code") to
  25910. // unconditionally include in API requests. By default, fields with
  25911. // empty values are omitted from API requests. However, any non-pointer,
  25912. // non-interface field appearing in ForceSendFields will be sent to the
  25913. // server regardless of whether the field is empty or not. This may be
  25914. // used to include empty fields in Patch requests.
  25915. ForceSendFields []string `json:"-"`
  25916. // NullFields is a list of field names (e.g. "Code") to include in API
  25917. // requests with the JSON null value. By default, fields with empty
  25918. // values are omitted from API requests. However, any field with an
  25919. // empty value appearing in NullFields will be sent to the server as
  25920. // null. It is an error if a field in this list has a non-empty value.
  25921. // This may be used to include null fields in Patch requests.
  25922. NullFields []string `json:"-"`
  25923. }
  25924. func (s *UsableSubnetworksAggregatedListWarning) MarshalJSON() ([]byte, error) {
  25925. type NoMethod UsableSubnetworksAggregatedListWarning
  25926. raw := NoMethod(*s)
  25927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25928. }
  25929. type UsableSubnetworksAggregatedListWarningData struct {
  25930. // Key: [Output Only] A key that provides more detail on the warning
  25931. // being returned. For example, for warnings where there are no results
  25932. // in a list request for a particular zone, this key might be scope and
  25933. // the key value might be the zone name. Other examples might be a key
  25934. // indicating a deprecated resource and a suggested replacement, or a
  25935. // warning about invalid network settings (for example, if an instance
  25936. // attempts to perform IP forwarding but is not enabled for IP
  25937. // forwarding).
  25938. Key string `json:"key,omitempty"`
  25939. // Value: [Output Only] A warning data value corresponding to the key.
  25940. Value string `json:"value,omitempty"`
  25941. // ForceSendFields is a list of field names (e.g. "Key") to
  25942. // unconditionally include in API requests. By default, fields with
  25943. // empty values are omitted from API requests. However, any non-pointer,
  25944. // non-interface field appearing in ForceSendFields will be sent to the
  25945. // server regardless of whether the field is empty or not. This may be
  25946. // used to include empty fields in Patch requests.
  25947. ForceSendFields []string `json:"-"`
  25948. // NullFields is a list of field names (e.g. "Key") to include in API
  25949. // requests with the JSON null value. By default, fields with empty
  25950. // values are omitted from API requests. However, any field with an
  25951. // empty value appearing in NullFields will be sent to the server as
  25952. // null. It is an error if a field in this list has a non-empty value.
  25953. // This may be used to include null fields in Patch requests.
  25954. NullFields []string `json:"-"`
  25955. }
  25956. func (s *UsableSubnetworksAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  25957. type NoMethod UsableSubnetworksAggregatedListWarningData
  25958. raw := NoMethod(*s)
  25959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25960. }
  25961. // UsageExportLocation: The location in Cloud Storage and naming method
  25962. // of the daily usage report. Contains bucket_name and report_name
  25963. // prefix.
  25964. type UsageExportLocation struct {
  25965. // BucketName: The name of an existing bucket in Cloud Storage where the
  25966. // usage report object is stored. The Google Service Account is granted
  25967. // write access to this bucket. This can either be the bucket name by
  25968. // itself, such as example-bucket, or the bucket name with gs:// or
  25969. // https://storage.googleapis.com/ in front of it, such as
  25970. // gs://example-bucket.
  25971. BucketName string `json:"bucketName,omitempty"`
  25972. // ReportNamePrefix: An optional prefix for the name of the usage report
  25973. // object stored in bucketName. If not supplied, defaults to usage. The
  25974. // report is stored as a CSV file named
  25975. // report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the
  25976. // usage according to Pacific Time. If you supply a prefix, it should
  25977. // conform to Cloud Storage object naming conventions.
  25978. ReportNamePrefix string `json:"reportNamePrefix,omitempty"`
  25979. // ForceSendFields is a list of field names (e.g. "BucketName") to
  25980. // unconditionally include in API requests. By default, fields with
  25981. // empty values are omitted from API requests. However, any non-pointer,
  25982. // non-interface field appearing in ForceSendFields will be sent to the
  25983. // server regardless of whether the field is empty or not. This may be
  25984. // used to include empty fields in Patch requests.
  25985. ForceSendFields []string `json:"-"`
  25986. // NullFields is a list of field names (e.g. "BucketName") to include in
  25987. // API requests with the JSON null value. By default, fields with empty
  25988. // values are omitted from API requests. However, any field with an
  25989. // empty value appearing in NullFields will be sent to the server as
  25990. // null. It is an error if a field in this list has a non-empty value.
  25991. // This may be used to include null fields in Patch requests.
  25992. NullFields []string `json:"-"`
  25993. }
  25994. func (s *UsageExportLocation) MarshalJSON() ([]byte, error) {
  25995. type NoMethod UsageExportLocation
  25996. raw := NoMethod(*s)
  25997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  25998. }
  25999. // VmEndpointNatMappings: Contain information of Nat mapping for a VM
  26000. // endpoint (i.e., NIC).
  26001. type VmEndpointNatMappings struct {
  26002. // InstanceName: Name of the VM instance which the endpoint belongs to
  26003. InstanceName string `json:"instanceName,omitempty"`
  26004. InterfaceNatMappings []*VmEndpointNatMappingsInterfaceNatMappings `json:"interfaceNatMappings,omitempty"`
  26005. // ForceSendFields is a list of field names (e.g. "InstanceName") to
  26006. // unconditionally include in API requests. By default, fields with
  26007. // empty values are omitted from API requests. However, any non-pointer,
  26008. // non-interface field appearing in ForceSendFields will be sent to the
  26009. // server regardless of whether the field is empty or not. This may be
  26010. // used to include empty fields in Patch requests.
  26011. ForceSendFields []string `json:"-"`
  26012. // NullFields is a list of field names (e.g. "InstanceName") to include
  26013. // in API requests with the JSON null value. By default, fields with
  26014. // empty values are omitted from API requests. However, any field with
  26015. // an empty value appearing in NullFields will be sent to the server as
  26016. // null. It is an error if a field in this list has a non-empty value.
  26017. // This may be used to include null fields in Patch requests.
  26018. NullFields []string `json:"-"`
  26019. }
  26020. func (s *VmEndpointNatMappings) MarshalJSON() ([]byte, error) {
  26021. type NoMethod VmEndpointNatMappings
  26022. raw := NoMethod(*s)
  26023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26024. }
  26025. // VmEndpointNatMappingsInterfaceNatMappings: Contain information of Nat
  26026. // mapping for an interface of this endpoint.
  26027. type VmEndpointNatMappingsInterfaceNatMappings struct {
  26028. // NatIpPortRanges: A list of all IP:port-range mappings assigned to
  26029. // this interface. These ranges are inclusive, that is, both the first
  26030. // and the last ports can be used for NAT. Example:
  26031. // ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"].
  26032. NatIpPortRanges []string `json:"natIpPortRanges,omitempty"`
  26033. // NumTotalNatPorts: Total number of ports across all NAT IPs allocated
  26034. // to this interface. It equals to the aggregated port number in the
  26035. // field nat_ip_port_ranges.
  26036. NumTotalNatPorts int64 `json:"numTotalNatPorts,omitempty"`
  26037. // SourceAliasIpRange: Alias IP range for this interface endpoint. It
  26038. // will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or
  26039. // "192.168.5.0/24".
  26040. SourceAliasIpRange string `json:"sourceAliasIpRange,omitempty"`
  26041. // SourceVirtualIp: Primary IP of the VM for this NIC.
  26042. SourceVirtualIp string `json:"sourceVirtualIp,omitempty"`
  26043. // ForceSendFields is a list of field names (e.g. "NatIpPortRanges") to
  26044. // unconditionally include in API requests. By default, fields with
  26045. // empty values are omitted from API requests. However, any non-pointer,
  26046. // non-interface field appearing in ForceSendFields will be sent to the
  26047. // server regardless of whether the field is empty or not. This may be
  26048. // used to include empty fields in Patch requests.
  26049. ForceSendFields []string `json:"-"`
  26050. // NullFields is a list of field names (e.g. "NatIpPortRanges") to
  26051. // include in API requests with the JSON null value. By default, fields
  26052. // with empty values are omitted from API requests. However, any field
  26053. // with an empty value appearing in NullFields will be sent to the
  26054. // server as null. It is an error if a field in this list has a
  26055. // non-empty value. This may be used to include null fields in Patch
  26056. // requests.
  26057. NullFields []string `json:"-"`
  26058. }
  26059. func (s *VmEndpointNatMappingsInterfaceNatMappings) MarshalJSON() ([]byte, error) {
  26060. type NoMethod VmEndpointNatMappingsInterfaceNatMappings
  26061. raw := NoMethod(*s)
  26062. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26063. }
  26064. // VmEndpointNatMappingsList: Contains a list of VmEndpointNatMappings.
  26065. type VmEndpointNatMappingsList struct {
  26066. // Id: [Output Only] The unique identifier for the resource. This
  26067. // identifier is defined by the server.
  26068. Id string `json:"id,omitempty"`
  26069. // Kind: [Output Only] Type of resource. Always
  26070. // compute#vmEndpointNatMappingsList for lists of Nat mappings of VM
  26071. // endpoints.
  26072. Kind string `json:"kind,omitempty"`
  26073. // NextPageToken: [Output Only] This token allows you to get the next
  26074. // page of results for list requests. If the number of results is larger
  26075. // than maxResults, use the nextPageToken as a value for the query
  26076. // parameter pageToken in the next list request. Subsequent list
  26077. // requests will have their own nextPageToken to continue paging through
  26078. // the results.
  26079. NextPageToken string `json:"nextPageToken,omitempty"`
  26080. // Result: [Output Only] A list of Nat mapping information of VM
  26081. // endpoints.
  26082. Result []*VmEndpointNatMappings `json:"result,omitempty"`
  26083. // SelfLink: [Output Only] Server-defined URL for this resource.
  26084. SelfLink string `json:"selfLink,omitempty"`
  26085. // Warning: [Output Only] Informational warning message.
  26086. Warning *VmEndpointNatMappingsListWarning `json:"warning,omitempty"`
  26087. // ServerResponse contains the HTTP response code and headers from the
  26088. // server.
  26089. googleapi.ServerResponse `json:"-"`
  26090. // ForceSendFields is a list of field names (e.g. "Id") to
  26091. // unconditionally include in API requests. By default, fields with
  26092. // empty values are omitted from API requests. However, any non-pointer,
  26093. // non-interface field appearing in ForceSendFields will be sent to the
  26094. // server regardless of whether the field is empty or not. This may be
  26095. // used to include empty fields in Patch requests.
  26096. ForceSendFields []string `json:"-"`
  26097. // NullFields is a list of field names (e.g. "Id") to include in API
  26098. // requests with the JSON null value. By default, fields with empty
  26099. // values are omitted from API requests. However, any field with an
  26100. // empty value appearing in NullFields will be sent to the server as
  26101. // null. It is an error if a field in this list has a non-empty value.
  26102. // This may be used to include null fields in Patch requests.
  26103. NullFields []string `json:"-"`
  26104. }
  26105. func (s *VmEndpointNatMappingsList) MarshalJSON() ([]byte, error) {
  26106. type NoMethod VmEndpointNatMappingsList
  26107. raw := NoMethod(*s)
  26108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26109. }
  26110. // VmEndpointNatMappingsListWarning: [Output Only] Informational warning
  26111. // message.
  26112. type VmEndpointNatMappingsListWarning struct {
  26113. // Code: [Output Only] A warning code, if applicable. For example,
  26114. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26115. // the response.
  26116. //
  26117. // Possible values:
  26118. // "CLEANUP_FAILED"
  26119. // "DEPRECATED_RESOURCE_USED"
  26120. // "DEPRECATED_TYPE_USED"
  26121. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26122. // "EXPERIMENTAL_TYPE_USED"
  26123. // "EXTERNAL_API_WARNING"
  26124. // "FIELD_VALUE_OVERRIDEN"
  26125. // "INJECTED_KERNELS_DEPRECATED"
  26126. // "MISSING_TYPE_DEPENDENCY"
  26127. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26128. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26129. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26130. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26131. // "NEXT_HOP_NOT_RUNNING"
  26132. // "NOT_CRITICAL_ERROR"
  26133. // "NO_RESULTS_ON_PAGE"
  26134. // "REQUIRED_TOS_AGREEMENT"
  26135. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26136. // "RESOURCE_NOT_DELETED"
  26137. // "SCHEMA_VALIDATION_IGNORED"
  26138. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26139. // "UNDECLARED_PROPERTIES"
  26140. // "UNREACHABLE"
  26141. Code string `json:"code,omitempty"`
  26142. // Data: [Output Only] Metadata about this warning in key: value format.
  26143. // For example:
  26144. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26145. Data []*VmEndpointNatMappingsListWarningData `json:"data,omitempty"`
  26146. // Message: [Output Only] A human-readable description of the warning
  26147. // code.
  26148. Message string `json:"message,omitempty"`
  26149. // ForceSendFields is a list of field names (e.g. "Code") to
  26150. // unconditionally include in API requests. By default, fields with
  26151. // empty values are omitted from API requests. However, any non-pointer,
  26152. // non-interface field appearing in ForceSendFields will be sent to the
  26153. // server regardless of whether the field is empty or not. This may be
  26154. // used to include empty fields in Patch requests.
  26155. ForceSendFields []string `json:"-"`
  26156. // NullFields is a list of field names (e.g. "Code") to include in API
  26157. // requests with the JSON null value. By default, fields with empty
  26158. // values are omitted from API requests. However, any field with an
  26159. // empty value appearing in NullFields will be sent to the server as
  26160. // null. It is an error if a field in this list has a non-empty value.
  26161. // This may be used to include null fields in Patch requests.
  26162. NullFields []string `json:"-"`
  26163. }
  26164. func (s *VmEndpointNatMappingsListWarning) MarshalJSON() ([]byte, error) {
  26165. type NoMethod VmEndpointNatMappingsListWarning
  26166. raw := NoMethod(*s)
  26167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26168. }
  26169. type VmEndpointNatMappingsListWarningData struct {
  26170. // Key: [Output Only] A key that provides more detail on the warning
  26171. // being returned. For example, for warnings where there are no results
  26172. // in a list request for a particular zone, this key might be scope and
  26173. // the key value might be the zone name. Other examples might be a key
  26174. // indicating a deprecated resource and a suggested replacement, or a
  26175. // warning about invalid network settings (for example, if an instance
  26176. // attempts to perform IP forwarding but is not enabled for IP
  26177. // forwarding).
  26178. Key string `json:"key,omitempty"`
  26179. // Value: [Output Only] A warning data value corresponding to the key.
  26180. Value string `json:"value,omitempty"`
  26181. // ForceSendFields is a list of field names (e.g. "Key") to
  26182. // unconditionally include in API requests. By default, fields with
  26183. // empty values are omitted from API requests. However, any non-pointer,
  26184. // non-interface field appearing in ForceSendFields will be sent to the
  26185. // server regardless of whether the field is empty or not. This may be
  26186. // used to include empty fields in Patch requests.
  26187. ForceSendFields []string `json:"-"`
  26188. // NullFields is a list of field names (e.g. "Key") to include in API
  26189. // requests with the JSON null value. By default, fields with empty
  26190. // values are omitted from API requests. However, any field with an
  26191. // empty value appearing in NullFields will be sent to the server as
  26192. // null. It is an error if a field in this list has a non-empty value.
  26193. // This may be used to include null fields in Patch requests.
  26194. NullFields []string `json:"-"`
  26195. }
  26196. func (s *VmEndpointNatMappingsListWarningData) MarshalJSON() ([]byte, error) {
  26197. type NoMethod VmEndpointNatMappingsListWarningData
  26198. raw := NoMethod(*s)
  26199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26200. }
  26201. // VpnTunnel: VPN tunnel resource. (== resource_for beta.vpnTunnels ==)
  26202. // (== resource_for v1.vpnTunnels ==)
  26203. type VpnTunnel struct {
  26204. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26205. // format.
  26206. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26207. // Description: An optional description of this resource. Provide this
  26208. // property when you create the resource.
  26209. Description string `json:"description,omitempty"`
  26210. // DetailedStatus: [Output Only] Detailed status message for the VPN
  26211. // tunnel.
  26212. DetailedStatus string `json:"detailedStatus,omitempty"`
  26213. // Id: [Output Only] The unique identifier for the resource. This
  26214. // identifier is defined by the server.
  26215. Id uint64 `json:"id,omitempty,string"`
  26216. // IkeVersion: IKE protocol version to use when establishing the VPN
  26217. // tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2.
  26218. // The default version is 2.
  26219. IkeVersion int64 `json:"ikeVersion,omitempty"`
  26220. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  26221. // VPN tunnels.
  26222. Kind string `json:"kind,omitempty"`
  26223. // LocalTrafficSelector: Local traffic selector to use when establishing
  26224. // the VPN tunnel with the peer VPN gateway. The value should be a CIDR
  26225. // formatted string, for example: 192.168.0.0/16. The ranges must be
  26226. // disjoint. Only IPv4 is supported.
  26227. LocalTrafficSelector []string `json:"localTrafficSelector,omitempty"`
  26228. // Name: Name of the resource. Provided by the client when the resource
  26229. // is created. The name must be 1-63 characters long, and comply with
  26230. // RFC1035. Specifically, the name must be 1-63 characters long and
  26231. // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means
  26232. // the first character must be a lowercase letter, and all following
  26233. // characters must be a dash, lowercase letter, or digit, except the
  26234. // last character, which cannot be a dash.
  26235. Name string `json:"name,omitempty"`
  26236. // PeerIp: IP address of the peer VPN gateway. Only IPv4 is supported.
  26237. PeerIp string `json:"peerIp,omitempty"`
  26238. // Region: [Output Only] URL of the region where the VPN tunnel resides.
  26239. // You must specify this field as part of the HTTP request URL. It is
  26240. // not settable as a field in the request body.
  26241. Region string `json:"region,omitempty"`
  26242. // RemoteTrafficSelector: Remote traffic selectors to use when
  26243. // establishing the VPN tunnel with the peer VPN gateway. The value
  26244. // should be a CIDR formatted string, for example: 192.168.0.0/16. The
  26245. // ranges should be disjoint. Only IPv4 is supported.
  26246. RemoteTrafficSelector []string `json:"remoteTrafficSelector,omitempty"`
  26247. // Router: URL of the router resource to be used for dynamic routing.
  26248. Router string `json:"router,omitempty"`
  26249. // SelfLink: [Output Only] Server-defined URL for the resource.
  26250. SelfLink string `json:"selfLink,omitempty"`
  26251. // SharedSecret: Shared secret used to set the secure session between
  26252. // the Cloud VPN gateway and the peer VPN gateway.
  26253. SharedSecret string `json:"sharedSecret,omitempty"`
  26254. // SharedSecretHash: Hash of the shared secret.
  26255. SharedSecretHash string `json:"sharedSecretHash,omitempty"`
  26256. // Status: [Output Only] The status of the VPN tunnel, which can be one
  26257. // of the following:
  26258. // - PROVISIONING: Resource is being allocated for the VPN tunnel.
  26259. // - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs
  26260. // from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule,
  26261. // and Route resources are needed to setup the VPN tunnel.
  26262. // - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
  26263. // - ESTABLISHED: Secure session is successfully established with the
  26264. // peer VPN.
  26265. // - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
  26266. // - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
  26267. //
  26268. // - NEGOTIATION_FAILURE: Handshake failed.
  26269. // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel.
  26270. //
  26271. // - FAILED: Tunnel creation has failed and the tunnel is not ready to
  26272. // be used.
  26273. //
  26274. // Possible values:
  26275. // "ALLOCATING_RESOURCES"
  26276. // "AUTHORIZATION_ERROR"
  26277. // "DEPROVISIONING"
  26278. // "ESTABLISHED"
  26279. // "FAILED"
  26280. // "FIRST_HANDSHAKE"
  26281. // "NEGOTIATION_FAILURE"
  26282. // "NETWORK_ERROR"
  26283. // "NO_INCOMING_PACKETS"
  26284. // "PROVISIONING"
  26285. // "REJECTED"
  26286. // "WAITING_FOR_FULL_CONFIG"
  26287. Status string `json:"status,omitempty"`
  26288. // TargetVpnGateway: URL of the Target VPN gateway with which this VPN
  26289. // tunnel is associated. Provided by the client when the VPN tunnel is
  26290. // created.
  26291. TargetVpnGateway string `json:"targetVpnGateway,omitempty"`
  26292. // ServerResponse contains the HTTP response code and headers from the
  26293. // server.
  26294. googleapi.ServerResponse `json:"-"`
  26295. // ForceSendFields is a list of field names (e.g. "CreationTimestamp")
  26296. // to unconditionally include in API requests. By default, fields with
  26297. // empty values are omitted from API requests. However, any non-pointer,
  26298. // non-interface field appearing in ForceSendFields will be sent to the
  26299. // server regardless of whether the field is empty or not. This may be
  26300. // used to include empty fields in Patch requests.
  26301. ForceSendFields []string `json:"-"`
  26302. // NullFields is a list of field names (e.g. "CreationTimestamp") to
  26303. // include in API requests with the JSON null value. By default, fields
  26304. // with empty values are omitted from API requests. However, any field
  26305. // with an empty value appearing in NullFields will be sent to the
  26306. // server as null. It is an error if a field in this list has a
  26307. // non-empty value. This may be used to include null fields in Patch
  26308. // requests.
  26309. NullFields []string `json:"-"`
  26310. }
  26311. func (s *VpnTunnel) MarshalJSON() ([]byte, error) {
  26312. type NoMethod VpnTunnel
  26313. raw := NoMethod(*s)
  26314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26315. }
  26316. type VpnTunnelAggregatedList struct {
  26317. // Id: [Output Only] Unique identifier for the resource; defined by the
  26318. // server.
  26319. Id string `json:"id,omitempty"`
  26320. // Items: A list of VpnTunnelsScopedList resources.
  26321. Items map[string]VpnTunnelsScopedList `json:"items,omitempty"`
  26322. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  26323. // VPN tunnels.
  26324. Kind string `json:"kind,omitempty"`
  26325. // NextPageToken: [Output Only] This token allows you to get the next
  26326. // page of results for list requests. If the number of results is larger
  26327. // than maxResults, use the nextPageToken as a value for the query
  26328. // parameter pageToken in the next list request. Subsequent list
  26329. // requests will have their own nextPageToken to continue paging through
  26330. // the results.
  26331. NextPageToken string `json:"nextPageToken,omitempty"`
  26332. // SelfLink: [Output Only] Server-defined URL for this resource.
  26333. SelfLink string `json:"selfLink,omitempty"`
  26334. // Warning: [Output Only] Informational warning message.
  26335. Warning *VpnTunnelAggregatedListWarning `json:"warning,omitempty"`
  26336. // ServerResponse contains the HTTP response code and headers from the
  26337. // server.
  26338. googleapi.ServerResponse `json:"-"`
  26339. // ForceSendFields is a list of field names (e.g. "Id") to
  26340. // unconditionally include in API requests. By default, fields with
  26341. // empty values are omitted from API requests. However, any non-pointer,
  26342. // non-interface field appearing in ForceSendFields will be sent to the
  26343. // server regardless of whether the field is empty or not. This may be
  26344. // used to include empty fields in Patch requests.
  26345. ForceSendFields []string `json:"-"`
  26346. // NullFields is a list of field names (e.g. "Id") to include in API
  26347. // requests with the JSON null value. By default, fields with empty
  26348. // values are omitted from API requests. However, any field with an
  26349. // empty value appearing in NullFields will be sent to the server as
  26350. // null. It is an error if a field in this list has a non-empty value.
  26351. // This may be used to include null fields in Patch requests.
  26352. NullFields []string `json:"-"`
  26353. }
  26354. func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) {
  26355. type NoMethod VpnTunnelAggregatedList
  26356. raw := NoMethod(*s)
  26357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26358. }
  26359. // VpnTunnelAggregatedListWarning: [Output Only] Informational warning
  26360. // message.
  26361. type VpnTunnelAggregatedListWarning struct {
  26362. // Code: [Output Only] A warning code, if applicable. For example,
  26363. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26364. // the response.
  26365. //
  26366. // Possible values:
  26367. // "CLEANUP_FAILED"
  26368. // "DEPRECATED_RESOURCE_USED"
  26369. // "DEPRECATED_TYPE_USED"
  26370. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26371. // "EXPERIMENTAL_TYPE_USED"
  26372. // "EXTERNAL_API_WARNING"
  26373. // "FIELD_VALUE_OVERRIDEN"
  26374. // "INJECTED_KERNELS_DEPRECATED"
  26375. // "MISSING_TYPE_DEPENDENCY"
  26376. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26377. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26378. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26379. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26380. // "NEXT_HOP_NOT_RUNNING"
  26381. // "NOT_CRITICAL_ERROR"
  26382. // "NO_RESULTS_ON_PAGE"
  26383. // "REQUIRED_TOS_AGREEMENT"
  26384. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26385. // "RESOURCE_NOT_DELETED"
  26386. // "SCHEMA_VALIDATION_IGNORED"
  26387. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26388. // "UNDECLARED_PROPERTIES"
  26389. // "UNREACHABLE"
  26390. Code string `json:"code,omitempty"`
  26391. // Data: [Output Only] Metadata about this warning in key: value format.
  26392. // For example:
  26393. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26394. Data []*VpnTunnelAggregatedListWarningData `json:"data,omitempty"`
  26395. // Message: [Output Only] A human-readable description of the warning
  26396. // code.
  26397. Message string `json:"message,omitempty"`
  26398. // ForceSendFields is a list of field names (e.g. "Code") to
  26399. // unconditionally include in API requests. By default, fields with
  26400. // empty values are omitted from API requests. However, any non-pointer,
  26401. // non-interface field appearing in ForceSendFields will be sent to the
  26402. // server regardless of whether the field is empty or not. This may be
  26403. // used to include empty fields in Patch requests.
  26404. ForceSendFields []string `json:"-"`
  26405. // NullFields is a list of field names (e.g. "Code") to include in API
  26406. // requests with the JSON null value. By default, fields with empty
  26407. // values are omitted from API requests. However, any field with an
  26408. // empty value appearing in NullFields will be sent to the server as
  26409. // null. It is an error if a field in this list has a non-empty value.
  26410. // This may be used to include null fields in Patch requests.
  26411. NullFields []string `json:"-"`
  26412. }
  26413. func (s *VpnTunnelAggregatedListWarning) MarshalJSON() ([]byte, error) {
  26414. type NoMethod VpnTunnelAggregatedListWarning
  26415. raw := NoMethod(*s)
  26416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26417. }
  26418. type VpnTunnelAggregatedListWarningData struct {
  26419. // Key: [Output Only] A key that provides more detail on the warning
  26420. // being returned. For example, for warnings where there are no results
  26421. // in a list request for a particular zone, this key might be scope and
  26422. // the key value might be the zone name. Other examples might be a key
  26423. // indicating a deprecated resource and a suggested replacement, or a
  26424. // warning about invalid network settings (for example, if an instance
  26425. // attempts to perform IP forwarding but is not enabled for IP
  26426. // forwarding).
  26427. Key string `json:"key,omitempty"`
  26428. // Value: [Output Only] A warning data value corresponding to the key.
  26429. Value string `json:"value,omitempty"`
  26430. // ForceSendFields is a list of field names (e.g. "Key") to
  26431. // unconditionally include in API requests. By default, fields with
  26432. // empty values are omitted from API requests. However, any non-pointer,
  26433. // non-interface field appearing in ForceSendFields will be sent to the
  26434. // server regardless of whether the field is empty or not. This may be
  26435. // used to include empty fields in Patch requests.
  26436. ForceSendFields []string `json:"-"`
  26437. // NullFields is a list of field names (e.g. "Key") to include in API
  26438. // requests with the JSON null value. By default, fields with empty
  26439. // values are omitted from API requests. However, any field with an
  26440. // empty value appearing in NullFields will be sent to the server as
  26441. // null. It is an error if a field in this list has a non-empty value.
  26442. // This may be used to include null fields in Patch requests.
  26443. NullFields []string `json:"-"`
  26444. }
  26445. func (s *VpnTunnelAggregatedListWarningData) MarshalJSON() ([]byte, error) {
  26446. type NoMethod VpnTunnelAggregatedListWarningData
  26447. raw := NoMethod(*s)
  26448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26449. }
  26450. // VpnTunnelList: Contains a list of VpnTunnel resources.
  26451. type VpnTunnelList struct {
  26452. // Id: [Output Only] Unique identifier for the resource; defined by the
  26453. // server.
  26454. Id string `json:"id,omitempty"`
  26455. // Items: A list of VpnTunnel resources.
  26456. Items []*VpnTunnel `json:"items,omitempty"`
  26457. // Kind: [Output Only] Type of resource. Always compute#vpnTunnel for
  26458. // VPN tunnels.
  26459. Kind string `json:"kind,omitempty"`
  26460. // NextPageToken: [Output Only] This token allows you to get the next
  26461. // page of results for list requests. If the number of results is larger
  26462. // than maxResults, use the nextPageToken as a value for the query
  26463. // parameter pageToken in the next list request. Subsequent list
  26464. // requests will have their own nextPageToken to continue paging through
  26465. // the results.
  26466. NextPageToken string `json:"nextPageToken,omitempty"`
  26467. // SelfLink: [Output Only] Server-defined URL for this resource.
  26468. SelfLink string `json:"selfLink,omitempty"`
  26469. // Warning: [Output Only] Informational warning message.
  26470. Warning *VpnTunnelListWarning `json:"warning,omitempty"`
  26471. // ServerResponse contains the HTTP response code and headers from the
  26472. // server.
  26473. googleapi.ServerResponse `json:"-"`
  26474. // ForceSendFields is a list of field names (e.g. "Id") to
  26475. // unconditionally include in API requests. By default, fields with
  26476. // empty values are omitted from API requests. However, any non-pointer,
  26477. // non-interface field appearing in ForceSendFields will be sent to the
  26478. // server regardless of whether the field is empty or not. This may be
  26479. // used to include empty fields in Patch requests.
  26480. ForceSendFields []string `json:"-"`
  26481. // NullFields is a list of field names (e.g. "Id") to include in API
  26482. // requests with the JSON null value. By default, fields with empty
  26483. // values are omitted from API requests. However, any field with an
  26484. // empty value appearing in NullFields will be sent to the server as
  26485. // null. It is an error if a field in this list has a non-empty value.
  26486. // This may be used to include null fields in Patch requests.
  26487. NullFields []string `json:"-"`
  26488. }
  26489. func (s *VpnTunnelList) MarshalJSON() ([]byte, error) {
  26490. type NoMethod VpnTunnelList
  26491. raw := NoMethod(*s)
  26492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26493. }
  26494. // VpnTunnelListWarning: [Output Only] Informational warning message.
  26495. type VpnTunnelListWarning struct {
  26496. // Code: [Output Only] A warning code, if applicable. For example,
  26497. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26498. // the response.
  26499. //
  26500. // Possible values:
  26501. // "CLEANUP_FAILED"
  26502. // "DEPRECATED_RESOURCE_USED"
  26503. // "DEPRECATED_TYPE_USED"
  26504. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26505. // "EXPERIMENTAL_TYPE_USED"
  26506. // "EXTERNAL_API_WARNING"
  26507. // "FIELD_VALUE_OVERRIDEN"
  26508. // "INJECTED_KERNELS_DEPRECATED"
  26509. // "MISSING_TYPE_DEPENDENCY"
  26510. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26511. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26512. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26513. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26514. // "NEXT_HOP_NOT_RUNNING"
  26515. // "NOT_CRITICAL_ERROR"
  26516. // "NO_RESULTS_ON_PAGE"
  26517. // "REQUIRED_TOS_AGREEMENT"
  26518. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26519. // "RESOURCE_NOT_DELETED"
  26520. // "SCHEMA_VALIDATION_IGNORED"
  26521. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26522. // "UNDECLARED_PROPERTIES"
  26523. // "UNREACHABLE"
  26524. Code string `json:"code,omitempty"`
  26525. // Data: [Output Only] Metadata about this warning in key: value format.
  26526. // For example:
  26527. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26528. Data []*VpnTunnelListWarningData `json:"data,omitempty"`
  26529. // Message: [Output Only] A human-readable description of the warning
  26530. // code.
  26531. Message string `json:"message,omitempty"`
  26532. // ForceSendFields is a list of field names (e.g. "Code") to
  26533. // unconditionally include in API requests. By default, fields with
  26534. // empty values are omitted from API requests. However, any non-pointer,
  26535. // non-interface field appearing in ForceSendFields will be sent to the
  26536. // server regardless of whether the field is empty or not. This may be
  26537. // used to include empty fields in Patch requests.
  26538. ForceSendFields []string `json:"-"`
  26539. // NullFields is a list of field names (e.g. "Code") to include in API
  26540. // requests with the JSON null value. By default, fields with empty
  26541. // values are omitted from API requests. However, any field with an
  26542. // empty value appearing in NullFields will be sent to the server as
  26543. // null. It is an error if a field in this list has a non-empty value.
  26544. // This may be used to include null fields in Patch requests.
  26545. NullFields []string `json:"-"`
  26546. }
  26547. func (s *VpnTunnelListWarning) MarshalJSON() ([]byte, error) {
  26548. type NoMethod VpnTunnelListWarning
  26549. raw := NoMethod(*s)
  26550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26551. }
  26552. type VpnTunnelListWarningData struct {
  26553. // Key: [Output Only] A key that provides more detail on the warning
  26554. // being returned. For example, for warnings where there are no results
  26555. // in a list request for a particular zone, this key might be scope and
  26556. // the key value might be the zone name. Other examples might be a key
  26557. // indicating a deprecated resource and a suggested replacement, or a
  26558. // warning about invalid network settings (for example, if an instance
  26559. // attempts to perform IP forwarding but is not enabled for IP
  26560. // forwarding).
  26561. Key string `json:"key,omitempty"`
  26562. // Value: [Output Only] A warning data value corresponding to the key.
  26563. Value string `json:"value,omitempty"`
  26564. // ForceSendFields is a list of field names (e.g. "Key") to
  26565. // unconditionally include in API requests. By default, fields with
  26566. // empty values are omitted from API requests. However, any non-pointer,
  26567. // non-interface field appearing in ForceSendFields will be sent to the
  26568. // server regardless of whether the field is empty or not. This may be
  26569. // used to include empty fields in Patch requests.
  26570. ForceSendFields []string `json:"-"`
  26571. // NullFields is a list of field names (e.g. "Key") to include in API
  26572. // requests with the JSON null value. By default, fields with empty
  26573. // values are omitted from API requests. However, any field with an
  26574. // empty value appearing in NullFields will be sent to the server as
  26575. // null. It is an error if a field in this list has a non-empty value.
  26576. // This may be used to include null fields in Patch requests.
  26577. NullFields []string `json:"-"`
  26578. }
  26579. func (s *VpnTunnelListWarningData) MarshalJSON() ([]byte, error) {
  26580. type NoMethod VpnTunnelListWarningData
  26581. raw := NoMethod(*s)
  26582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26583. }
  26584. type VpnTunnelsScopedList struct {
  26585. // VpnTunnels: A list of VPN tunnels contained in this scope.
  26586. VpnTunnels []*VpnTunnel `json:"vpnTunnels,omitempty"`
  26587. // Warning: Informational warning which replaces the list of addresses
  26588. // when the list is empty.
  26589. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"`
  26590. // ForceSendFields is a list of field names (e.g. "VpnTunnels") to
  26591. // unconditionally include in API requests. By default, fields with
  26592. // empty values are omitted from API requests. However, any non-pointer,
  26593. // non-interface field appearing in ForceSendFields will be sent to the
  26594. // server regardless of whether the field is empty or not. This may be
  26595. // used to include empty fields in Patch requests.
  26596. ForceSendFields []string `json:"-"`
  26597. // NullFields is a list of field names (e.g. "VpnTunnels") to include in
  26598. // API requests with the JSON null value. By default, fields with empty
  26599. // values are omitted from API requests. However, any field with an
  26600. // empty value appearing in NullFields will be sent to the server as
  26601. // null. It is an error if a field in this list has a non-empty value.
  26602. // This may be used to include null fields in Patch requests.
  26603. NullFields []string `json:"-"`
  26604. }
  26605. func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) {
  26606. type NoMethod VpnTunnelsScopedList
  26607. raw := NoMethod(*s)
  26608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26609. }
  26610. // VpnTunnelsScopedListWarning: Informational warning which replaces the
  26611. // list of addresses when the list is empty.
  26612. type VpnTunnelsScopedListWarning struct {
  26613. // Code: [Output Only] A warning code, if applicable. For example,
  26614. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26615. // the response.
  26616. //
  26617. // Possible values:
  26618. // "CLEANUP_FAILED"
  26619. // "DEPRECATED_RESOURCE_USED"
  26620. // "DEPRECATED_TYPE_USED"
  26621. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26622. // "EXPERIMENTAL_TYPE_USED"
  26623. // "EXTERNAL_API_WARNING"
  26624. // "FIELD_VALUE_OVERRIDEN"
  26625. // "INJECTED_KERNELS_DEPRECATED"
  26626. // "MISSING_TYPE_DEPENDENCY"
  26627. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26628. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26629. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26630. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26631. // "NEXT_HOP_NOT_RUNNING"
  26632. // "NOT_CRITICAL_ERROR"
  26633. // "NO_RESULTS_ON_PAGE"
  26634. // "REQUIRED_TOS_AGREEMENT"
  26635. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26636. // "RESOURCE_NOT_DELETED"
  26637. // "SCHEMA_VALIDATION_IGNORED"
  26638. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26639. // "UNDECLARED_PROPERTIES"
  26640. // "UNREACHABLE"
  26641. Code string `json:"code,omitempty"`
  26642. // Data: [Output Only] Metadata about this warning in key: value format.
  26643. // For example:
  26644. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26645. Data []*VpnTunnelsScopedListWarningData `json:"data,omitempty"`
  26646. // Message: [Output Only] A human-readable description of the warning
  26647. // code.
  26648. Message string `json:"message,omitempty"`
  26649. // ForceSendFields is a list of field names (e.g. "Code") to
  26650. // unconditionally include in API requests. By default, fields with
  26651. // empty values are omitted from API requests. However, any non-pointer,
  26652. // non-interface field appearing in ForceSendFields will be sent to the
  26653. // server regardless of whether the field is empty or not. This may be
  26654. // used to include empty fields in Patch requests.
  26655. ForceSendFields []string `json:"-"`
  26656. // NullFields is a list of field names (e.g. "Code") to include in API
  26657. // requests with the JSON null value. By default, fields with empty
  26658. // values are omitted from API requests. However, any field with an
  26659. // empty value appearing in NullFields will be sent to the server as
  26660. // null. It is an error if a field in this list has a non-empty value.
  26661. // This may be used to include null fields in Patch requests.
  26662. NullFields []string `json:"-"`
  26663. }
  26664. func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) {
  26665. type NoMethod VpnTunnelsScopedListWarning
  26666. raw := NoMethod(*s)
  26667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26668. }
  26669. type VpnTunnelsScopedListWarningData struct {
  26670. // Key: [Output Only] A key that provides more detail on the warning
  26671. // being returned. For example, for warnings where there are no results
  26672. // in a list request for a particular zone, this key might be scope and
  26673. // the key value might be the zone name. Other examples might be a key
  26674. // indicating a deprecated resource and a suggested replacement, or a
  26675. // warning about invalid network settings (for example, if an instance
  26676. // attempts to perform IP forwarding but is not enabled for IP
  26677. // forwarding).
  26678. Key string `json:"key,omitempty"`
  26679. // Value: [Output Only] A warning data value corresponding to the key.
  26680. Value string `json:"value,omitempty"`
  26681. // ForceSendFields is a list of field names (e.g. "Key") to
  26682. // unconditionally include in API requests. By default, fields with
  26683. // empty values are omitted from API requests. However, any non-pointer,
  26684. // non-interface field appearing in ForceSendFields will be sent to the
  26685. // server regardless of whether the field is empty or not. This may be
  26686. // used to include empty fields in Patch requests.
  26687. ForceSendFields []string `json:"-"`
  26688. // NullFields is a list of field names (e.g. "Key") to include in API
  26689. // requests with the JSON null value. By default, fields with empty
  26690. // values are omitted from API requests. However, any field with an
  26691. // empty value appearing in NullFields will be sent to the server as
  26692. // null. It is an error if a field in this list has a non-empty value.
  26693. // This may be used to include null fields in Patch requests.
  26694. NullFields []string `json:"-"`
  26695. }
  26696. func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) {
  26697. type NoMethod VpnTunnelsScopedListWarningData
  26698. raw := NoMethod(*s)
  26699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26700. }
  26701. type XpnHostList struct {
  26702. // Id: [Output Only] Unique identifier for the resource; defined by the
  26703. // server.
  26704. Id string `json:"id,omitempty"`
  26705. // Items: [Output Only] A list of shared VPC host project URLs.
  26706. Items []*Project `json:"items,omitempty"`
  26707. // Kind: [Output Only] Type of resource. Always compute#xpnHostList for
  26708. // lists of shared VPC hosts.
  26709. Kind string `json:"kind,omitempty"`
  26710. // NextPageToken: [Output Only] This token allows you to get the next
  26711. // page of results for list requests. If the number of results is larger
  26712. // than maxResults, use the nextPageToken as a value for the query
  26713. // parameter pageToken in the next list request. Subsequent list
  26714. // requests will have their own nextPageToken to continue paging through
  26715. // the results.
  26716. NextPageToken string `json:"nextPageToken,omitempty"`
  26717. // SelfLink: [Output Only] Server-defined URL for this resource.
  26718. SelfLink string `json:"selfLink,omitempty"`
  26719. // Warning: [Output Only] Informational warning message.
  26720. Warning *XpnHostListWarning `json:"warning,omitempty"`
  26721. // ServerResponse contains the HTTP response code and headers from the
  26722. // server.
  26723. googleapi.ServerResponse `json:"-"`
  26724. // ForceSendFields is a list of field names (e.g. "Id") to
  26725. // unconditionally include in API requests. By default, fields with
  26726. // empty values are omitted from API requests. However, any non-pointer,
  26727. // non-interface field appearing in ForceSendFields will be sent to the
  26728. // server regardless of whether the field is empty or not. This may be
  26729. // used to include empty fields in Patch requests.
  26730. ForceSendFields []string `json:"-"`
  26731. // NullFields is a list of field names (e.g. "Id") to include in API
  26732. // requests with the JSON null value. By default, fields with empty
  26733. // values are omitted from API requests. However, any field with an
  26734. // empty value appearing in NullFields will be sent to the server as
  26735. // null. It is an error if a field in this list has a non-empty value.
  26736. // This may be used to include null fields in Patch requests.
  26737. NullFields []string `json:"-"`
  26738. }
  26739. func (s *XpnHostList) MarshalJSON() ([]byte, error) {
  26740. type NoMethod XpnHostList
  26741. raw := NoMethod(*s)
  26742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26743. }
  26744. // XpnHostListWarning: [Output Only] Informational warning message.
  26745. type XpnHostListWarning struct {
  26746. // Code: [Output Only] A warning code, if applicable. For example,
  26747. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26748. // the response.
  26749. //
  26750. // Possible values:
  26751. // "CLEANUP_FAILED"
  26752. // "DEPRECATED_RESOURCE_USED"
  26753. // "DEPRECATED_TYPE_USED"
  26754. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26755. // "EXPERIMENTAL_TYPE_USED"
  26756. // "EXTERNAL_API_WARNING"
  26757. // "FIELD_VALUE_OVERRIDEN"
  26758. // "INJECTED_KERNELS_DEPRECATED"
  26759. // "MISSING_TYPE_DEPENDENCY"
  26760. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26761. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26762. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26763. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26764. // "NEXT_HOP_NOT_RUNNING"
  26765. // "NOT_CRITICAL_ERROR"
  26766. // "NO_RESULTS_ON_PAGE"
  26767. // "REQUIRED_TOS_AGREEMENT"
  26768. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26769. // "RESOURCE_NOT_DELETED"
  26770. // "SCHEMA_VALIDATION_IGNORED"
  26771. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26772. // "UNDECLARED_PROPERTIES"
  26773. // "UNREACHABLE"
  26774. Code string `json:"code,omitempty"`
  26775. // Data: [Output Only] Metadata about this warning in key: value format.
  26776. // For example:
  26777. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  26778. Data []*XpnHostListWarningData `json:"data,omitempty"`
  26779. // Message: [Output Only] A human-readable description of the warning
  26780. // code.
  26781. Message string `json:"message,omitempty"`
  26782. // ForceSendFields is a list of field names (e.g. "Code") to
  26783. // unconditionally include in API requests. By default, fields with
  26784. // empty values are omitted from API requests. However, any non-pointer,
  26785. // non-interface field appearing in ForceSendFields will be sent to the
  26786. // server regardless of whether the field is empty or not. This may be
  26787. // used to include empty fields in Patch requests.
  26788. ForceSendFields []string `json:"-"`
  26789. // NullFields is a list of field names (e.g. "Code") to include in API
  26790. // requests with the JSON null value. By default, fields with empty
  26791. // values are omitted from API requests. However, any field with an
  26792. // empty value appearing in NullFields will be sent to the server as
  26793. // null. It is an error if a field in this list has a non-empty value.
  26794. // This may be used to include null fields in Patch requests.
  26795. NullFields []string `json:"-"`
  26796. }
  26797. func (s *XpnHostListWarning) MarshalJSON() ([]byte, error) {
  26798. type NoMethod XpnHostListWarning
  26799. raw := NoMethod(*s)
  26800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26801. }
  26802. type XpnHostListWarningData struct {
  26803. // Key: [Output Only] A key that provides more detail on the warning
  26804. // being returned. For example, for warnings where there are no results
  26805. // in a list request for a particular zone, this key might be scope and
  26806. // the key value might be the zone name. Other examples might be a key
  26807. // indicating a deprecated resource and a suggested replacement, or a
  26808. // warning about invalid network settings (for example, if an instance
  26809. // attempts to perform IP forwarding but is not enabled for IP
  26810. // forwarding).
  26811. Key string `json:"key,omitempty"`
  26812. // Value: [Output Only] A warning data value corresponding to the key.
  26813. Value string `json:"value,omitempty"`
  26814. // ForceSendFields is a list of field names (e.g. "Key") to
  26815. // unconditionally include in API requests. By default, fields with
  26816. // empty values are omitted from API requests. However, any non-pointer,
  26817. // non-interface field appearing in ForceSendFields will be sent to the
  26818. // server regardless of whether the field is empty or not. This may be
  26819. // used to include empty fields in Patch requests.
  26820. ForceSendFields []string `json:"-"`
  26821. // NullFields is a list of field names (e.g. "Key") to include in API
  26822. // requests with the JSON null value. By default, fields with empty
  26823. // values are omitted from API requests. However, any field with an
  26824. // empty value appearing in NullFields will be sent to the server as
  26825. // null. It is an error if a field in this list has a non-empty value.
  26826. // This may be used to include null fields in Patch requests.
  26827. NullFields []string `json:"-"`
  26828. }
  26829. func (s *XpnHostListWarningData) MarshalJSON() ([]byte, error) {
  26830. type NoMethod XpnHostListWarningData
  26831. raw := NoMethod(*s)
  26832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26833. }
  26834. // XpnResourceId: Service resource (a.k.a service project) ID.
  26835. type XpnResourceId struct {
  26836. // Id: The ID of the service resource. In the case of projects, this
  26837. // field supports project id (e.g., my-project-123) and project number
  26838. // (e.g. 12345678).
  26839. Id string `json:"id,omitempty"`
  26840. // Type: The type of the service resource.
  26841. //
  26842. // Possible values:
  26843. // "PROJECT"
  26844. // "XPN_RESOURCE_TYPE_UNSPECIFIED"
  26845. Type string `json:"type,omitempty"`
  26846. // ForceSendFields is a list of field names (e.g. "Id") to
  26847. // unconditionally include in API requests. By default, fields with
  26848. // empty values are omitted from API requests. However, any non-pointer,
  26849. // non-interface field appearing in ForceSendFields will be sent to the
  26850. // server regardless of whether the field is empty or not. This may be
  26851. // used to include empty fields in Patch requests.
  26852. ForceSendFields []string `json:"-"`
  26853. // NullFields is a list of field names (e.g. "Id") to include in API
  26854. // requests with the JSON null value. By default, fields with empty
  26855. // values are omitted from API requests. However, any field with an
  26856. // empty value appearing in NullFields will be sent to the server as
  26857. // null. It is an error if a field in this list has a non-empty value.
  26858. // This may be used to include null fields in Patch requests.
  26859. NullFields []string `json:"-"`
  26860. }
  26861. func (s *XpnResourceId) MarshalJSON() ([]byte, error) {
  26862. type NoMethod XpnResourceId
  26863. raw := NoMethod(*s)
  26864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26865. }
  26866. // Zone: A Zone resource. (== resource_for beta.zones ==) (==
  26867. // resource_for v1.zones ==) Next ID: 17
  26868. type Zone struct {
  26869. // AvailableCpuPlatforms: [Output Only] Available cpu/platform
  26870. // selections for the zone.
  26871. AvailableCpuPlatforms []string `json:"availableCpuPlatforms,omitempty"`
  26872. // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text
  26873. // format.
  26874. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  26875. // Deprecated: [Output Only] The deprecation status associated with this
  26876. // zone.
  26877. Deprecated *DeprecationStatus `json:"deprecated,omitempty"`
  26878. // Description: [Output Only] Textual description of the resource.
  26879. Description string `json:"description,omitempty"`
  26880. // Id: [Output Only] The unique identifier for the resource. This
  26881. // identifier is defined by the server.
  26882. Id uint64 `json:"id,omitempty,string"`
  26883. // Kind: [Output Only] Type of the resource. Always compute#zone for
  26884. // zones.
  26885. Kind string `json:"kind,omitempty"`
  26886. // Name: [Output Only] Name of the resource.
  26887. Name string `json:"name,omitempty"`
  26888. // Region: [Output Only] Full URL reference to the region which hosts
  26889. // the zone.
  26890. Region string `json:"region,omitempty"`
  26891. // SelfLink: [Output Only] Server-defined URL for the resource.
  26892. SelfLink string `json:"selfLink,omitempty"`
  26893. // Status: [Output Only] Status of the zone, either UP or DOWN.
  26894. //
  26895. // Possible values:
  26896. // "DOWN"
  26897. // "UP"
  26898. Status string `json:"status,omitempty"`
  26899. // ServerResponse contains the HTTP response code and headers from the
  26900. // server.
  26901. googleapi.ServerResponse `json:"-"`
  26902. // ForceSendFields is a list of field names (e.g.
  26903. // "AvailableCpuPlatforms") to unconditionally include in API requests.
  26904. // By default, fields with empty values are omitted from API requests.
  26905. // However, any non-pointer, non-interface field appearing in
  26906. // ForceSendFields will be sent to the server regardless of whether the
  26907. // field is empty or not. This may be used to include empty fields in
  26908. // Patch requests.
  26909. ForceSendFields []string `json:"-"`
  26910. // NullFields is a list of field names (e.g. "AvailableCpuPlatforms") to
  26911. // include in API requests with the JSON null value. By default, fields
  26912. // with empty values are omitted from API requests. However, any field
  26913. // with an empty value appearing in NullFields will be sent to the
  26914. // server as null. It is an error if a field in this list has a
  26915. // non-empty value. This may be used to include null fields in Patch
  26916. // requests.
  26917. NullFields []string `json:"-"`
  26918. }
  26919. func (s *Zone) MarshalJSON() ([]byte, error) {
  26920. type NoMethod Zone
  26921. raw := NoMethod(*s)
  26922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26923. }
  26924. // ZoneList: Contains a list of zone resources.
  26925. type ZoneList struct {
  26926. // Id: [Output Only] Unique identifier for the resource; defined by the
  26927. // server.
  26928. Id string `json:"id,omitempty"`
  26929. // Items: A list of Zone resources.
  26930. Items []*Zone `json:"items,omitempty"`
  26931. // Kind: Type of resource.
  26932. Kind string `json:"kind,omitempty"`
  26933. // NextPageToken: [Output Only] This token allows you to get the next
  26934. // page of results for list requests. If the number of results is larger
  26935. // than maxResults, use the nextPageToken as a value for the query
  26936. // parameter pageToken in the next list request. Subsequent list
  26937. // requests will have their own nextPageToken to continue paging through
  26938. // the results.
  26939. NextPageToken string `json:"nextPageToken,omitempty"`
  26940. // SelfLink: [Output Only] Server-defined URL for this resource.
  26941. SelfLink string `json:"selfLink,omitempty"`
  26942. // Warning: [Output Only] Informational warning message.
  26943. Warning *ZoneListWarning `json:"warning,omitempty"`
  26944. // ServerResponse contains the HTTP response code and headers from the
  26945. // server.
  26946. googleapi.ServerResponse `json:"-"`
  26947. // ForceSendFields is a list of field names (e.g. "Id") to
  26948. // unconditionally include in API requests. By default, fields with
  26949. // empty values are omitted from API requests. However, any non-pointer,
  26950. // non-interface field appearing in ForceSendFields will be sent to the
  26951. // server regardless of whether the field is empty or not. This may be
  26952. // used to include empty fields in Patch requests.
  26953. ForceSendFields []string `json:"-"`
  26954. // NullFields is a list of field names (e.g. "Id") to include in API
  26955. // requests with the JSON null value. By default, fields with empty
  26956. // values are omitted from API requests. However, any field with an
  26957. // empty value appearing in NullFields will be sent to the server as
  26958. // null. It is an error if a field in this list has a non-empty value.
  26959. // This may be used to include null fields in Patch requests.
  26960. NullFields []string `json:"-"`
  26961. }
  26962. func (s *ZoneList) MarshalJSON() ([]byte, error) {
  26963. type NoMethod ZoneList
  26964. raw := NoMethod(*s)
  26965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  26966. }
  26967. // ZoneListWarning: [Output Only] Informational warning message.
  26968. type ZoneListWarning struct {
  26969. // Code: [Output Only] A warning code, if applicable. For example,
  26970. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  26971. // the response.
  26972. //
  26973. // Possible values:
  26974. // "CLEANUP_FAILED"
  26975. // "DEPRECATED_RESOURCE_USED"
  26976. // "DEPRECATED_TYPE_USED"
  26977. // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"
  26978. // "EXPERIMENTAL_TYPE_USED"
  26979. // "EXTERNAL_API_WARNING"
  26980. // "FIELD_VALUE_OVERRIDEN"
  26981. // "INJECTED_KERNELS_DEPRECATED"
  26982. // "MISSING_TYPE_DEPENDENCY"
  26983. // "NEXT_HOP_ADDRESS_NOT_ASSIGNED"
  26984. // "NEXT_HOP_CANNOT_IP_FORWARD"
  26985. // "NEXT_HOP_INSTANCE_NOT_FOUND"
  26986. // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"
  26987. // "NEXT_HOP_NOT_RUNNING"
  26988. // "NOT_CRITICAL_ERROR"
  26989. // "NO_RESULTS_ON_PAGE"
  26990. // "REQUIRED_TOS_AGREEMENT"
  26991. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"
  26992. // "RESOURCE_NOT_DELETED"
  26993. // "SCHEMA_VALIDATION_IGNORED"
  26994. // "SINGLE_INSTANCE_PROPERTY_TEMPLATE"
  26995. // "UNDECLARED_PROPERTIES"
  26996. // "UNREACHABLE"
  26997. Code string `json:"code,omitempty"`
  26998. // Data: [Output Only] Metadata about this warning in key: value format.
  26999. // For example:
  27000. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  27001. Data []*ZoneListWarningData `json:"data,omitempty"`
  27002. // Message: [Output Only] A human-readable description of the warning
  27003. // code.
  27004. Message string `json:"message,omitempty"`
  27005. // ForceSendFields is a list of field names (e.g. "Code") to
  27006. // unconditionally include in API requests. By default, fields with
  27007. // empty values are omitted from API requests. However, any non-pointer,
  27008. // non-interface field appearing in ForceSendFields will be sent to the
  27009. // server regardless of whether the field is empty or not. This may be
  27010. // used to include empty fields in Patch requests.
  27011. ForceSendFields []string `json:"-"`
  27012. // NullFields is a list of field names (e.g. "Code") to include in API
  27013. // requests with the JSON null value. By default, fields with empty
  27014. // values are omitted from API requests. However, any field with an
  27015. // empty value appearing in NullFields will be sent to the server as
  27016. // null. It is an error if a field in this list has a non-empty value.
  27017. // This may be used to include null fields in Patch requests.
  27018. NullFields []string `json:"-"`
  27019. }
  27020. func (s *ZoneListWarning) MarshalJSON() ([]byte, error) {
  27021. type NoMethod ZoneListWarning
  27022. raw := NoMethod(*s)
  27023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27024. }
  27025. type ZoneListWarningData struct {
  27026. // Key: [Output Only] A key that provides more detail on the warning
  27027. // being returned. For example, for warnings where there are no results
  27028. // in a list request for a particular zone, this key might be scope and
  27029. // the key value might be the zone name. Other examples might be a key
  27030. // indicating a deprecated resource and a suggested replacement, or a
  27031. // warning about invalid network settings (for example, if an instance
  27032. // attempts to perform IP forwarding but is not enabled for IP
  27033. // forwarding).
  27034. Key string `json:"key,omitempty"`
  27035. // Value: [Output Only] A warning data value corresponding to the key.
  27036. Value string `json:"value,omitempty"`
  27037. // ForceSendFields is a list of field names (e.g. "Key") to
  27038. // unconditionally include in API requests. By default, fields with
  27039. // empty values are omitted from API requests. However, any non-pointer,
  27040. // non-interface field appearing in ForceSendFields will be sent to the
  27041. // server regardless of whether the field is empty or not. This may be
  27042. // used to include empty fields in Patch requests.
  27043. ForceSendFields []string `json:"-"`
  27044. // NullFields is a list of field names (e.g. "Key") to include in API
  27045. // requests with the JSON null value. By default, fields with empty
  27046. // values are omitted from API requests. However, any field with an
  27047. // empty value appearing in NullFields will be sent to the server as
  27048. // null. It is an error if a field in this list has a non-empty value.
  27049. // This may be used to include null fields in Patch requests.
  27050. NullFields []string `json:"-"`
  27051. }
  27052. func (s *ZoneListWarningData) MarshalJSON() ([]byte, error) {
  27053. type NoMethod ZoneListWarningData
  27054. raw := NoMethod(*s)
  27055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27056. }
  27057. type ZoneSetLabelsRequest struct {
  27058. // LabelFingerprint: The fingerprint of the previous set of labels for
  27059. // this resource, used to detect conflicts. The fingerprint is initially
  27060. // generated by Compute Engine and changes after every request to modify
  27061. // or update labels. You must always provide an up-to-date fingerprint
  27062. // hash in order to update or change labels. Make a get() request to the
  27063. // resource to get the latest fingerprint.
  27064. LabelFingerprint string `json:"labelFingerprint,omitempty"`
  27065. // Labels: The labels to set for this resource.
  27066. Labels map[string]string `json:"labels,omitempty"`
  27067. // ForceSendFields is a list of field names (e.g. "LabelFingerprint") to
  27068. // unconditionally include in API requests. By default, fields with
  27069. // empty values are omitted from API requests. However, any non-pointer,
  27070. // non-interface field appearing in ForceSendFields will be sent to the
  27071. // server regardless of whether the field is empty or not. This may be
  27072. // used to include empty fields in Patch requests.
  27073. ForceSendFields []string `json:"-"`
  27074. // NullFields is a list of field names (e.g. "LabelFingerprint") to
  27075. // include in API requests with the JSON null value. By default, fields
  27076. // with empty values are omitted from API requests. However, any field
  27077. // with an empty value appearing in NullFields will be sent to the
  27078. // server as null. It is an error if a field in this list has a
  27079. // non-empty value. This may be used to include null fields in Patch
  27080. // requests.
  27081. NullFields []string `json:"-"`
  27082. }
  27083. func (s *ZoneSetLabelsRequest) MarshalJSON() ([]byte, error) {
  27084. type NoMethod ZoneSetLabelsRequest
  27085. raw := NoMethod(*s)
  27086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27087. }
  27088. type ZoneSetPolicyRequest struct {
  27089. // Bindings: Flatten Policy to create a backwacd compatible wire-format.
  27090. // Deprecated. Use 'policy' to specify bindings.
  27091. Bindings []*Binding `json:"bindings,omitempty"`
  27092. // Etag: Flatten Policy to create a backward compatible wire-format.
  27093. // Deprecated. Use 'policy' to specify the etag.
  27094. Etag string `json:"etag,omitempty"`
  27095. // Policy: REQUIRED: The complete policy to be applied to the
  27096. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  27097. // empty policy is in general a valid policy but certain services (like
  27098. // Projects) might reject them.
  27099. Policy *Policy `json:"policy,omitempty"`
  27100. // ForceSendFields is a list of field names (e.g. "Bindings") to
  27101. // unconditionally include in API requests. By default, fields with
  27102. // empty values are omitted from API requests. However, any non-pointer,
  27103. // non-interface field appearing in ForceSendFields will be sent to the
  27104. // server regardless of whether the field is empty or not. This may be
  27105. // used to include empty fields in Patch requests.
  27106. ForceSendFields []string `json:"-"`
  27107. // NullFields is a list of field names (e.g. "Bindings") to include in
  27108. // API requests with the JSON null value. By default, fields with empty
  27109. // values are omitted from API requests. However, any field with an
  27110. // empty value appearing in NullFields will be sent to the server as
  27111. // null. It is an error if a field in this list has a non-empty value.
  27112. // This may be used to include null fields in Patch requests.
  27113. NullFields []string `json:"-"`
  27114. }
  27115. func (s *ZoneSetPolicyRequest) MarshalJSON() ([]byte, error) {
  27116. type NoMethod ZoneSetPolicyRequest
  27117. raw := NoMethod(*s)
  27118. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  27119. }
  27120. // method id "compute.acceleratorTypes.aggregatedList":
  27121. type AcceleratorTypesAggregatedListCall struct {
  27122. s *Service
  27123. project string
  27124. urlParams_ gensupport.URLParams
  27125. ifNoneMatch_ string
  27126. ctx_ context.Context
  27127. header_ http.Header
  27128. }
  27129. // AggregatedList: Retrieves an aggregated list of accelerator types.
  27130. func (r *AcceleratorTypesService) AggregatedList(project string) *AcceleratorTypesAggregatedListCall {
  27131. c := &AcceleratorTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27132. c.project = project
  27133. return c
  27134. }
  27135. // Filter sets the optional parameter "filter": A filter expression that
  27136. // filters resources listed in the response. The expression must specify
  27137. // the field name, a comparison operator, and the value that you want to
  27138. // use for filtering. The value must be a string, a number, or a
  27139. // boolean. The comparison operator must be either =, !=, >, or <.
  27140. //
  27141. // For example, if you are filtering Compute Engine instances, you can
  27142. // exclude instances named example-instance by specifying name !=
  27143. // example-instance.
  27144. //
  27145. // You can also filter nested fields. For example, you could specify
  27146. // scheduling.automaticRestart = false to include instances only if they
  27147. // are not scheduled for automatic restarts. You can use filtering on
  27148. // nested fields to filter based on resource labels.
  27149. //
  27150. // To filter on multiple expressions, provide each separate expression
  27151. // within parentheses. For example, (scheduling.automaticRestart = true)
  27152. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27153. // AND expression. However, you can include AND and OR expressions
  27154. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27155. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27156. // true).
  27157. func (c *AcceleratorTypesAggregatedListCall) Filter(filter string) *AcceleratorTypesAggregatedListCall {
  27158. c.urlParams_.Set("filter", filter)
  27159. return c
  27160. }
  27161. // MaxResults sets the optional parameter "maxResults": The maximum
  27162. // number of results per page that should be returned. If the number of
  27163. // available results is larger than maxResults, Compute Engine returns a
  27164. // nextPageToken that can be used to get the next page of results in
  27165. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27166. // (Default: 500)
  27167. func (c *AcceleratorTypesAggregatedListCall) MaxResults(maxResults int64) *AcceleratorTypesAggregatedListCall {
  27168. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27169. return c
  27170. }
  27171. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27172. // a certain order. By default, results are returned in alphanumerical
  27173. // order based on the resource name.
  27174. //
  27175. // You can also sort results in descending order based on the creation
  27176. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27177. // based on the creationTimestamp field in reverse chronological order
  27178. // (newest result first). Use this to sort resources like operations so
  27179. // that the newest operation is returned first.
  27180. //
  27181. // Currently, only sorting by name or creationTimestamp desc is
  27182. // supported.
  27183. func (c *AcceleratorTypesAggregatedListCall) OrderBy(orderBy string) *AcceleratorTypesAggregatedListCall {
  27184. c.urlParams_.Set("orderBy", orderBy)
  27185. return c
  27186. }
  27187. // PageToken sets the optional parameter "pageToken": Specifies a page
  27188. // token to use. Set pageToken to the nextPageToken returned by a
  27189. // previous list request to get the next page of results.
  27190. func (c *AcceleratorTypesAggregatedListCall) PageToken(pageToken string) *AcceleratorTypesAggregatedListCall {
  27191. c.urlParams_.Set("pageToken", pageToken)
  27192. return c
  27193. }
  27194. // Fields allows partial responses to be retrieved. See
  27195. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27196. // for more information.
  27197. func (c *AcceleratorTypesAggregatedListCall) Fields(s ...googleapi.Field) *AcceleratorTypesAggregatedListCall {
  27198. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27199. return c
  27200. }
  27201. // IfNoneMatch sets the optional parameter which makes the operation
  27202. // fail if the object's ETag matches the given value. This is useful for
  27203. // getting updates only after the object has changed since the last
  27204. // request. Use googleapi.IsNotModified to check whether the response
  27205. // error from Do is the result of In-None-Match.
  27206. func (c *AcceleratorTypesAggregatedListCall) IfNoneMatch(entityTag string) *AcceleratorTypesAggregatedListCall {
  27207. c.ifNoneMatch_ = entityTag
  27208. return c
  27209. }
  27210. // Context sets the context to be used in this call's Do method. Any
  27211. // pending HTTP request will be aborted if the provided context is
  27212. // canceled.
  27213. func (c *AcceleratorTypesAggregatedListCall) Context(ctx context.Context) *AcceleratorTypesAggregatedListCall {
  27214. c.ctx_ = ctx
  27215. return c
  27216. }
  27217. // Header returns an http.Header that can be modified by the caller to
  27218. // add HTTP headers to the request.
  27219. func (c *AcceleratorTypesAggregatedListCall) Header() http.Header {
  27220. if c.header_ == nil {
  27221. c.header_ = make(http.Header)
  27222. }
  27223. return c.header_
  27224. }
  27225. func (c *AcceleratorTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  27226. reqHeaders := make(http.Header)
  27227. for k, v := range c.header_ {
  27228. reqHeaders[k] = v
  27229. }
  27230. reqHeaders.Set("User-Agent", c.s.userAgent())
  27231. if c.ifNoneMatch_ != "" {
  27232. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27233. }
  27234. var body io.Reader = nil
  27235. c.urlParams_.Set("alt", alt)
  27236. c.urlParams_.Set("prettyPrint", "false")
  27237. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/acceleratorTypes")
  27238. urls += "?" + c.urlParams_.Encode()
  27239. req, err := http.NewRequest("GET", urls, body)
  27240. if err != nil {
  27241. return nil, err
  27242. }
  27243. req.Header = reqHeaders
  27244. googleapi.Expand(req.URL, map[string]string{
  27245. "project": c.project,
  27246. })
  27247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27248. }
  27249. // Do executes the "compute.acceleratorTypes.aggregatedList" call.
  27250. // Exactly one of *AcceleratorTypeAggregatedList or error will be
  27251. // non-nil. Any non-2xx status code is an error. Response headers are in
  27252. // either *AcceleratorTypeAggregatedList.ServerResponse.Header or (if a
  27253. // response was returned at all) in error.(*googleapi.Error).Header. Use
  27254. // googleapi.IsNotModified to check whether the returned error was
  27255. // because http.StatusNotModified was returned.
  27256. func (c *AcceleratorTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeAggregatedList, error) {
  27257. gensupport.SetOptions(c.urlParams_, opts...)
  27258. res, err := c.doRequest("json")
  27259. if res != nil && res.StatusCode == http.StatusNotModified {
  27260. if res.Body != nil {
  27261. res.Body.Close()
  27262. }
  27263. return nil, &googleapi.Error{
  27264. Code: res.StatusCode,
  27265. Header: res.Header,
  27266. }
  27267. }
  27268. if err != nil {
  27269. return nil, err
  27270. }
  27271. defer googleapi.CloseBody(res)
  27272. if err := googleapi.CheckResponse(res); err != nil {
  27273. return nil, err
  27274. }
  27275. ret := &AcceleratorTypeAggregatedList{
  27276. ServerResponse: googleapi.ServerResponse{
  27277. Header: res.Header,
  27278. HTTPStatusCode: res.StatusCode,
  27279. },
  27280. }
  27281. target := &ret
  27282. if err := gensupport.DecodeResponse(target, res); err != nil {
  27283. return nil, err
  27284. }
  27285. return ret, nil
  27286. // {
  27287. // "description": "Retrieves an aggregated list of accelerator types.",
  27288. // "httpMethod": "GET",
  27289. // "id": "compute.acceleratorTypes.aggregatedList",
  27290. // "parameterOrder": [
  27291. // "project"
  27292. // ],
  27293. // "parameters": {
  27294. // "filter": {
  27295. // "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).",
  27296. // "location": "query",
  27297. // "type": "string"
  27298. // },
  27299. // "maxResults": {
  27300. // "default": "500",
  27301. // "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)",
  27302. // "format": "uint32",
  27303. // "location": "query",
  27304. // "minimum": "0",
  27305. // "type": "integer"
  27306. // },
  27307. // "orderBy": {
  27308. // "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.",
  27309. // "location": "query",
  27310. // "type": "string"
  27311. // },
  27312. // "pageToken": {
  27313. // "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.",
  27314. // "location": "query",
  27315. // "type": "string"
  27316. // },
  27317. // "project": {
  27318. // "description": "Project ID for this request.",
  27319. // "location": "path",
  27320. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27321. // "required": true,
  27322. // "type": "string"
  27323. // }
  27324. // },
  27325. // "path": "{project}/aggregated/acceleratorTypes",
  27326. // "response": {
  27327. // "$ref": "AcceleratorTypeAggregatedList"
  27328. // },
  27329. // "scopes": [
  27330. // "https://www.googleapis.com/auth/cloud-platform",
  27331. // "https://www.googleapis.com/auth/compute",
  27332. // "https://www.googleapis.com/auth/compute.readonly"
  27333. // ]
  27334. // }
  27335. }
  27336. // Pages invokes f for each page of results.
  27337. // A non-nil error returned from f will halt the iteration.
  27338. // The provided context supersedes any context provided to the Context method.
  27339. func (c *AcceleratorTypesAggregatedListCall) Pages(ctx context.Context, f func(*AcceleratorTypeAggregatedList) error) error {
  27340. c.ctx_ = ctx
  27341. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27342. for {
  27343. x, err := c.Do()
  27344. if err != nil {
  27345. return err
  27346. }
  27347. if err := f(x); err != nil {
  27348. return err
  27349. }
  27350. if x.NextPageToken == "" {
  27351. return nil
  27352. }
  27353. c.PageToken(x.NextPageToken)
  27354. }
  27355. }
  27356. // method id "compute.acceleratorTypes.get":
  27357. type AcceleratorTypesGetCall struct {
  27358. s *Service
  27359. project string
  27360. zone string
  27361. acceleratorType string
  27362. urlParams_ gensupport.URLParams
  27363. ifNoneMatch_ string
  27364. ctx_ context.Context
  27365. header_ http.Header
  27366. }
  27367. // Get: Returns the specified accelerator type.
  27368. func (r *AcceleratorTypesService) Get(project string, zone string, acceleratorType string) *AcceleratorTypesGetCall {
  27369. c := &AcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27370. c.project = project
  27371. c.zone = zone
  27372. c.acceleratorType = acceleratorType
  27373. return c
  27374. }
  27375. // Fields allows partial responses to be retrieved. See
  27376. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27377. // for more information.
  27378. func (c *AcceleratorTypesGetCall) Fields(s ...googleapi.Field) *AcceleratorTypesGetCall {
  27379. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27380. return c
  27381. }
  27382. // IfNoneMatch sets the optional parameter which makes the operation
  27383. // fail if the object's ETag matches the given value. This is useful for
  27384. // getting updates only after the object has changed since the last
  27385. // request. Use googleapi.IsNotModified to check whether the response
  27386. // error from Do is the result of In-None-Match.
  27387. func (c *AcceleratorTypesGetCall) IfNoneMatch(entityTag string) *AcceleratorTypesGetCall {
  27388. c.ifNoneMatch_ = entityTag
  27389. return c
  27390. }
  27391. // Context sets the context to be used in this call's Do method. Any
  27392. // pending HTTP request will be aborted if the provided context is
  27393. // canceled.
  27394. func (c *AcceleratorTypesGetCall) Context(ctx context.Context) *AcceleratorTypesGetCall {
  27395. c.ctx_ = ctx
  27396. return c
  27397. }
  27398. // Header returns an http.Header that can be modified by the caller to
  27399. // add HTTP headers to the request.
  27400. func (c *AcceleratorTypesGetCall) Header() http.Header {
  27401. if c.header_ == nil {
  27402. c.header_ = make(http.Header)
  27403. }
  27404. return c.header_
  27405. }
  27406. func (c *AcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  27407. reqHeaders := make(http.Header)
  27408. for k, v := range c.header_ {
  27409. reqHeaders[k] = v
  27410. }
  27411. reqHeaders.Set("User-Agent", c.s.userAgent())
  27412. if c.ifNoneMatch_ != "" {
  27413. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27414. }
  27415. var body io.Reader = nil
  27416. c.urlParams_.Set("alt", alt)
  27417. c.urlParams_.Set("prettyPrint", "false")
  27418. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}")
  27419. urls += "?" + c.urlParams_.Encode()
  27420. req, err := http.NewRequest("GET", urls, body)
  27421. if err != nil {
  27422. return nil, err
  27423. }
  27424. req.Header = reqHeaders
  27425. googleapi.Expand(req.URL, map[string]string{
  27426. "project": c.project,
  27427. "zone": c.zone,
  27428. "acceleratorType": c.acceleratorType,
  27429. })
  27430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27431. }
  27432. // Do executes the "compute.acceleratorTypes.get" call.
  27433. // Exactly one of *AcceleratorType or error will be non-nil. Any non-2xx
  27434. // status code is an error. Response headers are in either
  27435. // *AcceleratorType.ServerResponse.Header or (if a response was returned
  27436. // at all) in error.(*googleapi.Error).Header. Use
  27437. // googleapi.IsNotModified to check whether the returned error was
  27438. // because http.StatusNotModified was returned.
  27439. func (c *AcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  27440. gensupport.SetOptions(c.urlParams_, opts...)
  27441. res, err := c.doRequest("json")
  27442. if res != nil && res.StatusCode == http.StatusNotModified {
  27443. if res.Body != nil {
  27444. res.Body.Close()
  27445. }
  27446. return nil, &googleapi.Error{
  27447. Code: res.StatusCode,
  27448. Header: res.Header,
  27449. }
  27450. }
  27451. if err != nil {
  27452. return nil, err
  27453. }
  27454. defer googleapi.CloseBody(res)
  27455. if err := googleapi.CheckResponse(res); err != nil {
  27456. return nil, err
  27457. }
  27458. ret := &AcceleratorType{
  27459. ServerResponse: googleapi.ServerResponse{
  27460. Header: res.Header,
  27461. HTTPStatusCode: res.StatusCode,
  27462. },
  27463. }
  27464. target := &ret
  27465. if err := gensupport.DecodeResponse(target, res); err != nil {
  27466. return nil, err
  27467. }
  27468. return ret, nil
  27469. // {
  27470. // "description": "Returns the specified accelerator type.",
  27471. // "httpMethod": "GET",
  27472. // "id": "compute.acceleratorTypes.get",
  27473. // "parameterOrder": [
  27474. // "project",
  27475. // "zone",
  27476. // "acceleratorType"
  27477. // ],
  27478. // "parameters": {
  27479. // "acceleratorType": {
  27480. // "description": "Name of the accelerator type to return.",
  27481. // "location": "path",
  27482. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  27483. // "required": true,
  27484. // "type": "string"
  27485. // },
  27486. // "project": {
  27487. // "description": "Project ID for this request.",
  27488. // "location": "path",
  27489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27490. // "required": true,
  27491. // "type": "string"
  27492. // },
  27493. // "zone": {
  27494. // "description": "The name of the zone for this request.",
  27495. // "location": "path",
  27496. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27497. // "required": true,
  27498. // "type": "string"
  27499. // }
  27500. // },
  27501. // "path": "{project}/zones/{zone}/acceleratorTypes/{acceleratorType}",
  27502. // "response": {
  27503. // "$ref": "AcceleratorType"
  27504. // },
  27505. // "scopes": [
  27506. // "https://www.googleapis.com/auth/cloud-platform",
  27507. // "https://www.googleapis.com/auth/compute",
  27508. // "https://www.googleapis.com/auth/compute.readonly"
  27509. // ]
  27510. // }
  27511. }
  27512. // method id "compute.acceleratorTypes.list":
  27513. type AcceleratorTypesListCall struct {
  27514. s *Service
  27515. project string
  27516. zone string
  27517. urlParams_ gensupport.URLParams
  27518. ifNoneMatch_ string
  27519. ctx_ context.Context
  27520. header_ http.Header
  27521. }
  27522. // List: Retrieves a list of accelerator types available to the
  27523. // specified project.
  27524. func (r *AcceleratorTypesService) List(project string, zone string) *AcceleratorTypesListCall {
  27525. c := &AcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27526. c.project = project
  27527. c.zone = zone
  27528. return c
  27529. }
  27530. // Filter sets the optional parameter "filter": A filter expression that
  27531. // filters resources listed in the response. The expression must specify
  27532. // the field name, a comparison operator, and the value that you want to
  27533. // use for filtering. The value must be a string, a number, or a
  27534. // boolean. The comparison operator must be either =, !=, >, or <.
  27535. //
  27536. // For example, if you are filtering Compute Engine instances, you can
  27537. // exclude instances named example-instance by specifying name !=
  27538. // example-instance.
  27539. //
  27540. // You can also filter nested fields. For example, you could specify
  27541. // scheduling.automaticRestart = false to include instances only if they
  27542. // are not scheduled for automatic restarts. You can use filtering on
  27543. // nested fields to filter based on resource labels.
  27544. //
  27545. // To filter on multiple expressions, provide each separate expression
  27546. // within parentheses. For example, (scheduling.automaticRestart = true)
  27547. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27548. // AND expression. However, you can include AND and OR expressions
  27549. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27550. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27551. // true).
  27552. func (c *AcceleratorTypesListCall) Filter(filter string) *AcceleratorTypesListCall {
  27553. c.urlParams_.Set("filter", filter)
  27554. return c
  27555. }
  27556. // MaxResults sets the optional parameter "maxResults": The maximum
  27557. // number of results per page that should be returned. If the number of
  27558. // available results is larger than maxResults, Compute Engine returns a
  27559. // nextPageToken that can be used to get the next page of results in
  27560. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27561. // (Default: 500)
  27562. func (c *AcceleratorTypesListCall) MaxResults(maxResults int64) *AcceleratorTypesListCall {
  27563. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27564. return c
  27565. }
  27566. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27567. // a certain order. By default, results are returned in alphanumerical
  27568. // order based on the resource name.
  27569. //
  27570. // You can also sort results in descending order based on the creation
  27571. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27572. // based on the creationTimestamp field in reverse chronological order
  27573. // (newest result first). Use this to sort resources like operations so
  27574. // that the newest operation is returned first.
  27575. //
  27576. // Currently, only sorting by name or creationTimestamp desc is
  27577. // supported.
  27578. func (c *AcceleratorTypesListCall) OrderBy(orderBy string) *AcceleratorTypesListCall {
  27579. c.urlParams_.Set("orderBy", orderBy)
  27580. return c
  27581. }
  27582. // PageToken sets the optional parameter "pageToken": Specifies a page
  27583. // token to use. Set pageToken to the nextPageToken returned by a
  27584. // previous list request to get the next page of results.
  27585. func (c *AcceleratorTypesListCall) PageToken(pageToken string) *AcceleratorTypesListCall {
  27586. c.urlParams_.Set("pageToken", pageToken)
  27587. return c
  27588. }
  27589. // Fields allows partial responses to be retrieved. See
  27590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27591. // for more information.
  27592. func (c *AcceleratorTypesListCall) Fields(s ...googleapi.Field) *AcceleratorTypesListCall {
  27593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27594. return c
  27595. }
  27596. // IfNoneMatch sets the optional parameter which makes the operation
  27597. // fail if the object's ETag matches the given value. This is useful for
  27598. // getting updates only after the object has changed since the last
  27599. // request. Use googleapi.IsNotModified to check whether the response
  27600. // error from Do is the result of In-None-Match.
  27601. func (c *AcceleratorTypesListCall) IfNoneMatch(entityTag string) *AcceleratorTypesListCall {
  27602. c.ifNoneMatch_ = entityTag
  27603. return c
  27604. }
  27605. // Context sets the context to be used in this call's Do method. Any
  27606. // pending HTTP request will be aborted if the provided context is
  27607. // canceled.
  27608. func (c *AcceleratorTypesListCall) Context(ctx context.Context) *AcceleratorTypesListCall {
  27609. c.ctx_ = ctx
  27610. return c
  27611. }
  27612. // Header returns an http.Header that can be modified by the caller to
  27613. // add HTTP headers to the request.
  27614. func (c *AcceleratorTypesListCall) Header() http.Header {
  27615. if c.header_ == nil {
  27616. c.header_ = make(http.Header)
  27617. }
  27618. return c.header_
  27619. }
  27620. func (c *AcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  27621. reqHeaders := make(http.Header)
  27622. for k, v := range c.header_ {
  27623. reqHeaders[k] = v
  27624. }
  27625. reqHeaders.Set("User-Agent", c.s.userAgent())
  27626. if c.ifNoneMatch_ != "" {
  27627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27628. }
  27629. var body io.Reader = nil
  27630. c.urlParams_.Set("alt", alt)
  27631. c.urlParams_.Set("prettyPrint", "false")
  27632. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/acceleratorTypes")
  27633. urls += "?" + c.urlParams_.Encode()
  27634. req, err := http.NewRequest("GET", urls, body)
  27635. if err != nil {
  27636. return nil, err
  27637. }
  27638. req.Header = reqHeaders
  27639. googleapi.Expand(req.URL, map[string]string{
  27640. "project": c.project,
  27641. "zone": c.zone,
  27642. })
  27643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27644. }
  27645. // Do executes the "compute.acceleratorTypes.list" call.
  27646. // Exactly one of *AcceleratorTypeList or error will be non-nil. Any
  27647. // non-2xx status code is an error. Response headers are in either
  27648. // *AcceleratorTypeList.ServerResponse.Header or (if a response was
  27649. // returned at all) in error.(*googleapi.Error).Header. Use
  27650. // googleapi.IsNotModified to check whether the returned error was
  27651. // because http.StatusNotModified was returned.
  27652. func (c *AcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*AcceleratorTypeList, error) {
  27653. gensupport.SetOptions(c.urlParams_, opts...)
  27654. res, err := c.doRequest("json")
  27655. if res != nil && res.StatusCode == http.StatusNotModified {
  27656. if res.Body != nil {
  27657. res.Body.Close()
  27658. }
  27659. return nil, &googleapi.Error{
  27660. Code: res.StatusCode,
  27661. Header: res.Header,
  27662. }
  27663. }
  27664. if err != nil {
  27665. return nil, err
  27666. }
  27667. defer googleapi.CloseBody(res)
  27668. if err := googleapi.CheckResponse(res); err != nil {
  27669. return nil, err
  27670. }
  27671. ret := &AcceleratorTypeList{
  27672. ServerResponse: googleapi.ServerResponse{
  27673. Header: res.Header,
  27674. HTTPStatusCode: res.StatusCode,
  27675. },
  27676. }
  27677. target := &ret
  27678. if err := gensupport.DecodeResponse(target, res); err != nil {
  27679. return nil, err
  27680. }
  27681. return ret, nil
  27682. // {
  27683. // "description": "Retrieves a list of accelerator types available to the specified project.",
  27684. // "httpMethod": "GET",
  27685. // "id": "compute.acceleratorTypes.list",
  27686. // "parameterOrder": [
  27687. // "project",
  27688. // "zone"
  27689. // ],
  27690. // "parameters": {
  27691. // "filter": {
  27692. // "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).",
  27693. // "location": "query",
  27694. // "type": "string"
  27695. // },
  27696. // "maxResults": {
  27697. // "default": "500",
  27698. // "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)",
  27699. // "format": "uint32",
  27700. // "location": "query",
  27701. // "minimum": "0",
  27702. // "type": "integer"
  27703. // },
  27704. // "orderBy": {
  27705. // "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.",
  27706. // "location": "query",
  27707. // "type": "string"
  27708. // },
  27709. // "pageToken": {
  27710. // "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.",
  27711. // "location": "query",
  27712. // "type": "string"
  27713. // },
  27714. // "project": {
  27715. // "description": "Project ID for this request.",
  27716. // "location": "path",
  27717. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27718. // "required": true,
  27719. // "type": "string"
  27720. // },
  27721. // "zone": {
  27722. // "description": "The name of the zone for this request.",
  27723. // "location": "path",
  27724. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  27725. // "required": true,
  27726. // "type": "string"
  27727. // }
  27728. // },
  27729. // "path": "{project}/zones/{zone}/acceleratorTypes",
  27730. // "response": {
  27731. // "$ref": "AcceleratorTypeList"
  27732. // },
  27733. // "scopes": [
  27734. // "https://www.googleapis.com/auth/cloud-platform",
  27735. // "https://www.googleapis.com/auth/compute",
  27736. // "https://www.googleapis.com/auth/compute.readonly"
  27737. // ]
  27738. // }
  27739. }
  27740. // Pages invokes f for each page of results.
  27741. // A non-nil error returned from f will halt the iteration.
  27742. // The provided context supersedes any context provided to the Context method.
  27743. func (c *AcceleratorTypesListCall) Pages(ctx context.Context, f func(*AcceleratorTypeList) error) error {
  27744. c.ctx_ = ctx
  27745. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27746. for {
  27747. x, err := c.Do()
  27748. if err != nil {
  27749. return err
  27750. }
  27751. if err := f(x); err != nil {
  27752. return err
  27753. }
  27754. if x.NextPageToken == "" {
  27755. return nil
  27756. }
  27757. c.PageToken(x.NextPageToken)
  27758. }
  27759. }
  27760. // method id "compute.addresses.aggregatedList":
  27761. type AddressesAggregatedListCall struct {
  27762. s *Service
  27763. project string
  27764. urlParams_ gensupport.URLParams
  27765. ifNoneMatch_ string
  27766. ctx_ context.Context
  27767. header_ http.Header
  27768. }
  27769. // AggregatedList: Retrieves an aggregated list of addresses.
  27770. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList
  27771. func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall {
  27772. c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27773. c.project = project
  27774. return c
  27775. }
  27776. // Filter sets the optional parameter "filter": A filter expression that
  27777. // filters resources listed in the response. The expression must specify
  27778. // the field name, a comparison operator, and the value that you want to
  27779. // use for filtering. The value must be a string, a number, or a
  27780. // boolean. The comparison operator must be either =, !=, >, or <.
  27781. //
  27782. // For example, if you are filtering Compute Engine instances, you can
  27783. // exclude instances named example-instance by specifying name !=
  27784. // example-instance.
  27785. //
  27786. // You can also filter nested fields. For example, you could specify
  27787. // scheduling.automaticRestart = false to include instances only if they
  27788. // are not scheduled for automatic restarts. You can use filtering on
  27789. // nested fields to filter based on resource labels.
  27790. //
  27791. // To filter on multiple expressions, provide each separate expression
  27792. // within parentheses. For example, (scheduling.automaticRestart = true)
  27793. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  27794. // AND expression. However, you can include AND and OR expressions
  27795. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  27796. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  27797. // true).
  27798. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall {
  27799. c.urlParams_.Set("filter", filter)
  27800. return c
  27801. }
  27802. // MaxResults sets the optional parameter "maxResults": The maximum
  27803. // number of results per page that should be returned. If the number of
  27804. // available results is larger than maxResults, Compute Engine returns a
  27805. // nextPageToken that can be used to get the next page of results in
  27806. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  27807. // (Default: 500)
  27808. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall {
  27809. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27810. return c
  27811. }
  27812. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  27813. // a certain order. By default, results are returned in alphanumerical
  27814. // order based on the resource name.
  27815. //
  27816. // You can also sort results in descending order based on the creation
  27817. // timestamp using orderBy="creationTimestamp desc". This sorts results
  27818. // based on the creationTimestamp field in reverse chronological order
  27819. // (newest result first). Use this to sort resources like operations so
  27820. // that the newest operation is returned first.
  27821. //
  27822. // Currently, only sorting by name or creationTimestamp desc is
  27823. // supported.
  27824. func (c *AddressesAggregatedListCall) OrderBy(orderBy string) *AddressesAggregatedListCall {
  27825. c.urlParams_.Set("orderBy", orderBy)
  27826. return c
  27827. }
  27828. // PageToken sets the optional parameter "pageToken": Specifies a page
  27829. // token to use. Set pageToken to the nextPageToken returned by a
  27830. // previous list request to get the next page of results.
  27831. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall {
  27832. c.urlParams_.Set("pageToken", pageToken)
  27833. return c
  27834. }
  27835. // Fields allows partial responses to be retrieved. See
  27836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27837. // for more information.
  27838. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall {
  27839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27840. return c
  27841. }
  27842. // IfNoneMatch sets the optional parameter which makes the operation
  27843. // fail if the object's ETag matches the given value. This is useful for
  27844. // getting updates only after the object has changed since the last
  27845. // request. Use googleapi.IsNotModified to check whether the response
  27846. // error from Do is the result of In-None-Match.
  27847. func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall {
  27848. c.ifNoneMatch_ = entityTag
  27849. return c
  27850. }
  27851. // Context sets the context to be used in this call's Do method. Any
  27852. // pending HTTP request will be aborted if the provided context is
  27853. // canceled.
  27854. func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall {
  27855. c.ctx_ = ctx
  27856. return c
  27857. }
  27858. // Header returns an http.Header that can be modified by the caller to
  27859. // add HTTP headers to the request.
  27860. func (c *AddressesAggregatedListCall) Header() http.Header {
  27861. if c.header_ == nil {
  27862. c.header_ = make(http.Header)
  27863. }
  27864. return c.header_
  27865. }
  27866. func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  27867. reqHeaders := make(http.Header)
  27868. for k, v := range c.header_ {
  27869. reqHeaders[k] = v
  27870. }
  27871. reqHeaders.Set("User-Agent", c.s.userAgent())
  27872. if c.ifNoneMatch_ != "" {
  27873. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27874. }
  27875. var body io.Reader = nil
  27876. c.urlParams_.Set("alt", alt)
  27877. c.urlParams_.Set("prettyPrint", "false")
  27878. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses")
  27879. urls += "?" + c.urlParams_.Encode()
  27880. req, err := http.NewRequest("GET", urls, body)
  27881. if err != nil {
  27882. return nil, err
  27883. }
  27884. req.Header = reqHeaders
  27885. googleapi.Expand(req.URL, map[string]string{
  27886. "project": c.project,
  27887. })
  27888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27889. }
  27890. // Do executes the "compute.addresses.aggregatedList" call.
  27891. // Exactly one of *AddressAggregatedList or error will be non-nil. Any
  27892. // non-2xx status code is an error. Response headers are in either
  27893. // *AddressAggregatedList.ServerResponse.Header or (if a response was
  27894. // returned at all) in error.(*googleapi.Error).Header. Use
  27895. // googleapi.IsNotModified to check whether the returned error was
  27896. // because http.StatusNotModified was returned.
  27897. func (c *AddressesAggregatedListCall) Do(opts ...googleapi.CallOption) (*AddressAggregatedList, error) {
  27898. gensupport.SetOptions(c.urlParams_, opts...)
  27899. res, err := c.doRequest("json")
  27900. if res != nil && res.StatusCode == http.StatusNotModified {
  27901. if res.Body != nil {
  27902. res.Body.Close()
  27903. }
  27904. return nil, &googleapi.Error{
  27905. Code: res.StatusCode,
  27906. Header: res.Header,
  27907. }
  27908. }
  27909. if err != nil {
  27910. return nil, err
  27911. }
  27912. defer googleapi.CloseBody(res)
  27913. if err := googleapi.CheckResponse(res); err != nil {
  27914. return nil, err
  27915. }
  27916. ret := &AddressAggregatedList{
  27917. ServerResponse: googleapi.ServerResponse{
  27918. Header: res.Header,
  27919. HTTPStatusCode: res.StatusCode,
  27920. },
  27921. }
  27922. target := &ret
  27923. if err := gensupport.DecodeResponse(target, res); err != nil {
  27924. return nil, err
  27925. }
  27926. return ret, nil
  27927. // {
  27928. // "description": "Retrieves an aggregated list of addresses.",
  27929. // "httpMethod": "GET",
  27930. // "id": "compute.addresses.aggregatedList",
  27931. // "parameterOrder": [
  27932. // "project"
  27933. // ],
  27934. // "parameters": {
  27935. // "filter": {
  27936. // "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).",
  27937. // "location": "query",
  27938. // "type": "string"
  27939. // },
  27940. // "maxResults": {
  27941. // "default": "500",
  27942. // "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)",
  27943. // "format": "uint32",
  27944. // "location": "query",
  27945. // "minimum": "0",
  27946. // "type": "integer"
  27947. // },
  27948. // "orderBy": {
  27949. // "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.",
  27950. // "location": "query",
  27951. // "type": "string"
  27952. // },
  27953. // "pageToken": {
  27954. // "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.",
  27955. // "location": "query",
  27956. // "type": "string"
  27957. // },
  27958. // "project": {
  27959. // "description": "Project ID for this request.",
  27960. // "location": "path",
  27961. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  27962. // "required": true,
  27963. // "type": "string"
  27964. // }
  27965. // },
  27966. // "path": "{project}/aggregated/addresses",
  27967. // "response": {
  27968. // "$ref": "AddressAggregatedList"
  27969. // },
  27970. // "scopes": [
  27971. // "https://www.googleapis.com/auth/cloud-platform",
  27972. // "https://www.googleapis.com/auth/compute",
  27973. // "https://www.googleapis.com/auth/compute.readonly"
  27974. // ]
  27975. // }
  27976. }
  27977. // Pages invokes f for each page of results.
  27978. // A non-nil error returned from f will halt the iteration.
  27979. // The provided context supersedes any context provided to the Context method.
  27980. func (c *AddressesAggregatedListCall) Pages(ctx context.Context, f func(*AddressAggregatedList) error) error {
  27981. c.ctx_ = ctx
  27982. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27983. for {
  27984. x, err := c.Do()
  27985. if err != nil {
  27986. return err
  27987. }
  27988. if err := f(x); err != nil {
  27989. return err
  27990. }
  27991. if x.NextPageToken == "" {
  27992. return nil
  27993. }
  27994. c.PageToken(x.NextPageToken)
  27995. }
  27996. }
  27997. // method id "compute.addresses.delete":
  27998. type AddressesDeleteCall struct {
  27999. s *Service
  28000. project string
  28001. region string
  28002. address string
  28003. urlParams_ gensupport.URLParams
  28004. ctx_ context.Context
  28005. header_ http.Header
  28006. }
  28007. // Delete: Deletes the specified address resource.
  28008. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete
  28009. func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall {
  28010. c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28011. c.project = project
  28012. c.region = region
  28013. c.address = address
  28014. return c
  28015. }
  28016. // RequestId sets the optional parameter "requestId": An optional
  28017. // request ID to identify requests. Specify a unique request ID so that
  28018. // if you must retry your request, the server will know to ignore the
  28019. // request if it has already been completed.
  28020. //
  28021. // For example, consider a situation where you make an initial request
  28022. // and the request times out. If you make the request again with the
  28023. // same request ID, the server can check if original operation with the
  28024. // same request ID was received, and if so, will ignore the second
  28025. // request. This prevents clients from accidentally creating duplicate
  28026. // commitments.
  28027. //
  28028. // The request ID must be a valid UUID with the exception that zero UUID
  28029. // is not supported (00000000-0000-0000-0000-000000000000).
  28030. func (c *AddressesDeleteCall) RequestId(requestId string) *AddressesDeleteCall {
  28031. c.urlParams_.Set("requestId", requestId)
  28032. return c
  28033. }
  28034. // Fields allows partial responses to be retrieved. See
  28035. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28036. // for more information.
  28037. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall {
  28038. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28039. return c
  28040. }
  28041. // Context sets the context to be used in this call's Do method. Any
  28042. // pending HTTP request will be aborted if the provided context is
  28043. // canceled.
  28044. func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall {
  28045. c.ctx_ = ctx
  28046. return c
  28047. }
  28048. // Header returns an http.Header that can be modified by the caller to
  28049. // add HTTP headers to the request.
  28050. func (c *AddressesDeleteCall) Header() http.Header {
  28051. if c.header_ == nil {
  28052. c.header_ = make(http.Header)
  28053. }
  28054. return c.header_
  28055. }
  28056. func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28057. reqHeaders := make(http.Header)
  28058. for k, v := range c.header_ {
  28059. reqHeaders[k] = v
  28060. }
  28061. reqHeaders.Set("User-Agent", c.s.userAgent())
  28062. var body io.Reader = nil
  28063. c.urlParams_.Set("alt", alt)
  28064. c.urlParams_.Set("prettyPrint", "false")
  28065. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  28066. urls += "?" + c.urlParams_.Encode()
  28067. req, err := http.NewRequest("DELETE", urls, body)
  28068. if err != nil {
  28069. return nil, err
  28070. }
  28071. req.Header = reqHeaders
  28072. googleapi.Expand(req.URL, map[string]string{
  28073. "project": c.project,
  28074. "region": c.region,
  28075. "address": c.address,
  28076. })
  28077. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28078. }
  28079. // Do executes the "compute.addresses.delete" call.
  28080. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28081. // status code is an error. Response headers are in either
  28082. // *Operation.ServerResponse.Header or (if a response was returned at
  28083. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28084. // to check whether the returned error was because
  28085. // http.StatusNotModified was returned.
  28086. func (c *AddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28087. gensupport.SetOptions(c.urlParams_, opts...)
  28088. res, err := c.doRequest("json")
  28089. if res != nil && res.StatusCode == http.StatusNotModified {
  28090. if res.Body != nil {
  28091. res.Body.Close()
  28092. }
  28093. return nil, &googleapi.Error{
  28094. Code: res.StatusCode,
  28095. Header: res.Header,
  28096. }
  28097. }
  28098. if err != nil {
  28099. return nil, err
  28100. }
  28101. defer googleapi.CloseBody(res)
  28102. if err := googleapi.CheckResponse(res); err != nil {
  28103. return nil, err
  28104. }
  28105. ret := &Operation{
  28106. ServerResponse: googleapi.ServerResponse{
  28107. Header: res.Header,
  28108. HTTPStatusCode: res.StatusCode,
  28109. },
  28110. }
  28111. target := &ret
  28112. if err := gensupport.DecodeResponse(target, res); err != nil {
  28113. return nil, err
  28114. }
  28115. return ret, nil
  28116. // {
  28117. // "description": "Deletes the specified address resource.",
  28118. // "httpMethod": "DELETE",
  28119. // "id": "compute.addresses.delete",
  28120. // "parameterOrder": [
  28121. // "project",
  28122. // "region",
  28123. // "address"
  28124. // ],
  28125. // "parameters": {
  28126. // "address": {
  28127. // "description": "Name of the address resource to delete.",
  28128. // "location": "path",
  28129. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  28130. // "required": true,
  28131. // "type": "string"
  28132. // },
  28133. // "project": {
  28134. // "description": "Project ID for this request.",
  28135. // "location": "path",
  28136. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28137. // "required": true,
  28138. // "type": "string"
  28139. // },
  28140. // "region": {
  28141. // "description": "Name of the region for this request.",
  28142. // "location": "path",
  28143. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28144. // "required": true,
  28145. // "type": "string"
  28146. // },
  28147. // "requestId": {
  28148. // "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).",
  28149. // "location": "query",
  28150. // "type": "string"
  28151. // }
  28152. // },
  28153. // "path": "{project}/regions/{region}/addresses/{address}",
  28154. // "response": {
  28155. // "$ref": "Operation"
  28156. // },
  28157. // "scopes": [
  28158. // "https://www.googleapis.com/auth/cloud-platform",
  28159. // "https://www.googleapis.com/auth/compute"
  28160. // ]
  28161. // }
  28162. }
  28163. // method id "compute.addresses.get":
  28164. type AddressesGetCall struct {
  28165. s *Service
  28166. project string
  28167. region string
  28168. address string
  28169. urlParams_ gensupport.URLParams
  28170. ifNoneMatch_ string
  28171. ctx_ context.Context
  28172. header_ http.Header
  28173. }
  28174. // Get: Returns the specified address resource.
  28175. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get
  28176. func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall {
  28177. c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28178. c.project = project
  28179. c.region = region
  28180. c.address = address
  28181. return c
  28182. }
  28183. // Fields allows partial responses to be retrieved. See
  28184. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28185. // for more information.
  28186. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall {
  28187. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28188. return c
  28189. }
  28190. // IfNoneMatch sets the optional parameter which makes the operation
  28191. // fail if the object's ETag matches the given value. This is useful for
  28192. // getting updates only after the object has changed since the last
  28193. // request. Use googleapi.IsNotModified to check whether the response
  28194. // error from Do is the result of In-None-Match.
  28195. func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall {
  28196. c.ifNoneMatch_ = entityTag
  28197. return c
  28198. }
  28199. // Context sets the context to be used in this call's Do method. Any
  28200. // pending HTTP request will be aborted if the provided context is
  28201. // canceled.
  28202. func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall {
  28203. c.ctx_ = ctx
  28204. return c
  28205. }
  28206. // Header returns an http.Header that can be modified by the caller to
  28207. // add HTTP headers to the request.
  28208. func (c *AddressesGetCall) Header() http.Header {
  28209. if c.header_ == nil {
  28210. c.header_ = make(http.Header)
  28211. }
  28212. return c.header_
  28213. }
  28214. func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) {
  28215. reqHeaders := make(http.Header)
  28216. for k, v := range c.header_ {
  28217. reqHeaders[k] = v
  28218. }
  28219. reqHeaders.Set("User-Agent", c.s.userAgent())
  28220. if c.ifNoneMatch_ != "" {
  28221. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28222. }
  28223. var body io.Reader = nil
  28224. c.urlParams_.Set("alt", alt)
  28225. c.urlParams_.Set("prettyPrint", "false")
  28226. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}")
  28227. urls += "?" + c.urlParams_.Encode()
  28228. req, err := http.NewRequest("GET", urls, body)
  28229. if err != nil {
  28230. return nil, err
  28231. }
  28232. req.Header = reqHeaders
  28233. googleapi.Expand(req.URL, map[string]string{
  28234. "project": c.project,
  28235. "region": c.region,
  28236. "address": c.address,
  28237. })
  28238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28239. }
  28240. // Do executes the "compute.addresses.get" call.
  28241. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  28242. // code is an error. Response headers are in either
  28243. // *Address.ServerResponse.Header or (if a response was returned at all)
  28244. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  28245. // check whether the returned error was because http.StatusNotModified
  28246. // was returned.
  28247. func (c *AddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  28248. gensupport.SetOptions(c.urlParams_, opts...)
  28249. res, err := c.doRequest("json")
  28250. if res != nil && res.StatusCode == http.StatusNotModified {
  28251. if res.Body != nil {
  28252. res.Body.Close()
  28253. }
  28254. return nil, &googleapi.Error{
  28255. Code: res.StatusCode,
  28256. Header: res.Header,
  28257. }
  28258. }
  28259. if err != nil {
  28260. return nil, err
  28261. }
  28262. defer googleapi.CloseBody(res)
  28263. if err := googleapi.CheckResponse(res); err != nil {
  28264. return nil, err
  28265. }
  28266. ret := &Address{
  28267. ServerResponse: googleapi.ServerResponse{
  28268. Header: res.Header,
  28269. HTTPStatusCode: res.StatusCode,
  28270. },
  28271. }
  28272. target := &ret
  28273. if err := gensupport.DecodeResponse(target, res); err != nil {
  28274. return nil, err
  28275. }
  28276. return ret, nil
  28277. // {
  28278. // "description": "Returns the specified address resource.",
  28279. // "httpMethod": "GET",
  28280. // "id": "compute.addresses.get",
  28281. // "parameterOrder": [
  28282. // "project",
  28283. // "region",
  28284. // "address"
  28285. // ],
  28286. // "parameters": {
  28287. // "address": {
  28288. // "description": "Name of the address resource to return.",
  28289. // "location": "path",
  28290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  28291. // "required": true,
  28292. // "type": "string"
  28293. // },
  28294. // "project": {
  28295. // "description": "Project ID for this request.",
  28296. // "location": "path",
  28297. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28298. // "required": true,
  28299. // "type": "string"
  28300. // },
  28301. // "region": {
  28302. // "description": "Name of the region for this request.",
  28303. // "location": "path",
  28304. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28305. // "required": true,
  28306. // "type": "string"
  28307. // }
  28308. // },
  28309. // "path": "{project}/regions/{region}/addresses/{address}",
  28310. // "response": {
  28311. // "$ref": "Address"
  28312. // },
  28313. // "scopes": [
  28314. // "https://www.googleapis.com/auth/cloud-platform",
  28315. // "https://www.googleapis.com/auth/compute",
  28316. // "https://www.googleapis.com/auth/compute.readonly"
  28317. // ]
  28318. // }
  28319. }
  28320. // method id "compute.addresses.insert":
  28321. type AddressesInsertCall struct {
  28322. s *Service
  28323. project string
  28324. region string
  28325. address *Address
  28326. urlParams_ gensupport.URLParams
  28327. ctx_ context.Context
  28328. header_ http.Header
  28329. }
  28330. // Insert: Creates an address resource in the specified project using
  28331. // the data included in the request.
  28332. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert
  28333. func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall {
  28334. c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28335. c.project = project
  28336. c.region = region
  28337. c.address = address
  28338. return c
  28339. }
  28340. // RequestId sets the optional parameter "requestId": An optional
  28341. // request ID to identify requests. Specify a unique request ID so that
  28342. // if you must retry your request, the server will know to ignore the
  28343. // request if it has already been completed.
  28344. //
  28345. // For example, consider a situation where you make an initial request
  28346. // and the request times out. If you make the request again with the
  28347. // same request ID, the server can check if original operation with the
  28348. // same request ID was received, and if so, will ignore the second
  28349. // request. This prevents clients from accidentally creating duplicate
  28350. // commitments.
  28351. //
  28352. // The request ID must be a valid UUID with the exception that zero UUID
  28353. // is not supported (00000000-0000-0000-0000-000000000000).
  28354. func (c *AddressesInsertCall) RequestId(requestId string) *AddressesInsertCall {
  28355. c.urlParams_.Set("requestId", requestId)
  28356. return c
  28357. }
  28358. // Fields allows partial responses to be retrieved. See
  28359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28360. // for more information.
  28361. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall {
  28362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28363. return c
  28364. }
  28365. // Context sets the context to be used in this call's Do method. Any
  28366. // pending HTTP request will be aborted if the provided context is
  28367. // canceled.
  28368. func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall {
  28369. c.ctx_ = ctx
  28370. return c
  28371. }
  28372. // Header returns an http.Header that can be modified by the caller to
  28373. // add HTTP headers to the request.
  28374. func (c *AddressesInsertCall) Header() http.Header {
  28375. if c.header_ == nil {
  28376. c.header_ = make(http.Header)
  28377. }
  28378. return c.header_
  28379. }
  28380. func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  28381. reqHeaders := make(http.Header)
  28382. for k, v := range c.header_ {
  28383. reqHeaders[k] = v
  28384. }
  28385. reqHeaders.Set("User-Agent", c.s.userAgent())
  28386. var body io.Reader = nil
  28387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  28388. if err != nil {
  28389. return nil, err
  28390. }
  28391. reqHeaders.Set("Content-Type", "application/json")
  28392. c.urlParams_.Set("alt", alt)
  28393. c.urlParams_.Set("prettyPrint", "false")
  28394. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  28395. urls += "?" + c.urlParams_.Encode()
  28396. req, err := http.NewRequest("POST", urls, body)
  28397. if err != nil {
  28398. return nil, err
  28399. }
  28400. req.Header = reqHeaders
  28401. googleapi.Expand(req.URL, map[string]string{
  28402. "project": c.project,
  28403. "region": c.region,
  28404. })
  28405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28406. }
  28407. // Do executes the "compute.addresses.insert" call.
  28408. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  28409. // status code is an error. Response headers are in either
  28410. // *Operation.ServerResponse.Header or (if a response was returned at
  28411. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28412. // to check whether the returned error was because
  28413. // http.StatusNotModified was returned.
  28414. func (c *AddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  28415. gensupport.SetOptions(c.urlParams_, opts...)
  28416. res, err := c.doRequest("json")
  28417. if res != nil && res.StatusCode == http.StatusNotModified {
  28418. if res.Body != nil {
  28419. res.Body.Close()
  28420. }
  28421. return nil, &googleapi.Error{
  28422. Code: res.StatusCode,
  28423. Header: res.Header,
  28424. }
  28425. }
  28426. if err != nil {
  28427. return nil, err
  28428. }
  28429. defer googleapi.CloseBody(res)
  28430. if err := googleapi.CheckResponse(res); err != nil {
  28431. return nil, err
  28432. }
  28433. ret := &Operation{
  28434. ServerResponse: googleapi.ServerResponse{
  28435. Header: res.Header,
  28436. HTTPStatusCode: res.StatusCode,
  28437. },
  28438. }
  28439. target := &ret
  28440. if err := gensupport.DecodeResponse(target, res); err != nil {
  28441. return nil, err
  28442. }
  28443. return ret, nil
  28444. // {
  28445. // "description": "Creates an address resource in the specified project using the data included in the request.",
  28446. // "httpMethod": "POST",
  28447. // "id": "compute.addresses.insert",
  28448. // "parameterOrder": [
  28449. // "project",
  28450. // "region"
  28451. // ],
  28452. // "parameters": {
  28453. // "project": {
  28454. // "description": "Project ID for this request.",
  28455. // "location": "path",
  28456. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28457. // "required": true,
  28458. // "type": "string"
  28459. // },
  28460. // "region": {
  28461. // "description": "Name of the region for this request.",
  28462. // "location": "path",
  28463. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28464. // "required": true,
  28465. // "type": "string"
  28466. // },
  28467. // "requestId": {
  28468. // "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).",
  28469. // "location": "query",
  28470. // "type": "string"
  28471. // }
  28472. // },
  28473. // "path": "{project}/regions/{region}/addresses",
  28474. // "request": {
  28475. // "$ref": "Address"
  28476. // },
  28477. // "response": {
  28478. // "$ref": "Operation"
  28479. // },
  28480. // "scopes": [
  28481. // "https://www.googleapis.com/auth/cloud-platform",
  28482. // "https://www.googleapis.com/auth/compute"
  28483. // ]
  28484. // }
  28485. }
  28486. // method id "compute.addresses.list":
  28487. type AddressesListCall struct {
  28488. s *Service
  28489. project string
  28490. region string
  28491. urlParams_ gensupport.URLParams
  28492. ifNoneMatch_ string
  28493. ctx_ context.Context
  28494. header_ http.Header
  28495. }
  28496. // List: Retrieves a list of addresses contained within the specified
  28497. // region.
  28498. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list
  28499. func (r *AddressesService) List(project string, region string) *AddressesListCall {
  28500. c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28501. c.project = project
  28502. c.region = region
  28503. return c
  28504. }
  28505. // Filter sets the optional parameter "filter": A filter expression that
  28506. // filters resources listed in the response. The expression must specify
  28507. // the field name, a comparison operator, and the value that you want to
  28508. // use for filtering. The value must be a string, a number, or a
  28509. // boolean. The comparison operator must be either =, !=, >, or <.
  28510. //
  28511. // For example, if you are filtering Compute Engine instances, you can
  28512. // exclude instances named example-instance by specifying name !=
  28513. // example-instance.
  28514. //
  28515. // You can also filter nested fields. For example, you could specify
  28516. // scheduling.automaticRestart = false to include instances only if they
  28517. // are not scheduled for automatic restarts. You can use filtering on
  28518. // nested fields to filter based on resource labels.
  28519. //
  28520. // To filter on multiple expressions, provide each separate expression
  28521. // within parentheses. For example, (scheduling.automaticRestart = true)
  28522. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  28523. // AND expression. However, you can include AND and OR expressions
  28524. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  28525. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  28526. // true).
  28527. func (c *AddressesListCall) Filter(filter string) *AddressesListCall {
  28528. c.urlParams_.Set("filter", filter)
  28529. return c
  28530. }
  28531. // MaxResults sets the optional parameter "maxResults": The maximum
  28532. // number of results per page that should be returned. If the number of
  28533. // available results is larger than maxResults, Compute Engine returns a
  28534. // nextPageToken that can be used to get the next page of results in
  28535. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  28536. // (Default: 500)
  28537. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall {
  28538. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28539. return c
  28540. }
  28541. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28542. // a certain order. By default, results are returned in alphanumerical
  28543. // order based on the resource name.
  28544. //
  28545. // You can also sort results in descending order based on the creation
  28546. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28547. // based on the creationTimestamp field in reverse chronological order
  28548. // (newest result first). Use this to sort resources like operations so
  28549. // that the newest operation is returned first.
  28550. //
  28551. // Currently, only sorting by name or creationTimestamp desc is
  28552. // supported.
  28553. func (c *AddressesListCall) OrderBy(orderBy string) *AddressesListCall {
  28554. c.urlParams_.Set("orderBy", orderBy)
  28555. return c
  28556. }
  28557. // PageToken sets the optional parameter "pageToken": Specifies a page
  28558. // token to use. Set pageToken to the nextPageToken returned by a
  28559. // previous list request to get the next page of results.
  28560. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall {
  28561. c.urlParams_.Set("pageToken", pageToken)
  28562. return c
  28563. }
  28564. // Fields allows partial responses to be retrieved. See
  28565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28566. // for more information.
  28567. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall {
  28568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28569. return c
  28570. }
  28571. // IfNoneMatch sets the optional parameter which makes the operation
  28572. // fail if the object's ETag matches the given value. This is useful for
  28573. // getting updates only after the object has changed since the last
  28574. // request. Use googleapi.IsNotModified to check whether the response
  28575. // error from Do is the result of In-None-Match.
  28576. func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall {
  28577. c.ifNoneMatch_ = entityTag
  28578. return c
  28579. }
  28580. // Context sets the context to be used in this call's Do method. Any
  28581. // pending HTTP request will be aborted if the provided context is
  28582. // canceled.
  28583. func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall {
  28584. c.ctx_ = ctx
  28585. return c
  28586. }
  28587. // Header returns an http.Header that can be modified by the caller to
  28588. // add HTTP headers to the request.
  28589. func (c *AddressesListCall) Header() http.Header {
  28590. if c.header_ == nil {
  28591. c.header_ = make(http.Header)
  28592. }
  28593. return c.header_
  28594. }
  28595. func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) {
  28596. reqHeaders := make(http.Header)
  28597. for k, v := range c.header_ {
  28598. reqHeaders[k] = v
  28599. }
  28600. reqHeaders.Set("User-Agent", c.s.userAgent())
  28601. if c.ifNoneMatch_ != "" {
  28602. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28603. }
  28604. var body io.Reader = nil
  28605. c.urlParams_.Set("alt", alt)
  28606. c.urlParams_.Set("prettyPrint", "false")
  28607. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses")
  28608. urls += "?" + c.urlParams_.Encode()
  28609. req, err := http.NewRequest("GET", urls, body)
  28610. if err != nil {
  28611. return nil, err
  28612. }
  28613. req.Header = reqHeaders
  28614. googleapi.Expand(req.URL, map[string]string{
  28615. "project": c.project,
  28616. "region": c.region,
  28617. })
  28618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28619. }
  28620. // Do executes the "compute.addresses.list" call.
  28621. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  28622. // status code is an error. Response headers are in either
  28623. // *AddressList.ServerResponse.Header or (if a response was returned at
  28624. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28625. // to check whether the returned error was because
  28626. // http.StatusNotModified was returned.
  28627. func (c *AddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  28628. gensupport.SetOptions(c.urlParams_, opts...)
  28629. res, err := c.doRequest("json")
  28630. if res != nil && res.StatusCode == http.StatusNotModified {
  28631. if res.Body != nil {
  28632. res.Body.Close()
  28633. }
  28634. return nil, &googleapi.Error{
  28635. Code: res.StatusCode,
  28636. Header: res.Header,
  28637. }
  28638. }
  28639. if err != nil {
  28640. return nil, err
  28641. }
  28642. defer googleapi.CloseBody(res)
  28643. if err := googleapi.CheckResponse(res); err != nil {
  28644. return nil, err
  28645. }
  28646. ret := &AddressList{
  28647. ServerResponse: googleapi.ServerResponse{
  28648. Header: res.Header,
  28649. HTTPStatusCode: res.StatusCode,
  28650. },
  28651. }
  28652. target := &ret
  28653. if err := gensupport.DecodeResponse(target, res); err != nil {
  28654. return nil, err
  28655. }
  28656. return ret, nil
  28657. // {
  28658. // "description": "Retrieves a list of addresses contained within the specified region.",
  28659. // "httpMethod": "GET",
  28660. // "id": "compute.addresses.list",
  28661. // "parameterOrder": [
  28662. // "project",
  28663. // "region"
  28664. // ],
  28665. // "parameters": {
  28666. // "filter": {
  28667. // "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).",
  28668. // "location": "query",
  28669. // "type": "string"
  28670. // },
  28671. // "maxResults": {
  28672. // "default": "500",
  28673. // "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)",
  28674. // "format": "uint32",
  28675. // "location": "query",
  28676. // "minimum": "0",
  28677. // "type": "integer"
  28678. // },
  28679. // "orderBy": {
  28680. // "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.",
  28681. // "location": "query",
  28682. // "type": "string"
  28683. // },
  28684. // "pageToken": {
  28685. // "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.",
  28686. // "location": "query",
  28687. // "type": "string"
  28688. // },
  28689. // "project": {
  28690. // "description": "Project ID for this request.",
  28691. // "location": "path",
  28692. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28693. // "required": true,
  28694. // "type": "string"
  28695. // },
  28696. // "region": {
  28697. // "description": "Name of the region for this request.",
  28698. // "location": "path",
  28699. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  28700. // "required": true,
  28701. // "type": "string"
  28702. // }
  28703. // },
  28704. // "path": "{project}/regions/{region}/addresses",
  28705. // "response": {
  28706. // "$ref": "AddressList"
  28707. // },
  28708. // "scopes": [
  28709. // "https://www.googleapis.com/auth/cloud-platform",
  28710. // "https://www.googleapis.com/auth/compute",
  28711. // "https://www.googleapis.com/auth/compute.readonly"
  28712. // ]
  28713. // }
  28714. }
  28715. // Pages invokes f for each page of results.
  28716. // A non-nil error returned from f will halt the iteration.
  28717. // The provided context supersedes any context provided to the Context method.
  28718. func (c *AddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  28719. c.ctx_ = ctx
  28720. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28721. for {
  28722. x, err := c.Do()
  28723. if err != nil {
  28724. return err
  28725. }
  28726. if err := f(x); err != nil {
  28727. return err
  28728. }
  28729. if x.NextPageToken == "" {
  28730. return nil
  28731. }
  28732. c.PageToken(x.NextPageToken)
  28733. }
  28734. }
  28735. // method id "compute.autoscalers.aggregatedList":
  28736. type AutoscalersAggregatedListCall struct {
  28737. s *Service
  28738. project string
  28739. urlParams_ gensupport.URLParams
  28740. ifNoneMatch_ string
  28741. ctx_ context.Context
  28742. header_ http.Header
  28743. }
  28744. // AggregatedList: Retrieves an aggregated list of autoscalers.
  28745. func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall {
  28746. c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28747. c.project = project
  28748. return c
  28749. }
  28750. // Filter sets the optional parameter "filter": A filter expression that
  28751. // filters resources listed in the response. The expression must specify
  28752. // the field name, a comparison operator, and the value that you want to
  28753. // use for filtering. The value must be a string, a number, or a
  28754. // boolean. The comparison operator must be either =, !=, >, or <.
  28755. //
  28756. // For example, if you are filtering Compute Engine instances, you can
  28757. // exclude instances named example-instance by specifying name !=
  28758. // example-instance.
  28759. //
  28760. // You can also filter nested fields. For example, you could specify
  28761. // scheduling.automaticRestart = false to include instances only if they
  28762. // are not scheduled for automatic restarts. You can use filtering on
  28763. // nested fields to filter based on resource labels.
  28764. //
  28765. // To filter on multiple expressions, provide each separate expression
  28766. // within parentheses. For example, (scheduling.automaticRestart = true)
  28767. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  28768. // AND expression. However, you can include AND and OR expressions
  28769. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  28770. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  28771. // true).
  28772. func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall {
  28773. c.urlParams_.Set("filter", filter)
  28774. return c
  28775. }
  28776. // MaxResults sets the optional parameter "maxResults": The maximum
  28777. // number of results per page that should be returned. If the number of
  28778. // available results is larger than maxResults, Compute Engine returns a
  28779. // nextPageToken that can be used to get the next page of results in
  28780. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  28781. // (Default: 500)
  28782. func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall {
  28783. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28784. return c
  28785. }
  28786. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  28787. // a certain order. By default, results are returned in alphanumerical
  28788. // order based on the resource name.
  28789. //
  28790. // You can also sort results in descending order based on the creation
  28791. // timestamp using orderBy="creationTimestamp desc". This sorts results
  28792. // based on the creationTimestamp field in reverse chronological order
  28793. // (newest result first). Use this to sort resources like operations so
  28794. // that the newest operation is returned first.
  28795. //
  28796. // Currently, only sorting by name or creationTimestamp desc is
  28797. // supported.
  28798. func (c *AutoscalersAggregatedListCall) OrderBy(orderBy string) *AutoscalersAggregatedListCall {
  28799. c.urlParams_.Set("orderBy", orderBy)
  28800. return c
  28801. }
  28802. // PageToken sets the optional parameter "pageToken": Specifies a page
  28803. // token to use. Set pageToken to the nextPageToken returned by a
  28804. // previous list request to get the next page of results.
  28805. func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall {
  28806. c.urlParams_.Set("pageToken", pageToken)
  28807. return c
  28808. }
  28809. // Fields allows partial responses to be retrieved. See
  28810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28811. // for more information.
  28812. func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall {
  28813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28814. return c
  28815. }
  28816. // IfNoneMatch sets the optional parameter which makes the operation
  28817. // fail if the object's ETag matches the given value. This is useful for
  28818. // getting updates only after the object has changed since the last
  28819. // request. Use googleapi.IsNotModified to check whether the response
  28820. // error from Do is the result of In-None-Match.
  28821. func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall {
  28822. c.ifNoneMatch_ = entityTag
  28823. return c
  28824. }
  28825. // Context sets the context to be used in this call's Do method. Any
  28826. // pending HTTP request will be aborted if the provided context is
  28827. // canceled.
  28828. func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall {
  28829. c.ctx_ = ctx
  28830. return c
  28831. }
  28832. // Header returns an http.Header that can be modified by the caller to
  28833. // add HTTP headers to the request.
  28834. func (c *AutoscalersAggregatedListCall) Header() http.Header {
  28835. if c.header_ == nil {
  28836. c.header_ = make(http.Header)
  28837. }
  28838. return c.header_
  28839. }
  28840. func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  28841. reqHeaders := make(http.Header)
  28842. for k, v := range c.header_ {
  28843. reqHeaders[k] = v
  28844. }
  28845. reqHeaders.Set("User-Agent", c.s.userAgent())
  28846. if c.ifNoneMatch_ != "" {
  28847. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28848. }
  28849. var body io.Reader = nil
  28850. c.urlParams_.Set("alt", alt)
  28851. c.urlParams_.Set("prettyPrint", "false")
  28852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers")
  28853. urls += "?" + c.urlParams_.Encode()
  28854. req, err := http.NewRequest("GET", urls, body)
  28855. if err != nil {
  28856. return nil, err
  28857. }
  28858. req.Header = reqHeaders
  28859. googleapi.Expand(req.URL, map[string]string{
  28860. "project": c.project,
  28861. })
  28862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28863. }
  28864. // Do executes the "compute.autoscalers.aggregatedList" call.
  28865. // Exactly one of *AutoscalerAggregatedList or error will be non-nil.
  28866. // Any non-2xx status code is an error. Response headers are in either
  28867. // *AutoscalerAggregatedList.ServerResponse.Header or (if a response was
  28868. // returned 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 *AutoscalersAggregatedListCall) Do(opts ...googleapi.CallOption) (*AutoscalerAggregatedList, 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 := &AutoscalerAggregatedList{
  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": "Retrieves an aggregated list of autoscalers.",
  28903. // "httpMethod": "GET",
  28904. // "id": "compute.autoscalers.aggregatedList",
  28905. // "parameterOrder": [
  28906. // "project"
  28907. // ],
  28908. // "parameters": {
  28909. // "filter": {
  28910. // "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).",
  28911. // "location": "query",
  28912. // "type": "string"
  28913. // },
  28914. // "maxResults": {
  28915. // "default": "500",
  28916. // "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)",
  28917. // "format": "uint32",
  28918. // "location": "query",
  28919. // "minimum": "0",
  28920. // "type": "integer"
  28921. // },
  28922. // "orderBy": {
  28923. // "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.",
  28924. // "location": "query",
  28925. // "type": "string"
  28926. // },
  28927. // "pageToken": {
  28928. // "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.",
  28929. // "location": "query",
  28930. // "type": "string"
  28931. // },
  28932. // "project": {
  28933. // "description": "Project ID for this request.",
  28934. // "location": "path",
  28935. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  28936. // "required": true,
  28937. // "type": "string"
  28938. // }
  28939. // },
  28940. // "path": "{project}/aggregated/autoscalers",
  28941. // "response": {
  28942. // "$ref": "AutoscalerAggregatedList"
  28943. // },
  28944. // "scopes": [
  28945. // "https://www.googleapis.com/auth/cloud-platform",
  28946. // "https://www.googleapis.com/auth/compute",
  28947. // "https://www.googleapis.com/auth/compute.readonly"
  28948. // ]
  28949. // }
  28950. }
  28951. // Pages invokes f for each page of results.
  28952. // A non-nil error returned from f will halt the iteration.
  28953. // The provided context supersedes any context provided to the Context method.
  28954. func (c *AutoscalersAggregatedListCall) Pages(ctx context.Context, f func(*AutoscalerAggregatedList) error) error {
  28955. c.ctx_ = ctx
  28956. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28957. for {
  28958. x, err := c.Do()
  28959. if err != nil {
  28960. return err
  28961. }
  28962. if err := f(x); err != nil {
  28963. return err
  28964. }
  28965. if x.NextPageToken == "" {
  28966. return nil
  28967. }
  28968. c.PageToken(x.NextPageToken)
  28969. }
  28970. }
  28971. // method id "compute.autoscalers.delete":
  28972. type AutoscalersDeleteCall struct {
  28973. s *Service
  28974. project string
  28975. zone string
  28976. autoscaler string
  28977. urlParams_ gensupport.URLParams
  28978. ctx_ context.Context
  28979. header_ http.Header
  28980. }
  28981. // Delete: Deletes the specified autoscaler.
  28982. func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall {
  28983. c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28984. c.project = project
  28985. c.zone = zone
  28986. c.autoscaler = autoscaler
  28987. return c
  28988. }
  28989. // RequestId sets the optional parameter "requestId": An optional
  28990. // request ID to identify requests. Specify a unique request ID so that
  28991. // if you must retry your request, the server will know to ignore the
  28992. // request if it has already been completed.
  28993. //
  28994. // For example, consider a situation where you make an initial request
  28995. // and the request times out. If you make the request again with the
  28996. // same request ID, the server can check if original operation with the
  28997. // same request ID was received, and if so, will ignore the second
  28998. // request. This prevents clients from accidentally creating duplicate
  28999. // commitments.
  29000. //
  29001. // The request ID must be a valid UUID with the exception that zero UUID
  29002. // is not supported (00000000-0000-0000-0000-000000000000).
  29003. func (c *AutoscalersDeleteCall) RequestId(requestId string) *AutoscalersDeleteCall {
  29004. c.urlParams_.Set("requestId", requestId)
  29005. return c
  29006. }
  29007. // Fields allows partial responses to be retrieved. See
  29008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29009. // for more information.
  29010. func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall {
  29011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29012. return c
  29013. }
  29014. // Context sets the context to be used in this call's Do method. Any
  29015. // pending HTTP request will be aborted if the provided context is
  29016. // canceled.
  29017. func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall {
  29018. c.ctx_ = ctx
  29019. return c
  29020. }
  29021. // Header returns an http.Header that can be modified by the caller to
  29022. // add HTTP headers to the request.
  29023. func (c *AutoscalersDeleteCall) Header() http.Header {
  29024. if c.header_ == nil {
  29025. c.header_ = make(http.Header)
  29026. }
  29027. return c.header_
  29028. }
  29029. func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  29030. reqHeaders := make(http.Header)
  29031. for k, v := range c.header_ {
  29032. reqHeaders[k] = v
  29033. }
  29034. reqHeaders.Set("User-Agent", c.s.userAgent())
  29035. var body io.Reader = nil
  29036. c.urlParams_.Set("alt", alt)
  29037. c.urlParams_.Set("prettyPrint", "false")
  29038. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  29039. urls += "?" + c.urlParams_.Encode()
  29040. req, err := http.NewRequest("DELETE", urls, body)
  29041. if err != nil {
  29042. return nil, err
  29043. }
  29044. req.Header = reqHeaders
  29045. googleapi.Expand(req.URL, map[string]string{
  29046. "project": c.project,
  29047. "zone": c.zone,
  29048. "autoscaler": c.autoscaler,
  29049. })
  29050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29051. }
  29052. // Do executes the "compute.autoscalers.delete" call.
  29053. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29054. // status code is an error. Response headers are in either
  29055. // *Operation.ServerResponse.Header or (if a response was returned at
  29056. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29057. // to check whether the returned error was because
  29058. // http.StatusNotModified was returned.
  29059. func (c *AutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29060. gensupport.SetOptions(c.urlParams_, opts...)
  29061. res, err := c.doRequest("json")
  29062. if res != nil && res.StatusCode == http.StatusNotModified {
  29063. if res.Body != nil {
  29064. res.Body.Close()
  29065. }
  29066. return nil, &googleapi.Error{
  29067. Code: res.StatusCode,
  29068. Header: res.Header,
  29069. }
  29070. }
  29071. if err != nil {
  29072. return nil, err
  29073. }
  29074. defer googleapi.CloseBody(res)
  29075. if err := googleapi.CheckResponse(res); err != nil {
  29076. return nil, err
  29077. }
  29078. ret := &Operation{
  29079. ServerResponse: googleapi.ServerResponse{
  29080. Header: res.Header,
  29081. HTTPStatusCode: res.StatusCode,
  29082. },
  29083. }
  29084. target := &ret
  29085. if err := gensupport.DecodeResponse(target, res); err != nil {
  29086. return nil, err
  29087. }
  29088. return ret, nil
  29089. // {
  29090. // "description": "Deletes the specified autoscaler.",
  29091. // "httpMethod": "DELETE",
  29092. // "id": "compute.autoscalers.delete",
  29093. // "parameterOrder": [
  29094. // "project",
  29095. // "zone",
  29096. // "autoscaler"
  29097. // ],
  29098. // "parameters": {
  29099. // "autoscaler": {
  29100. // "description": "Name of the autoscaler to delete.",
  29101. // "location": "path",
  29102. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  29103. // "required": true,
  29104. // "type": "string"
  29105. // },
  29106. // "project": {
  29107. // "description": "Project ID for this request.",
  29108. // "location": "path",
  29109. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29110. // "required": true,
  29111. // "type": "string"
  29112. // },
  29113. // "requestId": {
  29114. // "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).",
  29115. // "location": "query",
  29116. // "type": "string"
  29117. // },
  29118. // "zone": {
  29119. // "description": "Name of the zone for this request.",
  29120. // "location": "path",
  29121. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29122. // "required": true,
  29123. // "type": "string"
  29124. // }
  29125. // },
  29126. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  29127. // "response": {
  29128. // "$ref": "Operation"
  29129. // },
  29130. // "scopes": [
  29131. // "https://www.googleapis.com/auth/cloud-platform",
  29132. // "https://www.googleapis.com/auth/compute"
  29133. // ]
  29134. // }
  29135. }
  29136. // method id "compute.autoscalers.get":
  29137. type AutoscalersGetCall struct {
  29138. s *Service
  29139. project string
  29140. zone string
  29141. autoscaler string
  29142. urlParams_ gensupport.URLParams
  29143. ifNoneMatch_ string
  29144. ctx_ context.Context
  29145. header_ http.Header
  29146. }
  29147. // Get: Returns the specified autoscaler resource. Gets a list of
  29148. // available autoscalers by making a list() request.
  29149. func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall {
  29150. c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29151. c.project = project
  29152. c.zone = zone
  29153. c.autoscaler = autoscaler
  29154. return c
  29155. }
  29156. // Fields allows partial responses to be retrieved. See
  29157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29158. // for more information.
  29159. func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall {
  29160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29161. return c
  29162. }
  29163. // IfNoneMatch sets the optional parameter which makes the operation
  29164. // fail if the object's ETag matches the given value. This is useful for
  29165. // getting updates only after the object has changed since the last
  29166. // request. Use googleapi.IsNotModified to check whether the response
  29167. // error from Do is the result of In-None-Match.
  29168. func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall {
  29169. c.ifNoneMatch_ = entityTag
  29170. return c
  29171. }
  29172. // Context sets the context to be used in this call's Do method. Any
  29173. // pending HTTP request will be aborted if the provided context is
  29174. // canceled.
  29175. func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall {
  29176. c.ctx_ = ctx
  29177. return c
  29178. }
  29179. // Header returns an http.Header that can be modified by the caller to
  29180. // add HTTP headers to the request.
  29181. func (c *AutoscalersGetCall) Header() http.Header {
  29182. if c.header_ == nil {
  29183. c.header_ = make(http.Header)
  29184. }
  29185. return c.header_
  29186. }
  29187. func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  29188. reqHeaders := make(http.Header)
  29189. for k, v := range c.header_ {
  29190. reqHeaders[k] = v
  29191. }
  29192. reqHeaders.Set("User-Agent", c.s.userAgent())
  29193. if c.ifNoneMatch_ != "" {
  29194. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29195. }
  29196. var body io.Reader = nil
  29197. c.urlParams_.Set("alt", alt)
  29198. c.urlParams_.Set("prettyPrint", "false")
  29199. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}")
  29200. urls += "?" + c.urlParams_.Encode()
  29201. req, err := http.NewRequest("GET", urls, body)
  29202. if err != nil {
  29203. return nil, err
  29204. }
  29205. req.Header = reqHeaders
  29206. googleapi.Expand(req.URL, map[string]string{
  29207. "project": c.project,
  29208. "zone": c.zone,
  29209. "autoscaler": c.autoscaler,
  29210. })
  29211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29212. }
  29213. // Do executes the "compute.autoscalers.get" call.
  29214. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  29215. // status code is an error. Response headers are in either
  29216. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  29217. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29218. // to check whether the returned error was because
  29219. // http.StatusNotModified was returned.
  29220. func (c *AutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  29221. gensupport.SetOptions(c.urlParams_, opts...)
  29222. res, err := c.doRequest("json")
  29223. if res != nil && res.StatusCode == http.StatusNotModified {
  29224. if res.Body != nil {
  29225. res.Body.Close()
  29226. }
  29227. return nil, &googleapi.Error{
  29228. Code: res.StatusCode,
  29229. Header: res.Header,
  29230. }
  29231. }
  29232. if err != nil {
  29233. return nil, err
  29234. }
  29235. defer googleapi.CloseBody(res)
  29236. if err := googleapi.CheckResponse(res); err != nil {
  29237. return nil, err
  29238. }
  29239. ret := &Autoscaler{
  29240. ServerResponse: googleapi.ServerResponse{
  29241. Header: res.Header,
  29242. HTTPStatusCode: res.StatusCode,
  29243. },
  29244. }
  29245. target := &ret
  29246. if err := gensupport.DecodeResponse(target, res); err != nil {
  29247. return nil, err
  29248. }
  29249. return ret, nil
  29250. // {
  29251. // "description": "Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.",
  29252. // "httpMethod": "GET",
  29253. // "id": "compute.autoscalers.get",
  29254. // "parameterOrder": [
  29255. // "project",
  29256. // "zone",
  29257. // "autoscaler"
  29258. // ],
  29259. // "parameters": {
  29260. // "autoscaler": {
  29261. // "description": "Name of the autoscaler to return.",
  29262. // "location": "path",
  29263. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  29264. // "required": true,
  29265. // "type": "string"
  29266. // },
  29267. // "project": {
  29268. // "description": "Project ID for this request.",
  29269. // "location": "path",
  29270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29271. // "required": true,
  29272. // "type": "string"
  29273. // },
  29274. // "zone": {
  29275. // "description": "Name of the zone for this request.",
  29276. // "location": "path",
  29277. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29278. // "required": true,
  29279. // "type": "string"
  29280. // }
  29281. // },
  29282. // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}",
  29283. // "response": {
  29284. // "$ref": "Autoscaler"
  29285. // },
  29286. // "scopes": [
  29287. // "https://www.googleapis.com/auth/cloud-platform",
  29288. // "https://www.googleapis.com/auth/compute",
  29289. // "https://www.googleapis.com/auth/compute.readonly"
  29290. // ]
  29291. // }
  29292. }
  29293. // method id "compute.autoscalers.insert":
  29294. type AutoscalersInsertCall struct {
  29295. s *Service
  29296. project string
  29297. zone string
  29298. autoscaler *Autoscaler
  29299. urlParams_ gensupport.URLParams
  29300. ctx_ context.Context
  29301. header_ http.Header
  29302. }
  29303. // Insert: Creates an autoscaler in the specified project using the data
  29304. // included in the request.
  29305. func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall {
  29306. c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29307. c.project = project
  29308. c.zone = zone
  29309. c.autoscaler = autoscaler
  29310. return c
  29311. }
  29312. // RequestId sets the optional parameter "requestId": An optional
  29313. // request ID to identify requests. Specify a unique request ID so that
  29314. // if you must retry your request, the server will know to ignore the
  29315. // request if it has already been completed.
  29316. //
  29317. // For example, consider a situation where you make an initial request
  29318. // and the request times out. If you make the request again with the
  29319. // same request ID, the server can check if original operation with the
  29320. // same request ID was received, and if so, will ignore the second
  29321. // request. This prevents clients from accidentally creating duplicate
  29322. // commitments.
  29323. //
  29324. // The request ID must be a valid UUID with the exception that zero UUID
  29325. // is not supported (00000000-0000-0000-0000-000000000000).
  29326. func (c *AutoscalersInsertCall) RequestId(requestId string) *AutoscalersInsertCall {
  29327. c.urlParams_.Set("requestId", requestId)
  29328. return c
  29329. }
  29330. // Fields allows partial responses to be retrieved. See
  29331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29332. // for more information.
  29333. func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall {
  29334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29335. return c
  29336. }
  29337. // Context sets the context to be used in this call's Do method. Any
  29338. // pending HTTP request will be aborted if the provided context is
  29339. // canceled.
  29340. func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall {
  29341. c.ctx_ = ctx
  29342. return c
  29343. }
  29344. // Header returns an http.Header that can be modified by the caller to
  29345. // add HTTP headers to the request.
  29346. func (c *AutoscalersInsertCall) Header() http.Header {
  29347. if c.header_ == nil {
  29348. c.header_ = make(http.Header)
  29349. }
  29350. return c.header_
  29351. }
  29352. func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  29353. reqHeaders := make(http.Header)
  29354. for k, v := range c.header_ {
  29355. reqHeaders[k] = v
  29356. }
  29357. reqHeaders.Set("User-Agent", c.s.userAgent())
  29358. var body io.Reader = nil
  29359. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  29360. if err != nil {
  29361. return nil, err
  29362. }
  29363. reqHeaders.Set("Content-Type", "application/json")
  29364. c.urlParams_.Set("alt", alt)
  29365. c.urlParams_.Set("prettyPrint", "false")
  29366. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  29367. urls += "?" + c.urlParams_.Encode()
  29368. req, err := http.NewRequest("POST", urls, body)
  29369. if err != nil {
  29370. return nil, err
  29371. }
  29372. req.Header = reqHeaders
  29373. googleapi.Expand(req.URL, map[string]string{
  29374. "project": c.project,
  29375. "zone": c.zone,
  29376. })
  29377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29378. }
  29379. // Do executes the "compute.autoscalers.insert" call.
  29380. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29381. // status code is an error. Response headers are in either
  29382. // *Operation.ServerResponse.Header or (if a response was returned at
  29383. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29384. // to check whether the returned error was because
  29385. // http.StatusNotModified was returned.
  29386. func (c *AutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29387. gensupport.SetOptions(c.urlParams_, opts...)
  29388. res, err := c.doRequest("json")
  29389. if res != nil && res.StatusCode == http.StatusNotModified {
  29390. if res.Body != nil {
  29391. res.Body.Close()
  29392. }
  29393. return nil, &googleapi.Error{
  29394. Code: res.StatusCode,
  29395. Header: res.Header,
  29396. }
  29397. }
  29398. if err != nil {
  29399. return nil, err
  29400. }
  29401. defer googleapi.CloseBody(res)
  29402. if err := googleapi.CheckResponse(res); err != nil {
  29403. return nil, err
  29404. }
  29405. ret := &Operation{
  29406. ServerResponse: googleapi.ServerResponse{
  29407. Header: res.Header,
  29408. HTTPStatusCode: res.StatusCode,
  29409. },
  29410. }
  29411. target := &ret
  29412. if err := gensupport.DecodeResponse(target, res); err != nil {
  29413. return nil, err
  29414. }
  29415. return ret, nil
  29416. // {
  29417. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  29418. // "httpMethod": "POST",
  29419. // "id": "compute.autoscalers.insert",
  29420. // "parameterOrder": [
  29421. // "project",
  29422. // "zone"
  29423. // ],
  29424. // "parameters": {
  29425. // "project": {
  29426. // "description": "Project ID for this request.",
  29427. // "location": "path",
  29428. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29429. // "required": true,
  29430. // "type": "string"
  29431. // },
  29432. // "requestId": {
  29433. // "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).",
  29434. // "location": "query",
  29435. // "type": "string"
  29436. // },
  29437. // "zone": {
  29438. // "description": "Name of the zone for this request.",
  29439. // "location": "path",
  29440. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29441. // "required": true,
  29442. // "type": "string"
  29443. // }
  29444. // },
  29445. // "path": "{project}/zones/{zone}/autoscalers",
  29446. // "request": {
  29447. // "$ref": "Autoscaler"
  29448. // },
  29449. // "response": {
  29450. // "$ref": "Operation"
  29451. // },
  29452. // "scopes": [
  29453. // "https://www.googleapis.com/auth/cloud-platform",
  29454. // "https://www.googleapis.com/auth/compute"
  29455. // ]
  29456. // }
  29457. }
  29458. // method id "compute.autoscalers.list":
  29459. type AutoscalersListCall struct {
  29460. s *Service
  29461. project string
  29462. zone string
  29463. urlParams_ gensupport.URLParams
  29464. ifNoneMatch_ string
  29465. ctx_ context.Context
  29466. header_ http.Header
  29467. }
  29468. // List: Retrieves a list of autoscalers contained within the specified
  29469. // zone.
  29470. func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall {
  29471. c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29472. c.project = project
  29473. c.zone = zone
  29474. return c
  29475. }
  29476. // Filter sets the optional parameter "filter": A filter expression that
  29477. // filters resources listed in the response. The expression must specify
  29478. // the field name, a comparison operator, and the value that you want to
  29479. // use for filtering. The value must be a string, a number, or a
  29480. // boolean. The comparison operator must be either =, !=, >, or <.
  29481. //
  29482. // For example, if you are filtering Compute Engine instances, you can
  29483. // exclude instances named example-instance by specifying name !=
  29484. // example-instance.
  29485. //
  29486. // You can also filter nested fields. For example, you could specify
  29487. // scheduling.automaticRestart = false to include instances only if they
  29488. // are not scheduled for automatic restarts. You can use filtering on
  29489. // nested fields to filter based on resource labels.
  29490. //
  29491. // To filter on multiple expressions, provide each separate expression
  29492. // within parentheses. For example, (scheduling.automaticRestart = true)
  29493. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  29494. // AND expression. However, you can include AND and OR expressions
  29495. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  29496. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  29497. // true).
  29498. func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall {
  29499. c.urlParams_.Set("filter", filter)
  29500. return c
  29501. }
  29502. // MaxResults sets the optional parameter "maxResults": The maximum
  29503. // number of results per page that should be returned. If the number of
  29504. // available results is larger than maxResults, Compute Engine returns a
  29505. // nextPageToken that can be used to get the next page of results in
  29506. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  29507. // (Default: 500)
  29508. func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall {
  29509. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29510. return c
  29511. }
  29512. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  29513. // a certain order. By default, results are returned in alphanumerical
  29514. // order based on the resource name.
  29515. //
  29516. // You can also sort results in descending order based on the creation
  29517. // timestamp using orderBy="creationTimestamp desc". This sorts results
  29518. // based on the creationTimestamp field in reverse chronological order
  29519. // (newest result first). Use this to sort resources like operations so
  29520. // that the newest operation is returned first.
  29521. //
  29522. // Currently, only sorting by name or creationTimestamp desc is
  29523. // supported.
  29524. func (c *AutoscalersListCall) OrderBy(orderBy string) *AutoscalersListCall {
  29525. c.urlParams_.Set("orderBy", orderBy)
  29526. return c
  29527. }
  29528. // PageToken sets the optional parameter "pageToken": Specifies a page
  29529. // token to use. Set pageToken to the nextPageToken returned by a
  29530. // previous list request to get the next page of results.
  29531. func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall {
  29532. c.urlParams_.Set("pageToken", pageToken)
  29533. return c
  29534. }
  29535. // Fields allows partial responses to be retrieved. See
  29536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29537. // for more information.
  29538. func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall {
  29539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29540. return c
  29541. }
  29542. // IfNoneMatch sets the optional parameter which makes the operation
  29543. // fail if the object's ETag matches the given value. This is useful for
  29544. // getting updates only after the object has changed since the last
  29545. // request. Use googleapi.IsNotModified to check whether the response
  29546. // error from Do is the result of In-None-Match.
  29547. func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall {
  29548. c.ifNoneMatch_ = entityTag
  29549. return c
  29550. }
  29551. // Context sets the context to be used in this call's Do method. Any
  29552. // pending HTTP request will be aborted if the provided context is
  29553. // canceled.
  29554. func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall {
  29555. c.ctx_ = ctx
  29556. return c
  29557. }
  29558. // Header returns an http.Header that can be modified by the caller to
  29559. // add HTTP headers to the request.
  29560. func (c *AutoscalersListCall) Header() http.Header {
  29561. if c.header_ == nil {
  29562. c.header_ = make(http.Header)
  29563. }
  29564. return c.header_
  29565. }
  29566. func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  29567. reqHeaders := make(http.Header)
  29568. for k, v := range c.header_ {
  29569. reqHeaders[k] = v
  29570. }
  29571. reqHeaders.Set("User-Agent", c.s.userAgent())
  29572. if c.ifNoneMatch_ != "" {
  29573. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29574. }
  29575. var body io.Reader = nil
  29576. c.urlParams_.Set("alt", alt)
  29577. c.urlParams_.Set("prettyPrint", "false")
  29578. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  29579. urls += "?" + c.urlParams_.Encode()
  29580. req, err := http.NewRequest("GET", urls, body)
  29581. if err != nil {
  29582. return nil, err
  29583. }
  29584. req.Header = reqHeaders
  29585. googleapi.Expand(req.URL, map[string]string{
  29586. "project": c.project,
  29587. "zone": c.zone,
  29588. })
  29589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29590. }
  29591. // Do executes the "compute.autoscalers.list" call.
  29592. // Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx
  29593. // status code is an error. Response headers are in either
  29594. // *AutoscalerList.ServerResponse.Header or (if a response was returned
  29595. // at all) in error.(*googleapi.Error).Header. Use
  29596. // googleapi.IsNotModified to check whether the returned error was
  29597. // because http.StatusNotModified was returned.
  29598. func (c *AutoscalersListCall) Do(opts ...googleapi.CallOption) (*AutoscalerList, error) {
  29599. gensupport.SetOptions(c.urlParams_, opts...)
  29600. res, err := c.doRequest("json")
  29601. if res != nil && res.StatusCode == http.StatusNotModified {
  29602. if res.Body != nil {
  29603. res.Body.Close()
  29604. }
  29605. return nil, &googleapi.Error{
  29606. Code: res.StatusCode,
  29607. Header: res.Header,
  29608. }
  29609. }
  29610. if err != nil {
  29611. return nil, err
  29612. }
  29613. defer googleapi.CloseBody(res)
  29614. if err := googleapi.CheckResponse(res); err != nil {
  29615. return nil, err
  29616. }
  29617. ret := &AutoscalerList{
  29618. ServerResponse: googleapi.ServerResponse{
  29619. Header: res.Header,
  29620. HTTPStatusCode: res.StatusCode,
  29621. },
  29622. }
  29623. target := &ret
  29624. if err := gensupport.DecodeResponse(target, res); err != nil {
  29625. return nil, err
  29626. }
  29627. return ret, nil
  29628. // {
  29629. // "description": "Retrieves a list of autoscalers contained within the specified zone.",
  29630. // "httpMethod": "GET",
  29631. // "id": "compute.autoscalers.list",
  29632. // "parameterOrder": [
  29633. // "project",
  29634. // "zone"
  29635. // ],
  29636. // "parameters": {
  29637. // "filter": {
  29638. // "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).",
  29639. // "location": "query",
  29640. // "type": "string"
  29641. // },
  29642. // "maxResults": {
  29643. // "default": "500",
  29644. // "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)",
  29645. // "format": "uint32",
  29646. // "location": "query",
  29647. // "minimum": "0",
  29648. // "type": "integer"
  29649. // },
  29650. // "orderBy": {
  29651. // "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.",
  29652. // "location": "query",
  29653. // "type": "string"
  29654. // },
  29655. // "pageToken": {
  29656. // "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.",
  29657. // "location": "query",
  29658. // "type": "string"
  29659. // },
  29660. // "project": {
  29661. // "description": "Project ID for this request.",
  29662. // "location": "path",
  29663. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29664. // "required": true,
  29665. // "type": "string"
  29666. // },
  29667. // "zone": {
  29668. // "description": "Name of the zone for this request.",
  29669. // "location": "path",
  29670. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29671. // "required": true,
  29672. // "type": "string"
  29673. // }
  29674. // },
  29675. // "path": "{project}/zones/{zone}/autoscalers",
  29676. // "response": {
  29677. // "$ref": "AutoscalerList"
  29678. // },
  29679. // "scopes": [
  29680. // "https://www.googleapis.com/auth/cloud-platform",
  29681. // "https://www.googleapis.com/auth/compute",
  29682. // "https://www.googleapis.com/auth/compute.readonly"
  29683. // ]
  29684. // }
  29685. }
  29686. // Pages invokes f for each page of results.
  29687. // A non-nil error returned from f will halt the iteration.
  29688. // The provided context supersedes any context provided to the Context method.
  29689. func (c *AutoscalersListCall) Pages(ctx context.Context, f func(*AutoscalerList) error) error {
  29690. c.ctx_ = ctx
  29691. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29692. for {
  29693. x, err := c.Do()
  29694. if err != nil {
  29695. return err
  29696. }
  29697. if err := f(x); err != nil {
  29698. return err
  29699. }
  29700. if x.NextPageToken == "" {
  29701. return nil
  29702. }
  29703. c.PageToken(x.NextPageToken)
  29704. }
  29705. }
  29706. // method id "compute.autoscalers.patch":
  29707. type AutoscalersPatchCall struct {
  29708. s *Service
  29709. project string
  29710. zone string
  29711. autoscaler *Autoscaler
  29712. urlParams_ gensupport.URLParams
  29713. ctx_ context.Context
  29714. header_ http.Header
  29715. }
  29716. // Patch: Updates an autoscaler in the specified project using the data
  29717. // included in the request. This method supports PATCH semantics and
  29718. // uses the JSON merge patch format and processing rules.
  29719. func (r *AutoscalersService) Patch(project string, zone string, autoscaler *Autoscaler) *AutoscalersPatchCall {
  29720. c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29721. c.project = project
  29722. c.zone = zone
  29723. c.autoscaler = autoscaler
  29724. return c
  29725. }
  29726. // Autoscaler sets the optional parameter "autoscaler": Name of the
  29727. // autoscaler to patch.
  29728. func (c *AutoscalersPatchCall) Autoscaler(autoscaler string) *AutoscalersPatchCall {
  29729. c.urlParams_.Set("autoscaler", autoscaler)
  29730. return c
  29731. }
  29732. // RequestId sets the optional parameter "requestId": An optional
  29733. // request ID to identify requests. Specify a unique request ID so that
  29734. // if you must retry your request, the server will know to ignore the
  29735. // request if it has already been completed.
  29736. //
  29737. // For example, consider a situation where you make an initial request
  29738. // and the request times out. If you make the request again with the
  29739. // same request ID, the server can check if original operation with the
  29740. // same request ID was received, and if so, will ignore the second
  29741. // request. This prevents clients from accidentally creating duplicate
  29742. // commitments.
  29743. //
  29744. // The request ID must be a valid UUID with the exception that zero UUID
  29745. // is not supported (00000000-0000-0000-0000-000000000000).
  29746. func (c *AutoscalersPatchCall) RequestId(requestId string) *AutoscalersPatchCall {
  29747. c.urlParams_.Set("requestId", requestId)
  29748. return c
  29749. }
  29750. // Fields allows partial responses to be retrieved. See
  29751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29752. // for more information.
  29753. func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall {
  29754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29755. return c
  29756. }
  29757. // Context sets the context to be used in this call's Do method. Any
  29758. // pending HTTP request will be aborted if the provided context is
  29759. // canceled.
  29760. func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall {
  29761. c.ctx_ = ctx
  29762. return c
  29763. }
  29764. // Header returns an http.Header that can be modified by the caller to
  29765. // add HTTP headers to the request.
  29766. func (c *AutoscalersPatchCall) Header() http.Header {
  29767. if c.header_ == nil {
  29768. c.header_ = make(http.Header)
  29769. }
  29770. return c.header_
  29771. }
  29772. func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  29773. reqHeaders := make(http.Header)
  29774. for k, v := range c.header_ {
  29775. reqHeaders[k] = v
  29776. }
  29777. reqHeaders.Set("User-Agent", c.s.userAgent())
  29778. var body io.Reader = nil
  29779. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  29780. if err != nil {
  29781. return nil, err
  29782. }
  29783. reqHeaders.Set("Content-Type", "application/json")
  29784. c.urlParams_.Set("alt", alt)
  29785. c.urlParams_.Set("prettyPrint", "false")
  29786. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  29787. urls += "?" + c.urlParams_.Encode()
  29788. req, err := http.NewRequest("PATCH", urls, body)
  29789. if err != nil {
  29790. return nil, err
  29791. }
  29792. req.Header = reqHeaders
  29793. googleapi.Expand(req.URL, map[string]string{
  29794. "project": c.project,
  29795. "zone": c.zone,
  29796. })
  29797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29798. }
  29799. // Do executes the "compute.autoscalers.patch" call.
  29800. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29801. // status code is an error. Response headers are in either
  29802. // *Operation.ServerResponse.Header or (if a response was returned at
  29803. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29804. // to check whether the returned error was because
  29805. // http.StatusNotModified was returned.
  29806. func (c *AutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29807. gensupport.SetOptions(c.urlParams_, opts...)
  29808. res, err := c.doRequest("json")
  29809. if res != nil && res.StatusCode == http.StatusNotModified {
  29810. if res.Body != nil {
  29811. res.Body.Close()
  29812. }
  29813. return nil, &googleapi.Error{
  29814. Code: res.StatusCode,
  29815. Header: res.Header,
  29816. }
  29817. }
  29818. if err != nil {
  29819. return nil, err
  29820. }
  29821. defer googleapi.CloseBody(res)
  29822. if err := googleapi.CheckResponse(res); err != nil {
  29823. return nil, err
  29824. }
  29825. ret := &Operation{
  29826. ServerResponse: googleapi.ServerResponse{
  29827. Header: res.Header,
  29828. HTTPStatusCode: res.StatusCode,
  29829. },
  29830. }
  29831. target := &ret
  29832. if err := gensupport.DecodeResponse(target, res); err != nil {
  29833. return nil, err
  29834. }
  29835. return ret, nil
  29836. // {
  29837. // "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.",
  29838. // "httpMethod": "PATCH",
  29839. // "id": "compute.autoscalers.patch",
  29840. // "parameterOrder": [
  29841. // "project",
  29842. // "zone"
  29843. // ],
  29844. // "parameters": {
  29845. // "autoscaler": {
  29846. // "description": "Name of the autoscaler to patch.",
  29847. // "location": "query",
  29848. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  29849. // "type": "string"
  29850. // },
  29851. // "project": {
  29852. // "description": "Project ID for this request.",
  29853. // "location": "path",
  29854. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  29855. // "required": true,
  29856. // "type": "string"
  29857. // },
  29858. // "requestId": {
  29859. // "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).",
  29860. // "location": "query",
  29861. // "type": "string"
  29862. // },
  29863. // "zone": {
  29864. // "description": "Name of the zone for this request.",
  29865. // "location": "path",
  29866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  29867. // "required": true,
  29868. // "type": "string"
  29869. // }
  29870. // },
  29871. // "path": "{project}/zones/{zone}/autoscalers",
  29872. // "request": {
  29873. // "$ref": "Autoscaler"
  29874. // },
  29875. // "response": {
  29876. // "$ref": "Operation"
  29877. // },
  29878. // "scopes": [
  29879. // "https://www.googleapis.com/auth/cloud-platform",
  29880. // "https://www.googleapis.com/auth/compute"
  29881. // ]
  29882. // }
  29883. }
  29884. // method id "compute.autoscalers.update":
  29885. type AutoscalersUpdateCall struct {
  29886. s *Service
  29887. project string
  29888. zone string
  29889. autoscaler *Autoscaler
  29890. urlParams_ gensupport.URLParams
  29891. ctx_ context.Context
  29892. header_ http.Header
  29893. }
  29894. // Update: Updates an autoscaler in the specified project using the data
  29895. // included in the request.
  29896. func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall {
  29897. c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29898. c.project = project
  29899. c.zone = zone
  29900. c.autoscaler = autoscaler
  29901. return c
  29902. }
  29903. // Autoscaler sets the optional parameter "autoscaler": Name of the
  29904. // autoscaler to update.
  29905. func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall {
  29906. c.urlParams_.Set("autoscaler", autoscaler)
  29907. return c
  29908. }
  29909. // RequestId sets the optional parameter "requestId": An optional
  29910. // request ID to identify requests. Specify a unique request ID so that
  29911. // if you must retry your request, the server will know to ignore the
  29912. // request if it has already been completed.
  29913. //
  29914. // For example, consider a situation where you make an initial request
  29915. // and the request times out. If you make the request again with the
  29916. // same request ID, the server can check if original operation with the
  29917. // same request ID was received, and if so, will ignore the second
  29918. // request. This prevents clients from accidentally creating duplicate
  29919. // commitments.
  29920. //
  29921. // The request ID must be a valid UUID with the exception that zero UUID
  29922. // is not supported (00000000-0000-0000-0000-000000000000).
  29923. func (c *AutoscalersUpdateCall) RequestId(requestId string) *AutoscalersUpdateCall {
  29924. c.urlParams_.Set("requestId", requestId)
  29925. return c
  29926. }
  29927. // Fields allows partial responses to be retrieved. See
  29928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29929. // for more information.
  29930. func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall {
  29931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29932. return c
  29933. }
  29934. // Context sets the context to be used in this call's Do method. Any
  29935. // pending HTTP request will be aborted if the provided context is
  29936. // canceled.
  29937. func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall {
  29938. c.ctx_ = ctx
  29939. return c
  29940. }
  29941. // Header returns an http.Header that can be modified by the caller to
  29942. // add HTTP headers to the request.
  29943. func (c *AutoscalersUpdateCall) Header() http.Header {
  29944. if c.header_ == nil {
  29945. c.header_ = make(http.Header)
  29946. }
  29947. return c.header_
  29948. }
  29949. func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  29950. reqHeaders := make(http.Header)
  29951. for k, v := range c.header_ {
  29952. reqHeaders[k] = v
  29953. }
  29954. reqHeaders.Set("User-Agent", c.s.userAgent())
  29955. var body io.Reader = nil
  29956. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  29957. if err != nil {
  29958. return nil, err
  29959. }
  29960. reqHeaders.Set("Content-Type", "application/json")
  29961. c.urlParams_.Set("alt", alt)
  29962. c.urlParams_.Set("prettyPrint", "false")
  29963. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers")
  29964. urls += "?" + c.urlParams_.Encode()
  29965. req, err := http.NewRequest("PUT", urls, body)
  29966. if err != nil {
  29967. return nil, err
  29968. }
  29969. req.Header = reqHeaders
  29970. googleapi.Expand(req.URL, map[string]string{
  29971. "project": c.project,
  29972. "zone": c.zone,
  29973. })
  29974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29975. }
  29976. // Do executes the "compute.autoscalers.update" call.
  29977. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  29978. // status code is an error. Response headers are in either
  29979. // *Operation.ServerResponse.Header or (if a response was returned at
  29980. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  29981. // to check whether the returned error was because
  29982. // http.StatusNotModified was returned.
  29983. func (c *AutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  29984. gensupport.SetOptions(c.urlParams_, opts...)
  29985. res, err := c.doRequest("json")
  29986. if res != nil && res.StatusCode == http.StatusNotModified {
  29987. if res.Body != nil {
  29988. res.Body.Close()
  29989. }
  29990. return nil, &googleapi.Error{
  29991. Code: res.StatusCode,
  29992. Header: res.Header,
  29993. }
  29994. }
  29995. if err != nil {
  29996. return nil, err
  29997. }
  29998. defer googleapi.CloseBody(res)
  29999. if err := googleapi.CheckResponse(res); err != nil {
  30000. return nil, err
  30001. }
  30002. ret := &Operation{
  30003. ServerResponse: googleapi.ServerResponse{
  30004. Header: res.Header,
  30005. HTTPStatusCode: res.StatusCode,
  30006. },
  30007. }
  30008. target := &ret
  30009. if err := gensupport.DecodeResponse(target, res); err != nil {
  30010. return nil, err
  30011. }
  30012. return ret, nil
  30013. // {
  30014. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  30015. // "httpMethod": "PUT",
  30016. // "id": "compute.autoscalers.update",
  30017. // "parameterOrder": [
  30018. // "project",
  30019. // "zone"
  30020. // ],
  30021. // "parameters": {
  30022. // "autoscaler": {
  30023. // "description": "Name of the autoscaler to update.",
  30024. // "location": "query",
  30025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30026. // "type": "string"
  30027. // },
  30028. // "project": {
  30029. // "description": "Project ID for this request.",
  30030. // "location": "path",
  30031. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30032. // "required": true,
  30033. // "type": "string"
  30034. // },
  30035. // "requestId": {
  30036. // "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).",
  30037. // "location": "query",
  30038. // "type": "string"
  30039. // },
  30040. // "zone": {
  30041. // "description": "Name of the zone for this request.",
  30042. // "location": "path",
  30043. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  30044. // "required": true,
  30045. // "type": "string"
  30046. // }
  30047. // },
  30048. // "path": "{project}/zones/{zone}/autoscalers",
  30049. // "request": {
  30050. // "$ref": "Autoscaler"
  30051. // },
  30052. // "response": {
  30053. // "$ref": "Operation"
  30054. // },
  30055. // "scopes": [
  30056. // "https://www.googleapis.com/auth/cloud-platform",
  30057. // "https://www.googleapis.com/auth/compute"
  30058. // ]
  30059. // }
  30060. }
  30061. // method id "compute.backendBuckets.addSignedUrlKey":
  30062. type BackendBucketsAddSignedUrlKeyCall struct {
  30063. s *Service
  30064. project string
  30065. backendBucket string
  30066. signedurlkey *SignedUrlKey
  30067. urlParams_ gensupport.URLParams
  30068. ctx_ context.Context
  30069. header_ http.Header
  30070. }
  30071. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  30072. // for this backend bucket.
  30073. func (r *BackendBucketsService) AddSignedUrlKey(project string, backendBucket string, signedurlkey *SignedUrlKey) *BackendBucketsAddSignedUrlKeyCall {
  30074. c := &BackendBucketsAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30075. c.project = project
  30076. c.backendBucket = backendBucket
  30077. c.signedurlkey = signedurlkey
  30078. return c
  30079. }
  30080. // RequestId sets the optional parameter "requestId": An optional
  30081. // request ID to identify requests. Specify a unique request ID so that
  30082. // if you must retry your request, the server will know to ignore the
  30083. // request if it has already been completed.
  30084. //
  30085. // For example, consider a situation where you make an initial request
  30086. // and the request times out. If you make the request again with the
  30087. // same request ID, the server can check if original operation with the
  30088. // same request ID was received, and if so, will ignore the second
  30089. // request. This prevents clients from accidentally creating duplicate
  30090. // commitments.
  30091. //
  30092. // The request ID must be a valid UUID with the exception that zero UUID
  30093. // is not supported (00000000-0000-0000-0000-000000000000).
  30094. func (c *BackendBucketsAddSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsAddSignedUrlKeyCall {
  30095. c.urlParams_.Set("requestId", requestId)
  30096. return c
  30097. }
  30098. // Fields allows partial responses to be retrieved. See
  30099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30100. // for more information.
  30101. func (c *BackendBucketsAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsAddSignedUrlKeyCall {
  30102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30103. return c
  30104. }
  30105. // Context sets the context to be used in this call's Do method. Any
  30106. // pending HTTP request will be aborted if the provided context is
  30107. // canceled.
  30108. func (c *BackendBucketsAddSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsAddSignedUrlKeyCall {
  30109. c.ctx_ = ctx
  30110. return c
  30111. }
  30112. // Header returns an http.Header that can be modified by the caller to
  30113. // add HTTP headers to the request.
  30114. func (c *BackendBucketsAddSignedUrlKeyCall) Header() http.Header {
  30115. if c.header_ == nil {
  30116. c.header_ = make(http.Header)
  30117. }
  30118. return c.header_
  30119. }
  30120. func (c *BackendBucketsAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  30121. reqHeaders := make(http.Header)
  30122. for k, v := range c.header_ {
  30123. reqHeaders[k] = v
  30124. }
  30125. reqHeaders.Set("User-Agent", c.s.userAgent())
  30126. var body io.Reader = nil
  30127. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  30128. if err != nil {
  30129. return nil, err
  30130. }
  30131. reqHeaders.Set("Content-Type", "application/json")
  30132. c.urlParams_.Set("alt", alt)
  30133. c.urlParams_.Set("prettyPrint", "false")
  30134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey")
  30135. urls += "?" + c.urlParams_.Encode()
  30136. req, err := http.NewRequest("POST", urls, body)
  30137. if err != nil {
  30138. return nil, err
  30139. }
  30140. req.Header = reqHeaders
  30141. googleapi.Expand(req.URL, map[string]string{
  30142. "project": c.project,
  30143. "backendBucket": c.backendBucket,
  30144. })
  30145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30146. }
  30147. // Do executes the "compute.backendBuckets.addSignedUrlKey" call.
  30148. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30149. // status code is an error. Response headers are in either
  30150. // *Operation.ServerResponse.Header or (if a response was returned at
  30151. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30152. // to check whether the returned error was because
  30153. // http.StatusNotModified was returned.
  30154. func (c *BackendBucketsAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30155. gensupport.SetOptions(c.urlParams_, opts...)
  30156. res, err := c.doRequest("json")
  30157. if res != nil && res.StatusCode == http.StatusNotModified {
  30158. if res.Body != nil {
  30159. res.Body.Close()
  30160. }
  30161. return nil, &googleapi.Error{
  30162. Code: res.StatusCode,
  30163. Header: res.Header,
  30164. }
  30165. }
  30166. if err != nil {
  30167. return nil, err
  30168. }
  30169. defer googleapi.CloseBody(res)
  30170. if err := googleapi.CheckResponse(res); err != nil {
  30171. return nil, err
  30172. }
  30173. ret := &Operation{
  30174. ServerResponse: googleapi.ServerResponse{
  30175. Header: res.Header,
  30176. HTTPStatusCode: res.StatusCode,
  30177. },
  30178. }
  30179. target := &ret
  30180. if err := gensupport.DecodeResponse(target, res); err != nil {
  30181. return nil, err
  30182. }
  30183. return ret, nil
  30184. // {
  30185. // "description": "Adds a key for validating requests with signed URLs for this backend bucket.",
  30186. // "httpMethod": "POST",
  30187. // "id": "compute.backendBuckets.addSignedUrlKey",
  30188. // "parameterOrder": [
  30189. // "project",
  30190. // "backendBucket"
  30191. // ],
  30192. // "parameters": {
  30193. // "backendBucket": {
  30194. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  30195. // "location": "path",
  30196. // "required": true,
  30197. // "type": "string"
  30198. // },
  30199. // "project": {
  30200. // "description": "Project ID for this request.",
  30201. // "location": "path",
  30202. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30203. // "required": true,
  30204. // "type": "string"
  30205. // },
  30206. // "requestId": {
  30207. // "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).",
  30208. // "location": "query",
  30209. // "type": "string"
  30210. // }
  30211. // },
  30212. // "path": "{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey",
  30213. // "request": {
  30214. // "$ref": "SignedUrlKey"
  30215. // },
  30216. // "response": {
  30217. // "$ref": "Operation"
  30218. // },
  30219. // "scopes": [
  30220. // "https://www.googleapis.com/auth/cloud-platform",
  30221. // "https://www.googleapis.com/auth/compute"
  30222. // ]
  30223. // }
  30224. }
  30225. // method id "compute.backendBuckets.delete":
  30226. type BackendBucketsDeleteCall struct {
  30227. s *Service
  30228. project string
  30229. backendBucket string
  30230. urlParams_ gensupport.URLParams
  30231. ctx_ context.Context
  30232. header_ http.Header
  30233. }
  30234. // Delete: Deletes the specified BackendBucket resource.
  30235. func (r *BackendBucketsService) Delete(project string, backendBucket string) *BackendBucketsDeleteCall {
  30236. c := &BackendBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30237. c.project = project
  30238. c.backendBucket = backendBucket
  30239. return c
  30240. }
  30241. // RequestId sets the optional parameter "requestId": An optional
  30242. // request ID to identify requests. Specify a unique request ID so that
  30243. // if you must retry your request, the server will know to ignore the
  30244. // request if it has already been completed.
  30245. //
  30246. // For example, consider a situation where you make an initial request
  30247. // and the request times out. If you make the request again with the
  30248. // same request ID, the server can check if original operation with the
  30249. // same request ID was received, and if so, will ignore the second
  30250. // request. This prevents clients from accidentally creating duplicate
  30251. // commitments.
  30252. //
  30253. // The request ID must be a valid UUID with the exception that zero UUID
  30254. // is not supported (00000000-0000-0000-0000-000000000000).
  30255. func (c *BackendBucketsDeleteCall) RequestId(requestId string) *BackendBucketsDeleteCall {
  30256. c.urlParams_.Set("requestId", requestId)
  30257. return c
  30258. }
  30259. // Fields allows partial responses to be retrieved. See
  30260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30261. // for more information.
  30262. func (c *BackendBucketsDeleteCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteCall {
  30263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30264. return c
  30265. }
  30266. // Context sets the context to be used in this call's Do method. Any
  30267. // pending HTTP request will be aborted if the provided context is
  30268. // canceled.
  30269. func (c *BackendBucketsDeleteCall) Context(ctx context.Context) *BackendBucketsDeleteCall {
  30270. c.ctx_ = ctx
  30271. return c
  30272. }
  30273. // Header returns an http.Header that can be modified by the caller to
  30274. // add HTTP headers to the request.
  30275. func (c *BackendBucketsDeleteCall) Header() http.Header {
  30276. if c.header_ == nil {
  30277. c.header_ = make(http.Header)
  30278. }
  30279. return c.header_
  30280. }
  30281. func (c *BackendBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
  30282. reqHeaders := make(http.Header)
  30283. for k, v := range c.header_ {
  30284. reqHeaders[k] = v
  30285. }
  30286. reqHeaders.Set("User-Agent", c.s.userAgent())
  30287. var body io.Reader = nil
  30288. c.urlParams_.Set("alt", alt)
  30289. c.urlParams_.Set("prettyPrint", "false")
  30290. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  30291. urls += "?" + c.urlParams_.Encode()
  30292. req, err := http.NewRequest("DELETE", urls, body)
  30293. if err != nil {
  30294. return nil, err
  30295. }
  30296. req.Header = reqHeaders
  30297. googleapi.Expand(req.URL, map[string]string{
  30298. "project": c.project,
  30299. "backendBucket": c.backendBucket,
  30300. })
  30301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30302. }
  30303. // Do executes the "compute.backendBuckets.delete" call.
  30304. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30305. // status code is an error. Response headers are in either
  30306. // *Operation.ServerResponse.Header or (if a response was returned at
  30307. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30308. // to check whether the returned error was because
  30309. // http.StatusNotModified was returned.
  30310. func (c *BackendBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30311. gensupport.SetOptions(c.urlParams_, opts...)
  30312. res, err := c.doRequest("json")
  30313. if res != nil && res.StatusCode == http.StatusNotModified {
  30314. if res.Body != nil {
  30315. res.Body.Close()
  30316. }
  30317. return nil, &googleapi.Error{
  30318. Code: res.StatusCode,
  30319. Header: res.Header,
  30320. }
  30321. }
  30322. if err != nil {
  30323. return nil, err
  30324. }
  30325. defer googleapi.CloseBody(res)
  30326. if err := googleapi.CheckResponse(res); err != nil {
  30327. return nil, err
  30328. }
  30329. ret := &Operation{
  30330. ServerResponse: googleapi.ServerResponse{
  30331. Header: res.Header,
  30332. HTTPStatusCode: res.StatusCode,
  30333. },
  30334. }
  30335. target := &ret
  30336. if err := gensupport.DecodeResponse(target, res); err != nil {
  30337. return nil, err
  30338. }
  30339. return ret, nil
  30340. // {
  30341. // "description": "Deletes the specified BackendBucket resource.",
  30342. // "httpMethod": "DELETE",
  30343. // "id": "compute.backendBuckets.delete",
  30344. // "parameterOrder": [
  30345. // "project",
  30346. // "backendBucket"
  30347. // ],
  30348. // "parameters": {
  30349. // "backendBucket": {
  30350. // "description": "Name of the BackendBucket resource to delete.",
  30351. // "location": "path",
  30352. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30353. // "required": true,
  30354. // "type": "string"
  30355. // },
  30356. // "project": {
  30357. // "description": "Project ID for this request.",
  30358. // "location": "path",
  30359. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30360. // "required": true,
  30361. // "type": "string"
  30362. // },
  30363. // "requestId": {
  30364. // "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).",
  30365. // "location": "query",
  30366. // "type": "string"
  30367. // }
  30368. // },
  30369. // "path": "{project}/global/backendBuckets/{backendBucket}",
  30370. // "response": {
  30371. // "$ref": "Operation"
  30372. // },
  30373. // "scopes": [
  30374. // "https://www.googleapis.com/auth/cloud-platform",
  30375. // "https://www.googleapis.com/auth/compute"
  30376. // ]
  30377. // }
  30378. }
  30379. // method id "compute.backendBuckets.deleteSignedUrlKey":
  30380. type BackendBucketsDeleteSignedUrlKeyCall struct {
  30381. s *Service
  30382. project string
  30383. backendBucket string
  30384. urlParams_ gensupport.URLParams
  30385. ctx_ context.Context
  30386. header_ http.Header
  30387. }
  30388. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  30389. // URLs for this backend bucket.
  30390. func (r *BackendBucketsService) DeleteSignedUrlKey(project string, backendBucket string, keyName string) *BackendBucketsDeleteSignedUrlKeyCall {
  30391. c := &BackendBucketsDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30392. c.project = project
  30393. c.backendBucket = backendBucket
  30394. c.urlParams_.Set("keyName", keyName)
  30395. return c
  30396. }
  30397. // RequestId sets the optional parameter "requestId": An optional
  30398. // request ID to identify requests. Specify a unique request ID so that
  30399. // if you must retry your request, the server will know to ignore the
  30400. // request if it has already been completed.
  30401. //
  30402. // For example, consider a situation where you make an initial request
  30403. // and the request times out. If you make the request again with the
  30404. // same request ID, the server can check if original operation with the
  30405. // same request ID was received, and if so, will ignore the second
  30406. // request. This prevents clients from accidentally creating duplicate
  30407. // commitments.
  30408. //
  30409. // The request ID must be a valid UUID with the exception that zero UUID
  30410. // is not supported (00000000-0000-0000-0000-000000000000).
  30411. func (c *BackendBucketsDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendBucketsDeleteSignedUrlKeyCall {
  30412. c.urlParams_.Set("requestId", requestId)
  30413. return c
  30414. }
  30415. // Fields allows partial responses to be retrieved. See
  30416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30417. // for more information.
  30418. func (c *BackendBucketsDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendBucketsDeleteSignedUrlKeyCall {
  30419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30420. return c
  30421. }
  30422. // Context sets the context to be used in this call's Do method. Any
  30423. // pending HTTP request will be aborted if the provided context is
  30424. // canceled.
  30425. func (c *BackendBucketsDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendBucketsDeleteSignedUrlKeyCall {
  30426. c.ctx_ = ctx
  30427. return c
  30428. }
  30429. // Header returns an http.Header that can be modified by the caller to
  30430. // add HTTP headers to the request.
  30431. func (c *BackendBucketsDeleteSignedUrlKeyCall) Header() http.Header {
  30432. if c.header_ == nil {
  30433. c.header_ = make(http.Header)
  30434. }
  30435. return c.header_
  30436. }
  30437. func (c *BackendBucketsDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  30438. reqHeaders := make(http.Header)
  30439. for k, v := range c.header_ {
  30440. reqHeaders[k] = v
  30441. }
  30442. reqHeaders.Set("User-Agent", c.s.userAgent())
  30443. var body io.Reader = nil
  30444. c.urlParams_.Set("alt", alt)
  30445. c.urlParams_.Set("prettyPrint", "false")
  30446. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey")
  30447. urls += "?" + c.urlParams_.Encode()
  30448. req, err := http.NewRequest("POST", urls, body)
  30449. if err != nil {
  30450. return nil, err
  30451. }
  30452. req.Header = reqHeaders
  30453. googleapi.Expand(req.URL, map[string]string{
  30454. "project": c.project,
  30455. "backendBucket": c.backendBucket,
  30456. })
  30457. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30458. }
  30459. // Do executes the "compute.backendBuckets.deleteSignedUrlKey" call.
  30460. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30461. // status code is an error. Response headers are in either
  30462. // *Operation.ServerResponse.Header or (if a response was returned at
  30463. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30464. // to check whether the returned error was because
  30465. // http.StatusNotModified was returned.
  30466. func (c *BackendBucketsDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30467. gensupport.SetOptions(c.urlParams_, opts...)
  30468. res, err := c.doRequest("json")
  30469. if res != nil && res.StatusCode == http.StatusNotModified {
  30470. if res.Body != nil {
  30471. res.Body.Close()
  30472. }
  30473. return nil, &googleapi.Error{
  30474. Code: res.StatusCode,
  30475. Header: res.Header,
  30476. }
  30477. }
  30478. if err != nil {
  30479. return nil, err
  30480. }
  30481. defer googleapi.CloseBody(res)
  30482. if err := googleapi.CheckResponse(res); err != nil {
  30483. return nil, err
  30484. }
  30485. ret := &Operation{
  30486. ServerResponse: googleapi.ServerResponse{
  30487. Header: res.Header,
  30488. HTTPStatusCode: res.StatusCode,
  30489. },
  30490. }
  30491. target := &ret
  30492. if err := gensupport.DecodeResponse(target, res); err != nil {
  30493. return nil, err
  30494. }
  30495. return ret, nil
  30496. // {
  30497. // "description": "Deletes a key for validating requests with signed URLs for this backend bucket.",
  30498. // "httpMethod": "POST",
  30499. // "id": "compute.backendBuckets.deleteSignedUrlKey",
  30500. // "parameterOrder": [
  30501. // "project",
  30502. // "backendBucket",
  30503. // "keyName"
  30504. // ],
  30505. // "parameters": {
  30506. // "backendBucket": {
  30507. // "description": "Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  30508. // "location": "path",
  30509. // "required": true,
  30510. // "type": "string"
  30511. // },
  30512. // "keyName": {
  30513. // "description": "The name of the Signed URL Key to delete.",
  30514. // "location": "query",
  30515. // "required": true,
  30516. // "type": "string"
  30517. // },
  30518. // "project": {
  30519. // "description": "Project ID for this request.",
  30520. // "location": "path",
  30521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30522. // "required": true,
  30523. // "type": "string"
  30524. // },
  30525. // "requestId": {
  30526. // "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).",
  30527. // "location": "query",
  30528. // "type": "string"
  30529. // }
  30530. // },
  30531. // "path": "{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey",
  30532. // "response": {
  30533. // "$ref": "Operation"
  30534. // },
  30535. // "scopes": [
  30536. // "https://www.googleapis.com/auth/cloud-platform",
  30537. // "https://www.googleapis.com/auth/compute"
  30538. // ]
  30539. // }
  30540. }
  30541. // method id "compute.backendBuckets.get":
  30542. type BackendBucketsGetCall struct {
  30543. s *Service
  30544. project string
  30545. backendBucket string
  30546. urlParams_ gensupport.URLParams
  30547. ifNoneMatch_ string
  30548. ctx_ context.Context
  30549. header_ http.Header
  30550. }
  30551. // Get: Returns the specified BackendBucket resource. Gets a list of
  30552. // available backend buckets by making a list() request.
  30553. func (r *BackendBucketsService) Get(project string, backendBucket string) *BackendBucketsGetCall {
  30554. c := &BackendBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30555. c.project = project
  30556. c.backendBucket = backendBucket
  30557. return c
  30558. }
  30559. // Fields allows partial responses to be retrieved. See
  30560. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30561. // for more information.
  30562. func (c *BackendBucketsGetCall) Fields(s ...googleapi.Field) *BackendBucketsGetCall {
  30563. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30564. return c
  30565. }
  30566. // IfNoneMatch sets the optional parameter which makes the operation
  30567. // fail if the object's ETag matches the given value. This is useful for
  30568. // getting updates only after the object has changed since the last
  30569. // request. Use googleapi.IsNotModified to check whether the response
  30570. // error from Do is the result of In-None-Match.
  30571. func (c *BackendBucketsGetCall) IfNoneMatch(entityTag string) *BackendBucketsGetCall {
  30572. c.ifNoneMatch_ = entityTag
  30573. return c
  30574. }
  30575. // Context sets the context to be used in this call's Do method. Any
  30576. // pending HTTP request will be aborted if the provided context is
  30577. // canceled.
  30578. func (c *BackendBucketsGetCall) Context(ctx context.Context) *BackendBucketsGetCall {
  30579. c.ctx_ = ctx
  30580. return c
  30581. }
  30582. // Header returns an http.Header that can be modified by the caller to
  30583. // add HTTP headers to the request.
  30584. func (c *BackendBucketsGetCall) Header() http.Header {
  30585. if c.header_ == nil {
  30586. c.header_ = make(http.Header)
  30587. }
  30588. return c.header_
  30589. }
  30590. func (c *BackendBucketsGetCall) doRequest(alt string) (*http.Response, error) {
  30591. reqHeaders := make(http.Header)
  30592. for k, v := range c.header_ {
  30593. reqHeaders[k] = v
  30594. }
  30595. reqHeaders.Set("User-Agent", c.s.userAgent())
  30596. if c.ifNoneMatch_ != "" {
  30597. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30598. }
  30599. var body io.Reader = nil
  30600. c.urlParams_.Set("alt", alt)
  30601. c.urlParams_.Set("prettyPrint", "false")
  30602. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  30603. urls += "?" + c.urlParams_.Encode()
  30604. req, err := http.NewRequest("GET", urls, body)
  30605. if err != nil {
  30606. return nil, err
  30607. }
  30608. req.Header = reqHeaders
  30609. googleapi.Expand(req.URL, map[string]string{
  30610. "project": c.project,
  30611. "backendBucket": c.backendBucket,
  30612. })
  30613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30614. }
  30615. // Do executes the "compute.backendBuckets.get" call.
  30616. // Exactly one of *BackendBucket or error will be non-nil. Any non-2xx
  30617. // status code is an error. Response headers are in either
  30618. // *BackendBucket.ServerResponse.Header or (if a response was returned
  30619. // at all) in error.(*googleapi.Error).Header. Use
  30620. // googleapi.IsNotModified to check whether the returned error was
  30621. // because http.StatusNotModified was returned.
  30622. func (c *BackendBucketsGetCall) Do(opts ...googleapi.CallOption) (*BackendBucket, error) {
  30623. gensupport.SetOptions(c.urlParams_, opts...)
  30624. res, err := c.doRequest("json")
  30625. if res != nil && res.StatusCode == http.StatusNotModified {
  30626. if res.Body != nil {
  30627. res.Body.Close()
  30628. }
  30629. return nil, &googleapi.Error{
  30630. Code: res.StatusCode,
  30631. Header: res.Header,
  30632. }
  30633. }
  30634. if err != nil {
  30635. return nil, err
  30636. }
  30637. defer googleapi.CloseBody(res)
  30638. if err := googleapi.CheckResponse(res); err != nil {
  30639. return nil, err
  30640. }
  30641. ret := &BackendBucket{
  30642. ServerResponse: googleapi.ServerResponse{
  30643. Header: res.Header,
  30644. HTTPStatusCode: res.StatusCode,
  30645. },
  30646. }
  30647. target := &ret
  30648. if err := gensupport.DecodeResponse(target, res); err != nil {
  30649. return nil, err
  30650. }
  30651. return ret, nil
  30652. // {
  30653. // "description": "Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.",
  30654. // "httpMethod": "GET",
  30655. // "id": "compute.backendBuckets.get",
  30656. // "parameterOrder": [
  30657. // "project",
  30658. // "backendBucket"
  30659. // ],
  30660. // "parameters": {
  30661. // "backendBucket": {
  30662. // "description": "Name of the BackendBucket resource to return.",
  30663. // "location": "path",
  30664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  30665. // "required": true,
  30666. // "type": "string"
  30667. // },
  30668. // "project": {
  30669. // "description": "Project ID for this request.",
  30670. // "location": "path",
  30671. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30672. // "required": true,
  30673. // "type": "string"
  30674. // }
  30675. // },
  30676. // "path": "{project}/global/backendBuckets/{backendBucket}",
  30677. // "response": {
  30678. // "$ref": "BackendBucket"
  30679. // },
  30680. // "scopes": [
  30681. // "https://www.googleapis.com/auth/cloud-platform",
  30682. // "https://www.googleapis.com/auth/compute",
  30683. // "https://www.googleapis.com/auth/compute.readonly"
  30684. // ]
  30685. // }
  30686. }
  30687. // method id "compute.backendBuckets.insert":
  30688. type BackendBucketsInsertCall struct {
  30689. s *Service
  30690. project string
  30691. backendbucket *BackendBucket
  30692. urlParams_ gensupport.URLParams
  30693. ctx_ context.Context
  30694. header_ http.Header
  30695. }
  30696. // Insert: Creates a BackendBucket resource in the specified project
  30697. // using the data included in the request.
  30698. func (r *BackendBucketsService) Insert(project string, backendbucket *BackendBucket) *BackendBucketsInsertCall {
  30699. c := &BackendBucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30700. c.project = project
  30701. c.backendbucket = backendbucket
  30702. return c
  30703. }
  30704. // RequestId sets the optional parameter "requestId": An optional
  30705. // request ID to identify requests. Specify a unique request ID so that
  30706. // if you must retry your request, the server will know to ignore the
  30707. // request if it has already been completed.
  30708. //
  30709. // For example, consider a situation where you make an initial request
  30710. // and the request times out. If you make the request again with the
  30711. // same request ID, the server can check if original operation with the
  30712. // same request ID was received, and if so, will ignore the second
  30713. // request. This prevents clients from accidentally creating duplicate
  30714. // commitments.
  30715. //
  30716. // The request ID must be a valid UUID with the exception that zero UUID
  30717. // is not supported (00000000-0000-0000-0000-000000000000).
  30718. func (c *BackendBucketsInsertCall) RequestId(requestId string) *BackendBucketsInsertCall {
  30719. c.urlParams_.Set("requestId", requestId)
  30720. return c
  30721. }
  30722. // Fields allows partial responses to be retrieved. See
  30723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30724. // for more information.
  30725. func (c *BackendBucketsInsertCall) Fields(s ...googleapi.Field) *BackendBucketsInsertCall {
  30726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30727. return c
  30728. }
  30729. // Context sets the context to be used in this call's Do method. Any
  30730. // pending HTTP request will be aborted if the provided context is
  30731. // canceled.
  30732. func (c *BackendBucketsInsertCall) Context(ctx context.Context) *BackendBucketsInsertCall {
  30733. c.ctx_ = ctx
  30734. return c
  30735. }
  30736. // Header returns an http.Header that can be modified by the caller to
  30737. // add HTTP headers to the request.
  30738. func (c *BackendBucketsInsertCall) Header() http.Header {
  30739. if c.header_ == nil {
  30740. c.header_ = make(http.Header)
  30741. }
  30742. return c.header_
  30743. }
  30744. func (c *BackendBucketsInsertCall) doRequest(alt string) (*http.Response, error) {
  30745. reqHeaders := make(http.Header)
  30746. for k, v := range c.header_ {
  30747. reqHeaders[k] = v
  30748. }
  30749. reqHeaders.Set("User-Agent", c.s.userAgent())
  30750. var body io.Reader = nil
  30751. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  30752. if err != nil {
  30753. return nil, err
  30754. }
  30755. reqHeaders.Set("Content-Type", "application/json")
  30756. c.urlParams_.Set("alt", alt)
  30757. c.urlParams_.Set("prettyPrint", "false")
  30758. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  30759. urls += "?" + c.urlParams_.Encode()
  30760. req, err := http.NewRequest("POST", urls, body)
  30761. if err != nil {
  30762. return nil, err
  30763. }
  30764. req.Header = reqHeaders
  30765. googleapi.Expand(req.URL, map[string]string{
  30766. "project": c.project,
  30767. })
  30768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30769. }
  30770. // Do executes the "compute.backendBuckets.insert" call.
  30771. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  30772. // status code is an error. Response headers are in either
  30773. // *Operation.ServerResponse.Header or (if a response was returned at
  30774. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30775. // to check whether the returned error was because
  30776. // http.StatusNotModified was returned.
  30777. func (c *BackendBucketsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  30778. gensupport.SetOptions(c.urlParams_, opts...)
  30779. res, err := c.doRequest("json")
  30780. if res != nil && res.StatusCode == http.StatusNotModified {
  30781. if res.Body != nil {
  30782. res.Body.Close()
  30783. }
  30784. return nil, &googleapi.Error{
  30785. Code: res.StatusCode,
  30786. Header: res.Header,
  30787. }
  30788. }
  30789. if err != nil {
  30790. return nil, err
  30791. }
  30792. defer googleapi.CloseBody(res)
  30793. if err := googleapi.CheckResponse(res); err != nil {
  30794. return nil, err
  30795. }
  30796. ret := &Operation{
  30797. ServerResponse: googleapi.ServerResponse{
  30798. Header: res.Header,
  30799. HTTPStatusCode: res.StatusCode,
  30800. },
  30801. }
  30802. target := &ret
  30803. if err := gensupport.DecodeResponse(target, res); err != nil {
  30804. return nil, err
  30805. }
  30806. return ret, nil
  30807. // {
  30808. // "description": "Creates a BackendBucket resource in the specified project using the data included in the request.",
  30809. // "httpMethod": "POST",
  30810. // "id": "compute.backendBuckets.insert",
  30811. // "parameterOrder": [
  30812. // "project"
  30813. // ],
  30814. // "parameters": {
  30815. // "project": {
  30816. // "description": "Project ID for this request.",
  30817. // "location": "path",
  30818. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  30819. // "required": true,
  30820. // "type": "string"
  30821. // },
  30822. // "requestId": {
  30823. // "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).",
  30824. // "location": "query",
  30825. // "type": "string"
  30826. // }
  30827. // },
  30828. // "path": "{project}/global/backendBuckets",
  30829. // "request": {
  30830. // "$ref": "BackendBucket"
  30831. // },
  30832. // "response": {
  30833. // "$ref": "Operation"
  30834. // },
  30835. // "scopes": [
  30836. // "https://www.googleapis.com/auth/cloud-platform",
  30837. // "https://www.googleapis.com/auth/compute"
  30838. // ]
  30839. // }
  30840. }
  30841. // method id "compute.backendBuckets.list":
  30842. type BackendBucketsListCall struct {
  30843. s *Service
  30844. project string
  30845. urlParams_ gensupport.URLParams
  30846. ifNoneMatch_ string
  30847. ctx_ context.Context
  30848. header_ http.Header
  30849. }
  30850. // List: Retrieves the list of BackendBucket resources available to the
  30851. // specified project.
  30852. func (r *BackendBucketsService) List(project string) *BackendBucketsListCall {
  30853. c := &BackendBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30854. c.project = project
  30855. return c
  30856. }
  30857. // Filter sets the optional parameter "filter": A filter expression that
  30858. // filters resources listed in the response. The expression must specify
  30859. // the field name, a comparison operator, and the value that you want to
  30860. // use for filtering. The value must be a string, a number, or a
  30861. // boolean. The comparison operator must be either =, !=, >, or <.
  30862. //
  30863. // For example, if you are filtering Compute Engine instances, you can
  30864. // exclude instances named example-instance by specifying name !=
  30865. // example-instance.
  30866. //
  30867. // You can also filter nested fields. For example, you could specify
  30868. // scheduling.automaticRestart = false to include instances only if they
  30869. // are not scheduled for automatic restarts. You can use filtering on
  30870. // nested fields to filter based on resource labels.
  30871. //
  30872. // To filter on multiple expressions, provide each separate expression
  30873. // within parentheses. For example, (scheduling.automaticRestart = true)
  30874. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  30875. // AND expression. However, you can include AND and OR expressions
  30876. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  30877. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  30878. // true).
  30879. func (c *BackendBucketsListCall) Filter(filter string) *BackendBucketsListCall {
  30880. c.urlParams_.Set("filter", filter)
  30881. return c
  30882. }
  30883. // MaxResults sets the optional parameter "maxResults": The maximum
  30884. // number of results per page that should be returned. If the number of
  30885. // available results is larger than maxResults, Compute Engine returns a
  30886. // nextPageToken that can be used to get the next page of results in
  30887. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  30888. // (Default: 500)
  30889. func (c *BackendBucketsListCall) MaxResults(maxResults int64) *BackendBucketsListCall {
  30890. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30891. return c
  30892. }
  30893. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  30894. // a certain order. By default, results are returned in alphanumerical
  30895. // order based on the resource name.
  30896. //
  30897. // You can also sort results in descending order based on the creation
  30898. // timestamp using orderBy="creationTimestamp desc". This sorts results
  30899. // based on the creationTimestamp field in reverse chronological order
  30900. // (newest result first). Use this to sort resources like operations so
  30901. // that the newest operation is returned first.
  30902. //
  30903. // Currently, only sorting by name or creationTimestamp desc is
  30904. // supported.
  30905. func (c *BackendBucketsListCall) OrderBy(orderBy string) *BackendBucketsListCall {
  30906. c.urlParams_.Set("orderBy", orderBy)
  30907. return c
  30908. }
  30909. // PageToken sets the optional parameter "pageToken": Specifies a page
  30910. // token to use. Set pageToken to the nextPageToken returned by a
  30911. // previous list request to get the next page of results.
  30912. func (c *BackendBucketsListCall) PageToken(pageToken string) *BackendBucketsListCall {
  30913. c.urlParams_.Set("pageToken", pageToken)
  30914. return c
  30915. }
  30916. // Fields allows partial responses to be retrieved. See
  30917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30918. // for more information.
  30919. func (c *BackendBucketsListCall) Fields(s ...googleapi.Field) *BackendBucketsListCall {
  30920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30921. return c
  30922. }
  30923. // IfNoneMatch sets the optional parameter which makes the operation
  30924. // fail if the object's ETag matches the given value. This is useful for
  30925. // getting updates only after the object has changed since the last
  30926. // request. Use googleapi.IsNotModified to check whether the response
  30927. // error from Do is the result of In-None-Match.
  30928. func (c *BackendBucketsListCall) IfNoneMatch(entityTag string) *BackendBucketsListCall {
  30929. c.ifNoneMatch_ = entityTag
  30930. return c
  30931. }
  30932. // Context sets the context to be used in this call's Do method. Any
  30933. // pending HTTP request will be aborted if the provided context is
  30934. // canceled.
  30935. func (c *BackendBucketsListCall) Context(ctx context.Context) *BackendBucketsListCall {
  30936. c.ctx_ = ctx
  30937. return c
  30938. }
  30939. // Header returns an http.Header that can be modified by the caller to
  30940. // add HTTP headers to the request.
  30941. func (c *BackendBucketsListCall) Header() http.Header {
  30942. if c.header_ == nil {
  30943. c.header_ = make(http.Header)
  30944. }
  30945. return c.header_
  30946. }
  30947. func (c *BackendBucketsListCall) doRequest(alt string) (*http.Response, error) {
  30948. reqHeaders := make(http.Header)
  30949. for k, v := range c.header_ {
  30950. reqHeaders[k] = v
  30951. }
  30952. reqHeaders.Set("User-Agent", c.s.userAgent())
  30953. if c.ifNoneMatch_ != "" {
  30954. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30955. }
  30956. var body io.Reader = nil
  30957. c.urlParams_.Set("alt", alt)
  30958. c.urlParams_.Set("prettyPrint", "false")
  30959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets")
  30960. urls += "?" + c.urlParams_.Encode()
  30961. req, err := http.NewRequest("GET", urls, body)
  30962. if err != nil {
  30963. return nil, err
  30964. }
  30965. req.Header = reqHeaders
  30966. googleapi.Expand(req.URL, map[string]string{
  30967. "project": c.project,
  30968. })
  30969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30970. }
  30971. // Do executes the "compute.backendBuckets.list" call.
  30972. // Exactly one of *BackendBucketList or error will be non-nil. Any
  30973. // non-2xx status code is an error. Response headers are in either
  30974. // *BackendBucketList.ServerResponse.Header or (if a response was
  30975. // returned at all) in error.(*googleapi.Error).Header. Use
  30976. // googleapi.IsNotModified to check whether the returned error was
  30977. // because http.StatusNotModified was returned.
  30978. func (c *BackendBucketsListCall) Do(opts ...googleapi.CallOption) (*BackendBucketList, error) {
  30979. gensupport.SetOptions(c.urlParams_, opts...)
  30980. res, err := c.doRequest("json")
  30981. if res != nil && res.StatusCode == http.StatusNotModified {
  30982. if res.Body != nil {
  30983. res.Body.Close()
  30984. }
  30985. return nil, &googleapi.Error{
  30986. Code: res.StatusCode,
  30987. Header: res.Header,
  30988. }
  30989. }
  30990. if err != nil {
  30991. return nil, err
  30992. }
  30993. defer googleapi.CloseBody(res)
  30994. if err := googleapi.CheckResponse(res); err != nil {
  30995. return nil, err
  30996. }
  30997. ret := &BackendBucketList{
  30998. ServerResponse: googleapi.ServerResponse{
  30999. Header: res.Header,
  31000. HTTPStatusCode: res.StatusCode,
  31001. },
  31002. }
  31003. target := &ret
  31004. if err := gensupport.DecodeResponse(target, res); err != nil {
  31005. return nil, err
  31006. }
  31007. return ret, nil
  31008. // {
  31009. // "description": "Retrieves the list of BackendBucket resources available to the specified project.",
  31010. // "httpMethod": "GET",
  31011. // "id": "compute.backendBuckets.list",
  31012. // "parameterOrder": [
  31013. // "project"
  31014. // ],
  31015. // "parameters": {
  31016. // "filter": {
  31017. // "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).",
  31018. // "location": "query",
  31019. // "type": "string"
  31020. // },
  31021. // "maxResults": {
  31022. // "default": "500",
  31023. // "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)",
  31024. // "format": "uint32",
  31025. // "location": "query",
  31026. // "minimum": "0",
  31027. // "type": "integer"
  31028. // },
  31029. // "orderBy": {
  31030. // "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.",
  31031. // "location": "query",
  31032. // "type": "string"
  31033. // },
  31034. // "pageToken": {
  31035. // "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.",
  31036. // "location": "query",
  31037. // "type": "string"
  31038. // },
  31039. // "project": {
  31040. // "description": "Project ID for this request.",
  31041. // "location": "path",
  31042. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31043. // "required": true,
  31044. // "type": "string"
  31045. // }
  31046. // },
  31047. // "path": "{project}/global/backendBuckets",
  31048. // "response": {
  31049. // "$ref": "BackendBucketList"
  31050. // },
  31051. // "scopes": [
  31052. // "https://www.googleapis.com/auth/cloud-platform",
  31053. // "https://www.googleapis.com/auth/compute",
  31054. // "https://www.googleapis.com/auth/compute.readonly"
  31055. // ]
  31056. // }
  31057. }
  31058. // Pages invokes f for each page of results.
  31059. // A non-nil error returned from f will halt the iteration.
  31060. // The provided context supersedes any context provided to the Context method.
  31061. func (c *BackendBucketsListCall) Pages(ctx context.Context, f func(*BackendBucketList) error) error {
  31062. c.ctx_ = ctx
  31063. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31064. for {
  31065. x, err := c.Do()
  31066. if err != nil {
  31067. return err
  31068. }
  31069. if err := f(x); err != nil {
  31070. return err
  31071. }
  31072. if x.NextPageToken == "" {
  31073. return nil
  31074. }
  31075. c.PageToken(x.NextPageToken)
  31076. }
  31077. }
  31078. // method id "compute.backendBuckets.patch":
  31079. type BackendBucketsPatchCall struct {
  31080. s *Service
  31081. project string
  31082. backendBucket string
  31083. backendbucket *BackendBucket
  31084. urlParams_ gensupport.URLParams
  31085. ctx_ context.Context
  31086. header_ http.Header
  31087. }
  31088. // Patch: Updates the specified BackendBucket resource with the data
  31089. // included in the request. This method supports PATCH semantics and
  31090. // uses the JSON merge patch format and processing rules.
  31091. func (r *BackendBucketsService) Patch(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsPatchCall {
  31092. c := &BackendBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31093. c.project = project
  31094. c.backendBucket = backendBucket
  31095. c.backendbucket = backendbucket
  31096. return c
  31097. }
  31098. // RequestId sets the optional parameter "requestId": An optional
  31099. // request ID to identify requests. Specify a unique request ID so that
  31100. // if you must retry your request, the server will know to ignore the
  31101. // request if it has already been completed.
  31102. //
  31103. // For example, consider a situation where you make an initial request
  31104. // and the request times out. If you make the request again with the
  31105. // same request ID, the server can check if original operation with the
  31106. // same request ID was received, and if so, will ignore the second
  31107. // request. This prevents clients from accidentally creating duplicate
  31108. // commitments.
  31109. //
  31110. // The request ID must be a valid UUID with the exception that zero UUID
  31111. // is not supported (00000000-0000-0000-0000-000000000000).
  31112. func (c *BackendBucketsPatchCall) RequestId(requestId string) *BackendBucketsPatchCall {
  31113. c.urlParams_.Set("requestId", requestId)
  31114. return c
  31115. }
  31116. // Fields allows partial responses to be retrieved. See
  31117. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31118. // for more information.
  31119. func (c *BackendBucketsPatchCall) Fields(s ...googleapi.Field) *BackendBucketsPatchCall {
  31120. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31121. return c
  31122. }
  31123. // Context sets the context to be used in this call's Do method. Any
  31124. // pending HTTP request will be aborted if the provided context is
  31125. // canceled.
  31126. func (c *BackendBucketsPatchCall) Context(ctx context.Context) *BackendBucketsPatchCall {
  31127. c.ctx_ = ctx
  31128. return c
  31129. }
  31130. // Header returns an http.Header that can be modified by the caller to
  31131. // add HTTP headers to the request.
  31132. func (c *BackendBucketsPatchCall) Header() http.Header {
  31133. if c.header_ == nil {
  31134. c.header_ = make(http.Header)
  31135. }
  31136. return c.header_
  31137. }
  31138. func (c *BackendBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
  31139. reqHeaders := make(http.Header)
  31140. for k, v := range c.header_ {
  31141. reqHeaders[k] = v
  31142. }
  31143. reqHeaders.Set("User-Agent", c.s.userAgent())
  31144. var body io.Reader = nil
  31145. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  31146. if err != nil {
  31147. return nil, err
  31148. }
  31149. reqHeaders.Set("Content-Type", "application/json")
  31150. c.urlParams_.Set("alt", alt)
  31151. c.urlParams_.Set("prettyPrint", "false")
  31152. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  31153. urls += "?" + c.urlParams_.Encode()
  31154. req, err := http.NewRequest("PATCH", urls, body)
  31155. if err != nil {
  31156. return nil, err
  31157. }
  31158. req.Header = reqHeaders
  31159. googleapi.Expand(req.URL, map[string]string{
  31160. "project": c.project,
  31161. "backendBucket": c.backendBucket,
  31162. })
  31163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31164. }
  31165. // Do executes the "compute.backendBuckets.patch" call.
  31166. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31167. // status code is an error. Response headers are in either
  31168. // *Operation.ServerResponse.Header or (if a response was returned at
  31169. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31170. // to check whether the returned error was because
  31171. // http.StatusNotModified was returned.
  31172. func (c *BackendBucketsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31173. gensupport.SetOptions(c.urlParams_, opts...)
  31174. res, err := c.doRequest("json")
  31175. if res != nil && res.StatusCode == http.StatusNotModified {
  31176. if res.Body != nil {
  31177. res.Body.Close()
  31178. }
  31179. return nil, &googleapi.Error{
  31180. Code: res.StatusCode,
  31181. Header: res.Header,
  31182. }
  31183. }
  31184. if err != nil {
  31185. return nil, err
  31186. }
  31187. defer googleapi.CloseBody(res)
  31188. if err := googleapi.CheckResponse(res); err != nil {
  31189. return nil, err
  31190. }
  31191. ret := &Operation{
  31192. ServerResponse: googleapi.ServerResponse{
  31193. Header: res.Header,
  31194. HTTPStatusCode: res.StatusCode,
  31195. },
  31196. }
  31197. target := &ret
  31198. if err := gensupport.DecodeResponse(target, res); err != nil {
  31199. return nil, err
  31200. }
  31201. return ret, nil
  31202. // {
  31203. // "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.",
  31204. // "httpMethod": "PATCH",
  31205. // "id": "compute.backendBuckets.patch",
  31206. // "parameterOrder": [
  31207. // "project",
  31208. // "backendBucket"
  31209. // ],
  31210. // "parameters": {
  31211. // "backendBucket": {
  31212. // "description": "Name of the BackendBucket resource to patch.",
  31213. // "location": "path",
  31214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31215. // "required": true,
  31216. // "type": "string"
  31217. // },
  31218. // "project": {
  31219. // "description": "Project ID for this request.",
  31220. // "location": "path",
  31221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31222. // "required": true,
  31223. // "type": "string"
  31224. // },
  31225. // "requestId": {
  31226. // "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).",
  31227. // "location": "query",
  31228. // "type": "string"
  31229. // }
  31230. // },
  31231. // "path": "{project}/global/backendBuckets/{backendBucket}",
  31232. // "request": {
  31233. // "$ref": "BackendBucket"
  31234. // },
  31235. // "response": {
  31236. // "$ref": "Operation"
  31237. // },
  31238. // "scopes": [
  31239. // "https://www.googleapis.com/auth/cloud-platform",
  31240. // "https://www.googleapis.com/auth/compute"
  31241. // ]
  31242. // }
  31243. }
  31244. // method id "compute.backendBuckets.update":
  31245. type BackendBucketsUpdateCall struct {
  31246. s *Service
  31247. project string
  31248. backendBucket string
  31249. backendbucket *BackendBucket
  31250. urlParams_ gensupport.URLParams
  31251. ctx_ context.Context
  31252. header_ http.Header
  31253. }
  31254. // Update: Updates the specified BackendBucket resource with the data
  31255. // included in the request.
  31256. func (r *BackendBucketsService) Update(project string, backendBucket string, backendbucket *BackendBucket) *BackendBucketsUpdateCall {
  31257. c := &BackendBucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31258. c.project = project
  31259. c.backendBucket = backendBucket
  31260. c.backendbucket = backendbucket
  31261. return c
  31262. }
  31263. // RequestId sets the optional parameter "requestId": An optional
  31264. // request ID to identify requests. Specify a unique request ID so that
  31265. // if you must retry your request, the server will know to ignore the
  31266. // request if it has already been completed.
  31267. //
  31268. // For example, consider a situation where you make an initial request
  31269. // and the request times out. If you make the request again with the
  31270. // same request ID, the server can check if original operation with the
  31271. // same request ID was received, and if so, will ignore the second
  31272. // request. This prevents clients from accidentally creating duplicate
  31273. // commitments.
  31274. //
  31275. // The request ID must be a valid UUID with the exception that zero UUID
  31276. // is not supported (00000000-0000-0000-0000-000000000000).
  31277. func (c *BackendBucketsUpdateCall) RequestId(requestId string) *BackendBucketsUpdateCall {
  31278. c.urlParams_.Set("requestId", requestId)
  31279. return c
  31280. }
  31281. // Fields allows partial responses to be retrieved. See
  31282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31283. // for more information.
  31284. func (c *BackendBucketsUpdateCall) Fields(s ...googleapi.Field) *BackendBucketsUpdateCall {
  31285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31286. return c
  31287. }
  31288. // Context sets the context to be used in this call's Do method. Any
  31289. // pending HTTP request will be aborted if the provided context is
  31290. // canceled.
  31291. func (c *BackendBucketsUpdateCall) Context(ctx context.Context) *BackendBucketsUpdateCall {
  31292. c.ctx_ = ctx
  31293. return c
  31294. }
  31295. // Header returns an http.Header that can be modified by the caller to
  31296. // add HTTP headers to the request.
  31297. func (c *BackendBucketsUpdateCall) Header() http.Header {
  31298. if c.header_ == nil {
  31299. c.header_ = make(http.Header)
  31300. }
  31301. return c.header_
  31302. }
  31303. func (c *BackendBucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
  31304. reqHeaders := make(http.Header)
  31305. for k, v := range c.header_ {
  31306. reqHeaders[k] = v
  31307. }
  31308. reqHeaders.Set("User-Agent", c.s.userAgent())
  31309. var body io.Reader = nil
  31310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendbucket)
  31311. if err != nil {
  31312. return nil, err
  31313. }
  31314. reqHeaders.Set("Content-Type", "application/json")
  31315. c.urlParams_.Set("alt", alt)
  31316. c.urlParams_.Set("prettyPrint", "false")
  31317. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendBuckets/{backendBucket}")
  31318. urls += "?" + c.urlParams_.Encode()
  31319. req, err := http.NewRequest("PUT", urls, body)
  31320. if err != nil {
  31321. return nil, err
  31322. }
  31323. req.Header = reqHeaders
  31324. googleapi.Expand(req.URL, map[string]string{
  31325. "project": c.project,
  31326. "backendBucket": c.backendBucket,
  31327. })
  31328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31329. }
  31330. // Do executes the "compute.backendBuckets.update" call.
  31331. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31332. // status code is an error. Response headers are in either
  31333. // *Operation.ServerResponse.Header or (if a response was returned at
  31334. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31335. // to check whether the returned error was because
  31336. // http.StatusNotModified was returned.
  31337. func (c *BackendBucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31338. gensupport.SetOptions(c.urlParams_, opts...)
  31339. res, err := c.doRequest("json")
  31340. if res != nil && res.StatusCode == http.StatusNotModified {
  31341. if res.Body != nil {
  31342. res.Body.Close()
  31343. }
  31344. return nil, &googleapi.Error{
  31345. Code: res.StatusCode,
  31346. Header: res.Header,
  31347. }
  31348. }
  31349. if err != nil {
  31350. return nil, err
  31351. }
  31352. defer googleapi.CloseBody(res)
  31353. if err := googleapi.CheckResponse(res); err != nil {
  31354. return nil, err
  31355. }
  31356. ret := &Operation{
  31357. ServerResponse: googleapi.ServerResponse{
  31358. Header: res.Header,
  31359. HTTPStatusCode: res.StatusCode,
  31360. },
  31361. }
  31362. target := &ret
  31363. if err := gensupport.DecodeResponse(target, res); err != nil {
  31364. return nil, err
  31365. }
  31366. return ret, nil
  31367. // {
  31368. // "description": "Updates the specified BackendBucket resource with the data included in the request.",
  31369. // "httpMethod": "PUT",
  31370. // "id": "compute.backendBuckets.update",
  31371. // "parameterOrder": [
  31372. // "project",
  31373. // "backendBucket"
  31374. // ],
  31375. // "parameters": {
  31376. // "backendBucket": {
  31377. // "description": "Name of the BackendBucket resource to update.",
  31378. // "location": "path",
  31379. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31380. // "required": true,
  31381. // "type": "string"
  31382. // },
  31383. // "project": {
  31384. // "description": "Project ID for this request.",
  31385. // "location": "path",
  31386. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31387. // "required": true,
  31388. // "type": "string"
  31389. // },
  31390. // "requestId": {
  31391. // "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).",
  31392. // "location": "query",
  31393. // "type": "string"
  31394. // }
  31395. // },
  31396. // "path": "{project}/global/backendBuckets/{backendBucket}",
  31397. // "request": {
  31398. // "$ref": "BackendBucket"
  31399. // },
  31400. // "response": {
  31401. // "$ref": "Operation"
  31402. // },
  31403. // "scopes": [
  31404. // "https://www.googleapis.com/auth/cloud-platform",
  31405. // "https://www.googleapis.com/auth/compute"
  31406. // ]
  31407. // }
  31408. }
  31409. // method id "compute.backendServices.addSignedUrlKey":
  31410. type BackendServicesAddSignedUrlKeyCall struct {
  31411. s *Service
  31412. project string
  31413. backendService string
  31414. signedurlkey *SignedUrlKey
  31415. urlParams_ gensupport.URLParams
  31416. ctx_ context.Context
  31417. header_ http.Header
  31418. }
  31419. // AddSignedUrlKey: Adds a key for validating requests with signed URLs
  31420. // for this backend service.
  31421. func (r *BackendServicesService) AddSignedUrlKey(project string, backendService string, signedurlkey *SignedUrlKey) *BackendServicesAddSignedUrlKeyCall {
  31422. c := &BackendServicesAddSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31423. c.project = project
  31424. c.backendService = backendService
  31425. c.signedurlkey = signedurlkey
  31426. return c
  31427. }
  31428. // RequestId sets the optional parameter "requestId": An optional
  31429. // request ID to identify requests. Specify a unique request ID so that
  31430. // if you must retry your request, the server will know to ignore the
  31431. // request if it has already been completed.
  31432. //
  31433. // For example, consider a situation where you make an initial request
  31434. // and the request times out. If you make the request again with the
  31435. // same request ID, the server can check if original operation with the
  31436. // same request ID was received, and if so, will ignore the second
  31437. // request. This prevents clients from accidentally creating duplicate
  31438. // commitments.
  31439. //
  31440. // The request ID must be a valid UUID with the exception that zero UUID
  31441. // is not supported (00000000-0000-0000-0000-000000000000).
  31442. func (c *BackendServicesAddSignedUrlKeyCall) RequestId(requestId string) *BackendServicesAddSignedUrlKeyCall {
  31443. c.urlParams_.Set("requestId", requestId)
  31444. return c
  31445. }
  31446. // Fields allows partial responses to be retrieved. See
  31447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31448. // for more information.
  31449. func (c *BackendServicesAddSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesAddSignedUrlKeyCall {
  31450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31451. return c
  31452. }
  31453. // Context sets the context to be used in this call's Do method. Any
  31454. // pending HTTP request will be aborted if the provided context is
  31455. // canceled.
  31456. func (c *BackendServicesAddSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesAddSignedUrlKeyCall {
  31457. c.ctx_ = ctx
  31458. return c
  31459. }
  31460. // Header returns an http.Header that can be modified by the caller to
  31461. // add HTTP headers to the request.
  31462. func (c *BackendServicesAddSignedUrlKeyCall) Header() http.Header {
  31463. if c.header_ == nil {
  31464. c.header_ = make(http.Header)
  31465. }
  31466. return c.header_
  31467. }
  31468. func (c *BackendServicesAddSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  31469. reqHeaders := make(http.Header)
  31470. for k, v := range c.header_ {
  31471. reqHeaders[k] = v
  31472. }
  31473. reqHeaders.Set("User-Agent", c.s.userAgent())
  31474. var body io.Reader = nil
  31475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.signedurlkey)
  31476. if err != nil {
  31477. return nil, err
  31478. }
  31479. reqHeaders.Set("Content-Type", "application/json")
  31480. c.urlParams_.Set("alt", alt)
  31481. c.urlParams_.Set("prettyPrint", "false")
  31482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/addSignedUrlKey")
  31483. urls += "?" + c.urlParams_.Encode()
  31484. req, err := http.NewRequest("POST", urls, body)
  31485. if err != nil {
  31486. return nil, err
  31487. }
  31488. req.Header = reqHeaders
  31489. googleapi.Expand(req.URL, map[string]string{
  31490. "project": c.project,
  31491. "backendService": c.backendService,
  31492. })
  31493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31494. }
  31495. // Do executes the "compute.backendServices.addSignedUrlKey" call.
  31496. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31497. // status code is an error. Response headers are in either
  31498. // *Operation.ServerResponse.Header or (if a response was returned at
  31499. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31500. // to check whether the returned error was because
  31501. // http.StatusNotModified was returned.
  31502. func (c *BackendServicesAddSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31503. gensupport.SetOptions(c.urlParams_, opts...)
  31504. res, err := c.doRequest("json")
  31505. if res != nil && res.StatusCode == http.StatusNotModified {
  31506. if res.Body != nil {
  31507. res.Body.Close()
  31508. }
  31509. return nil, &googleapi.Error{
  31510. Code: res.StatusCode,
  31511. Header: res.Header,
  31512. }
  31513. }
  31514. if err != nil {
  31515. return nil, err
  31516. }
  31517. defer googleapi.CloseBody(res)
  31518. if err := googleapi.CheckResponse(res); err != nil {
  31519. return nil, err
  31520. }
  31521. ret := &Operation{
  31522. ServerResponse: googleapi.ServerResponse{
  31523. Header: res.Header,
  31524. HTTPStatusCode: res.StatusCode,
  31525. },
  31526. }
  31527. target := &ret
  31528. if err := gensupport.DecodeResponse(target, res); err != nil {
  31529. return nil, err
  31530. }
  31531. return ret, nil
  31532. // {
  31533. // "description": "Adds a key for validating requests with signed URLs for this backend service.",
  31534. // "httpMethod": "POST",
  31535. // "id": "compute.backendServices.addSignedUrlKey",
  31536. // "parameterOrder": [
  31537. // "project",
  31538. // "backendService"
  31539. // ],
  31540. // "parameters": {
  31541. // "backendService": {
  31542. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  31543. // "location": "path",
  31544. // "required": true,
  31545. // "type": "string"
  31546. // },
  31547. // "project": {
  31548. // "description": "Project ID for this request.",
  31549. // "location": "path",
  31550. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31551. // "required": true,
  31552. // "type": "string"
  31553. // },
  31554. // "requestId": {
  31555. // "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).",
  31556. // "location": "query",
  31557. // "type": "string"
  31558. // }
  31559. // },
  31560. // "path": "{project}/global/backendServices/{backendService}/addSignedUrlKey",
  31561. // "request": {
  31562. // "$ref": "SignedUrlKey"
  31563. // },
  31564. // "response": {
  31565. // "$ref": "Operation"
  31566. // },
  31567. // "scopes": [
  31568. // "https://www.googleapis.com/auth/cloud-platform",
  31569. // "https://www.googleapis.com/auth/compute"
  31570. // ]
  31571. // }
  31572. }
  31573. // method id "compute.backendServices.aggregatedList":
  31574. type BackendServicesAggregatedListCall struct {
  31575. s *Service
  31576. project string
  31577. urlParams_ gensupport.URLParams
  31578. ifNoneMatch_ string
  31579. ctx_ context.Context
  31580. header_ http.Header
  31581. }
  31582. // AggregatedList: Retrieves the list of all BackendService resources,
  31583. // regional and global, available to the specified project.
  31584. func (r *BackendServicesService) AggregatedList(project string) *BackendServicesAggregatedListCall {
  31585. c := &BackendServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31586. c.project = project
  31587. return c
  31588. }
  31589. // Filter sets the optional parameter "filter": A filter expression that
  31590. // filters resources listed in the response. The expression must specify
  31591. // the field name, a comparison operator, and the value that you want to
  31592. // use for filtering. The value must be a string, a number, or a
  31593. // boolean. The comparison operator must be either =, !=, >, or <.
  31594. //
  31595. // For example, if you are filtering Compute Engine instances, you can
  31596. // exclude instances named example-instance by specifying name !=
  31597. // example-instance.
  31598. //
  31599. // You can also filter nested fields. For example, you could specify
  31600. // scheduling.automaticRestart = false to include instances only if they
  31601. // are not scheduled for automatic restarts. You can use filtering on
  31602. // nested fields to filter based on resource labels.
  31603. //
  31604. // To filter on multiple expressions, provide each separate expression
  31605. // within parentheses. For example, (scheduling.automaticRestart = true)
  31606. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  31607. // AND expression. However, you can include AND and OR expressions
  31608. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  31609. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  31610. // true).
  31611. func (c *BackendServicesAggregatedListCall) Filter(filter string) *BackendServicesAggregatedListCall {
  31612. c.urlParams_.Set("filter", filter)
  31613. return c
  31614. }
  31615. // MaxResults sets the optional parameter "maxResults": The maximum
  31616. // number of results per page that should be returned. If the number of
  31617. // available results is larger than maxResults, Compute Engine returns a
  31618. // nextPageToken that can be used to get the next page of results in
  31619. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  31620. // (Default: 500)
  31621. func (c *BackendServicesAggregatedListCall) MaxResults(maxResults int64) *BackendServicesAggregatedListCall {
  31622. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31623. return c
  31624. }
  31625. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  31626. // a certain order. By default, results are returned in alphanumerical
  31627. // order based on the resource name.
  31628. //
  31629. // You can also sort results in descending order based on the creation
  31630. // timestamp using orderBy="creationTimestamp desc". This sorts results
  31631. // based on the creationTimestamp field in reverse chronological order
  31632. // (newest result first). Use this to sort resources like operations so
  31633. // that the newest operation is returned first.
  31634. //
  31635. // Currently, only sorting by name or creationTimestamp desc is
  31636. // supported.
  31637. func (c *BackendServicesAggregatedListCall) OrderBy(orderBy string) *BackendServicesAggregatedListCall {
  31638. c.urlParams_.Set("orderBy", orderBy)
  31639. return c
  31640. }
  31641. // PageToken sets the optional parameter "pageToken": Specifies a page
  31642. // token to use. Set pageToken to the nextPageToken returned by a
  31643. // previous list request to get the next page of results.
  31644. func (c *BackendServicesAggregatedListCall) PageToken(pageToken string) *BackendServicesAggregatedListCall {
  31645. c.urlParams_.Set("pageToken", pageToken)
  31646. return c
  31647. }
  31648. // Fields allows partial responses to be retrieved. See
  31649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31650. // for more information.
  31651. func (c *BackendServicesAggregatedListCall) Fields(s ...googleapi.Field) *BackendServicesAggregatedListCall {
  31652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31653. return c
  31654. }
  31655. // IfNoneMatch sets the optional parameter which makes the operation
  31656. // fail if the object's ETag matches the given value. This is useful for
  31657. // getting updates only after the object has changed since the last
  31658. // request. Use googleapi.IsNotModified to check whether the response
  31659. // error from Do is the result of In-None-Match.
  31660. func (c *BackendServicesAggregatedListCall) IfNoneMatch(entityTag string) *BackendServicesAggregatedListCall {
  31661. c.ifNoneMatch_ = entityTag
  31662. return c
  31663. }
  31664. // Context sets the context to be used in this call's Do method. Any
  31665. // pending HTTP request will be aborted if the provided context is
  31666. // canceled.
  31667. func (c *BackendServicesAggregatedListCall) Context(ctx context.Context) *BackendServicesAggregatedListCall {
  31668. c.ctx_ = ctx
  31669. return c
  31670. }
  31671. // Header returns an http.Header that can be modified by the caller to
  31672. // add HTTP headers to the request.
  31673. func (c *BackendServicesAggregatedListCall) Header() http.Header {
  31674. if c.header_ == nil {
  31675. c.header_ = make(http.Header)
  31676. }
  31677. return c.header_
  31678. }
  31679. func (c *BackendServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  31680. reqHeaders := make(http.Header)
  31681. for k, v := range c.header_ {
  31682. reqHeaders[k] = v
  31683. }
  31684. reqHeaders.Set("User-Agent", c.s.userAgent())
  31685. if c.ifNoneMatch_ != "" {
  31686. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31687. }
  31688. var body io.Reader = nil
  31689. c.urlParams_.Set("alt", alt)
  31690. c.urlParams_.Set("prettyPrint", "false")
  31691. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/backendServices")
  31692. urls += "?" + c.urlParams_.Encode()
  31693. req, err := http.NewRequest("GET", urls, body)
  31694. if err != nil {
  31695. return nil, err
  31696. }
  31697. req.Header = reqHeaders
  31698. googleapi.Expand(req.URL, map[string]string{
  31699. "project": c.project,
  31700. })
  31701. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31702. }
  31703. // Do executes the "compute.backendServices.aggregatedList" call.
  31704. // Exactly one of *BackendServiceAggregatedList or error will be
  31705. // non-nil. Any non-2xx status code is an error. Response headers are in
  31706. // either *BackendServiceAggregatedList.ServerResponse.Header or (if a
  31707. // response was returned at all) in error.(*googleapi.Error).Header. Use
  31708. // googleapi.IsNotModified to check whether the returned error was
  31709. // because http.StatusNotModified was returned.
  31710. func (c *BackendServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*BackendServiceAggregatedList, error) {
  31711. gensupport.SetOptions(c.urlParams_, opts...)
  31712. res, err := c.doRequest("json")
  31713. if res != nil && res.StatusCode == http.StatusNotModified {
  31714. if res.Body != nil {
  31715. res.Body.Close()
  31716. }
  31717. return nil, &googleapi.Error{
  31718. Code: res.StatusCode,
  31719. Header: res.Header,
  31720. }
  31721. }
  31722. if err != nil {
  31723. return nil, err
  31724. }
  31725. defer googleapi.CloseBody(res)
  31726. if err := googleapi.CheckResponse(res); err != nil {
  31727. return nil, err
  31728. }
  31729. ret := &BackendServiceAggregatedList{
  31730. ServerResponse: googleapi.ServerResponse{
  31731. Header: res.Header,
  31732. HTTPStatusCode: res.StatusCode,
  31733. },
  31734. }
  31735. target := &ret
  31736. if err := gensupport.DecodeResponse(target, res); err != nil {
  31737. return nil, err
  31738. }
  31739. return ret, nil
  31740. // {
  31741. // "description": "Retrieves the list of all BackendService resources, regional and global, available to the specified project.",
  31742. // "httpMethod": "GET",
  31743. // "id": "compute.backendServices.aggregatedList",
  31744. // "parameterOrder": [
  31745. // "project"
  31746. // ],
  31747. // "parameters": {
  31748. // "filter": {
  31749. // "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).",
  31750. // "location": "query",
  31751. // "type": "string"
  31752. // },
  31753. // "maxResults": {
  31754. // "default": "500",
  31755. // "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)",
  31756. // "format": "uint32",
  31757. // "location": "query",
  31758. // "minimum": "0",
  31759. // "type": "integer"
  31760. // },
  31761. // "orderBy": {
  31762. // "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.",
  31763. // "location": "query",
  31764. // "type": "string"
  31765. // },
  31766. // "pageToken": {
  31767. // "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.",
  31768. // "location": "query",
  31769. // "type": "string"
  31770. // },
  31771. // "project": {
  31772. // "description": "Name of the project scoping this request.",
  31773. // "location": "path",
  31774. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31775. // "required": true,
  31776. // "type": "string"
  31777. // }
  31778. // },
  31779. // "path": "{project}/aggregated/backendServices",
  31780. // "response": {
  31781. // "$ref": "BackendServiceAggregatedList"
  31782. // },
  31783. // "scopes": [
  31784. // "https://www.googleapis.com/auth/cloud-platform",
  31785. // "https://www.googleapis.com/auth/compute",
  31786. // "https://www.googleapis.com/auth/compute.readonly"
  31787. // ]
  31788. // }
  31789. }
  31790. // Pages invokes f for each page of results.
  31791. // A non-nil error returned from f will halt the iteration.
  31792. // The provided context supersedes any context provided to the Context method.
  31793. func (c *BackendServicesAggregatedListCall) Pages(ctx context.Context, f func(*BackendServiceAggregatedList) error) error {
  31794. c.ctx_ = ctx
  31795. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31796. for {
  31797. x, err := c.Do()
  31798. if err != nil {
  31799. return err
  31800. }
  31801. if err := f(x); err != nil {
  31802. return err
  31803. }
  31804. if x.NextPageToken == "" {
  31805. return nil
  31806. }
  31807. c.PageToken(x.NextPageToken)
  31808. }
  31809. }
  31810. // method id "compute.backendServices.delete":
  31811. type BackendServicesDeleteCall struct {
  31812. s *Service
  31813. project string
  31814. backendService string
  31815. urlParams_ gensupport.URLParams
  31816. ctx_ context.Context
  31817. header_ http.Header
  31818. }
  31819. // Delete: Deletes the specified BackendService resource.
  31820. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete
  31821. func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall {
  31822. c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31823. c.project = project
  31824. c.backendService = backendService
  31825. return c
  31826. }
  31827. // RequestId sets the optional parameter "requestId": An optional
  31828. // request ID to identify requests. Specify a unique request ID so that
  31829. // if you must retry your request, the server will know to ignore the
  31830. // request if it has already been completed.
  31831. //
  31832. // For example, consider a situation where you make an initial request
  31833. // and the request times out. If you make the request again with the
  31834. // same request ID, the server can check if original operation with the
  31835. // same request ID was received, and if so, will ignore the second
  31836. // request. This prevents clients from accidentally creating duplicate
  31837. // commitments.
  31838. //
  31839. // The request ID must be a valid UUID with the exception that zero UUID
  31840. // is not supported (00000000-0000-0000-0000-000000000000).
  31841. func (c *BackendServicesDeleteCall) RequestId(requestId string) *BackendServicesDeleteCall {
  31842. c.urlParams_.Set("requestId", requestId)
  31843. return c
  31844. }
  31845. // Fields allows partial responses to be retrieved. See
  31846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31847. // for more information.
  31848. func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall {
  31849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31850. return c
  31851. }
  31852. // Context sets the context to be used in this call's Do method. Any
  31853. // pending HTTP request will be aborted if the provided context is
  31854. // canceled.
  31855. func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall {
  31856. c.ctx_ = ctx
  31857. return c
  31858. }
  31859. // Header returns an http.Header that can be modified by the caller to
  31860. // add HTTP headers to the request.
  31861. func (c *BackendServicesDeleteCall) Header() http.Header {
  31862. if c.header_ == nil {
  31863. c.header_ = make(http.Header)
  31864. }
  31865. return c.header_
  31866. }
  31867. func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  31868. reqHeaders := make(http.Header)
  31869. for k, v := range c.header_ {
  31870. reqHeaders[k] = v
  31871. }
  31872. reqHeaders.Set("User-Agent", c.s.userAgent())
  31873. var body io.Reader = nil
  31874. c.urlParams_.Set("alt", alt)
  31875. c.urlParams_.Set("prettyPrint", "false")
  31876. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  31877. urls += "?" + c.urlParams_.Encode()
  31878. req, err := http.NewRequest("DELETE", urls, body)
  31879. if err != nil {
  31880. return nil, err
  31881. }
  31882. req.Header = reqHeaders
  31883. googleapi.Expand(req.URL, map[string]string{
  31884. "project": c.project,
  31885. "backendService": c.backendService,
  31886. })
  31887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31888. }
  31889. // Do executes the "compute.backendServices.delete" call.
  31890. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  31891. // status code is an error. Response headers are in either
  31892. // *Operation.ServerResponse.Header or (if a response was returned at
  31893. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  31894. // to check whether the returned error was because
  31895. // http.StatusNotModified was returned.
  31896. func (c *BackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  31897. gensupport.SetOptions(c.urlParams_, opts...)
  31898. res, err := c.doRequest("json")
  31899. if res != nil && res.StatusCode == http.StatusNotModified {
  31900. if res.Body != nil {
  31901. res.Body.Close()
  31902. }
  31903. return nil, &googleapi.Error{
  31904. Code: res.StatusCode,
  31905. Header: res.Header,
  31906. }
  31907. }
  31908. if err != nil {
  31909. return nil, err
  31910. }
  31911. defer googleapi.CloseBody(res)
  31912. if err := googleapi.CheckResponse(res); err != nil {
  31913. return nil, err
  31914. }
  31915. ret := &Operation{
  31916. ServerResponse: googleapi.ServerResponse{
  31917. Header: res.Header,
  31918. HTTPStatusCode: res.StatusCode,
  31919. },
  31920. }
  31921. target := &ret
  31922. if err := gensupport.DecodeResponse(target, res); err != nil {
  31923. return nil, err
  31924. }
  31925. return ret, nil
  31926. // {
  31927. // "description": "Deletes the specified BackendService resource.",
  31928. // "httpMethod": "DELETE",
  31929. // "id": "compute.backendServices.delete",
  31930. // "parameterOrder": [
  31931. // "project",
  31932. // "backendService"
  31933. // ],
  31934. // "parameters": {
  31935. // "backendService": {
  31936. // "description": "Name of the BackendService resource to delete.",
  31937. // "location": "path",
  31938. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  31939. // "required": true,
  31940. // "type": "string"
  31941. // },
  31942. // "project": {
  31943. // "description": "Project ID for this request.",
  31944. // "location": "path",
  31945. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  31946. // "required": true,
  31947. // "type": "string"
  31948. // },
  31949. // "requestId": {
  31950. // "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).",
  31951. // "location": "query",
  31952. // "type": "string"
  31953. // }
  31954. // },
  31955. // "path": "{project}/global/backendServices/{backendService}",
  31956. // "response": {
  31957. // "$ref": "Operation"
  31958. // },
  31959. // "scopes": [
  31960. // "https://www.googleapis.com/auth/cloud-platform",
  31961. // "https://www.googleapis.com/auth/compute"
  31962. // ]
  31963. // }
  31964. }
  31965. // method id "compute.backendServices.deleteSignedUrlKey":
  31966. type BackendServicesDeleteSignedUrlKeyCall struct {
  31967. s *Service
  31968. project string
  31969. backendService string
  31970. urlParams_ gensupport.URLParams
  31971. ctx_ context.Context
  31972. header_ http.Header
  31973. }
  31974. // DeleteSignedUrlKey: Deletes a key for validating requests with signed
  31975. // URLs for this backend service.
  31976. func (r *BackendServicesService) DeleteSignedUrlKey(project string, backendService string, keyName string) *BackendServicesDeleteSignedUrlKeyCall {
  31977. c := &BackendServicesDeleteSignedUrlKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31978. c.project = project
  31979. c.backendService = backendService
  31980. c.urlParams_.Set("keyName", keyName)
  31981. return c
  31982. }
  31983. // RequestId sets the optional parameter "requestId": An optional
  31984. // request ID to identify requests. Specify a unique request ID so that
  31985. // if you must retry your request, the server will know to ignore the
  31986. // request if it has already been completed.
  31987. //
  31988. // For example, consider a situation where you make an initial request
  31989. // and the request times out. If you make the request again with the
  31990. // same request ID, the server can check if original operation with the
  31991. // same request ID was received, and if so, will ignore the second
  31992. // request. This prevents clients from accidentally creating duplicate
  31993. // commitments.
  31994. //
  31995. // The request ID must be a valid UUID with the exception that zero UUID
  31996. // is not supported (00000000-0000-0000-0000-000000000000).
  31997. func (c *BackendServicesDeleteSignedUrlKeyCall) RequestId(requestId string) *BackendServicesDeleteSignedUrlKeyCall {
  31998. c.urlParams_.Set("requestId", requestId)
  31999. return c
  32000. }
  32001. // Fields allows partial responses to be retrieved. See
  32002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32003. // for more information.
  32004. func (c *BackendServicesDeleteSignedUrlKeyCall) Fields(s ...googleapi.Field) *BackendServicesDeleteSignedUrlKeyCall {
  32005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32006. return c
  32007. }
  32008. // Context sets the context to be used in this call's Do method. Any
  32009. // pending HTTP request will be aborted if the provided context is
  32010. // canceled.
  32011. func (c *BackendServicesDeleteSignedUrlKeyCall) Context(ctx context.Context) *BackendServicesDeleteSignedUrlKeyCall {
  32012. c.ctx_ = ctx
  32013. return c
  32014. }
  32015. // Header returns an http.Header that can be modified by the caller to
  32016. // add HTTP headers to the request.
  32017. func (c *BackendServicesDeleteSignedUrlKeyCall) Header() http.Header {
  32018. if c.header_ == nil {
  32019. c.header_ = make(http.Header)
  32020. }
  32021. return c.header_
  32022. }
  32023. func (c *BackendServicesDeleteSignedUrlKeyCall) doRequest(alt string) (*http.Response, error) {
  32024. reqHeaders := make(http.Header)
  32025. for k, v := range c.header_ {
  32026. reqHeaders[k] = v
  32027. }
  32028. reqHeaders.Set("User-Agent", c.s.userAgent())
  32029. var body io.Reader = nil
  32030. c.urlParams_.Set("alt", alt)
  32031. c.urlParams_.Set("prettyPrint", "false")
  32032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/deleteSignedUrlKey")
  32033. urls += "?" + c.urlParams_.Encode()
  32034. req, err := http.NewRequest("POST", urls, body)
  32035. if err != nil {
  32036. return nil, err
  32037. }
  32038. req.Header = reqHeaders
  32039. googleapi.Expand(req.URL, map[string]string{
  32040. "project": c.project,
  32041. "backendService": c.backendService,
  32042. })
  32043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32044. }
  32045. // Do executes the "compute.backendServices.deleteSignedUrlKey" call.
  32046. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32047. // status code is an error. Response headers are in either
  32048. // *Operation.ServerResponse.Header or (if a response was returned at
  32049. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32050. // to check whether the returned error was because
  32051. // http.StatusNotModified was returned.
  32052. func (c *BackendServicesDeleteSignedUrlKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32053. gensupport.SetOptions(c.urlParams_, opts...)
  32054. res, err := c.doRequest("json")
  32055. if res != nil && res.StatusCode == http.StatusNotModified {
  32056. if res.Body != nil {
  32057. res.Body.Close()
  32058. }
  32059. return nil, &googleapi.Error{
  32060. Code: res.StatusCode,
  32061. Header: res.Header,
  32062. }
  32063. }
  32064. if err != nil {
  32065. return nil, err
  32066. }
  32067. defer googleapi.CloseBody(res)
  32068. if err := googleapi.CheckResponse(res); err != nil {
  32069. return nil, err
  32070. }
  32071. ret := &Operation{
  32072. ServerResponse: googleapi.ServerResponse{
  32073. Header: res.Header,
  32074. HTTPStatusCode: res.StatusCode,
  32075. },
  32076. }
  32077. target := &ret
  32078. if err := gensupport.DecodeResponse(target, res); err != nil {
  32079. return nil, err
  32080. }
  32081. return ret, nil
  32082. // {
  32083. // "description": "Deletes a key for validating requests with signed URLs for this backend service.",
  32084. // "httpMethod": "POST",
  32085. // "id": "compute.backendServices.deleteSignedUrlKey",
  32086. // "parameterOrder": [
  32087. // "project",
  32088. // "backendService",
  32089. // "keyName"
  32090. // ],
  32091. // "parameters": {
  32092. // "backendService": {
  32093. // "description": "Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035.",
  32094. // "location": "path",
  32095. // "required": true,
  32096. // "type": "string"
  32097. // },
  32098. // "keyName": {
  32099. // "description": "The name of the Signed URL Key to delete.",
  32100. // "location": "query",
  32101. // "required": true,
  32102. // "type": "string"
  32103. // },
  32104. // "project": {
  32105. // "description": "Project ID for this request.",
  32106. // "location": "path",
  32107. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32108. // "required": true,
  32109. // "type": "string"
  32110. // },
  32111. // "requestId": {
  32112. // "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).",
  32113. // "location": "query",
  32114. // "type": "string"
  32115. // }
  32116. // },
  32117. // "path": "{project}/global/backendServices/{backendService}/deleteSignedUrlKey",
  32118. // "response": {
  32119. // "$ref": "Operation"
  32120. // },
  32121. // "scopes": [
  32122. // "https://www.googleapis.com/auth/cloud-platform",
  32123. // "https://www.googleapis.com/auth/compute"
  32124. // ]
  32125. // }
  32126. }
  32127. // method id "compute.backendServices.get":
  32128. type BackendServicesGetCall struct {
  32129. s *Service
  32130. project string
  32131. backendService string
  32132. urlParams_ gensupport.URLParams
  32133. ifNoneMatch_ string
  32134. ctx_ context.Context
  32135. header_ http.Header
  32136. }
  32137. // Get: Returns the specified BackendService resource. Gets a list of
  32138. // available backend services.
  32139. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get
  32140. func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall {
  32141. c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32142. c.project = project
  32143. c.backendService = backendService
  32144. return c
  32145. }
  32146. // Fields allows partial responses to be retrieved. See
  32147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32148. // for more information.
  32149. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall {
  32150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32151. return c
  32152. }
  32153. // IfNoneMatch sets the optional parameter which makes the operation
  32154. // fail if the object's ETag matches the given value. This is useful for
  32155. // getting updates only after the object has changed since the last
  32156. // request. Use googleapi.IsNotModified to check whether the response
  32157. // error from Do is the result of In-None-Match.
  32158. func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall {
  32159. c.ifNoneMatch_ = entityTag
  32160. return c
  32161. }
  32162. // Context sets the context to be used in this call's Do method. Any
  32163. // pending HTTP request will be aborted if the provided context is
  32164. // canceled.
  32165. func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall {
  32166. c.ctx_ = ctx
  32167. return c
  32168. }
  32169. // Header returns an http.Header that can be modified by the caller to
  32170. // add HTTP headers to the request.
  32171. func (c *BackendServicesGetCall) Header() http.Header {
  32172. if c.header_ == nil {
  32173. c.header_ = make(http.Header)
  32174. }
  32175. return c.header_
  32176. }
  32177. func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  32178. reqHeaders := make(http.Header)
  32179. for k, v := range c.header_ {
  32180. reqHeaders[k] = v
  32181. }
  32182. reqHeaders.Set("User-Agent", c.s.userAgent())
  32183. if c.ifNoneMatch_ != "" {
  32184. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32185. }
  32186. var body io.Reader = nil
  32187. c.urlParams_.Set("alt", alt)
  32188. c.urlParams_.Set("prettyPrint", "false")
  32189. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  32190. urls += "?" + c.urlParams_.Encode()
  32191. req, err := http.NewRequest("GET", urls, body)
  32192. if err != nil {
  32193. return nil, err
  32194. }
  32195. req.Header = reqHeaders
  32196. googleapi.Expand(req.URL, map[string]string{
  32197. "project": c.project,
  32198. "backendService": c.backendService,
  32199. })
  32200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32201. }
  32202. // Do executes the "compute.backendServices.get" call.
  32203. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  32204. // status code is an error. Response headers are in either
  32205. // *BackendService.ServerResponse.Header or (if a response was returned
  32206. // at all) in error.(*googleapi.Error).Header. Use
  32207. // googleapi.IsNotModified to check whether the returned error was
  32208. // because http.StatusNotModified was returned.
  32209. func (c *BackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  32210. gensupport.SetOptions(c.urlParams_, opts...)
  32211. res, err := c.doRequest("json")
  32212. if res != nil && res.StatusCode == http.StatusNotModified {
  32213. if res.Body != nil {
  32214. res.Body.Close()
  32215. }
  32216. return nil, &googleapi.Error{
  32217. Code: res.StatusCode,
  32218. Header: res.Header,
  32219. }
  32220. }
  32221. if err != nil {
  32222. return nil, err
  32223. }
  32224. defer googleapi.CloseBody(res)
  32225. if err := googleapi.CheckResponse(res); err != nil {
  32226. return nil, err
  32227. }
  32228. ret := &BackendService{
  32229. ServerResponse: googleapi.ServerResponse{
  32230. Header: res.Header,
  32231. HTTPStatusCode: res.StatusCode,
  32232. },
  32233. }
  32234. target := &ret
  32235. if err := gensupport.DecodeResponse(target, res); err != nil {
  32236. return nil, err
  32237. }
  32238. return ret, nil
  32239. // {
  32240. // "description": "Returns the specified BackendService resource. Gets a list of available backend services.",
  32241. // "httpMethod": "GET",
  32242. // "id": "compute.backendServices.get",
  32243. // "parameterOrder": [
  32244. // "project",
  32245. // "backendService"
  32246. // ],
  32247. // "parameters": {
  32248. // "backendService": {
  32249. // "description": "Name of the BackendService resource to return.",
  32250. // "location": "path",
  32251. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32252. // "required": true,
  32253. // "type": "string"
  32254. // },
  32255. // "project": {
  32256. // "description": "Project ID for this request.",
  32257. // "location": "path",
  32258. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32259. // "required": true,
  32260. // "type": "string"
  32261. // }
  32262. // },
  32263. // "path": "{project}/global/backendServices/{backendService}",
  32264. // "response": {
  32265. // "$ref": "BackendService"
  32266. // },
  32267. // "scopes": [
  32268. // "https://www.googleapis.com/auth/cloud-platform",
  32269. // "https://www.googleapis.com/auth/compute",
  32270. // "https://www.googleapis.com/auth/compute.readonly"
  32271. // ]
  32272. // }
  32273. }
  32274. // method id "compute.backendServices.getHealth":
  32275. type BackendServicesGetHealthCall struct {
  32276. s *Service
  32277. project string
  32278. backendService string
  32279. resourcegroupreference *ResourceGroupReference
  32280. urlParams_ gensupport.URLParams
  32281. ctx_ context.Context
  32282. header_ http.Header
  32283. }
  32284. // GetHealth: Gets the most recent health check results for this
  32285. // BackendService.
  32286. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth
  32287. func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall {
  32288. c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32289. c.project = project
  32290. c.backendService = backendService
  32291. c.resourcegroupreference = resourcegroupreference
  32292. return c
  32293. }
  32294. // Fields allows partial responses to be retrieved. See
  32295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32296. // for more information.
  32297. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall {
  32298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32299. return c
  32300. }
  32301. // Context sets the context to be used in this call's Do method. Any
  32302. // pending HTTP request will be aborted if the provided context is
  32303. // canceled.
  32304. func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall {
  32305. c.ctx_ = ctx
  32306. return c
  32307. }
  32308. // Header returns an http.Header that can be modified by the caller to
  32309. // add HTTP headers to the request.
  32310. func (c *BackendServicesGetHealthCall) Header() http.Header {
  32311. if c.header_ == nil {
  32312. c.header_ = make(http.Header)
  32313. }
  32314. return c.header_
  32315. }
  32316. func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  32317. reqHeaders := make(http.Header)
  32318. for k, v := range c.header_ {
  32319. reqHeaders[k] = v
  32320. }
  32321. reqHeaders.Set("User-Agent", c.s.userAgent())
  32322. var body io.Reader = nil
  32323. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  32324. if err != nil {
  32325. return nil, err
  32326. }
  32327. reqHeaders.Set("Content-Type", "application/json")
  32328. c.urlParams_.Set("alt", alt)
  32329. c.urlParams_.Set("prettyPrint", "false")
  32330. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth")
  32331. urls += "?" + c.urlParams_.Encode()
  32332. req, err := http.NewRequest("POST", urls, body)
  32333. if err != nil {
  32334. return nil, err
  32335. }
  32336. req.Header = reqHeaders
  32337. googleapi.Expand(req.URL, map[string]string{
  32338. "project": c.project,
  32339. "backendService": c.backendService,
  32340. })
  32341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32342. }
  32343. // Do executes the "compute.backendServices.getHealth" call.
  32344. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  32345. // Any non-2xx status code is an error. Response headers are in either
  32346. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  32347. // was returned at all) in error.(*googleapi.Error).Header. Use
  32348. // googleapi.IsNotModified to check whether the returned error was
  32349. // because http.StatusNotModified was returned.
  32350. func (c *BackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  32351. gensupport.SetOptions(c.urlParams_, opts...)
  32352. res, err := c.doRequest("json")
  32353. if res != nil && res.StatusCode == http.StatusNotModified {
  32354. if res.Body != nil {
  32355. res.Body.Close()
  32356. }
  32357. return nil, &googleapi.Error{
  32358. Code: res.StatusCode,
  32359. Header: res.Header,
  32360. }
  32361. }
  32362. if err != nil {
  32363. return nil, err
  32364. }
  32365. defer googleapi.CloseBody(res)
  32366. if err := googleapi.CheckResponse(res); err != nil {
  32367. return nil, err
  32368. }
  32369. ret := &BackendServiceGroupHealth{
  32370. ServerResponse: googleapi.ServerResponse{
  32371. Header: res.Header,
  32372. HTTPStatusCode: res.StatusCode,
  32373. },
  32374. }
  32375. target := &ret
  32376. if err := gensupport.DecodeResponse(target, res); err != nil {
  32377. return nil, err
  32378. }
  32379. return ret, nil
  32380. // {
  32381. // "description": "Gets the most recent health check results for this BackendService.",
  32382. // "httpMethod": "POST",
  32383. // "id": "compute.backendServices.getHealth",
  32384. // "parameterOrder": [
  32385. // "project",
  32386. // "backendService"
  32387. // ],
  32388. // "parameters": {
  32389. // "backendService": {
  32390. // "description": "Name of the BackendService resource to which the queried instance belongs.",
  32391. // "location": "path",
  32392. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32393. // "required": true,
  32394. // "type": "string"
  32395. // },
  32396. // "project": {
  32397. // "location": "path",
  32398. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32399. // "required": true,
  32400. // "type": "string"
  32401. // }
  32402. // },
  32403. // "path": "{project}/global/backendServices/{backendService}/getHealth",
  32404. // "request": {
  32405. // "$ref": "ResourceGroupReference"
  32406. // },
  32407. // "response": {
  32408. // "$ref": "BackendServiceGroupHealth"
  32409. // },
  32410. // "scopes": [
  32411. // "https://www.googleapis.com/auth/cloud-platform",
  32412. // "https://www.googleapis.com/auth/compute",
  32413. // "https://www.googleapis.com/auth/compute.readonly"
  32414. // ]
  32415. // }
  32416. }
  32417. // method id "compute.backendServices.insert":
  32418. type BackendServicesInsertCall struct {
  32419. s *Service
  32420. project string
  32421. backendservice *BackendService
  32422. urlParams_ gensupport.URLParams
  32423. ctx_ context.Context
  32424. header_ http.Header
  32425. }
  32426. // Insert: Creates a BackendService resource in the specified project
  32427. // using the data included in the request. There are several
  32428. // restrictions and guidelines to keep in mind when creating a backend
  32429. // service. Read Restrictions and Guidelines for more information.
  32430. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert
  32431. func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall {
  32432. c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32433. c.project = project
  32434. c.backendservice = backendservice
  32435. return c
  32436. }
  32437. // RequestId sets the optional parameter "requestId": An optional
  32438. // request ID to identify requests. Specify a unique request ID so that
  32439. // if you must retry your request, the server will know to ignore the
  32440. // request if it has already been completed.
  32441. //
  32442. // For example, consider a situation where you make an initial request
  32443. // and the request times out. If you make the request again with the
  32444. // same request ID, the server can check if original operation with the
  32445. // same request ID was received, and if so, will ignore the second
  32446. // request. This prevents clients from accidentally creating duplicate
  32447. // commitments.
  32448. //
  32449. // The request ID must be a valid UUID with the exception that zero UUID
  32450. // is not supported (00000000-0000-0000-0000-000000000000).
  32451. func (c *BackendServicesInsertCall) RequestId(requestId string) *BackendServicesInsertCall {
  32452. c.urlParams_.Set("requestId", requestId)
  32453. return c
  32454. }
  32455. // Fields allows partial responses to be retrieved. See
  32456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32457. // for more information.
  32458. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall {
  32459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32460. return c
  32461. }
  32462. // Context sets the context to be used in this call's Do method. Any
  32463. // pending HTTP request will be aborted if the provided context is
  32464. // canceled.
  32465. func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall {
  32466. c.ctx_ = ctx
  32467. return c
  32468. }
  32469. // Header returns an http.Header that can be modified by the caller to
  32470. // add HTTP headers to the request.
  32471. func (c *BackendServicesInsertCall) Header() http.Header {
  32472. if c.header_ == nil {
  32473. c.header_ = make(http.Header)
  32474. }
  32475. return c.header_
  32476. }
  32477. func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  32478. reqHeaders := make(http.Header)
  32479. for k, v := range c.header_ {
  32480. reqHeaders[k] = v
  32481. }
  32482. reqHeaders.Set("User-Agent", c.s.userAgent())
  32483. var body io.Reader = nil
  32484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  32485. if err != nil {
  32486. return nil, err
  32487. }
  32488. reqHeaders.Set("Content-Type", "application/json")
  32489. c.urlParams_.Set("alt", alt)
  32490. c.urlParams_.Set("prettyPrint", "false")
  32491. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  32492. urls += "?" + c.urlParams_.Encode()
  32493. req, err := http.NewRequest("POST", urls, body)
  32494. if err != nil {
  32495. return nil, err
  32496. }
  32497. req.Header = reqHeaders
  32498. googleapi.Expand(req.URL, map[string]string{
  32499. "project": c.project,
  32500. })
  32501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32502. }
  32503. // Do executes the "compute.backendServices.insert" call.
  32504. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32505. // status code is an error. Response headers are in either
  32506. // *Operation.ServerResponse.Header or (if a response was returned at
  32507. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32508. // to check whether the returned error was because
  32509. // http.StatusNotModified was returned.
  32510. func (c *BackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32511. gensupport.SetOptions(c.urlParams_, opts...)
  32512. res, err := c.doRequest("json")
  32513. if res != nil && res.StatusCode == http.StatusNotModified {
  32514. if res.Body != nil {
  32515. res.Body.Close()
  32516. }
  32517. return nil, &googleapi.Error{
  32518. Code: res.StatusCode,
  32519. Header: res.Header,
  32520. }
  32521. }
  32522. if err != nil {
  32523. return nil, err
  32524. }
  32525. defer googleapi.CloseBody(res)
  32526. if err := googleapi.CheckResponse(res); err != nil {
  32527. return nil, err
  32528. }
  32529. ret := &Operation{
  32530. ServerResponse: googleapi.ServerResponse{
  32531. Header: res.Header,
  32532. HTTPStatusCode: res.StatusCode,
  32533. },
  32534. }
  32535. target := &ret
  32536. if err := gensupport.DecodeResponse(target, res); err != nil {
  32537. return nil, err
  32538. }
  32539. return ret, nil
  32540. // {
  32541. // "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.",
  32542. // "httpMethod": "POST",
  32543. // "id": "compute.backendServices.insert",
  32544. // "parameterOrder": [
  32545. // "project"
  32546. // ],
  32547. // "parameters": {
  32548. // "project": {
  32549. // "description": "Project ID for this request.",
  32550. // "location": "path",
  32551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32552. // "required": true,
  32553. // "type": "string"
  32554. // },
  32555. // "requestId": {
  32556. // "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).",
  32557. // "location": "query",
  32558. // "type": "string"
  32559. // }
  32560. // },
  32561. // "path": "{project}/global/backendServices",
  32562. // "request": {
  32563. // "$ref": "BackendService"
  32564. // },
  32565. // "response": {
  32566. // "$ref": "Operation"
  32567. // },
  32568. // "scopes": [
  32569. // "https://www.googleapis.com/auth/cloud-platform",
  32570. // "https://www.googleapis.com/auth/compute"
  32571. // ]
  32572. // }
  32573. }
  32574. // method id "compute.backendServices.list":
  32575. type BackendServicesListCall struct {
  32576. s *Service
  32577. project string
  32578. urlParams_ gensupport.URLParams
  32579. ifNoneMatch_ string
  32580. ctx_ context.Context
  32581. header_ http.Header
  32582. }
  32583. // List: Retrieves the list of BackendService resources available to the
  32584. // specified project.
  32585. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list
  32586. func (r *BackendServicesService) List(project string) *BackendServicesListCall {
  32587. c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32588. c.project = project
  32589. return c
  32590. }
  32591. // Filter sets the optional parameter "filter": A filter expression that
  32592. // filters resources listed in the response. The expression must specify
  32593. // the field name, a comparison operator, and the value that you want to
  32594. // use for filtering. The value must be a string, a number, or a
  32595. // boolean. The comparison operator must be either =, !=, >, or <.
  32596. //
  32597. // For example, if you are filtering Compute Engine instances, you can
  32598. // exclude instances named example-instance by specifying name !=
  32599. // example-instance.
  32600. //
  32601. // You can also filter nested fields. For example, you could specify
  32602. // scheduling.automaticRestart = false to include instances only if they
  32603. // are not scheduled for automatic restarts. You can use filtering on
  32604. // nested fields to filter based on resource labels.
  32605. //
  32606. // To filter on multiple expressions, provide each separate expression
  32607. // within parentheses. For example, (scheduling.automaticRestart = true)
  32608. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  32609. // AND expression. However, you can include AND and OR expressions
  32610. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  32611. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  32612. // true).
  32613. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall {
  32614. c.urlParams_.Set("filter", filter)
  32615. return c
  32616. }
  32617. // MaxResults sets the optional parameter "maxResults": The maximum
  32618. // number of results per page that should be returned. If the number of
  32619. // available results is larger than maxResults, Compute Engine returns a
  32620. // nextPageToken that can be used to get the next page of results in
  32621. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  32622. // (Default: 500)
  32623. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall {
  32624. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32625. return c
  32626. }
  32627. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  32628. // a certain order. By default, results are returned in alphanumerical
  32629. // order based on the resource name.
  32630. //
  32631. // You can also sort results in descending order based on the creation
  32632. // timestamp using orderBy="creationTimestamp desc". This sorts results
  32633. // based on the creationTimestamp field in reverse chronological order
  32634. // (newest result first). Use this to sort resources like operations so
  32635. // that the newest operation is returned first.
  32636. //
  32637. // Currently, only sorting by name or creationTimestamp desc is
  32638. // supported.
  32639. func (c *BackendServicesListCall) OrderBy(orderBy string) *BackendServicesListCall {
  32640. c.urlParams_.Set("orderBy", orderBy)
  32641. return c
  32642. }
  32643. // PageToken sets the optional parameter "pageToken": Specifies a page
  32644. // token to use. Set pageToken to the nextPageToken returned by a
  32645. // previous list request to get the next page of results.
  32646. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall {
  32647. c.urlParams_.Set("pageToken", pageToken)
  32648. return c
  32649. }
  32650. // Fields allows partial responses to be retrieved. See
  32651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32652. // for more information.
  32653. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall {
  32654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32655. return c
  32656. }
  32657. // IfNoneMatch sets the optional parameter which makes the operation
  32658. // fail if the object's ETag matches the given value. This is useful for
  32659. // getting updates only after the object has changed since the last
  32660. // request. Use googleapi.IsNotModified to check whether the response
  32661. // error from Do is the result of In-None-Match.
  32662. func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall {
  32663. c.ifNoneMatch_ = entityTag
  32664. return c
  32665. }
  32666. // Context sets the context to be used in this call's Do method. Any
  32667. // pending HTTP request will be aborted if the provided context is
  32668. // canceled.
  32669. func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall {
  32670. c.ctx_ = ctx
  32671. return c
  32672. }
  32673. // Header returns an http.Header that can be modified by the caller to
  32674. // add HTTP headers to the request.
  32675. func (c *BackendServicesListCall) Header() http.Header {
  32676. if c.header_ == nil {
  32677. c.header_ = make(http.Header)
  32678. }
  32679. return c.header_
  32680. }
  32681. func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  32682. reqHeaders := make(http.Header)
  32683. for k, v := range c.header_ {
  32684. reqHeaders[k] = v
  32685. }
  32686. reqHeaders.Set("User-Agent", c.s.userAgent())
  32687. if c.ifNoneMatch_ != "" {
  32688. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32689. }
  32690. var body io.Reader = nil
  32691. c.urlParams_.Set("alt", alt)
  32692. c.urlParams_.Set("prettyPrint", "false")
  32693. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices")
  32694. urls += "?" + c.urlParams_.Encode()
  32695. req, err := http.NewRequest("GET", urls, body)
  32696. if err != nil {
  32697. return nil, err
  32698. }
  32699. req.Header = reqHeaders
  32700. googleapi.Expand(req.URL, map[string]string{
  32701. "project": c.project,
  32702. })
  32703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32704. }
  32705. // Do executes the "compute.backendServices.list" call.
  32706. // Exactly one of *BackendServiceList or error will be non-nil. Any
  32707. // non-2xx status code is an error. Response headers are in either
  32708. // *BackendServiceList.ServerResponse.Header or (if a response was
  32709. // returned at all) in error.(*googleapi.Error).Header. Use
  32710. // googleapi.IsNotModified to check whether the returned error was
  32711. // because http.StatusNotModified was returned.
  32712. func (c *BackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  32713. gensupport.SetOptions(c.urlParams_, opts...)
  32714. res, err := c.doRequest("json")
  32715. if res != nil && res.StatusCode == http.StatusNotModified {
  32716. if res.Body != nil {
  32717. res.Body.Close()
  32718. }
  32719. return nil, &googleapi.Error{
  32720. Code: res.StatusCode,
  32721. Header: res.Header,
  32722. }
  32723. }
  32724. if err != nil {
  32725. return nil, err
  32726. }
  32727. defer googleapi.CloseBody(res)
  32728. if err := googleapi.CheckResponse(res); err != nil {
  32729. return nil, err
  32730. }
  32731. ret := &BackendServiceList{
  32732. ServerResponse: googleapi.ServerResponse{
  32733. Header: res.Header,
  32734. HTTPStatusCode: res.StatusCode,
  32735. },
  32736. }
  32737. target := &ret
  32738. if err := gensupport.DecodeResponse(target, res); err != nil {
  32739. return nil, err
  32740. }
  32741. return ret, nil
  32742. // {
  32743. // "description": "Retrieves the list of BackendService resources available to the specified project.",
  32744. // "httpMethod": "GET",
  32745. // "id": "compute.backendServices.list",
  32746. // "parameterOrder": [
  32747. // "project"
  32748. // ],
  32749. // "parameters": {
  32750. // "filter": {
  32751. // "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).",
  32752. // "location": "query",
  32753. // "type": "string"
  32754. // },
  32755. // "maxResults": {
  32756. // "default": "500",
  32757. // "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)",
  32758. // "format": "uint32",
  32759. // "location": "query",
  32760. // "minimum": "0",
  32761. // "type": "integer"
  32762. // },
  32763. // "orderBy": {
  32764. // "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.",
  32765. // "location": "query",
  32766. // "type": "string"
  32767. // },
  32768. // "pageToken": {
  32769. // "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.",
  32770. // "location": "query",
  32771. // "type": "string"
  32772. // },
  32773. // "project": {
  32774. // "description": "Project ID for this request.",
  32775. // "location": "path",
  32776. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32777. // "required": true,
  32778. // "type": "string"
  32779. // }
  32780. // },
  32781. // "path": "{project}/global/backendServices",
  32782. // "response": {
  32783. // "$ref": "BackendServiceList"
  32784. // },
  32785. // "scopes": [
  32786. // "https://www.googleapis.com/auth/cloud-platform",
  32787. // "https://www.googleapis.com/auth/compute",
  32788. // "https://www.googleapis.com/auth/compute.readonly"
  32789. // ]
  32790. // }
  32791. }
  32792. // Pages invokes f for each page of results.
  32793. // A non-nil error returned from f will halt the iteration.
  32794. // The provided context supersedes any context provided to the Context method.
  32795. func (c *BackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  32796. c.ctx_ = ctx
  32797. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32798. for {
  32799. x, err := c.Do()
  32800. if err != nil {
  32801. return err
  32802. }
  32803. if err := f(x); err != nil {
  32804. return err
  32805. }
  32806. if x.NextPageToken == "" {
  32807. return nil
  32808. }
  32809. c.PageToken(x.NextPageToken)
  32810. }
  32811. }
  32812. // method id "compute.backendServices.patch":
  32813. type BackendServicesPatchCall struct {
  32814. s *Service
  32815. project string
  32816. backendService string
  32817. backendservice *BackendService
  32818. urlParams_ gensupport.URLParams
  32819. ctx_ context.Context
  32820. header_ http.Header
  32821. }
  32822. // Patch: Patches the specified BackendService resource with the data
  32823. // included in the request. There are several restrictions and
  32824. // guidelines to keep in mind when updating a backend service. Read
  32825. // Restrictions and Guidelines for more information. This method
  32826. // supports PATCH semantics and uses the JSON merge patch format and
  32827. // processing rules.
  32828. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch
  32829. func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall {
  32830. c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32831. c.project = project
  32832. c.backendService = backendService
  32833. c.backendservice = backendservice
  32834. return c
  32835. }
  32836. // RequestId sets the optional parameter "requestId": An optional
  32837. // request ID to identify requests. Specify a unique request ID so that
  32838. // if you must retry your request, the server will know to ignore the
  32839. // request if it has already been completed.
  32840. //
  32841. // For example, consider a situation where you make an initial request
  32842. // and the request times out. If you make the request again with the
  32843. // same request ID, the server can check if original operation with the
  32844. // same request ID was received, and if so, will ignore the second
  32845. // request. This prevents clients from accidentally creating duplicate
  32846. // commitments.
  32847. //
  32848. // The request ID must be a valid UUID with the exception that zero UUID
  32849. // is not supported (00000000-0000-0000-0000-000000000000).
  32850. func (c *BackendServicesPatchCall) RequestId(requestId string) *BackendServicesPatchCall {
  32851. c.urlParams_.Set("requestId", requestId)
  32852. return c
  32853. }
  32854. // Fields allows partial responses to be retrieved. See
  32855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32856. // for more information.
  32857. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall {
  32858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32859. return c
  32860. }
  32861. // Context sets the context to be used in this call's Do method. Any
  32862. // pending HTTP request will be aborted if the provided context is
  32863. // canceled.
  32864. func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall {
  32865. c.ctx_ = ctx
  32866. return c
  32867. }
  32868. // Header returns an http.Header that can be modified by the caller to
  32869. // add HTTP headers to the request.
  32870. func (c *BackendServicesPatchCall) Header() http.Header {
  32871. if c.header_ == nil {
  32872. c.header_ = make(http.Header)
  32873. }
  32874. return c.header_
  32875. }
  32876. func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  32877. reqHeaders := make(http.Header)
  32878. for k, v := range c.header_ {
  32879. reqHeaders[k] = v
  32880. }
  32881. reqHeaders.Set("User-Agent", c.s.userAgent())
  32882. var body io.Reader = nil
  32883. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  32884. if err != nil {
  32885. return nil, err
  32886. }
  32887. reqHeaders.Set("Content-Type", "application/json")
  32888. c.urlParams_.Set("alt", alt)
  32889. c.urlParams_.Set("prettyPrint", "false")
  32890. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  32891. urls += "?" + c.urlParams_.Encode()
  32892. req, err := http.NewRequest("PATCH", urls, body)
  32893. if err != nil {
  32894. return nil, err
  32895. }
  32896. req.Header = reqHeaders
  32897. googleapi.Expand(req.URL, map[string]string{
  32898. "project": c.project,
  32899. "backendService": c.backendService,
  32900. })
  32901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32902. }
  32903. // Do executes the "compute.backendServices.patch" call.
  32904. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  32905. // status code is an error. Response headers are in either
  32906. // *Operation.ServerResponse.Header or (if a response was returned at
  32907. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  32908. // to check whether the returned error was because
  32909. // http.StatusNotModified was returned.
  32910. func (c *BackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  32911. gensupport.SetOptions(c.urlParams_, opts...)
  32912. res, err := c.doRequest("json")
  32913. if res != nil && res.StatusCode == http.StatusNotModified {
  32914. if res.Body != nil {
  32915. res.Body.Close()
  32916. }
  32917. return nil, &googleapi.Error{
  32918. Code: res.StatusCode,
  32919. Header: res.Header,
  32920. }
  32921. }
  32922. if err != nil {
  32923. return nil, err
  32924. }
  32925. defer googleapi.CloseBody(res)
  32926. if err := googleapi.CheckResponse(res); err != nil {
  32927. return nil, err
  32928. }
  32929. ret := &Operation{
  32930. ServerResponse: googleapi.ServerResponse{
  32931. Header: res.Header,
  32932. HTTPStatusCode: res.StatusCode,
  32933. },
  32934. }
  32935. target := &ret
  32936. if err := gensupport.DecodeResponse(target, res); err != nil {
  32937. return nil, err
  32938. }
  32939. return ret, nil
  32940. // {
  32941. // "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.",
  32942. // "httpMethod": "PATCH",
  32943. // "id": "compute.backendServices.patch",
  32944. // "parameterOrder": [
  32945. // "project",
  32946. // "backendService"
  32947. // ],
  32948. // "parameters": {
  32949. // "backendService": {
  32950. // "description": "Name of the BackendService resource to patch.",
  32951. // "location": "path",
  32952. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  32953. // "required": true,
  32954. // "type": "string"
  32955. // },
  32956. // "project": {
  32957. // "description": "Project ID for this request.",
  32958. // "location": "path",
  32959. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  32960. // "required": true,
  32961. // "type": "string"
  32962. // },
  32963. // "requestId": {
  32964. // "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).",
  32965. // "location": "query",
  32966. // "type": "string"
  32967. // }
  32968. // },
  32969. // "path": "{project}/global/backendServices/{backendService}",
  32970. // "request": {
  32971. // "$ref": "BackendService"
  32972. // },
  32973. // "response": {
  32974. // "$ref": "Operation"
  32975. // },
  32976. // "scopes": [
  32977. // "https://www.googleapis.com/auth/cloud-platform",
  32978. // "https://www.googleapis.com/auth/compute"
  32979. // ]
  32980. // }
  32981. }
  32982. // method id "compute.backendServices.setSecurityPolicy":
  32983. type BackendServicesSetSecurityPolicyCall struct {
  32984. s *Service
  32985. project string
  32986. backendService string
  32987. securitypolicyreference *SecurityPolicyReference
  32988. urlParams_ gensupport.URLParams
  32989. ctx_ context.Context
  32990. header_ http.Header
  32991. }
  32992. // SetSecurityPolicy: Sets the security policy for the specified backend
  32993. // service.
  32994. func (r *BackendServicesService) SetSecurityPolicy(project string, backendService string, securitypolicyreference *SecurityPolicyReference) *BackendServicesSetSecurityPolicyCall {
  32995. c := &BackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32996. c.project = project
  32997. c.backendService = backendService
  32998. c.securitypolicyreference = securitypolicyreference
  32999. return c
  33000. }
  33001. // RequestId sets the optional parameter "requestId": An optional
  33002. // request ID to identify requests. Specify a unique request ID so that
  33003. // if you must retry your request, the server will know to ignore the
  33004. // request if it has already been completed.
  33005. //
  33006. // For example, consider a situation where you make an initial request
  33007. // and the request times out. If you make the request again with the
  33008. // same request ID, the server can check if original operation with the
  33009. // same request ID was received, and if so, will ignore the second
  33010. // request. This prevents clients from accidentally creating duplicate
  33011. // commitments.
  33012. //
  33013. // The request ID must be a valid UUID with the exception that zero UUID
  33014. // is not supported (00000000-0000-0000-0000-000000000000).
  33015. func (c *BackendServicesSetSecurityPolicyCall) RequestId(requestId string) *BackendServicesSetSecurityPolicyCall {
  33016. c.urlParams_.Set("requestId", requestId)
  33017. return c
  33018. }
  33019. // Fields allows partial responses to be retrieved. See
  33020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33021. // for more information.
  33022. func (c *BackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *BackendServicesSetSecurityPolicyCall {
  33023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33024. return c
  33025. }
  33026. // Context sets the context to be used in this call's Do method. Any
  33027. // pending HTTP request will be aborted if the provided context is
  33028. // canceled.
  33029. func (c *BackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *BackendServicesSetSecurityPolicyCall {
  33030. c.ctx_ = ctx
  33031. return c
  33032. }
  33033. // Header returns an http.Header that can be modified by the caller to
  33034. // add HTTP headers to the request.
  33035. func (c *BackendServicesSetSecurityPolicyCall) Header() http.Header {
  33036. if c.header_ == nil {
  33037. c.header_ = make(http.Header)
  33038. }
  33039. return c.header_
  33040. }
  33041. func (c *BackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) {
  33042. reqHeaders := make(http.Header)
  33043. for k, v := range c.header_ {
  33044. reqHeaders[k] = v
  33045. }
  33046. reqHeaders.Set("User-Agent", c.s.userAgent())
  33047. var body io.Reader = nil
  33048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference)
  33049. if err != nil {
  33050. return nil, err
  33051. }
  33052. reqHeaders.Set("Content-Type", "application/json")
  33053. c.urlParams_.Set("alt", alt)
  33054. c.urlParams_.Set("prettyPrint", "false")
  33055. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/setSecurityPolicy")
  33056. urls += "?" + c.urlParams_.Encode()
  33057. req, err := http.NewRequest("POST", urls, body)
  33058. if err != nil {
  33059. return nil, err
  33060. }
  33061. req.Header = reqHeaders
  33062. googleapi.Expand(req.URL, map[string]string{
  33063. "project": c.project,
  33064. "backendService": c.backendService,
  33065. })
  33066. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33067. }
  33068. // Do executes the "compute.backendServices.setSecurityPolicy" call.
  33069. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33070. // status code is an error. Response headers are in either
  33071. // *Operation.ServerResponse.Header or (if a response was returned at
  33072. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33073. // to check whether the returned error was because
  33074. // http.StatusNotModified was returned.
  33075. func (c *BackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33076. gensupport.SetOptions(c.urlParams_, opts...)
  33077. res, err := c.doRequest("json")
  33078. if res != nil && res.StatusCode == http.StatusNotModified {
  33079. if res.Body != nil {
  33080. res.Body.Close()
  33081. }
  33082. return nil, &googleapi.Error{
  33083. Code: res.StatusCode,
  33084. Header: res.Header,
  33085. }
  33086. }
  33087. if err != nil {
  33088. return nil, err
  33089. }
  33090. defer googleapi.CloseBody(res)
  33091. if err := googleapi.CheckResponse(res); err != nil {
  33092. return nil, err
  33093. }
  33094. ret := &Operation{
  33095. ServerResponse: googleapi.ServerResponse{
  33096. Header: res.Header,
  33097. HTTPStatusCode: res.StatusCode,
  33098. },
  33099. }
  33100. target := &ret
  33101. if err := gensupport.DecodeResponse(target, res); err != nil {
  33102. return nil, err
  33103. }
  33104. return ret, nil
  33105. // {
  33106. // "description": "Sets the security policy for the specified backend service.",
  33107. // "httpMethod": "POST",
  33108. // "id": "compute.backendServices.setSecurityPolicy",
  33109. // "parameterOrder": [
  33110. // "project",
  33111. // "backendService"
  33112. // ],
  33113. // "parameters": {
  33114. // "backendService": {
  33115. // "description": "Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035.",
  33116. // "location": "path",
  33117. // "required": true,
  33118. // "type": "string"
  33119. // },
  33120. // "project": {
  33121. // "description": "Project ID for this request.",
  33122. // "location": "path",
  33123. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33124. // "required": true,
  33125. // "type": "string"
  33126. // },
  33127. // "requestId": {
  33128. // "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).",
  33129. // "location": "query",
  33130. // "type": "string"
  33131. // }
  33132. // },
  33133. // "path": "{project}/global/backendServices/{backendService}/setSecurityPolicy",
  33134. // "request": {
  33135. // "$ref": "SecurityPolicyReference"
  33136. // },
  33137. // "response": {
  33138. // "$ref": "Operation"
  33139. // },
  33140. // "scopes": [
  33141. // "https://www.googleapis.com/auth/cloud-platform",
  33142. // "https://www.googleapis.com/auth/compute"
  33143. // ]
  33144. // }
  33145. }
  33146. // method id "compute.backendServices.update":
  33147. type BackendServicesUpdateCall struct {
  33148. s *Service
  33149. project string
  33150. backendService string
  33151. backendservice *BackendService
  33152. urlParams_ gensupport.URLParams
  33153. ctx_ context.Context
  33154. header_ http.Header
  33155. }
  33156. // Update: Updates the specified BackendService resource with the data
  33157. // included in the request. There are several restrictions and
  33158. // guidelines to keep in mind when updating a backend service. Read
  33159. // Restrictions and Guidelines for more information.
  33160. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update
  33161. func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall {
  33162. c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33163. c.project = project
  33164. c.backendService = backendService
  33165. c.backendservice = backendservice
  33166. return c
  33167. }
  33168. // RequestId sets the optional parameter "requestId": An optional
  33169. // request ID to identify requests. Specify a unique request ID so that
  33170. // if you must retry your request, the server will know to ignore the
  33171. // request if it has already been completed.
  33172. //
  33173. // For example, consider a situation where you make an initial request
  33174. // and the request times out. If you make the request again with the
  33175. // same request ID, the server can check if original operation with the
  33176. // same request ID was received, and if so, will ignore the second
  33177. // request. This prevents clients from accidentally creating duplicate
  33178. // commitments.
  33179. //
  33180. // The request ID must be a valid UUID with the exception that zero UUID
  33181. // is not supported (00000000-0000-0000-0000-000000000000).
  33182. func (c *BackendServicesUpdateCall) RequestId(requestId string) *BackendServicesUpdateCall {
  33183. c.urlParams_.Set("requestId", requestId)
  33184. return c
  33185. }
  33186. // Fields allows partial responses to be retrieved. See
  33187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33188. // for more information.
  33189. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall {
  33190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33191. return c
  33192. }
  33193. // Context sets the context to be used in this call's Do method. Any
  33194. // pending HTTP request will be aborted if the provided context is
  33195. // canceled.
  33196. func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall {
  33197. c.ctx_ = ctx
  33198. return c
  33199. }
  33200. // Header returns an http.Header that can be modified by the caller to
  33201. // add HTTP headers to the request.
  33202. func (c *BackendServicesUpdateCall) Header() http.Header {
  33203. if c.header_ == nil {
  33204. c.header_ = make(http.Header)
  33205. }
  33206. return c.header_
  33207. }
  33208. func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  33209. reqHeaders := make(http.Header)
  33210. for k, v := range c.header_ {
  33211. reqHeaders[k] = v
  33212. }
  33213. reqHeaders.Set("User-Agent", c.s.userAgent())
  33214. var body io.Reader = nil
  33215. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  33216. if err != nil {
  33217. return nil, err
  33218. }
  33219. reqHeaders.Set("Content-Type", "application/json")
  33220. c.urlParams_.Set("alt", alt)
  33221. c.urlParams_.Set("prettyPrint", "false")
  33222. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}")
  33223. urls += "?" + c.urlParams_.Encode()
  33224. req, err := http.NewRequest("PUT", urls, body)
  33225. if err != nil {
  33226. return nil, err
  33227. }
  33228. req.Header = reqHeaders
  33229. googleapi.Expand(req.URL, map[string]string{
  33230. "project": c.project,
  33231. "backendService": c.backendService,
  33232. })
  33233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33234. }
  33235. // Do executes the "compute.backendServices.update" call.
  33236. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  33237. // status code is an error. Response headers are in either
  33238. // *Operation.ServerResponse.Header or (if a response was returned at
  33239. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33240. // to check whether the returned error was because
  33241. // http.StatusNotModified was returned.
  33242. func (c *BackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  33243. gensupport.SetOptions(c.urlParams_, opts...)
  33244. res, err := c.doRequest("json")
  33245. if res != nil && res.StatusCode == http.StatusNotModified {
  33246. if res.Body != nil {
  33247. res.Body.Close()
  33248. }
  33249. return nil, &googleapi.Error{
  33250. Code: res.StatusCode,
  33251. Header: res.Header,
  33252. }
  33253. }
  33254. if err != nil {
  33255. return nil, err
  33256. }
  33257. defer googleapi.CloseBody(res)
  33258. if err := googleapi.CheckResponse(res); err != nil {
  33259. return nil, err
  33260. }
  33261. ret := &Operation{
  33262. ServerResponse: googleapi.ServerResponse{
  33263. Header: res.Header,
  33264. HTTPStatusCode: res.StatusCode,
  33265. },
  33266. }
  33267. target := &ret
  33268. if err := gensupport.DecodeResponse(target, res); err != nil {
  33269. return nil, err
  33270. }
  33271. return ret, nil
  33272. // {
  33273. // "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.",
  33274. // "httpMethod": "PUT",
  33275. // "id": "compute.backendServices.update",
  33276. // "parameterOrder": [
  33277. // "project",
  33278. // "backendService"
  33279. // ],
  33280. // "parameters": {
  33281. // "backendService": {
  33282. // "description": "Name of the BackendService resource to update.",
  33283. // "location": "path",
  33284. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33285. // "required": true,
  33286. // "type": "string"
  33287. // },
  33288. // "project": {
  33289. // "description": "Project ID for this request.",
  33290. // "location": "path",
  33291. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33292. // "required": true,
  33293. // "type": "string"
  33294. // },
  33295. // "requestId": {
  33296. // "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).",
  33297. // "location": "query",
  33298. // "type": "string"
  33299. // }
  33300. // },
  33301. // "path": "{project}/global/backendServices/{backendService}",
  33302. // "request": {
  33303. // "$ref": "BackendService"
  33304. // },
  33305. // "response": {
  33306. // "$ref": "Operation"
  33307. // },
  33308. // "scopes": [
  33309. // "https://www.googleapis.com/auth/cloud-platform",
  33310. // "https://www.googleapis.com/auth/compute"
  33311. // ]
  33312. // }
  33313. }
  33314. // method id "compute.diskTypes.aggregatedList":
  33315. type DiskTypesAggregatedListCall struct {
  33316. s *Service
  33317. project string
  33318. urlParams_ gensupport.URLParams
  33319. ifNoneMatch_ string
  33320. ctx_ context.Context
  33321. header_ http.Header
  33322. }
  33323. // AggregatedList: Retrieves an aggregated list of disk types.
  33324. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList
  33325. func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall {
  33326. c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33327. c.project = project
  33328. return c
  33329. }
  33330. // Filter sets the optional parameter "filter": A filter expression that
  33331. // filters resources listed in the response. The expression must specify
  33332. // the field name, a comparison operator, and the value that you want to
  33333. // use for filtering. The value must be a string, a number, or a
  33334. // boolean. The comparison operator must be either =, !=, >, or <.
  33335. //
  33336. // For example, if you are filtering Compute Engine instances, you can
  33337. // exclude instances named example-instance by specifying name !=
  33338. // example-instance.
  33339. //
  33340. // You can also filter nested fields. For example, you could specify
  33341. // scheduling.automaticRestart = false to include instances only if they
  33342. // are not scheduled for automatic restarts. You can use filtering on
  33343. // nested fields to filter based on resource labels.
  33344. //
  33345. // To filter on multiple expressions, provide each separate expression
  33346. // within parentheses. For example, (scheduling.automaticRestart = true)
  33347. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33348. // AND expression. However, you can include AND and OR expressions
  33349. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33350. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33351. // true).
  33352. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall {
  33353. c.urlParams_.Set("filter", filter)
  33354. return c
  33355. }
  33356. // MaxResults sets the optional parameter "maxResults": The maximum
  33357. // number of results per page that should be returned. If the number of
  33358. // available results is larger than maxResults, Compute Engine returns a
  33359. // nextPageToken that can be used to get the next page of results in
  33360. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33361. // (Default: 500)
  33362. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall {
  33363. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33364. return c
  33365. }
  33366. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33367. // a certain order. By default, results are returned in alphanumerical
  33368. // order based on the resource name.
  33369. //
  33370. // You can also sort results in descending order based on the creation
  33371. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33372. // based on the creationTimestamp field in reverse chronological order
  33373. // (newest result first). Use this to sort resources like operations so
  33374. // that the newest operation is returned first.
  33375. //
  33376. // Currently, only sorting by name or creationTimestamp desc is
  33377. // supported.
  33378. func (c *DiskTypesAggregatedListCall) OrderBy(orderBy string) *DiskTypesAggregatedListCall {
  33379. c.urlParams_.Set("orderBy", orderBy)
  33380. return c
  33381. }
  33382. // PageToken sets the optional parameter "pageToken": Specifies a page
  33383. // token to use. Set pageToken to the nextPageToken returned by a
  33384. // previous list request to get the next page of results.
  33385. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall {
  33386. c.urlParams_.Set("pageToken", pageToken)
  33387. return c
  33388. }
  33389. // Fields allows partial responses to be retrieved. See
  33390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33391. // for more information.
  33392. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall {
  33393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33394. return c
  33395. }
  33396. // IfNoneMatch sets the optional parameter which makes the operation
  33397. // fail if the object's ETag matches the given value. This is useful for
  33398. // getting updates only after the object has changed since the last
  33399. // request. Use googleapi.IsNotModified to check whether the response
  33400. // error from Do is the result of In-None-Match.
  33401. func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall {
  33402. c.ifNoneMatch_ = entityTag
  33403. return c
  33404. }
  33405. // Context sets the context to be used in this call's Do method. Any
  33406. // pending HTTP request will be aborted if the provided context is
  33407. // canceled.
  33408. func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall {
  33409. c.ctx_ = ctx
  33410. return c
  33411. }
  33412. // Header returns an http.Header that can be modified by the caller to
  33413. // add HTTP headers to the request.
  33414. func (c *DiskTypesAggregatedListCall) Header() http.Header {
  33415. if c.header_ == nil {
  33416. c.header_ = make(http.Header)
  33417. }
  33418. return c.header_
  33419. }
  33420. func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  33421. reqHeaders := make(http.Header)
  33422. for k, v := range c.header_ {
  33423. reqHeaders[k] = v
  33424. }
  33425. reqHeaders.Set("User-Agent", c.s.userAgent())
  33426. if c.ifNoneMatch_ != "" {
  33427. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33428. }
  33429. var body io.Reader = nil
  33430. c.urlParams_.Set("alt", alt)
  33431. c.urlParams_.Set("prettyPrint", "false")
  33432. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes")
  33433. urls += "?" + c.urlParams_.Encode()
  33434. req, err := http.NewRequest("GET", urls, body)
  33435. if err != nil {
  33436. return nil, err
  33437. }
  33438. req.Header = reqHeaders
  33439. googleapi.Expand(req.URL, map[string]string{
  33440. "project": c.project,
  33441. })
  33442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33443. }
  33444. // Do executes the "compute.diskTypes.aggregatedList" call.
  33445. // Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any
  33446. // non-2xx status code is an error. Response headers are in either
  33447. // *DiskTypeAggregatedList.ServerResponse.Header or (if a response was
  33448. // returned at all) in error.(*googleapi.Error).Header. Use
  33449. // googleapi.IsNotModified to check whether the returned error was
  33450. // because http.StatusNotModified was returned.
  33451. func (c *DiskTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskTypeAggregatedList, error) {
  33452. gensupport.SetOptions(c.urlParams_, opts...)
  33453. res, err := c.doRequest("json")
  33454. if res != nil && res.StatusCode == http.StatusNotModified {
  33455. if res.Body != nil {
  33456. res.Body.Close()
  33457. }
  33458. return nil, &googleapi.Error{
  33459. Code: res.StatusCode,
  33460. Header: res.Header,
  33461. }
  33462. }
  33463. if err != nil {
  33464. return nil, err
  33465. }
  33466. defer googleapi.CloseBody(res)
  33467. if err := googleapi.CheckResponse(res); err != nil {
  33468. return nil, err
  33469. }
  33470. ret := &DiskTypeAggregatedList{
  33471. ServerResponse: googleapi.ServerResponse{
  33472. Header: res.Header,
  33473. HTTPStatusCode: res.StatusCode,
  33474. },
  33475. }
  33476. target := &ret
  33477. if err := gensupport.DecodeResponse(target, res); err != nil {
  33478. return nil, err
  33479. }
  33480. return ret, nil
  33481. // {
  33482. // "description": "Retrieves an aggregated list of disk types.",
  33483. // "httpMethod": "GET",
  33484. // "id": "compute.diskTypes.aggregatedList",
  33485. // "parameterOrder": [
  33486. // "project"
  33487. // ],
  33488. // "parameters": {
  33489. // "filter": {
  33490. // "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).",
  33491. // "location": "query",
  33492. // "type": "string"
  33493. // },
  33494. // "maxResults": {
  33495. // "default": "500",
  33496. // "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)",
  33497. // "format": "uint32",
  33498. // "location": "query",
  33499. // "minimum": "0",
  33500. // "type": "integer"
  33501. // },
  33502. // "orderBy": {
  33503. // "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.",
  33504. // "location": "query",
  33505. // "type": "string"
  33506. // },
  33507. // "pageToken": {
  33508. // "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.",
  33509. // "location": "query",
  33510. // "type": "string"
  33511. // },
  33512. // "project": {
  33513. // "description": "Project ID for this request.",
  33514. // "location": "path",
  33515. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33516. // "required": true,
  33517. // "type": "string"
  33518. // }
  33519. // },
  33520. // "path": "{project}/aggregated/diskTypes",
  33521. // "response": {
  33522. // "$ref": "DiskTypeAggregatedList"
  33523. // },
  33524. // "scopes": [
  33525. // "https://www.googleapis.com/auth/cloud-platform",
  33526. // "https://www.googleapis.com/auth/compute",
  33527. // "https://www.googleapis.com/auth/compute.readonly"
  33528. // ]
  33529. // }
  33530. }
  33531. // Pages invokes f for each page of results.
  33532. // A non-nil error returned from f will halt the iteration.
  33533. // The provided context supersedes any context provided to the Context method.
  33534. func (c *DiskTypesAggregatedListCall) Pages(ctx context.Context, f func(*DiskTypeAggregatedList) error) error {
  33535. c.ctx_ = ctx
  33536. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33537. for {
  33538. x, err := c.Do()
  33539. if err != nil {
  33540. return err
  33541. }
  33542. if err := f(x); err != nil {
  33543. return err
  33544. }
  33545. if x.NextPageToken == "" {
  33546. return nil
  33547. }
  33548. c.PageToken(x.NextPageToken)
  33549. }
  33550. }
  33551. // method id "compute.diskTypes.get":
  33552. type DiskTypesGetCall struct {
  33553. s *Service
  33554. project string
  33555. zone string
  33556. diskType string
  33557. urlParams_ gensupport.URLParams
  33558. ifNoneMatch_ string
  33559. ctx_ context.Context
  33560. header_ http.Header
  33561. }
  33562. // Get: Returns the specified disk type. Gets a list of available disk
  33563. // types by making a list() request.
  33564. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get
  33565. func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall {
  33566. c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33567. c.project = project
  33568. c.zone = zone
  33569. c.diskType = diskType
  33570. return c
  33571. }
  33572. // Fields allows partial responses to be retrieved. See
  33573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33574. // for more information.
  33575. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall {
  33576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33577. return c
  33578. }
  33579. // IfNoneMatch sets the optional parameter which makes the operation
  33580. // fail if the object's ETag matches the given value. This is useful for
  33581. // getting updates only after the object has changed since the last
  33582. // request. Use googleapi.IsNotModified to check whether the response
  33583. // error from Do is the result of In-None-Match.
  33584. func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall {
  33585. c.ifNoneMatch_ = entityTag
  33586. return c
  33587. }
  33588. // Context sets the context to be used in this call's Do method. Any
  33589. // pending HTTP request will be aborted if the provided context is
  33590. // canceled.
  33591. func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall {
  33592. c.ctx_ = ctx
  33593. return c
  33594. }
  33595. // Header returns an http.Header that can be modified by the caller to
  33596. // add HTTP headers to the request.
  33597. func (c *DiskTypesGetCall) Header() http.Header {
  33598. if c.header_ == nil {
  33599. c.header_ = make(http.Header)
  33600. }
  33601. return c.header_
  33602. }
  33603. func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  33604. reqHeaders := make(http.Header)
  33605. for k, v := range c.header_ {
  33606. reqHeaders[k] = v
  33607. }
  33608. reqHeaders.Set("User-Agent", c.s.userAgent())
  33609. if c.ifNoneMatch_ != "" {
  33610. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33611. }
  33612. var body io.Reader = nil
  33613. c.urlParams_.Set("alt", alt)
  33614. c.urlParams_.Set("prettyPrint", "false")
  33615. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}")
  33616. urls += "?" + c.urlParams_.Encode()
  33617. req, err := http.NewRequest("GET", urls, body)
  33618. if err != nil {
  33619. return nil, err
  33620. }
  33621. req.Header = reqHeaders
  33622. googleapi.Expand(req.URL, map[string]string{
  33623. "project": c.project,
  33624. "zone": c.zone,
  33625. "diskType": c.diskType,
  33626. })
  33627. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33628. }
  33629. // Do executes the "compute.diskTypes.get" call.
  33630. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  33631. // code is an error. Response headers are in either
  33632. // *DiskType.ServerResponse.Header or (if a response was returned at
  33633. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33634. // to check whether the returned error was because
  33635. // http.StatusNotModified was returned.
  33636. func (c *DiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  33637. gensupport.SetOptions(c.urlParams_, opts...)
  33638. res, err := c.doRequest("json")
  33639. if res != nil && res.StatusCode == http.StatusNotModified {
  33640. if res.Body != nil {
  33641. res.Body.Close()
  33642. }
  33643. return nil, &googleapi.Error{
  33644. Code: res.StatusCode,
  33645. Header: res.Header,
  33646. }
  33647. }
  33648. if err != nil {
  33649. return nil, err
  33650. }
  33651. defer googleapi.CloseBody(res)
  33652. if err := googleapi.CheckResponse(res); err != nil {
  33653. return nil, err
  33654. }
  33655. ret := &DiskType{
  33656. ServerResponse: googleapi.ServerResponse{
  33657. Header: res.Header,
  33658. HTTPStatusCode: res.StatusCode,
  33659. },
  33660. }
  33661. target := &ret
  33662. if err := gensupport.DecodeResponse(target, res); err != nil {
  33663. return nil, err
  33664. }
  33665. return ret, nil
  33666. // {
  33667. // "description": "Returns the specified disk type. Gets a list of available disk types by making a list() request.",
  33668. // "httpMethod": "GET",
  33669. // "id": "compute.diskTypes.get",
  33670. // "parameterOrder": [
  33671. // "project",
  33672. // "zone",
  33673. // "diskType"
  33674. // ],
  33675. // "parameters": {
  33676. // "diskType": {
  33677. // "description": "Name of the disk type to return.",
  33678. // "location": "path",
  33679. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  33680. // "required": true,
  33681. // "type": "string"
  33682. // },
  33683. // "project": {
  33684. // "description": "Project ID for this request.",
  33685. // "location": "path",
  33686. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33687. // "required": true,
  33688. // "type": "string"
  33689. // },
  33690. // "zone": {
  33691. // "description": "The name of the zone for this request.",
  33692. // "location": "path",
  33693. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33694. // "required": true,
  33695. // "type": "string"
  33696. // }
  33697. // },
  33698. // "path": "{project}/zones/{zone}/diskTypes/{diskType}",
  33699. // "response": {
  33700. // "$ref": "DiskType"
  33701. // },
  33702. // "scopes": [
  33703. // "https://www.googleapis.com/auth/cloud-platform",
  33704. // "https://www.googleapis.com/auth/compute",
  33705. // "https://www.googleapis.com/auth/compute.readonly"
  33706. // ]
  33707. // }
  33708. }
  33709. // method id "compute.diskTypes.list":
  33710. type DiskTypesListCall struct {
  33711. s *Service
  33712. project string
  33713. zone string
  33714. urlParams_ gensupport.URLParams
  33715. ifNoneMatch_ string
  33716. ctx_ context.Context
  33717. header_ http.Header
  33718. }
  33719. // List: Retrieves a list of disk types available to the specified
  33720. // project.
  33721. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list
  33722. func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall {
  33723. c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33724. c.project = project
  33725. c.zone = zone
  33726. return c
  33727. }
  33728. // Filter sets the optional parameter "filter": A filter expression that
  33729. // filters resources listed in the response. The expression must specify
  33730. // the field name, a comparison operator, and the value that you want to
  33731. // use for filtering. The value must be a string, a number, or a
  33732. // boolean. The comparison operator must be either =, !=, >, or <.
  33733. //
  33734. // For example, if you are filtering Compute Engine instances, you can
  33735. // exclude instances named example-instance by specifying name !=
  33736. // example-instance.
  33737. //
  33738. // You can also filter nested fields. For example, you could specify
  33739. // scheduling.automaticRestart = false to include instances only if they
  33740. // are not scheduled for automatic restarts. You can use filtering on
  33741. // nested fields to filter based on resource labels.
  33742. //
  33743. // To filter on multiple expressions, provide each separate expression
  33744. // within parentheses. For example, (scheduling.automaticRestart = true)
  33745. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33746. // AND expression. However, you can include AND and OR expressions
  33747. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33748. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33749. // true).
  33750. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall {
  33751. c.urlParams_.Set("filter", filter)
  33752. return c
  33753. }
  33754. // MaxResults sets the optional parameter "maxResults": The maximum
  33755. // number of results per page that should be returned. If the number of
  33756. // available results is larger than maxResults, Compute Engine returns a
  33757. // nextPageToken that can be used to get the next page of results in
  33758. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  33759. // (Default: 500)
  33760. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall {
  33761. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33762. return c
  33763. }
  33764. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  33765. // a certain order. By default, results are returned in alphanumerical
  33766. // order based on the resource name.
  33767. //
  33768. // You can also sort results in descending order based on the creation
  33769. // timestamp using orderBy="creationTimestamp desc". This sorts results
  33770. // based on the creationTimestamp field in reverse chronological order
  33771. // (newest result first). Use this to sort resources like operations so
  33772. // that the newest operation is returned first.
  33773. //
  33774. // Currently, only sorting by name or creationTimestamp desc is
  33775. // supported.
  33776. func (c *DiskTypesListCall) OrderBy(orderBy string) *DiskTypesListCall {
  33777. c.urlParams_.Set("orderBy", orderBy)
  33778. return c
  33779. }
  33780. // PageToken sets the optional parameter "pageToken": Specifies a page
  33781. // token to use. Set pageToken to the nextPageToken returned by a
  33782. // previous list request to get the next page of results.
  33783. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall {
  33784. c.urlParams_.Set("pageToken", pageToken)
  33785. return c
  33786. }
  33787. // Fields allows partial responses to be retrieved. See
  33788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33789. // for more information.
  33790. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall {
  33791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33792. return c
  33793. }
  33794. // IfNoneMatch sets the optional parameter which makes the operation
  33795. // fail if the object's ETag matches the given value. This is useful for
  33796. // getting updates only after the object has changed since the last
  33797. // request. Use googleapi.IsNotModified to check whether the response
  33798. // error from Do is the result of In-None-Match.
  33799. func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall {
  33800. c.ifNoneMatch_ = entityTag
  33801. return c
  33802. }
  33803. // Context sets the context to be used in this call's Do method. Any
  33804. // pending HTTP request will be aborted if the provided context is
  33805. // canceled.
  33806. func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall {
  33807. c.ctx_ = ctx
  33808. return c
  33809. }
  33810. // Header returns an http.Header that can be modified by the caller to
  33811. // add HTTP headers to the request.
  33812. func (c *DiskTypesListCall) Header() http.Header {
  33813. if c.header_ == nil {
  33814. c.header_ = make(http.Header)
  33815. }
  33816. return c.header_
  33817. }
  33818. func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  33819. reqHeaders := make(http.Header)
  33820. for k, v := range c.header_ {
  33821. reqHeaders[k] = v
  33822. }
  33823. reqHeaders.Set("User-Agent", c.s.userAgent())
  33824. if c.ifNoneMatch_ != "" {
  33825. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33826. }
  33827. var body io.Reader = nil
  33828. c.urlParams_.Set("alt", alt)
  33829. c.urlParams_.Set("prettyPrint", "false")
  33830. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes")
  33831. urls += "?" + c.urlParams_.Encode()
  33832. req, err := http.NewRequest("GET", urls, body)
  33833. if err != nil {
  33834. return nil, err
  33835. }
  33836. req.Header = reqHeaders
  33837. googleapi.Expand(req.URL, map[string]string{
  33838. "project": c.project,
  33839. "zone": c.zone,
  33840. })
  33841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33842. }
  33843. // Do executes the "compute.diskTypes.list" call.
  33844. // Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx
  33845. // status code is an error. Response headers are in either
  33846. // *DiskTypeList.ServerResponse.Header or (if a response was returned at
  33847. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  33848. // to check whether the returned error was because
  33849. // http.StatusNotModified was returned.
  33850. func (c *DiskTypesListCall) Do(opts ...googleapi.CallOption) (*DiskTypeList, error) {
  33851. gensupport.SetOptions(c.urlParams_, opts...)
  33852. res, err := c.doRequest("json")
  33853. if res != nil && res.StatusCode == http.StatusNotModified {
  33854. if res.Body != nil {
  33855. res.Body.Close()
  33856. }
  33857. return nil, &googleapi.Error{
  33858. Code: res.StatusCode,
  33859. Header: res.Header,
  33860. }
  33861. }
  33862. if err != nil {
  33863. return nil, err
  33864. }
  33865. defer googleapi.CloseBody(res)
  33866. if err := googleapi.CheckResponse(res); err != nil {
  33867. return nil, err
  33868. }
  33869. ret := &DiskTypeList{
  33870. ServerResponse: googleapi.ServerResponse{
  33871. Header: res.Header,
  33872. HTTPStatusCode: res.StatusCode,
  33873. },
  33874. }
  33875. target := &ret
  33876. if err := gensupport.DecodeResponse(target, res); err != nil {
  33877. return nil, err
  33878. }
  33879. return ret, nil
  33880. // {
  33881. // "description": "Retrieves a list of disk types available to the specified project.",
  33882. // "httpMethod": "GET",
  33883. // "id": "compute.diskTypes.list",
  33884. // "parameterOrder": [
  33885. // "project",
  33886. // "zone"
  33887. // ],
  33888. // "parameters": {
  33889. // "filter": {
  33890. // "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).",
  33891. // "location": "query",
  33892. // "type": "string"
  33893. // },
  33894. // "maxResults": {
  33895. // "default": "500",
  33896. // "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)",
  33897. // "format": "uint32",
  33898. // "location": "query",
  33899. // "minimum": "0",
  33900. // "type": "integer"
  33901. // },
  33902. // "orderBy": {
  33903. // "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.",
  33904. // "location": "query",
  33905. // "type": "string"
  33906. // },
  33907. // "pageToken": {
  33908. // "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.",
  33909. // "location": "query",
  33910. // "type": "string"
  33911. // },
  33912. // "project": {
  33913. // "description": "Project ID for this request.",
  33914. // "location": "path",
  33915. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  33916. // "required": true,
  33917. // "type": "string"
  33918. // },
  33919. // "zone": {
  33920. // "description": "The name of the zone for this request.",
  33921. // "location": "path",
  33922. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  33923. // "required": true,
  33924. // "type": "string"
  33925. // }
  33926. // },
  33927. // "path": "{project}/zones/{zone}/diskTypes",
  33928. // "response": {
  33929. // "$ref": "DiskTypeList"
  33930. // },
  33931. // "scopes": [
  33932. // "https://www.googleapis.com/auth/cloud-platform",
  33933. // "https://www.googleapis.com/auth/compute",
  33934. // "https://www.googleapis.com/auth/compute.readonly"
  33935. // ]
  33936. // }
  33937. }
  33938. // Pages invokes f for each page of results.
  33939. // A non-nil error returned from f will halt the iteration.
  33940. // The provided context supersedes any context provided to the Context method.
  33941. func (c *DiskTypesListCall) Pages(ctx context.Context, f func(*DiskTypeList) error) error {
  33942. c.ctx_ = ctx
  33943. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33944. for {
  33945. x, err := c.Do()
  33946. if err != nil {
  33947. return err
  33948. }
  33949. if err := f(x); err != nil {
  33950. return err
  33951. }
  33952. if x.NextPageToken == "" {
  33953. return nil
  33954. }
  33955. c.PageToken(x.NextPageToken)
  33956. }
  33957. }
  33958. // method id "compute.disks.aggregatedList":
  33959. type DisksAggregatedListCall struct {
  33960. s *Service
  33961. project string
  33962. urlParams_ gensupport.URLParams
  33963. ifNoneMatch_ string
  33964. ctx_ context.Context
  33965. header_ http.Header
  33966. }
  33967. // AggregatedList: Retrieves an aggregated list of persistent disks.
  33968. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList
  33969. func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall {
  33970. c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33971. c.project = project
  33972. return c
  33973. }
  33974. // Filter sets the optional parameter "filter": A filter expression that
  33975. // filters resources listed in the response. The expression must specify
  33976. // the field name, a comparison operator, and the value that you want to
  33977. // use for filtering. The value must be a string, a number, or a
  33978. // boolean. The comparison operator must be either =, !=, >, or <.
  33979. //
  33980. // For example, if you are filtering Compute Engine instances, you can
  33981. // exclude instances named example-instance by specifying name !=
  33982. // example-instance.
  33983. //
  33984. // You can also filter nested fields. For example, you could specify
  33985. // scheduling.automaticRestart = false to include instances only if they
  33986. // are not scheduled for automatic restarts. You can use filtering on
  33987. // nested fields to filter based on resource labels.
  33988. //
  33989. // To filter on multiple expressions, provide each separate expression
  33990. // within parentheses. For example, (scheduling.automaticRestart = true)
  33991. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  33992. // AND expression. However, you can include AND and OR expressions
  33993. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  33994. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  33995. // true).
  33996. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall {
  33997. c.urlParams_.Set("filter", filter)
  33998. return c
  33999. }
  34000. // MaxResults sets the optional parameter "maxResults": The maximum
  34001. // number of results per page that should be returned. If the number of
  34002. // available results is larger than maxResults, Compute Engine returns a
  34003. // nextPageToken that can be used to get the next page of results in
  34004. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  34005. // (Default: 500)
  34006. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall {
  34007. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34008. return c
  34009. }
  34010. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  34011. // a certain order. By default, results are returned in alphanumerical
  34012. // order based on the resource name.
  34013. //
  34014. // You can also sort results in descending order based on the creation
  34015. // timestamp using orderBy="creationTimestamp desc". This sorts results
  34016. // based on the creationTimestamp field in reverse chronological order
  34017. // (newest result first). Use this to sort resources like operations so
  34018. // that the newest operation is returned first.
  34019. //
  34020. // Currently, only sorting by name or creationTimestamp desc is
  34021. // supported.
  34022. func (c *DisksAggregatedListCall) OrderBy(orderBy string) *DisksAggregatedListCall {
  34023. c.urlParams_.Set("orderBy", orderBy)
  34024. return c
  34025. }
  34026. // PageToken sets the optional parameter "pageToken": Specifies a page
  34027. // token to use. Set pageToken to the nextPageToken returned by a
  34028. // previous list request to get the next page of results.
  34029. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall {
  34030. c.urlParams_.Set("pageToken", pageToken)
  34031. return c
  34032. }
  34033. // Fields allows partial responses to be retrieved. See
  34034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34035. // for more information.
  34036. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall {
  34037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34038. return c
  34039. }
  34040. // IfNoneMatch sets the optional parameter which makes the operation
  34041. // fail if the object's ETag matches the given value. This is useful for
  34042. // getting updates only after the object has changed since the last
  34043. // request. Use googleapi.IsNotModified to check whether the response
  34044. // error from Do is the result of In-None-Match.
  34045. func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall {
  34046. c.ifNoneMatch_ = entityTag
  34047. return c
  34048. }
  34049. // Context sets the context to be used in this call's Do method. Any
  34050. // pending HTTP request will be aborted if the provided context is
  34051. // canceled.
  34052. func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall {
  34053. c.ctx_ = ctx
  34054. return c
  34055. }
  34056. // Header returns an http.Header that can be modified by the caller to
  34057. // add HTTP headers to the request.
  34058. func (c *DisksAggregatedListCall) Header() http.Header {
  34059. if c.header_ == nil {
  34060. c.header_ = make(http.Header)
  34061. }
  34062. return c.header_
  34063. }
  34064. func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  34065. reqHeaders := make(http.Header)
  34066. for k, v := range c.header_ {
  34067. reqHeaders[k] = v
  34068. }
  34069. reqHeaders.Set("User-Agent", c.s.userAgent())
  34070. if c.ifNoneMatch_ != "" {
  34071. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34072. }
  34073. var body io.Reader = nil
  34074. c.urlParams_.Set("alt", alt)
  34075. c.urlParams_.Set("prettyPrint", "false")
  34076. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks")
  34077. urls += "?" + c.urlParams_.Encode()
  34078. req, err := http.NewRequest("GET", urls, body)
  34079. if err != nil {
  34080. return nil, err
  34081. }
  34082. req.Header = reqHeaders
  34083. googleapi.Expand(req.URL, map[string]string{
  34084. "project": c.project,
  34085. })
  34086. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34087. }
  34088. // Do executes the "compute.disks.aggregatedList" call.
  34089. // Exactly one of *DiskAggregatedList or error will be non-nil. Any
  34090. // non-2xx status code is an error. Response headers are in either
  34091. // *DiskAggregatedList.ServerResponse.Header or (if a response was
  34092. // returned at all) in error.(*googleapi.Error).Header. Use
  34093. // googleapi.IsNotModified to check whether the returned error was
  34094. // because http.StatusNotModified was returned.
  34095. func (c *DisksAggregatedListCall) Do(opts ...googleapi.CallOption) (*DiskAggregatedList, error) {
  34096. gensupport.SetOptions(c.urlParams_, opts...)
  34097. res, err := c.doRequest("json")
  34098. if res != nil && res.StatusCode == http.StatusNotModified {
  34099. if res.Body != nil {
  34100. res.Body.Close()
  34101. }
  34102. return nil, &googleapi.Error{
  34103. Code: res.StatusCode,
  34104. Header: res.Header,
  34105. }
  34106. }
  34107. if err != nil {
  34108. return nil, err
  34109. }
  34110. defer googleapi.CloseBody(res)
  34111. if err := googleapi.CheckResponse(res); err != nil {
  34112. return nil, err
  34113. }
  34114. ret := &DiskAggregatedList{
  34115. ServerResponse: googleapi.ServerResponse{
  34116. Header: res.Header,
  34117. HTTPStatusCode: res.StatusCode,
  34118. },
  34119. }
  34120. target := &ret
  34121. if err := gensupport.DecodeResponse(target, res); err != nil {
  34122. return nil, err
  34123. }
  34124. return ret, nil
  34125. // {
  34126. // "description": "Retrieves an aggregated list of persistent disks.",
  34127. // "httpMethod": "GET",
  34128. // "id": "compute.disks.aggregatedList",
  34129. // "parameterOrder": [
  34130. // "project"
  34131. // ],
  34132. // "parameters": {
  34133. // "filter": {
  34134. // "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).",
  34135. // "location": "query",
  34136. // "type": "string"
  34137. // },
  34138. // "maxResults": {
  34139. // "default": "500",
  34140. // "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)",
  34141. // "format": "uint32",
  34142. // "location": "query",
  34143. // "minimum": "0",
  34144. // "type": "integer"
  34145. // },
  34146. // "orderBy": {
  34147. // "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.",
  34148. // "location": "query",
  34149. // "type": "string"
  34150. // },
  34151. // "pageToken": {
  34152. // "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.",
  34153. // "location": "query",
  34154. // "type": "string"
  34155. // },
  34156. // "project": {
  34157. // "description": "Project ID for this request.",
  34158. // "location": "path",
  34159. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34160. // "required": true,
  34161. // "type": "string"
  34162. // }
  34163. // },
  34164. // "path": "{project}/aggregated/disks",
  34165. // "response": {
  34166. // "$ref": "DiskAggregatedList"
  34167. // },
  34168. // "scopes": [
  34169. // "https://www.googleapis.com/auth/cloud-platform",
  34170. // "https://www.googleapis.com/auth/compute",
  34171. // "https://www.googleapis.com/auth/compute.readonly"
  34172. // ]
  34173. // }
  34174. }
  34175. // Pages invokes f for each page of results.
  34176. // A non-nil error returned from f will halt the iteration.
  34177. // The provided context supersedes any context provided to the Context method.
  34178. func (c *DisksAggregatedListCall) Pages(ctx context.Context, f func(*DiskAggregatedList) error) error {
  34179. c.ctx_ = ctx
  34180. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34181. for {
  34182. x, err := c.Do()
  34183. if err != nil {
  34184. return err
  34185. }
  34186. if err := f(x); err != nil {
  34187. return err
  34188. }
  34189. if x.NextPageToken == "" {
  34190. return nil
  34191. }
  34192. c.PageToken(x.NextPageToken)
  34193. }
  34194. }
  34195. // method id "compute.disks.createSnapshot":
  34196. type DisksCreateSnapshotCall struct {
  34197. s *Service
  34198. project string
  34199. zone string
  34200. disk string
  34201. snapshot *Snapshot
  34202. urlParams_ gensupport.URLParams
  34203. ctx_ context.Context
  34204. header_ http.Header
  34205. }
  34206. // CreateSnapshot: Creates a snapshot of a specified persistent disk.
  34207. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot
  34208. func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall {
  34209. c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34210. c.project = project
  34211. c.zone = zone
  34212. c.disk = disk
  34213. c.snapshot = snapshot
  34214. return c
  34215. }
  34216. // GuestFlush sets the optional parameter "guestFlush": [Input Only]
  34217. // Specifies to create an application consistent snapshot by informing
  34218. // the OS to prepare for the snapshot process. Currently only supported
  34219. // on Windows instances using the Volume Shadow Copy Service (VSS).
  34220. func (c *DisksCreateSnapshotCall) GuestFlush(guestFlush bool) *DisksCreateSnapshotCall {
  34221. c.urlParams_.Set("guestFlush", fmt.Sprint(guestFlush))
  34222. return c
  34223. }
  34224. // RequestId sets the optional parameter "requestId": An optional
  34225. // request ID to identify requests. Specify a unique request ID so that
  34226. // if you must retry your request, the server will know to ignore the
  34227. // request if it has already been completed.
  34228. //
  34229. // For example, consider a situation where you make an initial request
  34230. // and the request times out. If you make the request again with the
  34231. // same request ID, the server can check if original operation with the
  34232. // same request ID was received, and if so, will ignore the second
  34233. // request. This prevents clients from accidentally creating duplicate
  34234. // commitments.
  34235. //
  34236. // The request ID must be a valid UUID with the exception that zero UUID
  34237. // is not supported (00000000-0000-0000-0000-000000000000).
  34238. func (c *DisksCreateSnapshotCall) RequestId(requestId string) *DisksCreateSnapshotCall {
  34239. c.urlParams_.Set("requestId", requestId)
  34240. return c
  34241. }
  34242. // Fields allows partial responses to be retrieved. See
  34243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34244. // for more information.
  34245. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall {
  34246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34247. return c
  34248. }
  34249. // Context sets the context to be used in this call's Do method. Any
  34250. // pending HTTP request will be aborted if the provided context is
  34251. // canceled.
  34252. func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall {
  34253. c.ctx_ = ctx
  34254. return c
  34255. }
  34256. // Header returns an http.Header that can be modified by the caller to
  34257. // add HTTP headers to the request.
  34258. func (c *DisksCreateSnapshotCall) Header() http.Header {
  34259. if c.header_ == nil {
  34260. c.header_ = make(http.Header)
  34261. }
  34262. return c.header_
  34263. }
  34264. func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  34265. reqHeaders := make(http.Header)
  34266. for k, v := range c.header_ {
  34267. reqHeaders[k] = v
  34268. }
  34269. reqHeaders.Set("User-Agent", c.s.userAgent())
  34270. var body io.Reader = nil
  34271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  34272. if err != nil {
  34273. return nil, err
  34274. }
  34275. reqHeaders.Set("Content-Type", "application/json")
  34276. c.urlParams_.Set("alt", alt)
  34277. c.urlParams_.Set("prettyPrint", "false")
  34278. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot")
  34279. urls += "?" + c.urlParams_.Encode()
  34280. req, err := http.NewRequest("POST", urls, body)
  34281. if err != nil {
  34282. return nil, err
  34283. }
  34284. req.Header = reqHeaders
  34285. googleapi.Expand(req.URL, map[string]string{
  34286. "project": c.project,
  34287. "zone": c.zone,
  34288. "disk": c.disk,
  34289. })
  34290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34291. }
  34292. // Do executes the "compute.disks.createSnapshot" call.
  34293. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34294. // status code is an error. Response headers are in either
  34295. // *Operation.ServerResponse.Header or (if a response was returned at
  34296. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34297. // to check whether the returned error was because
  34298. // http.StatusNotModified was returned.
  34299. func (c *DisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34300. gensupport.SetOptions(c.urlParams_, opts...)
  34301. res, err := c.doRequest("json")
  34302. if res != nil && res.StatusCode == http.StatusNotModified {
  34303. if res.Body != nil {
  34304. res.Body.Close()
  34305. }
  34306. return nil, &googleapi.Error{
  34307. Code: res.StatusCode,
  34308. Header: res.Header,
  34309. }
  34310. }
  34311. if err != nil {
  34312. return nil, err
  34313. }
  34314. defer googleapi.CloseBody(res)
  34315. if err := googleapi.CheckResponse(res); err != nil {
  34316. return nil, err
  34317. }
  34318. ret := &Operation{
  34319. ServerResponse: googleapi.ServerResponse{
  34320. Header: res.Header,
  34321. HTTPStatusCode: res.StatusCode,
  34322. },
  34323. }
  34324. target := &ret
  34325. if err := gensupport.DecodeResponse(target, res); err != nil {
  34326. return nil, err
  34327. }
  34328. return ret, nil
  34329. // {
  34330. // "description": "Creates a snapshot of a specified persistent disk.",
  34331. // "httpMethod": "POST",
  34332. // "id": "compute.disks.createSnapshot",
  34333. // "parameterOrder": [
  34334. // "project",
  34335. // "zone",
  34336. // "disk"
  34337. // ],
  34338. // "parameters": {
  34339. // "disk": {
  34340. // "description": "Name of the persistent disk to snapshot.",
  34341. // "location": "path",
  34342. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34343. // "required": true,
  34344. // "type": "string"
  34345. // },
  34346. // "guestFlush": {
  34347. // "description": "[Input Only] Specifies to create an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS).",
  34348. // "location": "query",
  34349. // "type": "boolean"
  34350. // },
  34351. // "project": {
  34352. // "description": "Project ID for this request.",
  34353. // "location": "path",
  34354. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34355. // "required": true,
  34356. // "type": "string"
  34357. // },
  34358. // "requestId": {
  34359. // "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).",
  34360. // "location": "query",
  34361. // "type": "string"
  34362. // },
  34363. // "zone": {
  34364. // "description": "The name of the zone for this request.",
  34365. // "location": "path",
  34366. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34367. // "required": true,
  34368. // "type": "string"
  34369. // }
  34370. // },
  34371. // "path": "{project}/zones/{zone}/disks/{disk}/createSnapshot",
  34372. // "request": {
  34373. // "$ref": "Snapshot"
  34374. // },
  34375. // "response": {
  34376. // "$ref": "Operation"
  34377. // },
  34378. // "scopes": [
  34379. // "https://www.googleapis.com/auth/cloud-platform",
  34380. // "https://www.googleapis.com/auth/compute"
  34381. // ]
  34382. // }
  34383. }
  34384. // method id "compute.disks.delete":
  34385. type DisksDeleteCall struct {
  34386. s *Service
  34387. project string
  34388. zone string
  34389. disk string
  34390. urlParams_ gensupport.URLParams
  34391. ctx_ context.Context
  34392. header_ http.Header
  34393. }
  34394. // Delete: Deletes the specified persistent disk. Deleting a disk
  34395. // removes its data permanently and is irreversible. However, deleting a
  34396. // disk does not delete any snapshots previously made from the disk. You
  34397. // must separately delete snapshots.
  34398. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete
  34399. func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall {
  34400. c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34401. c.project = project
  34402. c.zone = zone
  34403. c.disk = disk
  34404. return c
  34405. }
  34406. // RequestId sets the optional parameter "requestId": An optional
  34407. // request ID to identify requests. Specify a unique request ID so that
  34408. // if you must retry your request, the server will know to ignore the
  34409. // request if it has already been completed.
  34410. //
  34411. // For example, consider a situation where you make an initial request
  34412. // and the request times out. If you make the request again with the
  34413. // same request ID, the server can check if original operation with the
  34414. // same request ID was received, and if so, will ignore the second
  34415. // request. This prevents clients from accidentally creating duplicate
  34416. // commitments.
  34417. //
  34418. // The request ID must be a valid UUID with the exception that zero UUID
  34419. // is not supported (00000000-0000-0000-0000-000000000000).
  34420. func (c *DisksDeleteCall) RequestId(requestId string) *DisksDeleteCall {
  34421. c.urlParams_.Set("requestId", requestId)
  34422. return c
  34423. }
  34424. // Fields allows partial responses to be retrieved. See
  34425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34426. // for more information.
  34427. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall {
  34428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34429. return c
  34430. }
  34431. // Context sets the context to be used in this call's Do method. Any
  34432. // pending HTTP request will be aborted if the provided context is
  34433. // canceled.
  34434. func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall {
  34435. c.ctx_ = ctx
  34436. return c
  34437. }
  34438. // Header returns an http.Header that can be modified by the caller to
  34439. // add HTTP headers to the request.
  34440. func (c *DisksDeleteCall) Header() http.Header {
  34441. if c.header_ == nil {
  34442. c.header_ = make(http.Header)
  34443. }
  34444. return c.header_
  34445. }
  34446. func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  34447. reqHeaders := make(http.Header)
  34448. for k, v := range c.header_ {
  34449. reqHeaders[k] = v
  34450. }
  34451. reqHeaders.Set("User-Agent", c.s.userAgent())
  34452. var body io.Reader = nil
  34453. c.urlParams_.Set("alt", alt)
  34454. c.urlParams_.Set("prettyPrint", "false")
  34455. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  34456. urls += "?" + c.urlParams_.Encode()
  34457. req, err := http.NewRequest("DELETE", urls, body)
  34458. if err != nil {
  34459. return nil, err
  34460. }
  34461. req.Header = reqHeaders
  34462. googleapi.Expand(req.URL, map[string]string{
  34463. "project": c.project,
  34464. "zone": c.zone,
  34465. "disk": c.disk,
  34466. })
  34467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34468. }
  34469. // Do executes the "compute.disks.delete" call.
  34470. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34471. // status code is an error. Response headers are in either
  34472. // *Operation.ServerResponse.Header or (if a response was returned at
  34473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34474. // to check whether the returned error was because
  34475. // http.StatusNotModified was returned.
  34476. func (c *DisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34477. gensupport.SetOptions(c.urlParams_, opts...)
  34478. res, err := c.doRequest("json")
  34479. if res != nil && res.StatusCode == http.StatusNotModified {
  34480. if res.Body != nil {
  34481. res.Body.Close()
  34482. }
  34483. return nil, &googleapi.Error{
  34484. Code: res.StatusCode,
  34485. Header: res.Header,
  34486. }
  34487. }
  34488. if err != nil {
  34489. return nil, err
  34490. }
  34491. defer googleapi.CloseBody(res)
  34492. if err := googleapi.CheckResponse(res); err != nil {
  34493. return nil, err
  34494. }
  34495. ret := &Operation{
  34496. ServerResponse: googleapi.ServerResponse{
  34497. Header: res.Header,
  34498. HTTPStatusCode: res.StatusCode,
  34499. },
  34500. }
  34501. target := &ret
  34502. if err := gensupport.DecodeResponse(target, res); err != nil {
  34503. return nil, err
  34504. }
  34505. return ret, nil
  34506. // {
  34507. // "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.",
  34508. // "httpMethod": "DELETE",
  34509. // "id": "compute.disks.delete",
  34510. // "parameterOrder": [
  34511. // "project",
  34512. // "zone",
  34513. // "disk"
  34514. // ],
  34515. // "parameters": {
  34516. // "disk": {
  34517. // "description": "Name of the persistent disk to delete.",
  34518. // "location": "path",
  34519. // "required": true,
  34520. // "type": "string"
  34521. // },
  34522. // "project": {
  34523. // "description": "Project ID for this request.",
  34524. // "location": "path",
  34525. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34526. // "required": true,
  34527. // "type": "string"
  34528. // },
  34529. // "requestId": {
  34530. // "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).",
  34531. // "location": "query",
  34532. // "type": "string"
  34533. // },
  34534. // "zone": {
  34535. // "description": "The name of the zone for this request.",
  34536. // "location": "path",
  34537. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34538. // "required": true,
  34539. // "type": "string"
  34540. // }
  34541. // },
  34542. // "path": "{project}/zones/{zone}/disks/{disk}",
  34543. // "response": {
  34544. // "$ref": "Operation"
  34545. // },
  34546. // "scopes": [
  34547. // "https://www.googleapis.com/auth/cloud-platform",
  34548. // "https://www.googleapis.com/auth/compute"
  34549. // ]
  34550. // }
  34551. }
  34552. // method id "compute.disks.get":
  34553. type DisksGetCall struct {
  34554. s *Service
  34555. project string
  34556. zone string
  34557. disk string
  34558. urlParams_ gensupport.URLParams
  34559. ifNoneMatch_ string
  34560. ctx_ context.Context
  34561. header_ http.Header
  34562. }
  34563. // Get: Returns a specified persistent disk. Gets a list of available
  34564. // persistent disks by making a list() request.
  34565. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get
  34566. func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall {
  34567. c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34568. c.project = project
  34569. c.zone = zone
  34570. c.disk = disk
  34571. return c
  34572. }
  34573. // Fields allows partial responses to be retrieved. See
  34574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34575. // for more information.
  34576. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall {
  34577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34578. return c
  34579. }
  34580. // IfNoneMatch sets the optional parameter which makes the operation
  34581. // fail if the object's ETag matches the given value. This is useful for
  34582. // getting updates only after the object has changed since the last
  34583. // request. Use googleapi.IsNotModified to check whether the response
  34584. // error from Do is the result of In-None-Match.
  34585. func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall {
  34586. c.ifNoneMatch_ = entityTag
  34587. return c
  34588. }
  34589. // Context sets the context to be used in this call's Do method. Any
  34590. // pending HTTP request will be aborted if the provided context is
  34591. // canceled.
  34592. func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall {
  34593. c.ctx_ = ctx
  34594. return c
  34595. }
  34596. // Header returns an http.Header that can be modified by the caller to
  34597. // add HTTP headers to the request.
  34598. func (c *DisksGetCall) Header() http.Header {
  34599. if c.header_ == nil {
  34600. c.header_ = make(http.Header)
  34601. }
  34602. return c.header_
  34603. }
  34604. func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) {
  34605. reqHeaders := make(http.Header)
  34606. for k, v := range c.header_ {
  34607. reqHeaders[k] = v
  34608. }
  34609. reqHeaders.Set("User-Agent", c.s.userAgent())
  34610. if c.ifNoneMatch_ != "" {
  34611. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34612. }
  34613. var body io.Reader = nil
  34614. c.urlParams_.Set("alt", alt)
  34615. c.urlParams_.Set("prettyPrint", "false")
  34616. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}")
  34617. urls += "?" + c.urlParams_.Encode()
  34618. req, err := http.NewRequest("GET", urls, body)
  34619. if err != nil {
  34620. return nil, err
  34621. }
  34622. req.Header = reqHeaders
  34623. googleapi.Expand(req.URL, map[string]string{
  34624. "project": c.project,
  34625. "zone": c.zone,
  34626. "disk": c.disk,
  34627. })
  34628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34629. }
  34630. // Do executes the "compute.disks.get" call.
  34631. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  34632. // code is an error. Response headers are in either
  34633. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  34634. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  34635. // whether the returned error was because http.StatusNotModified was
  34636. // returned.
  34637. func (c *DisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  34638. gensupport.SetOptions(c.urlParams_, opts...)
  34639. res, err := c.doRequest("json")
  34640. if res != nil && res.StatusCode == http.StatusNotModified {
  34641. if res.Body != nil {
  34642. res.Body.Close()
  34643. }
  34644. return nil, &googleapi.Error{
  34645. Code: res.StatusCode,
  34646. Header: res.Header,
  34647. }
  34648. }
  34649. if err != nil {
  34650. return nil, err
  34651. }
  34652. defer googleapi.CloseBody(res)
  34653. if err := googleapi.CheckResponse(res); err != nil {
  34654. return nil, err
  34655. }
  34656. ret := &Disk{
  34657. ServerResponse: googleapi.ServerResponse{
  34658. Header: res.Header,
  34659. HTTPStatusCode: res.StatusCode,
  34660. },
  34661. }
  34662. target := &ret
  34663. if err := gensupport.DecodeResponse(target, res); err != nil {
  34664. return nil, err
  34665. }
  34666. return ret, nil
  34667. // {
  34668. // "description": "Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.",
  34669. // "httpMethod": "GET",
  34670. // "id": "compute.disks.get",
  34671. // "parameterOrder": [
  34672. // "project",
  34673. // "zone",
  34674. // "disk"
  34675. // ],
  34676. // "parameters": {
  34677. // "disk": {
  34678. // "description": "Name of the persistent disk to return.",
  34679. // "location": "path",
  34680. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34681. // "required": true,
  34682. // "type": "string"
  34683. // },
  34684. // "project": {
  34685. // "description": "Project ID for this request.",
  34686. // "location": "path",
  34687. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34688. // "required": true,
  34689. // "type": "string"
  34690. // },
  34691. // "zone": {
  34692. // "description": "The name of the zone for this request.",
  34693. // "location": "path",
  34694. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34695. // "required": true,
  34696. // "type": "string"
  34697. // }
  34698. // },
  34699. // "path": "{project}/zones/{zone}/disks/{disk}",
  34700. // "response": {
  34701. // "$ref": "Disk"
  34702. // },
  34703. // "scopes": [
  34704. // "https://www.googleapis.com/auth/cloud-platform",
  34705. // "https://www.googleapis.com/auth/compute",
  34706. // "https://www.googleapis.com/auth/compute.readonly"
  34707. // ]
  34708. // }
  34709. }
  34710. // method id "compute.disks.getIamPolicy":
  34711. type DisksGetIamPolicyCall struct {
  34712. s *Service
  34713. project string
  34714. zone string
  34715. resource string
  34716. urlParams_ gensupport.URLParams
  34717. ifNoneMatch_ string
  34718. ctx_ context.Context
  34719. header_ http.Header
  34720. }
  34721. // GetIamPolicy: Gets the access control policy for a resource. May be
  34722. // empty if no such policy or resource exists.
  34723. func (r *DisksService) GetIamPolicy(project string, zone string, resource string) *DisksGetIamPolicyCall {
  34724. c := &DisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34725. c.project = project
  34726. c.zone = zone
  34727. c.resource = resource
  34728. return c
  34729. }
  34730. // Fields allows partial responses to be retrieved. See
  34731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34732. // for more information.
  34733. func (c *DisksGetIamPolicyCall) Fields(s ...googleapi.Field) *DisksGetIamPolicyCall {
  34734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34735. return c
  34736. }
  34737. // IfNoneMatch sets the optional parameter which makes the operation
  34738. // fail if the object's ETag matches the given value. This is useful for
  34739. // getting updates only after the object has changed since the last
  34740. // request. Use googleapi.IsNotModified to check whether the response
  34741. // error from Do is the result of In-None-Match.
  34742. func (c *DisksGetIamPolicyCall) IfNoneMatch(entityTag string) *DisksGetIamPolicyCall {
  34743. c.ifNoneMatch_ = entityTag
  34744. return c
  34745. }
  34746. // Context sets the context to be used in this call's Do method. Any
  34747. // pending HTTP request will be aborted if the provided context is
  34748. // canceled.
  34749. func (c *DisksGetIamPolicyCall) Context(ctx context.Context) *DisksGetIamPolicyCall {
  34750. c.ctx_ = ctx
  34751. return c
  34752. }
  34753. // Header returns an http.Header that can be modified by the caller to
  34754. // add HTTP headers to the request.
  34755. func (c *DisksGetIamPolicyCall) Header() http.Header {
  34756. if c.header_ == nil {
  34757. c.header_ = make(http.Header)
  34758. }
  34759. return c.header_
  34760. }
  34761. func (c *DisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  34762. reqHeaders := make(http.Header)
  34763. for k, v := range c.header_ {
  34764. reqHeaders[k] = v
  34765. }
  34766. reqHeaders.Set("User-Agent", c.s.userAgent())
  34767. if c.ifNoneMatch_ != "" {
  34768. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34769. }
  34770. var body io.Reader = nil
  34771. c.urlParams_.Set("alt", alt)
  34772. c.urlParams_.Set("prettyPrint", "false")
  34773. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/getIamPolicy")
  34774. urls += "?" + c.urlParams_.Encode()
  34775. req, err := http.NewRequest("GET", urls, body)
  34776. if err != nil {
  34777. return nil, err
  34778. }
  34779. req.Header = reqHeaders
  34780. googleapi.Expand(req.URL, map[string]string{
  34781. "project": c.project,
  34782. "zone": c.zone,
  34783. "resource": c.resource,
  34784. })
  34785. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34786. }
  34787. // Do executes the "compute.disks.getIamPolicy" call.
  34788. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  34789. // code is an error. Response headers are in either
  34790. // *Policy.ServerResponse.Header or (if a response was returned at all)
  34791. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  34792. // check whether the returned error was because http.StatusNotModified
  34793. // was returned.
  34794. func (c *DisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, 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 := &Policy{
  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": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  34826. // "httpMethod": "GET",
  34827. // "id": "compute.disks.getIamPolicy",
  34828. // "parameterOrder": [
  34829. // "project",
  34830. // "zone",
  34831. // "resource"
  34832. // ],
  34833. // "parameters": {
  34834. // "project": {
  34835. // "description": "Project ID for this request.",
  34836. // "location": "path",
  34837. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  34838. // "required": true,
  34839. // "type": "string"
  34840. // },
  34841. // "resource": {
  34842. // "description": "Name or id of the resource for this request.",
  34843. // "location": "path",
  34844. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  34845. // "required": true,
  34846. // "type": "string"
  34847. // },
  34848. // "zone": {
  34849. // "description": "The name of the zone for this request.",
  34850. // "location": "path",
  34851. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  34852. // "required": true,
  34853. // "type": "string"
  34854. // }
  34855. // },
  34856. // "path": "{project}/zones/{zone}/disks/{resource}/getIamPolicy",
  34857. // "response": {
  34858. // "$ref": "Policy"
  34859. // },
  34860. // "scopes": [
  34861. // "https://www.googleapis.com/auth/cloud-platform",
  34862. // "https://www.googleapis.com/auth/compute",
  34863. // "https://www.googleapis.com/auth/compute.readonly"
  34864. // ]
  34865. // }
  34866. }
  34867. // method id "compute.disks.insert":
  34868. type DisksInsertCall struct {
  34869. s *Service
  34870. project string
  34871. zone string
  34872. disk *Disk
  34873. urlParams_ gensupport.URLParams
  34874. ctx_ context.Context
  34875. header_ http.Header
  34876. }
  34877. // Insert: Creates a persistent disk in the specified project using the
  34878. // data in the request. You can create a disk with a sourceImage, a
  34879. // sourceSnapshot, or create an empty 500 GB data disk by omitting all
  34880. // properties. You can also create a disk that is larger than the
  34881. // default size by specifying the sizeGb property.
  34882. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert
  34883. func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall {
  34884. c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34885. c.project = project
  34886. c.zone = zone
  34887. c.disk = disk
  34888. return c
  34889. }
  34890. // RequestId sets the optional parameter "requestId": An optional
  34891. // request ID to identify requests. Specify a unique request ID so that
  34892. // if you must retry your request, the server will know to ignore the
  34893. // request if it has already been completed.
  34894. //
  34895. // For example, consider a situation where you make an initial request
  34896. // and the request times out. If you make the request again with the
  34897. // same request ID, the server can check if original operation with the
  34898. // same request ID was received, and if so, will ignore the second
  34899. // request. This prevents clients from accidentally creating duplicate
  34900. // commitments.
  34901. //
  34902. // The request ID must be a valid UUID with the exception that zero UUID
  34903. // is not supported (00000000-0000-0000-0000-000000000000).
  34904. func (c *DisksInsertCall) RequestId(requestId string) *DisksInsertCall {
  34905. c.urlParams_.Set("requestId", requestId)
  34906. return c
  34907. }
  34908. // SourceImage sets the optional parameter "sourceImage": Source image
  34909. // to restore onto a disk.
  34910. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall {
  34911. c.urlParams_.Set("sourceImage", sourceImage)
  34912. return c
  34913. }
  34914. // Fields allows partial responses to be retrieved. See
  34915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34916. // for more information.
  34917. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall {
  34918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34919. return c
  34920. }
  34921. // Context sets the context to be used in this call's Do method. Any
  34922. // pending HTTP request will be aborted if the provided context is
  34923. // canceled.
  34924. func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall {
  34925. c.ctx_ = ctx
  34926. return c
  34927. }
  34928. // Header returns an http.Header that can be modified by the caller to
  34929. // add HTTP headers to the request.
  34930. func (c *DisksInsertCall) Header() http.Header {
  34931. if c.header_ == nil {
  34932. c.header_ = make(http.Header)
  34933. }
  34934. return c.header_
  34935. }
  34936. func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) {
  34937. reqHeaders := make(http.Header)
  34938. for k, v := range c.header_ {
  34939. reqHeaders[k] = v
  34940. }
  34941. reqHeaders.Set("User-Agent", c.s.userAgent())
  34942. var body io.Reader = nil
  34943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  34944. if err != nil {
  34945. return nil, err
  34946. }
  34947. reqHeaders.Set("Content-Type", "application/json")
  34948. c.urlParams_.Set("alt", alt)
  34949. c.urlParams_.Set("prettyPrint", "false")
  34950. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  34951. urls += "?" + c.urlParams_.Encode()
  34952. req, err := http.NewRequest("POST", urls, body)
  34953. if err != nil {
  34954. return nil, err
  34955. }
  34956. req.Header = reqHeaders
  34957. googleapi.Expand(req.URL, map[string]string{
  34958. "project": c.project,
  34959. "zone": c.zone,
  34960. })
  34961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34962. }
  34963. // Do executes the "compute.disks.insert" call.
  34964. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  34965. // status code is an error. Response headers are in either
  34966. // *Operation.ServerResponse.Header or (if a response was returned at
  34967. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34968. // to check whether the returned error was because
  34969. // http.StatusNotModified was returned.
  34970. func (c *DisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  34971. gensupport.SetOptions(c.urlParams_, opts...)
  34972. res, err := c.doRequest("json")
  34973. if res != nil && res.StatusCode == http.StatusNotModified {
  34974. if res.Body != nil {
  34975. res.Body.Close()
  34976. }
  34977. return nil, &googleapi.Error{
  34978. Code: res.StatusCode,
  34979. Header: res.Header,
  34980. }
  34981. }
  34982. if err != nil {
  34983. return nil, err
  34984. }
  34985. defer googleapi.CloseBody(res)
  34986. if err := googleapi.CheckResponse(res); err != nil {
  34987. return nil, err
  34988. }
  34989. ret := &Operation{
  34990. ServerResponse: googleapi.ServerResponse{
  34991. Header: res.Header,
  34992. HTTPStatusCode: res.StatusCode,
  34993. },
  34994. }
  34995. target := &ret
  34996. if err := gensupport.DecodeResponse(target, res); err != nil {
  34997. return nil, err
  34998. }
  34999. return ret, nil
  35000. // {
  35001. // "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.",
  35002. // "httpMethod": "POST",
  35003. // "id": "compute.disks.insert",
  35004. // "parameterOrder": [
  35005. // "project",
  35006. // "zone"
  35007. // ],
  35008. // "parameters": {
  35009. // "project": {
  35010. // "description": "Project ID for this request.",
  35011. // "location": "path",
  35012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35013. // "required": true,
  35014. // "type": "string"
  35015. // },
  35016. // "requestId": {
  35017. // "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).",
  35018. // "location": "query",
  35019. // "type": "string"
  35020. // },
  35021. // "sourceImage": {
  35022. // "description": "Optional. Source image to restore onto a disk.",
  35023. // "location": "query",
  35024. // "type": "string"
  35025. // },
  35026. // "zone": {
  35027. // "description": "The name of the zone for this request.",
  35028. // "location": "path",
  35029. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35030. // "required": true,
  35031. // "type": "string"
  35032. // }
  35033. // },
  35034. // "path": "{project}/zones/{zone}/disks",
  35035. // "request": {
  35036. // "$ref": "Disk"
  35037. // },
  35038. // "response": {
  35039. // "$ref": "Operation"
  35040. // },
  35041. // "scopes": [
  35042. // "https://www.googleapis.com/auth/cloud-platform",
  35043. // "https://www.googleapis.com/auth/compute"
  35044. // ]
  35045. // }
  35046. }
  35047. // method id "compute.disks.list":
  35048. type DisksListCall struct {
  35049. s *Service
  35050. project string
  35051. zone string
  35052. urlParams_ gensupport.URLParams
  35053. ifNoneMatch_ string
  35054. ctx_ context.Context
  35055. header_ http.Header
  35056. }
  35057. // List: Retrieves a list of persistent disks contained within the
  35058. // specified zone.
  35059. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list
  35060. func (r *DisksService) List(project string, zone string) *DisksListCall {
  35061. c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35062. c.project = project
  35063. c.zone = zone
  35064. return c
  35065. }
  35066. // Filter sets the optional parameter "filter": A filter expression that
  35067. // filters resources listed in the response. The expression must specify
  35068. // the field name, a comparison operator, and the value that you want to
  35069. // use for filtering. The value must be a string, a number, or a
  35070. // boolean. The comparison operator must be either =, !=, >, or <.
  35071. //
  35072. // For example, if you are filtering Compute Engine instances, you can
  35073. // exclude instances named example-instance by specifying name !=
  35074. // example-instance.
  35075. //
  35076. // You can also filter nested fields. For example, you could specify
  35077. // scheduling.automaticRestart = false to include instances only if they
  35078. // are not scheduled for automatic restarts. You can use filtering on
  35079. // nested fields to filter based on resource labels.
  35080. //
  35081. // To filter on multiple expressions, provide each separate expression
  35082. // within parentheses. For example, (scheduling.automaticRestart = true)
  35083. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  35084. // AND expression. However, you can include AND and OR expressions
  35085. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  35086. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  35087. // true).
  35088. func (c *DisksListCall) Filter(filter string) *DisksListCall {
  35089. c.urlParams_.Set("filter", filter)
  35090. return c
  35091. }
  35092. // MaxResults sets the optional parameter "maxResults": The maximum
  35093. // number of results per page that should be returned. If the number of
  35094. // available results is larger than maxResults, Compute Engine returns a
  35095. // nextPageToken that can be used to get the next page of results in
  35096. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  35097. // (Default: 500)
  35098. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall {
  35099. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35100. return c
  35101. }
  35102. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  35103. // a certain order. By default, results are returned in alphanumerical
  35104. // order based on the resource name.
  35105. //
  35106. // You can also sort results in descending order based on the creation
  35107. // timestamp using orderBy="creationTimestamp desc". This sorts results
  35108. // based on the creationTimestamp field in reverse chronological order
  35109. // (newest result first). Use this to sort resources like operations so
  35110. // that the newest operation is returned first.
  35111. //
  35112. // Currently, only sorting by name or creationTimestamp desc is
  35113. // supported.
  35114. func (c *DisksListCall) OrderBy(orderBy string) *DisksListCall {
  35115. c.urlParams_.Set("orderBy", orderBy)
  35116. return c
  35117. }
  35118. // PageToken sets the optional parameter "pageToken": Specifies a page
  35119. // token to use. Set pageToken to the nextPageToken returned by a
  35120. // previous list request to get the next page of results.
  35121. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall {
  35122. c.urlParams_.Set("pageToken", pageToken)
  35123. return c
  35124. }
  35125. // Fields allows partial responses to be retrieved. See
  35126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35127. // for more information.
  35128. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall {
  35129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35130. return c
  35131. }
  35132. // IfNoneMatch sets the optional parameter which makes the operation
  35133. // fail if the object's ETag matches the given value. This is useful for
  35134. // getting updates only after the object has changed since the last
  35135. // request. Use googleapi.IsNotModified to check whether the response
  35136. // error from Do is the result of In-None-Match.
  35137. func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall {
  35138. c.ifNoneMatch_ = entityTag
  35139. return c
  35140. }
  35141. // Context sets the context to be used in this call's Do method. Any
  35142. // pending HTTP request will be aborted if the provided context is
  35143. // canceled.
  35144. func (c *DisksListCall) Context(ctx context.Context) *DisksListCall {
  35145. c.ctx_ = ctx
  35146. return c
  35147. }
  35148. // Header returns an http.Header that can be modified by the caller to
  35149. // add HTTP headers to the request.
  35150. func (c *DisksListCall) Header() http.Header {
  35151. if c.header_ == nil {
  35152. c.header_ = make(http.Header)
  35153. }
  35154. return c.header_
  35155. }
  35156. func (c *DisksListCall) doRequest(alt string) (*http.Response, error) {
  35157. reqHeaders := make(http.Header)
  35158. for k, v := range c.header_ {
  35159. reqHeaders[k] = v
  35160. }
  35161. reqHeaders.Set("User-Agent", c.s.userAgent())
  35162. if c.ifNoneMatch_ != "" {
  35163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35164. }
  35165. var body io.Reader = nil
  35166. c.urlParams_.Set("alt", alt)
  35167. c.urlParams_.Set("prettyPrint", "false")
  35168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks")
  35169. urls += "?" + c.urlParams_.Encode()
  35170. req, err := http.NewRequest("GET", urls, body)
  35171. if err != nil {
  35172. return nil, err
  35173. }
  35174. req.Header = reqHeaders
  35175. googleapi.Expand(req.URL, map[string]string{
  35176. "project": c.project,
  35177. "zone": c.zone,
  35178. })
  35179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35180. }
  35181. // Do executes the "compute.disks.list" call.
  35182. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  35183. // code is an error. Response headers are in either
  35184. // *DiskList.ServerResponse.Header or (if a response was returned at
  35185. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35186. // to check whether the returned error was because
  35187. // http.StatusNotModified was returned.
  35188. func (c *DisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  35189. gensupport.SetOptions(c.urlParams_, opts...)
  35190. res, err := c.doRequest("json")
  35191. if res != nil && res.StatusCode == http.StatusNotModified {
  35192. if res.Body != nil {
  35193. res.Body.Close()
  35194. }
  35195. return nil, &googleapi.Error{
  35196. Code: res.StatusCode,
  35197. Header: res.Header,
  35198. }
  35199. }
  35200. if err != nil {
  35201. return nil, err
  35202. }
  35203. defer googleapi.CloseBody(res)
  35204. if err := googleapi.CheckResponse(res); err != nil {
  35205. return nil, err
  35206. }
  35207. ret := &DiskList{
  35208. ServerResponse: googleapi.ServerResponse{
  35209. Header: res.Header,
  35210. HTTPStatusCode: res.StatusCode,
  35211. },
  35212. }
  35213. target := &ret
  35214. if err := gensupport.DecodeResponse(target, res); err != nil {
  35215. return nil, err
  35216. }
  35217. return ret, nil
  35218. // {
  35219. // "description": "Retrieves a list of persistent disks contained within the specified zone.",
  35220. // "httpMethod": "GET",
  35221. // "id": "compute.disks.list",
  35222. // "parameterOrder": [
  35223. // "project",
  35224. // "zone"
  35225. // ],
  35226. // "parameters": {
  35227. // "filter": {
  35228. // "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).",
  35229. // "location": "query",
  35230. // "type": "string"
  35231. // },
  35232. // "maxResults": {
  35233. // "default": "500",
  35234. // "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)",
  35235. // "format": "uint32",
  35236. // "location": "query",
  35237. // "minimum": "0",
  35238. // "type": "integer"
  35239. // },
  35240. // "orderBy": {
  35241. // "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.",
  35242. // "location": "query",
  35243. // "type": "string"
  35244. // },
  35245. // "pageToken": {
  35246. // "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.",
  35247. // "location": "query",
  35248. // "type": "string"
  35249. // },
  35250. // "project": {
  35251. // "description": "Project ID for this request.",
  35252. // "location": "path",
  35253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35254. // "required": true,
  35255. // "type": "string"
  35256. // },
  35257. // "zone": {
  35258. // "description": "The name of the zone for this request.",
  35259. // "location": "path",
  35260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35261. // "required": true,
  35262. // "type": "string"
  35263. // }
  35264. // },
  35265. // "path": "{project}/zones/{zone}/disks",
  35266. // "response": {
  35267. // "$ref": "DiskList"
  35268. // },
  35269. // "scopes": [
  35270. // "https://www.googleapis.com/auth/cloud-platform",
  35271. // "https://www.googleapis.com/auth/compute",
  35272. // "https://www.googleapis.com/auth/compute.readonly"
  35273. // ]
  35274. // }
  35275. }
  35276. // Pages invokes f for each page of results.
  35277. // A non-nil error returned from f will halt the iteration.
  35278. // The provided context supersedes any context provided to the Context method.
  35279. func (c *DisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  35280. c.ctx_ = ctx
  35281. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35282. for {
  35283. x, err := c.Do()
  35284. if err != nil {
  35285. return err
  35286. }
  35287. if err := f(x); err != nil {
  35288. return err
  35289. }
  35290. if x.NextPageToken == "" {
  35291. return nil
  35292. }
  35293. c.PageToken(x.NextPageToken)
  35294. }
  35295. }
  35296. // method id "compute.disks.resize":
  35297. type DisksResizeCall struct {
  35298. s *Service
  35299. project string
  35300. zone string
  35301. disk string
  35302. disksresizerequest *DisksResizeRequest
  35303. urlParams_ gensupport.URLParams
  35304. ctx_ context.Context
  35305. header_ http.Header
  35306. }
  35307. // Resize: Resizes the specified persistent disk. You can only increase
  35308. // the size of the disk.
  35309. func (r *DisksService) Resize(project string, zone string, disk string, disksresizerequest *DisksResizeRequest) *DisksResizeCall {
  35310. c := &DisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35311. c.project = project
  35312. c.zone = zone
  35313. c.disk = disk
  35314. c.disksresizerequest = disksresizerequest
  35315. return c
  35316. }
  35317. // RequestId sets the optional parameter "requestId": An optional
  35318. // request ID to identify requests. Specify a unique request ID so that
  35319. // if you must retry your request, the server will know to ignore the
  35320. // request if it has already been completed.
  35321. //
  35322. // For example, consider a situation where you make an initial request
  35323. // and the request times out. If you make the request again with the
  35324. // same request ID, the server can check if original operation with the
  35325. // same request ID was received, and if so, will ignore the second
  35326. // request. This prevents clients from accidentally creating duplicate
  35327. // commitments.
  35328. //
  35329. // The request ID must be a valid UUID with the exception that zero UUID
  35330. // is not supported (00000000-0000-0000-0000-000000000000).
  35331. func (c *DisksResizeCall) RequestId(requestId string) *DisksResizeCall {
  35332. c.urlParams_.Set("requestId", requestId)
  35333. return c
  35334. }
  35335. // Fields allows partial responses to be retrieved. See
  35336. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35337. // for more information.
  35338. func (c *DisksResizeCall) Fields(s ...googleapi.Field) *DisksResizeCall {
  35339. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35340. return c
  35341. }
  35342. // Context sets the context to be used in this call's Do method. Any
  35343. // pending HTTP request will be aborted if the provided context is
  35344. // canceled.
  35345. func (c *DisksResizeCall) Context(ctx context.Context) *DisksResizeCall {
  35346. c.ctx_ = ctx
  35347. return c
  35348. }
  35349. // Header returns an http.Header that can be modified by the caller to
  35350. // add HTTP headers to the request.
  35351. func (c *DisksResizeCall) Header() http.Header {
  35352. if c.header_ == nil {
  35353. c.header_ = make(http.Header)
  35354. }
  35355. return c.header_
  35356. }
  35357. func (c *DisksResizeCall) doRequest(alt string) (*http.Response, error) {
  35358. reqHeaders := make(http.Header)
  35359. for k, v := range c.header_ {
  35360. reqHeaders[k] = v
  35361. }
  35362. reqHeaders.Set("User-Agent", c.s.userAgent())
  35363. var body io.Reader = nil
  35364. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksresizerequest)
  35365. if err != nil {
  35366. return nil, err
  35367. }
  35368. reqHeaders.Set("Content-Type", "application/json")
  35369. c.urlParams_.Set("alt", alt)
  35370. c.urlParams_.Set("prettyPrint", "false")
  35371. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/resize")
  35372. urls += "?" + c.urlParams_.Encode()
  35373. req, err := http.NewRequest("POST", urls, body)
  35374. if err != nil {
  35375. return nil, err
  35376. }
  35377. req.Header = reqHeaders
  35378. googleapi.Expand(req.URL, map[string]string{
  35379. "project": c.project,
  35380. "zone": c.zone,
  35381. "disk": c.disk,
  35382. })
  35383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35384. }
  35385. // Do executes the "compute.disks.resize" call.
  35386. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35387. // status code is an error. Response headers are in either
  35388. // *Operation.ServerResponse.Header or (if a response was returned at
  35389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35390. // to check whether the returned error was because
  35391. // http.StatusNotModified was returned.
  35392. func (c *DisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35393. gensupport.SetOptions(c.urlParams_, opts...)
  35394. res, err := c.doRequest("json")
  35395. if res != nil && res.StatusCode == http.StatusNotModified {
  35396. if res.Body != nil {
  35397. res.Body.Close()
  35398. }
  35399. return nil, &googleapi.Error{
  35400. Code: res.StatusCode,
  35401. Header: res.Header,
  35402. }
  35403. }
  35404. if err != nil {
  35405. return nil, err
  35406. }
  35407. defer googleapi.CloseBody(res)
  35408. if err := googleapi.CheckResponse(res); err != nil {
  35409. return nil, err
  35410. }
  35411. ret := &Operation{
  35412. ServerResponse: googleapi.ServerResponse{
  35413. Header: res.Header,
  35414. HTTPStatusCode: res.StatusCode,
  35415. },
  35416. }
  35417. target := &ret
  35418. if err := gensupport.DecodeResponse(target, res); err != nil {
  35419. return nil, err
  35420. }
  35421. return ret, nil
  35422. // {
  35423. // "description": "Resizes the specified persistent disk. You can only increase the size of the disk.",
  35424. // "httpMethod": "POST",
  35425. // "id": "compute.disks.resize",
  35426. // "parameterOrder": [
  35427. // "project",
  35428. // "zone",
  35429. // "disk"
  35430. // ],
  35431. // "parameters": {
  35432. // "disk": {
  35433. // "description": "The name of the persistent disk.",
  35434. // "location": "path",
  35435. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35436. // "required": true,
  35437. // "type": "string"
  35438. // },
  35439. // "project": {
  35440. // "description": "Project ID for this request.",
  35441. // "location": "path",
  35442. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35443. // "required": true,
  35444. // "type": "string"
  35445. // },
  35446. // "requestId": {
  35447. // "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).",
  35448. // "location": "query",
  35449. // "type": "string"
  35450. // },
  35451. // "zone": {
  35452. // "description": "The name of the zone for this request.",
  35453. // "location": "path",
  35454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35455. // "required": true,
  35456. // "type": "string"
  35457. // }
  35458. // },
  35459. // "path": "{project}/zones/{zone}/disks/{disk}/resize",
  35460. // "request": {
  35461. // "$ref": "DisksResizeRequest"
  35462. // },
  35463. // "response": {
  35464. // "$ref": "Operation"
  35465. // },
  35466. // "scopes": [
  35467. // "https://www.googleapis.com/auth/cloud-platform",
  35468. // "https://www.googleapis.com/auth/compute"
  35469. // ]
  35470. // }
  35471. }
  35472. // method id "compute.disks.setIamPolicy":
  35473. type DisksSetIamPolicyCall struct {
  35474. s *Service
  35475. project string
  35476. zone string
  35477. resource string
  35478. zonesetpolicyrequest *ZoneSetPolicyRequest
  35479. urlParams_ gensupport.URLParams
  35480. ctx_ context.Context
  35481. header_ http.Header
  35482. }
  35483. // SetIamPolicy: Sets the access control policy on the specified
  35484. // resource. Replaces any existing policy.
  35485. func (r *DisksService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *DisksSetIamPolicyCall {
  35486. c := &DisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35487. c.project = project
  35488. c.zone = zone
  35489. c.resource = resource
  35490. c.zonesetpolicyrequest = zonesetpolicyrequest
  35491. return c
  35492. }
  35493. // Fields allows partial responses to be retrieved. See
  35494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35495. // for more information.
  35496. func (c *DisksSetIamPolicyCall) Fields(s ...googleapi.Field) *DisksSetIamPolicyCall {
  35497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35498. return c
  35499. }
  35500. // Context sets the context to be used in this call's Do method. Any
  35501. // pending HTTP request will be aborted if the provided context is
  35502. // canceled.
  35503. func (c *DisksSetIamPolicyCall) Context(ctx context.Context) *DisksSetIamPolicyCall {
  35504. c.ctx_ = ctx
  35505. return c
  35506. }
  35507. // Header returns an http.Header that can be modified by the caller to
  35508. // add HTTP headers to the request.
  35509. func (c *DisksSetIamPolicyCall) Header() http.Header {
  35510. if c.header_ == nil {
  35511. c.header_ = make(http.Header)
  35512. }
  35513. return c.header_
  35514. }
  35515. func (c *DisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  35516. reqHeaders := make(http.Header)
  35517. for k, v := range c.header_ {
  35518. reqHeaders[k] = v
  35519. }
  35520. reqHeaders.Set("User-Agent", c.s.userAgent())
  35521. var body io.Reader = nil
  35522. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  35523. if err != nil {
  35524. return nil, err
  35525. }
  35526. reqHeaders.Set("Content-Type", "application/json")
  35527. c.urlParams_.Set("alt", alt)
  35528. c.urlParams_.Set("prettyPrint", "false")
  35529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setIamPolicy")
  35530. urls += "?" + c.urlParams_.Encode()
  35531. req, err := http.NewRequest("POST", urls, body)
  35532. if err != nil {
  35533. return nil, err
  35534. }
  35535. req.Header = reqHeaders
  35536. googleapi.Expand(req.URL, map[string]string{
  35537. "project": c.project,
  35538. "zone": c.zone,
  35539. "resource": c.resource,
  35540. })
  35541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35542. }
  35543. // Do executes the "compute.disks.setIamPolicy" call.
  35544. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  35545. // code is an error. Response headers are in either
  35546. // *Policy.ServerResponse.Header or (if a response was returned at all)
  35547. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  35548. // check whether the returned error was because http.StatusNotModified
  35549. // was returned.
  35550. func (c *DisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  35551. gensupport.SetOptions(c.urlParams_, opts...)
  35552. res, err := c.doRequest("json")
  35553. if res != nil && res.StatusCode == http.StatusNotModified {
  35554. if res.Body != nil {
  35555. res.Body.Close()
  35556. }
  35557. return nil, &googleapi.Error{
  35558. Code: res.StatusCode,
  35559. Header: res.Header,
  35560. }
  35561. }
  35562. if err != nil {
  35563. return nil, err
  35564. }
  35565. defer googleapi.CloseBody(res)
  35566. if err := googleapi.CheckResponse(res); err != nil {
  35567. return nil, err
  35568. }
  35569. ret := &Policy{
  35570. ServerResponse: googleapi.ServerResponse{
  35571. Header: res.Header,
  35572. HTTPStatusCode: res.StatusCode,
  35573. },
  35574. }
  35575. target := &ret
  35576. if err := gensupport.DecodeResponse(target, res); err != nil {
  35577. return nil, err
  35578. }
  35579. return ret, nil
  35580. // {
  35581. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  35582. // "httpMethod": "POST",
  35583. // "id": "compute.disks.setIamPolicy",
  35584. // "parameterOrder": [
  35585. // "project",
  35586. // "zone",
  35587. // "resource"
  35588. // ],
  35589. // "parameters": {
  35590. // "project": {
  35591. // "description": "Project ID for this request.",
  35592. // "location": "path",
  35593. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35594. // "required": true,
  35595. // "type": "string"
  35596. // },
  35597. // "resource": {
  35598. // "description": "Name or id of the resource for this request.",
  35599. // "location": "path",
  35600. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35601. // "required": true,
  35602. // "type": "string"
  35603. // },
  35604. // "zone": {
  35605. // "description": "The name of the zone for this request.",
  35606. // "location": "path",
  35607. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35608. // "required": true,
  35609. // "type": "string"
  35610. // }
  35611. // },
  35612. // "path": "{project}/zones/{zone}/disks/{resource}/setIamPolicy",
  35613. // "request": {
  35614. // "$ref": "ZoneSetPolicyRequest"
  35615. // },
  35616. // "response": {
  35617. // "$ref": "Policy"
  35618. // },
  35619. // "scopes": [
  35620. // "https://www.googleapis.com/auth/cloud-platform",
  35621. // "https://www.googleapis.com/auth/compute"
  35622. // ]
  35623. // }
  35624. }
  35625. // method id "compute.disks.setLabels":
  35626. type DisksSetLabelsCall struct {
  35627. s *Service
  35628. project string
  35629. zone string
  35630. resource string
  35631. zonesetlabelsrequest *ZoneSetLabelsRequest
  35632. urlParams_ gensupport.URLParams
  35633. ctx_ context.Context
  35634. header_ http.Header
  35635. }
  35636. // SetLabels: Sets the labels on a disk. To learn more about labels,
  35637. // read the Labeling Resources documentation.
  35638. func (r *DisksService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *DisksSetLabelsCall {
  35639. c := &DisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35640. c.project = project
  35641. c.zone = zone
  35642. c.resource = resource
  35643. c.zonesetlabelsrequest = zonesetlabelsrequest
  35644. return c
  35645. }
  35646. // RequestId sets the optional parameter "requestId": An optional
  35647. // request ID to identify requests. Specify a unique request ID so that
  35648. // if you must retry your request, the server will know to ignore the
  35649. // request if it has already been completed.
  35650. //
  35651. // For example, consider a situation where you make an initial request
  35652. // and the request times out. If you make the request again with the
  35653. // same request ID, the server can check if original operation with the
  35654. // same request ID was received, and if so, will ignore the second
  35655. // request. This prevents clients from accidentally creating duplicate
  35656. // commitments.
  35657. //
  35658. // The request ID must be a valid UUID with the exception that zero UUID
  35659. // is not supported (00000000-0000-0000-0000-000000000000).
  35660. func (c *DisksSetLabelsCall) RequestId(requestId string) *DisksSetLabelsCall {
  35661. c.urlParams_.Set("requestId", requestId)
  35662. return c
  35663. }
  35664. // Fields allows partial responses to be retrieved. See
  35665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35666. // for more information.
  35667. func (c *DisksSetLabelsCall) Fields(s ...googleapi.Field) *DisksSetLabelsCall {
  35668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35669. return c
  35670. }
  35671. // Context sets the context to be used in this call's Do method. Any
  35672. // pending HTTP request will be aborted if the provided context is
  35673. // canceled.
  35674. func (c *DisksSetLabelsCall) Context(ctx context.Context) *DisksSetLabelsCall {
  35675. c.ctx_ = ctx
  35676. return c
  35677. }
  35678. // Header returns an http.Header that can be modified by the caller to
  35679. // add HTTP headers to the request.
  35680. func (c *DisksSetLabelsCall) Header() http.Header {
  35681. if c.header_ == nil {
  35682. c.header_ = make(http.Header)
  35683. }
  35684. return c.header_
  35685. }
  35686. func (c *DisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  35687. reqHeaders := make(http.Header)
  35688. for k, v := range c.header_ {
  35689. reqHeaders[k] = v
  35690. }
  35691. reqHeaders.Set("User-Agent", c.s.userAgent())
  35692. var body io.Reader = nil
  35693. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest)
  35694. if err != nil {
  35695. return nil, err
  35696. }
  35697. reqHeaders.Set("Content-Type", "application/json")
  35698. c.urlParams_.Set("alt", alt)
  35699. c.urlParams_.Set("prettyPrint", "false")
  35700. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/setLabels")
  35701. urls += "?" + c.urlParams_.Encode()
  35702. req, err := http.NewRequest("POST", urls, body)
  35703. if err != nil {
  35704. return nil, err
  35705. }
  35706. req.Header = reqHeaders
  35707. googleapi.Expand(req.URL, map[string]string{
  35708. "project": c.project,
  35709. "zone": c.zone,
  35710. "resource": c.resource,
  35711. })
  35712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35713. }
  35714. // Do executes the "compute.disks.setLabels" call.
  35715. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  35716. // status code is an error. Response headers are in either
  35717. // *Operation.ServerResponse.Header or (if a response was returned at
  35718. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35719. // to check whether the returned error was because
  35720. // http.StatusNotModified was returned.
  35721. func (c *DisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  35722. gensupport.SetOptions(c.urlParams_, opts...)
  35723. res, err := c.doRequest("json")
  35724. if res != nil && res.StatusCode == http.StatusNotModified {
  35725. if res.Body != nil {
  35726. res.Body.Close()
  35727. }
  35728. return nil, &googleapi.Error{
  35729. Code: res.StatusCode,
  35730. Header: res.Header,
  35731. }
  35732. }
  35733. if err != nil {
  35734. return nil, err
  35735. }
  35736. defer googleapi.CloseBody(res)
  35737. if err := googleapi.CheckResponse(res); err != nil {
  35738. return nil, err
  35739. }
  35740. ret := &Operation{
  35741. ServerResponse: googleapi.ServerResponse{
  35742. Header: res.Header,
  35743. HTTPStatusCode: res.StatusCode,
  35744. },
  35745. }
  35746. target := &ret
  35747. if err := gensupport.DecodeResponse(target, res); err != nil {
  35748. return nil, err
  35749. }
  35750. return ret, nil
  35751. // {
  35752. // "description": "Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation.",
  35753. // "httpMethod": "POST",
  35754. // "id": "compute.disks.setLabels",
  35755. // "parameterOrder": [
  35756. // "project",
  35757. // "zone",
  35758. // "resource"
  35759. // ],
  35760. // "parameters": {
  35761. // "project": {
  35762. // "description": "Project ID for this request.",
  35763. // "location": "path",
  35764. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35765. // "required": true,
  35766. // "type": "string"
  35767. // },
  35768. // "requestId": {
  35769. // "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).",
  35770. // "location": "query",
  35771. // "type": "string"
  35772. // },
  35773. // "resource": {
  35774. // "description": "Name or id of the resource for this request.",
  35775. // "location": "path",
  35776. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35777. // "required": true,
  35778. // "type": "string"
  35779. // },
  35780. // "zone": {
  35781. // "description": "The name of the zone for this request.",
  35782. // "location": "path",
  35783. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35784. // "required": true,
  35785. // "type": "string"
  35786. // }
  35787. // },
  35788. // "path": "{project}/zones/{zone}/disks/{resource}/setLabels",
  35789. // "request": {
  35790. // "$ref": "ZoneSetLabelsRequest"
  35791. // },
  35792. // "response": {
  35793. // "$ref": "Operation"
  35794. // },
  35795. // "scopes": [
  35796. // "https://www.googleapis.com/auth/cloud-platform",
  35797. // "https://www.googleapis.com/auth/compute"
  35798. // ]
  35799. // }
  35800. }
  35801. // method id "compute.disks.testIamPermissions":
  35802. type DisksTestIamPermissionsCall struct {
  35803. s *Service
  35804. project string
  35805. zone string
  35806. resource string
  35807. testpermissionsrequest *TestPermissionsRequest
  35808. urlParams_ gensupport.URLParams
  35809. ctx_ context.Context
  35810. header_ http.Header
  35811. }
  35812. // TestIamPermissions: Returns permissions that a caller has on the
  35813. // specified resource.
  35814. func (r *DisksService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *DisksTestIamPermissionsCall {
  35815. c := &DisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35816. c.project = project
  35817. c.zone = zone
  35818. c.resource = resource
  35819. c.testpermissionsrequest = testpermissionsrequest
  35820. return c
  35821. }
  35822. // Fields allows partial responses to be retrieved. See
  35823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35824. // for more information.
  35825. func (c *DisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *DisksTestIamPermissionsCall {
  35826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35827. return c
  35828. }
  35829. // Context sets the context to be used in this call's Do method. Any
  35830. // pending HTTP request will be aborted if the provided context is
  35831. // canceled.
  35832. func (c *DisksTestIamPermissionsCall) Context(ctx context.Context) *DisksTestIamPermissionsCall {
  35833. c.ctx_ = ctx
  35834. return c
  35835. }
  35836. // Header returns an http.Header that can be modified by the caller to
  35837. // add HTTP headers to the request.
  35838. func (c *DisksTestIamPermissionsCall) Header() http.Header {
  35839. if c.header_ == nil {
  35840. c.header_ = make(http.Header)
  35841. }
  35842. return c.header_
  35843. }
  35844. func (c *DisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  35845. reqHeaders := make(http.Header)
  35846. for k, v := range c.header_ {
  35847. reqHeaders[k] = v
  35848. }
  35849. reqHeaders.Set("User-Agent", c.s.userAgent())
  35850. var body io.Reader = nil
  35851. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  35852. if err != nil {
  35853. return nil, err
  35854. }
  35855. reqHeaders.Set("Content-Type", "application/json")
  35856. c.urlParams_.Set("alt", alt)
  35857. c.urlParams_.Set("prettyPrint", "false")
  35858. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{resource}/testIamPermissions")
  35859. urls += "?" + c.urlParams_.Encode()
  35860. req, err := http.NewRequest("POST", urls, body)
  35861. if err != nil {
  35862. return nil, err
  35863. }
  35864. req.Header = reqHeaders
  35865. googleapi.Expand(req.URL, map[string]string{
  35866. "project": c.project,
  35867. "zone": c.zone,
  35868. "resource": c.resource,
  35869. })
  35870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35871. }
  35872. // Do executes the "compute.disks.testIamPermissions" call.
  35873. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  35874. // non-2xx status code is an error. Response headers are in either
  35875. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  35876. // returned at all) in error.(*googleapi.Error).Header. Use
  35877. // googleapi.IsNotModified to check whether the returned error was
  35878. // because http.StatusNotModified was returned.
  35879. func (c *DisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  35880. gensupport.SetOptions(c.urlParams_, opts...)
  35881. res, err := c.doRequest("json")
  35882. if res != nil && res.StatusCode == http.StatusNotModified {
  35883. if res.Body != nil {
  35884. res.Body.Close()
  35885. }
  35886. return nil, &googleapi.Error{
  35887. Code: res.StatusCode,
  35888. Header: res.Header,
  35889. }
  35890. }
  35891. if err != nil {
  35892. return nil, err
  35893. }
  35894. defer googleapi.CloseBody(res)
  35895. if err := googleapi.CheckResponse(res); err != nil {
  35896. return nil, err
  35897. }
  35898. ret := &TestPermissionsResponse{
  35899. ServerResponse: googleapi.ServerResponse{
  35900. Header: res.Header,
  35901. HTTPStatusCode: res.StatusCode,
  35902. },
  35903. }
  35904. target := &ret
  35905. if err := gensupport.DecodeResponse(target, res); err != nil {
  35906. return nil, err
  35907. }
  35908. return ret, nil
  35909. // {
  35910. // "description": "Returns permissions that a caller has on the specified resource.",
  35911. // "httpMethod": "POST",
  35912. // "id": "compute.disks.testIamPermissions",
  35913. // "parameterOrder": [
  35914. // "project",
  35915. // "zone",
  35916. // "resource"
  35917. // ],
  35918. // "parameters": {
  35919. // "project": {
  35920. // "description": "Project ID for this request.",
  35921. // "location": "path",
  35922. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  35923. // "required": true,
  35924. // "type": "string"
  35925. // },
  35926. // "resource": {
  35927. // "description": "Name or id of the resource for this request.",
  35928. // "location": "path",
  35929. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  35930. // "required": true,
  35931. // "type": "string"
  35932. // },
  35933. // "zone": {
  35934. // "description": "The name of the zone for this request.",
  35935. // "location": "path",
  35936. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  35937. // "required": true,
  35938. // "type": "string"
  35939. // }
  35940. // },
  35941. // "path": "{project}/zones/{zone}/disks/{resource}/testIamPermissions",
  35942. // "request": {
  35943. // "$ref": "TestPermissionsRequest"
  35944. // },
  35945. // "response": {
  35946. // "$ref": "TestPermissionsResponse"
  35947. // },
  35948. // "scopes": [
  35949. // "https://www.googleapis.com/auth/cloud-platform",
  35950. // "https://www.googleapis.com/auth/compute",
  35951. // "https://www.googleapis.com/auth/compute.readonly"
  35952. // ]
  35953. // }
  35954. }
  35955. // method id "compute.firewalls.delete":
  35956. type FirewallsDeleteCall struct {
  35957. s *Service
  35958. project string
  35959. firewall string
  35960. urlParams_ gensupport.URLParams
  35961. ctx_ context.Context
  35962. header_ http.Header
  35963. }
  35964. // Delete: Deletes the specified firewall.
  35965. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete
  35966. func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall {
  35967. c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35968. c.project = project
  35969. c.firewall = firewall
  35970. return c
  35971. }
  35972. // RequestId sets the optional parameter "requestId": An optional
  35973. // request ID to identify requests. Specify a unique request ID so that
  35974. // if you must retry your request, the server will know to ignore the
  35975. // request if it has already been completed.
  35976. //
  35977. // For example, consider a situation where you make an initial request
  35978. // and the request times out. If you make the request again with the
  35979. // same request ID, the server can check if original operation with the
  35980. // same request ID was received, and if so, will ignore the second
  35981. // request. This prevents clients from accidentally creating duplicate
  35982. // commitments.
  35983. //
  35984. // The request ID must be a valid UUID with the exception that zero UUID
  35985. // is not supported (00000000-0000-0000-0000-000000000000).
  35986. func (c *FirewallsDeleteCall) RequestId(requestId string) *FirewallsDeleteCall {
  35987. c.urlParams_.Set("requestId", requestId)
  35988. return c
  35989. }
  35990. // Fields allows partial responses to be retrieved. See
  35991. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35992. // for more information.
  35993. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall {
  35994. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35995. return c
  35996. }
  35997. // Context sets the context to be used in this call's Do method. Any
  35998. // pending HTTP request will be aborted if the provided context is
  35999. // canceled.
  36000. func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall {
  36001. c.ctx_ = ctx
  36002. return c
  36003. }
  36004. // Header returns an http.Header that can be modified by the caller to
  36005. // add HTTP headers to the request.
  36006. func (c *FirewallsDeleteCall) Header() http.Header {
  36007. if c.header_ == nil {
  36008. c.header_ = make(http.Header)
  36009. }
  36010. return c.header_
  36011. }
  36012. func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) {
  36013. reqHeaders := make(http.Header)
  36014. for k, v := range c.header_ {
  36015. reqHeaders[k] = v
  36016. }
  36017. reqHeaders.Set("User-Agent", c.s.userAgent())
  36018. var body io.Reader = nil
  36019. c.urlParams_.Set("alt", alt)
  36020. c.urlParams_.Set("prettyPrint", "false")
  36021. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  36022. urls += "?" + c.urlParams_.Encode()
  36023. req, err := http.NewRequest("DELETE", urls, body)
  36024. if err != nil {
  36025. return nil, err
  36026. }
  36027. req.Header = reqHeaders
  36028. googleapi.Expand(req.URL, map[string]string{
  36029. "project": c.project,
  36030. "firewall": c.firewall,
  36031. })
  36032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36033. }
  36034. // Do executes the "compute.firewalls.delete" call.
  36035. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36036. // status code is an error. Response headers are in either
  36037. // *Operation.ServerResponse.Header or (if a response was returned at
  36038. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36039. // to check whether the returned error was because
  36040. // http.StatusNotModified was returned.
  36041. func (c *FirewallsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36042. gensupport.SetOptions(c.urlParams_, opts...)
  36043. res, err := c.doRequest("json")
  36044. if res != nil && res.StatusCode == http.StatusNotModified {
  36045. if res.Body != nil {
  36046. res.Body.Close()
  36047. }
  36048. return nil, &googleapi.Error{
  36049. Code: res.StatusCode,
  36050. Header: res.Header,
  36051. }
  36052. }
  36053. if err != nil {
  36054. return nil, err
  36055. }
  36056. defer googleapi.CloseBody(res)
  36057. if err := googleapi.CheckResponse(res); err != nil {
  36058. return nil, err
  36059. }
  36060. ret := &Operation{
  36061. ServerResponse: googleapi.ServerResponse{
  36062. Header: res.Header,
  36063. HTTPStatusCode: res.StatusCode,
  36064. },
  36065. }
  36066. target := &ret
  36067. if err := gensupport.DecodeResponse(target, res); err != nil {
  36068. return nil, err
  36069. }
  36070. return ret, nil
  36071. // {
  36072. // "description": "Deletes the specified firewall.",
  36073. // "httpMethod": "DELETE",
  36074. // "id": "compute.firewalls.delete",
  36075. // "parameterOrder": [
  36076. // "project",
  36077. // "firewall"
  36078. // ],
  36079. // "parameters": {
  36080. // "firewall": {
  36081. // "description": "Name of the firewall rule to delete.",
  36082. // "location": "path",
  36083. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36084. // "required": true,
  36085. // "type": "string"
  36086. // },
  36087. // "project": {
  36088. // "description": "Project ID for this request.",
  36089. // "location": "path",
  36090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36091. // "required": true,
  36092. // "type": "string"
  36093. // },
  36094. // "requestId": {
  36095. // "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).",
  36096. // "location": "query",
  36097. // "type": "string"
  36098. // }
  36099. // },
  36100. // "path": "{project}/global/firewalls/{firewall}",
  36101. // "response": {
  36102. // "$ref": "Operation"
  36103. // },
  36104. // "scopes": [
  36105. // "https://www.googleapis.com/auth/cloud-platform",
  36106. // "https://www.googleapis.com/auth/compute"
  36107. // ]
  36108. // }
  36109. }
  36110. // method id "compute.firewalls.get":
  36111. type FirewallsGetCall struct {
  36112. s *Service
  36113. project string
  36114. firewall string
  36115. urlParams_ gensupport.URLParams
  36116. ifNoneMatch_ string
  36117. ctx_ context.Context
  36118. header_ http.Header
  36119. }
  36120. // Get: Returns the specified firewall.
  36121. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get
  36122. func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall {
  36123. c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36124. c.project = project
  36125. c.firewall = firewall
  36126. return c
  36127. }
  36128. // Fields allows partial responses to be retrieved. See
  36129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36130. // for more information.
  36131. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall {
  36132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36133. return c
  36134. }
  36135. // IfNoneMatch sets the optional parameter which makes the operation
  36136. // fail if the object's ETag matches the given value. This is useful for
  36137. // getting updates only after the object has changed since the last
  36138. // request. Use googleapi.IsNotModified to check whether the response
  36139. // error from Do is the result of In-None-Match.
  36140. func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall {
  36141. c.ifNoneMatch_ = entityTag
  36142. return c
  36143. }
  36144. // Context sets the context to be used in this call's Do method. Any
  36145. // pending HTTP request will be aborted if the provided context is
  36146. // canceled.
  36147. func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall {
  36148. c.ctx_ = ctx
  36149. return c
  36150. }
  36151. // Header returns an http.Header that can be modified by the caller to
  36152. // add HTTP headers to the request.
  36153. func (c *FirewallsGetCall) Header() http.Header {
  36154. if c.header_ == nil {
  36155. c.header_ = make(http.Header)
  36156. }
  36157. return c.header_
  36158. }
  36159. func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) {
  36160. reqHeaders := make(http.Header)
  36161. for k, v := range c.header_ {
  36162. reqHeaders[k] = v
  36163. }
  36164. reqHeaders.Set("User-Agent", c.s.userAgent())
  36165. if c.ifNoneMatch_ != "" {
  36166. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36167. }
  36168. var body io.Reader = nil
  36169. c.urlParams_.Set("alt", alt)
  36170. c.urlParams_.Set("prettyPrint", "false")
  36171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  36172. urls += "?" + c.urlParams_.Encode()
  36173. req, err := http.NewRequest("GET", urls, body)
  36174. if err != nil {
  36175. return nil, err
  36176. }
  36177. req.Header = reqHeaders
  36178. googleapi.Expand(req.URL, map[string]string{
  36179. "project": c.project,
  36180. "firewall": c.firewall,
  36181. })
  36182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36183. }
  36184. // Do executes the "compute.firewalls.get" call.
  36185. // Exactly one of *Firewall or error will be non-nil. Any non-2xx status
  36186. // code is an error. Response headers are in either
  36187. // *Firewall.ServerResponse.Header or (if a response was returned at
  36188. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36189. // to check whether the returned error was because
  36190. // http.StatusNotModified was returned.
  36191. func (c *FirewallsGetCall) Do(opts ...googleapi.CallOption) (*Firewall, error) {
  36192. gensupport.SetOptions(c.urlParams_, opts...)
  36193. res, err := c.doRequest("json")
  36194. if res != nil && res.StatusCode == http.StatusNotModified {
  36195. if res.Body != nil {
  36196. res.Body.Close()
  36197. }
  36198. return nil, &googleapi.Error{
  36199. Code: res.StatusCode,
  36200. Header: res.Header,
  36201. }
  36202. }
  36203. if err != nil {
  36204. return nil, err
  36205. }
  36206. defer googleapi.CloseBody(res)
  36207. if err := googleapi.CheckResponse(res); err != nil {
  36208. return nil, err
  36209. }
  36210. ret := &Firewall{
  36211. ServerResponse: googleapi.ServerResponse{
  36212. Header: res.Header,
  36213. HTTPStatusCode: res.StatusCode,
  36214. },
  36215. }
  36216. target := &ret
  36217. if err := gensupport.DecodeResponse(target, res); err != nil {
  36218. return nil, err
  36219. }
  36220. return ret, nil
  36221. // {
  36222. // "description": "Returns the specified firewall.",
  36223. // "httpMethod": "GET",
  36224. // "id": "compute.firewalls.get",
  36225. // "parameterOrder": [
  36226. // "project",
  36227. // "firewall"
  36228. // ],
  36229. // "parameters": {
  36230. // "firewall": {
  36231. // "description": "Name of the firewall rule to return.",
  36232. // "location": "path",
  36233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36234. // "required": true,
  36235. // "type": "string"
  36236. // },
  36237. // "project": {
  36238. // "description": "Project ID for this request.",
  36239. // "location": "path",
  36240. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36241. // "required": true,
  36242. // "type": "string"
  36243. // }
  36244. // },
  36245. // "path": "{project}/global/firewalls/{firewall}",
  36246. // "response": {
  36247. // "$ref": "Firewall"
  36248. // },
  36249. // "scopes": [
  36250. // "https://www.googleapis.com/auth/cloud-platform",
  36251. // "https://www.googleapis.com/auth/compute",
  36252. // "https://www.googleapis.com/auth/compute.readonly"
  36253. // ]
  36254. // }
  36255. }
  36256. // method id "compute.firewalls.insert":
  36257. type FirewallsInsertCall struct {
  36258. s *Service
  36259. project string
  36260. firewall *Firewall
  36261. urlParams_ gensupport.URLParams
  36262. ctx_ context.Context
  36263. header_ http.Header
  36264. }
  36265. // Insert: Creates a firewall rule in the specified project using the
  36266. // data included in the request.
  36267. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert
  36268. func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall {
  36269. c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36270. c.project = project
  36271. c.firewall = firewall
  36272. return c
  36273. }
  36274. // RequestId sets the optional parameter "requestId": An optional
  36275. // request ID to identify requests. Specify a unique request ID so that
  36276. // if you must retry your request, the server will know to ignore the
  36277. // request if it has already been completed.
  36278. //
  36279. // For example, consider a situation where you make an initial request
  36280. // and the request times out. If you make the request again with the
  36281. // same request ID, the server can check if original operation with the
  36282. // same request ID was received, and if so, will ignore the second
  36283. // request. This prevents clients from accidentally creating duplicate
  36284. // commitments.
  36285. //
  36286. // The request ID must be a valid UUID with the exception that zero UUID
  36287. // is not supported (00000000-0000-0000-0000-000000000000).
  36288. func (c *FirewallsInsertCall) RequestId(requestId string) *FirewallsInsertCall {
  36289. c.urlParams_.Set("requestId", requestId)
  36290. return c
  36291. }
  36292. // Fields allows partial responses to be retrieved. See
  36293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36294. // for more information.
  36295. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall {
  36296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36297. return c
  36298. }
  36299. // Context sets the context to be used in this call's Do method. Any
  36300. // pending HTTP request will be aborted if the provided context is
  36301. // canceled.
  36302. func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall {
  36303. c.ctx_ = ctx
  36304. return c
  36305. }
  36306. // Header returns an http.Header that can be modified by the caller to
  36307. // add HTTP headers to the request.
  36308. func (c *FirewallsInsertCall) Header() http.Header {
  36309. if c.header_ == nil {
  36310. c.header_ = make(http.Header)
  36311. }
  36312. return c.header_
  36313. }
  36314. func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) {
  36315. reqHeaders := make(http.Header)
  36316. for k, v := range c.header_ {
  36317. reqHeaders[k] = v
  36318. }
  36319. reqHeaders.Set("User-Agent", c.s.userAgent())
  36320. var body io.Reader = nil
  36321. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall)
  36322. if err != nil {
  36323. return nil, err
  36324. }
  36325. reqHeaders.Set("Content-Type", "application/json")
  36326. c.urlParams_.Set("alt", alt)
  36327. c.urlParams_.Set("prettyPrint", "false")
  36328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  36329. urls += "?" + c.urlParams_.Encode()
  36330. req, err := http.NewRequest("POST", urls, body)
  36331. if err != nil {
  36332. return nil, err
  36333. }
  36334. req.Header = reqHeaders
  36335. googleapi.Expand(req.URL, map[string]string{
  36336. "project": c.project,
  36337. })
  36338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36339. }
  36340. // Do executes the "compute.firewalls.insert" call.
  36341. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36342. // status code is an error. Response headers are in either
  36343. // *Operation.ServerResponse.Header or (if a response was returned at
  36344. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36345. // to check whether the returned error was because
  36346. // http.StatusNotModified was returned.
  36347. func (c *FirewallsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36348. gensupport.SetOptions(c.urlParams_, opts...)
  36349. res, err := c.doRequest("json")
  36350. if res != nil && res.StatusCode == http.StatusNotModified {
  36351. if res.Body != nil {
  36352. res.Body.Close()
  36353. }
  36354. return nil, &googleapi.Error{
  36355. Code: res.StatusCode,
  36356. Header: res.Header,
  36357. }
  36358. }
  36359. if err != nil {
  36360. return nil, err
  36361. }
  36362. defer googleapi.CloseBody(res)
  36363. if err := googleapi.CheckResponse(res); err != nil {
  36364. return nil, err
  36365. }
  36366. ret := &Operation{
  36367. ServerResponse: googleapi.ServerResponse{
  36368. Header: res.Header,
  36369. HTTPStatusCode: res.StatusCode,
  36370. },
  36371. }
  36372. target := &ret
  36373. if err := gensupport.DecodeResponse(target, res); err != nil {
  36374. return nil, err
  36375. }
  36376. return ret, nil
  36377. // {
  36378. // "description": "Creates a firewall rule in the specified project using the data included in the request.",
  36379. // "httpMethod": "POST",
  36380. // "id": "compute.firewalls.insert",
  36381. // "parameterOrder": [
  36382. // "project"
  36383. // ],
  36384. // "parameters": {
  36385. // "project": {
  36386. // "description": "Project ID for this request.",
  36387. // "location": "path",
  36388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36389. // "required": true,
  36390. // "type": "string"
  36391. // },
  36392. // "requestId": {
  36393. // "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).",
  36394. // "location": "query",
  36395. // "type": "string"
  36396. // }
  36397. // },
  36398. // "path": "{project}/global/firewalls",
  36399. // "request": {
  36400. // "$ref": "Firewall"
  36401. // },
  36402. // "response": {
  36403. // "$ref": "Operation"
  36404. // },
  36405. // "scopes": [
  36406. // "https://www.googleapis.com/auth/cloud-platform",
  36407. // "https://www.googleapis.com/auth/compute"
  36408. // ]
  36409. // }
  36410. }
  36411. // method id "compute.firewalls.list":
  36412. type FirewallsListCall struct {
  36413. s *Service
  36414. project string
  36415. urlParams_ gensupport.URLParams
  36416. ifNoneMatch_ string
  36417. ctx_ context.Context
  36418. header_ http.Header
  36419. }
  36420. // List: Retrieves the list of firewall rules available to the specified
  36421. // project.
  36422. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list
  36423. func (r *FirewallsService) List(project string) *FirewallsListCall {
  36424. c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36425. c.project = project
  36426. return c
  36427. }
  36428. // Filter sets the optional parameter "filter": A filter expression that
  36429. // filters resources listed in the response. The expression must specify
  36430. // the field name, a comparison operator, and the value that you want to
  36431. // use for filtering. The value must be a string, a number, or a
  36432. // boolean. The comparison operator must be either =, !=, >, or <.
  36433. //
  36434. // For example, if you are filtering Compute Engine instances, you can
  36435. // exclude instances named example-instance by specifying name !=
  36436. // example-instance.
  36437. //
  36438. // You can also filter nested fields. For example, you could specify
  36439. // scheduling.automaticRestart = false to include instances only if they
  36440. // are not scheduled for automatic restarts. You can use filtering on
  36441. // nested fields to filter based on resource labels.
  36442. //
  36443. // To filter on multiple expressions, provide each separate expression
  36444. // within parentheses. For example, (scheduling.automaticRestart = true)
  36445. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  36446. // AND expression. However, you can include AND and OR expressions
  36447. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  36448. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  36449. // true).
  36450. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall {
  36451. c.urlParams_.Set("filter", filter)
  36452. return c
  36453. }
  36454. // MaxResults sets the optional parameter "maxResults": The maximum
  36455. // number of results per page that should be returned. If the number of
  36456. // available results is larger than maxResults, Compute Engine returns a
  36457. // nextPageToken that can be used to get the next page of results in
  36458. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  36459. // (Default: 500)
  36460. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall {
  36461. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36462. return c
  36463. }
  36464. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  36465. // a certain order. By default, results are returned in alphanumerical
  36466. // order based on the resource name.
  36467. //
  36468. // You can also sort results in descending order based on the creation
  36469. // timestamp using orderBy="creationTimestamp desc". This sorts results
  36470. // based on the creationTimestamp field in reverse chronological order
  36471. // (newest result first). Use this to sort resources like operations so
  36472. // that the newest operation is returned first.
  36473. //
  36474. // Currently, only sorting by name or creationTimestamp desc is
  36475. // supported.
  36476. func (c *FirewallsListCall) OrderBy(orderBy string) *FirewallsListCall {
  36477. c.urlParams_.Set("orderBy", orderBy)
  36478. return c
  36479. }
  36480. // PageToken sets the optional parameter "pageToken": Specifies a page
  36481. // token to use. Set pageToken to the nextPageToken returned by a
  36482. // previous list request to get the next page of results.
  36483. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall {
  36484. c.urlParams_.Set("pageToken", pageToken)
  36485. return c
  36486. }
  36487. // Fields allows partial responses to be retrieved. See
  36488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36489. // for more information.
  36490. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall {
  36491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36492. return c
  36493. }
  36494. // IfNoneMatch sets the optional parameter which makes the operation
  36495. // fail if the object's ETag matches the given value. This is useful for
  36496. // getting updates only after the object has changed since the last
  36497. // request. Use googleapi.IsNotModified to check whether the response
  36498. // error from Do is the result of In-None-Match.
  36499. func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall {
  36500. c.ifNoneMatch_ = entityTag
  36501. return c
  36502. }
  36503. // Context sets the context to be used in this call's Do method. Any
  36504. // pending HTTP request will be aborted if the provided context is
  36505. // canceled.
  36506. func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall {
  36507. c.ctx_ = ctx
  36508. return c
  36509. }
  36510. // Header returns an http.Header that can be modified by the caller to
  36511. // add HTTP headers to the request.
  36512. func (c *FirewallsListCall) Header() http.Header {
  36513. if c.header_ == nil {
  36514. c.header_ = make(http.Header)
  36515. }
  36516. return c.header_
  36517. }
  36518. func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) {
  36519. reqHeaders := make(http.Header)
  36520. for k, v := range c.header_ {
  36521. reqHeaders[k] = v
  36522. }
  36523. reqHeaders.Set("User-Agent", c.s.userAgent())
  36524. if c.ifNoneMatch_ != "" {
  36525. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36526. }
  36527. var body io.Reader = nil
  36528. c.urlParams_.Set("alt", alt)
  36529. c.urlParams_.Set("prettyPrint", "false")
  36530. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls")
  36531. urls += "?" + c.urlParams_.Encode()
  36532. req, err := http.NewRequest("GET", urls, body)
  36533. if err != nil {
  36534. return nil, err
  36535. }
  36536. req.Header = reqHeaders
  36537. googleapi.Expand(req.URL, map[string]string{
  36538. "project": c.project,
  36539. })
  36540. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36541. }
  36542. // Do executes the "compute.firewalls.list" call.
  36543. // Exactly one of *FirewallList or error will be non-nil. Any non-2xx
  36544. // status code is an error. Response headers are in either
  36545. // *FirewallList.ServerResponse.Header or (if a response was returned at
  36546. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36547. // to check whether the returned error was because
  36548. // http.StatusNotModified was returned.
  36549. func (c *FirewallsListCall) Do(opts ...googleapi.CallOption) (*FirewallList, error) {
  36550. gensupport.SetOptions(c.urlParams_, opts...)
  36551. res, err := c.doRequest("json")
  36552. if res != nil && res.StatusCode == http.StatusNotModified {
  36553. if res.Body != nil {
  36554. res.Body.Close()
  36555. }
  36556. return nil, &googleapi.Error{
  36557. Code: res.StatusCode,
  36558. Header: res.Header,
  36559. }
  36560. }
  36561. if err != nil {
  36562. return nil, err
  36563. }
  36564. defer googleapi.CloseBody(res)
  36565. if err := googleapi.CheckResponse(res); err != nil {
  36566. return nil, err
  36567. }
  36568. ret := &FirewallList{
  36569. ServerResponse: googleapi.ServerResponse{
  36570. Header: res.Header,
  36571. HTTPStatusCode: res.StatusCode,
  36572. },
  36573. }
  36574. target := &ret
  36575. if err := gensupport.DecodeResponse(target, res); err != nil {
  36576. return nil, err
  36577. }
  36578. return ret, nil
  36579. // {
  36580. // "description": "Retrieves the list of firewall rules available to the specified project.",
  36581. // "httpMethod": "GET",
  36582. // "id": "compute.firewalls.list",
  36583. // "parameterOrder": [
  36584. // "project"
  36585. // ],
  36586. // "parameters": {
  36587. // "filter": {
  36588. // "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).",
  36589. // "location": "query",
  36590. // "type": "string"
  36591. // },
  36592. // "maxResults": {
  36593. // "default": "500",
  36594. // "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)",
  36595. // "format": "uint32",
  36596. // "location": "query",
  36597. // "minimum": "0",
  36598. // "type": "integer"
  36599. // },
  36600. // "orderBy": {
  36601. // "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.",
  36602. // "location": "query",
  36603. // "type": "string"
  36604. // },
  36605. // "pageToken": {
  36606. // "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.",
  36607. // "location": "query",
  36608. // "type": "string"
  36609. // },
  36610. // "project": {
  36611. // "description": "Project ID for this request.",
  36612. // "location": "path",
  36613. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36614. // "required": true,
  36615. // "type": "string"
  36616. // }
  36617. // },
  36618. // "path": "{project}/global/firewalls",
  36619. // "response": {
  36620. // "$ref": "FirewallList"
  36621. // },
  36622. // "scopes": [
  36623. // "https://www.googleapis.com/auth/cloud-platform",
  36624. // "https://www.googleapis.com/auth/compute",
  36625. // "https://www.googleapis.com/auth/compute.readonly"
  36626. // ]
  36627. // }
  36628. }
  36629. // Pages invokes f for each page of results.
  36630. // A non-nil error returned from f will halt the iteration.
  36631. // The provided context supersedes any context provided to the Context method.
  36632. func (c *FirewallsListCall) Pages(ctx context.Context, f func(*FirewallList) error) error {
  36633. c.ctx_ = ctx
  36634. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36635. for {
  36636. x, err := c.Do()
  36637. if err != nil {
  36638. return err
  36639. }
  36640. if err := f(x); err != nil {
  36641. return err
  36642. }
  36643. if x.NextPageToken == "" {
  36644. return nil
  36645. }
  36646. c.PageToken(x.NextPageToken)
  36647. }
  36648. }
  36649. // method id "compute.firewalls.patch":
  36650. type FirewallsPatchCall struct {
  36651. s *Service
  36652. project string
  36653. firewall string
  36654. firewall2 *Firewall
  36655. urlParams_ gensupport.URLParams
  36656. ctx_ context.Context
  36657. header_ http.Header
  36658. }
  36659. // Patch: Updates the specified firewall rule with the data included in
  36660. // the request. This method supports PATCH semantics and uses the JSON
  36661. // merge patch format and processing rules.
  36662. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch
  36663. func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall {
  36664. c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36665. c.project = project
  36666. c.firewall = firewall
  36667. c.firewall2 = firewall2
  36668. return c
  36669. }
  36670. // RequestId sets the optional parameter "requestId": An optional
  36671. // request ID to identify requests. Specify a unique request ID so that
  36672. // if you must retry your request, the server will know to ignore the
  36673. // request if it has already been completed.
  36674. //
  36675. // For example, consider a situation where you make an initial request
  36676. // and the request times out. If you make the request again with the
  36677. // same request ID, the server can check if original operation with the
  36678. // same request ID was received, and if so, will ignore the second
  36679. // request. This prevents clients from accidentally creating duplicate
  36680. // commitments.
  36681. //
  36682. // The request ID must be a valid UUID with the exception that zero UUID
  36683. // is not supported (00000000-0000-0000-0000-000000000000).
  36684. func (c *FirewallsPatchCall) RequestId(requestId string) *FirewallsPatchCall {
  36685. c.urlParams_.Set("requestId", requestId)
  36686. return c
  36687. }
  36688. // Fields allows partial responses to be retrieved. See
  36689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36690. // for more information.
  36691. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall {
  36692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36693. return c
  36694. }
  36695. // Context sets the context to be used in this call's Do method. Any
  36696. // pending HTTP request will be aborted if the provided context is
  36697. // canceled.
  36698. func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall {
  36699. c.ctx_ = ctx
  36700. return c
  36701. }
  36702. // Header returns an http.Header that can be modified by the caller to
  36703. // add HTTP headers to the request.
  36704. func (c *FirewallsPatchCall) Header() http.Header {
  36705. if c.header_ == nil {
  36706. c.header_ = make(http.Header)
  36707. }
  36708. return c.header_
  36709. }
  36710. func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) {
  36711. reqHeaders := make(http.Header)
  36712. for k, v := range c.header_ {
  36713. reqHeaders[k] = v
  36714. }
  36715. reqHeaders.Set("User-Agent", c.s.userAgent())
  36716. var body io.Reader = nil
  36717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  36718. if err != nil {
  36719. return nil, err
  36720. }
  36721. reqHeaders.Set("Content-Type", "application/json")
  36722. c.urlParams_.Set("alt", alt)
  36723. c.urlParams_.Set("prettyPrint", "false")
  36724. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  36725. urls += "?" + c.urlParams_.Encode()
  36726. req, err := http.NewRequest("PATCH", urls, body)
  36727. if err != nil {
  36728. return nil, err
  36729. }
  36730. req.Header = reqHeaders
  36731. googleapi.Expand(req.URL, map[string]string{
  36732. "project": c.project,
  36733. "firewall": c.firewall,
  36734. })
  36735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36736. }
  36737. // Do executes the "compute.firewalls.patch" call.
  36738. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36739. // status code is an error. Response headers are in either
  36740. // *Operation.ServerResponse.Header or (if a response was returned at
  36741. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36742. // to check whether the returned error was because
  36743. // http.StatusNotModified was returned.
  36744. func (c *FirewallsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36745. gensupport.SetOptions(c.urlParams_, opts...)
  36746. res, err := c.doRequest("json")
  36747. if res != nil && res.StatusCode == http.StatusNotModified {
  36748. if res.Body != nil {
  36749. res.Body.Close()
  36750. }
  36751. return nil, &googleapi.Error{
  36752. Code: res.StatusCode,
  36753. Header: res.Header,
  36754. }
  36755. }
  36756. if err != nil {
  36757. return nil, err
  36758. }
  36759. defer googleapi.CloseBody(res)
  36760. if err := googleapi.CheckResponse(res); err != nil {
  36761. return nil, err
  36762. }
  36763. ret := &Operation{
  36764. ServerResponse: googleapi.ServerResponse{
  36765. Header: res.Header,
  36766. HTTPStatusCode: res.StatusCode,
  36767. },
  36768. }
  36769. target := &ret
  36770. if err := gensupport.DecodeResponse(target, res); err != nil {
  36771. return nil, err
  36772. }
  36773. return ret, nil
  36774. // {
  36775. // "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.",
  36776. // "httpMethod": "PATCH",
  36777. // "id": "compute.firewalls.patch",
  36778. // "parameterOrder": [
  36779. // "project",
  36780. // "firewall"
  36781. // ],
  36782. // "parameters": {
  36783. // "firewall": {
  36784. // "description": "Name of the firewall rule to patch.",
  36785. // "location": "path",
  36786. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36787. // "required": true,
  36788. // "type": "string"
  36789. // },
  36790. // "project": {
  36791. // "description": "Project ID for this request.",
  36792. // "location": "path",
  36793. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36794. // "required": true,
  36795. // "type": "string"
  36796. // },
  36797. // "requestId": {
  36798. // "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).",
  36799. // "location": "query",
  36800. // "type": "string"
  36801. // }
  36802. // },
  36803. // "path": "{project}/global/firewalls/{firewall}",
  36804. // "request": {
  36805. // "$ref": "Firewall"
  36806. // },
  36807. // "response": {
  36808. // "$ref": "Operation"
  36809. // },
  36810. // "scopes": [
  36811. // "https://www.googleapis.com/auth/cloud-platform",
  36812. // "https://www.googleapis.com/auth/compute"
  36813. // ]
  36814. // }
  36815. }
  36816. // method id "compute.firewalls.update":
  36817. type FirewallsUpdateCall struct {
  36818. s *Service
  36819. project string
  36820. firewall string
  36821. firewall2 *Firewall
  36822. urlParams_ gensupport.URLParams
  36823. ctx_ context.Context
  36824. header_ http.Header
  36825. }
  36826. // Update: Updates the specified firewall rule with the data included in
  36827. // the request. The PUT method can only update the following fields of
  36828. // firewall rule: allowed, description, sourceRanges, sourceTags,
  36829. // targetTags.
  36830. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update
  36831. func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall {
  36832. c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36833. c.project = project
  36834. c.firewall = firewall
  36835. c.firewall2 = firewall2
  36836. return c
  36837. }
  36838. // RequestId sets the optional parameter "requestId": An optional
  36839. // request ID to identify requests. Specify a unique request ID so that
  36840. // if you must retry your request, the server will know to ignore the
  36841. // request if it has already been completed.
  36842. //
  36843. // For example, consider a situation where you make an initial request
  36844. // and the request times out. If you make the request again with the
  36845. // same request ID, the server can check if original operation with the
  36846. // same request ID was received, and if so, will ignore the second
  36847. // request. This prevents clients from accidentally creating duplicate
  36848. // commitments.
  36849. //
  36850. // The request ID must be a valid UUID with the exception that zero UUID
  36851. // is not supported (00000000-0000-0000-0000-000000000000).
  36852. func (c *FirewallsUpdateCall) RequestId(requestId string) *FirewallsUpdateCall {
  36853. c.urlParams_.Set("requestId", requestId)
  36854. return c
  36855. }
  36856. // Fields allows partial responses to be retrieved. See
  36857. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36858. // for more information.
  36859. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall {
  36860. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36861. return c
  36862. }
  36863. // Context sets the context to be used in this call's Do method. Any
  36864. // pending HTTP request will be aborted if the provided context is
  36865. // canceled.
  36866. func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall {
  36867. c.ctx_ = ctx
  36868. return c
  36869. }
  36870. // Header returns an http.Header that can be modified by the caller to
  36871. // add HTTP headers to the request.
  36872. func (c *FirewallsUpdateCall) Header() http.Header {
  36873. if c.header_ == nil {
  36874. c.header_ = make(http.Header)
  36875. }
  36876. return c.header_
  36877. }
  36878. func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36879. reqHeaders := make(http.Header)
  36880. for k, v := range c.header_ {
  36881. reqHeaders[k] = v
  36882. }
  36883. reqHeaders.Set("User-Agent", c.s.userAgent())
  36884. var body io.Reader = nil
  36885. body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2)
  36886. if err != nil {
  36887. return nil, err
  36888. }
  36889. reqHeaders.Set("Content-Type", "application/json")
  36890. c.urlParams_.Set("alt", alt)
  36891. c.urlParams_.Set("prettyPrint", "false")
  36892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}")
  36893. urls += "?" + c.urlParams_.Encode()
  36894. req, err := http.NewRequest("PUT", urls, body)
  36895. if err != nil {
  36896. return nil, err
  36897. }
  36898. req.Header = reqHeaders
  36899. googleapi.Expand(req.URL, map[string]string{
  36900. "project": c.project,
  36901. "firewall": c.firewall,
  36902. })
  36903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36904. }
  36905. // Do executes the "compute.firewalls.update" call.
  36906. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  36907. // status code is an error. Response headers are in either
  36908. // *Operation.ServerResponse.Header or (if a response was returned at
  36909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36910. // to check whether the returned error was because
  36911. // http.StatusNotModified was returned.
  36912. func (c *FirewallsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  36913. gensupport.SetOptions(c.urlParams_, opts...)
  36914. res, err := c.doRequest("json")
  36915. if res != nil && res.StatusCode == http.StatusNotModified {
  36916. if res.Body != nil {
  36917. res.Body.Close()
  36918. }
  36919. return nil, &googleapi.Error{
  36920. Code: res.StatusCode,
  36921. Header: res.Header,
  36922. }
  36923. }
  36924. if err != nil {
  36925. return nil, err
  36926. }
  36927. defer googleapi.CloseBody(res)
  36928. if err := googleapi.CheckResponse(res); err != nil {
  36929. return nil, err
  36930. }
  36931. ret := &Operation{
  36932. ServerResponse: googleapi.ServerResponse{
  36933. Header: res.Header,
  36934. HTTPStatusCode: res.StatusCode,
  36935. },
  36936. }
  36937. target := &ret
  36938. if err := gensupport.DecodeResponse(target, res); err != nil {
  36939. return nil, err
  36940. }
  36941. return ret, nil
  36942. // {
  36943. // "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.",
  36944. // "httpMethod": "PUT",
  36945. // "id": "compute.firewalls.update",
  36946. // "parameterOrder": [
  36947. // "project",
  36948. // "firewall"
  36949. // ],
  36950. // "parameters": {
  36951. // "firewall": {
  36952. // "description": "Name of the firewall rule to update.",
  36953. // "location": "path",
  36954. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  36955. // "required": true,
  36956. // "type": "string"
  36957. // },
  36958. // "project": {
  36959. // "description": "Project ID for this request.",
  36960. // "location": "path",
  36961. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  36962. // "required": true,
  36963. // "type": "string"
  36964. // },
  36965. // "requestId": {
  36966. // "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).",
  36967. // "location": "query",
  36968. // "type": "string"
  36969. // }
  36970. // },
  36971. // "path": "{project}/global/firewalls/{firewall}",
  36972. // "request": {
  36973. // "$ref": "Firewall"
  36974. // },
  36975. // "response": {
  36976. // "$ref": "Operation"
  36977. // },
  36978. // "scopes": [
  36979. // "https://www.googleapis.com/auth/cloud-platform",
  36980. // "https://www.googleapis.com/auth/compute"
  36981. // ]
  36982. // }
  36983. }
  36984. // method id "compute.forwardingRules.aggregatedList":
  36985. type ForwardingRulesAggregatedListCall struct {
  36986. s *Service
  36987. project string
  36988. urlParams_ gensupport.URLParams
  36989. ifNoneMatch_ string
  36990. ctx_ context.Context
  36991. header_ http.Header
  36992. }
  36993. // AggregatedList: Retrieves an aggregated list of forwarding rules.
  36994. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList
  36995. func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall {
  36996. c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36997. c.project = project
  36998. return c
  36999. }
  37000. // Filter sets the optional parameter "filter": A filter expression that
  37001. // filters resources listed in the response. The expression must specify
  37002. // the field name, a comparison operator, and the value that you want to
  37003. // use for filtering. The value must be a string, a number, or a
  37004. // boolean. The comparison operator must be either =, !=, >, or <.
  37005. //
  37006. // For example, if you are filtering Compute Engine instances, you can
  37007. // exclude instances named example-instance by specifying name !=
  37008. // example-instance.
  37009. //
  37010. // You can also filter nested fields. For example, you could specify
  37011. // scheduling.automaticRestart = false to include instances only if they
  37012. // are not scheduled for automatic restarts. You can use filtering on
  37013. // nested fields to filter based on resource labels.
  37014. //
  37015. // To filter on multiple expressions, provide each separate expression
  37016. // within parentheses. For example, (scheduling.automaticRestart = true)
  37017. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37018. // AND expression. However, you can include AND and OR expressions
  37019. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37020. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37021. // true).
  37022. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall {
  37023. c.urlParams_.Set("filter", filter)
  37024. return c
  37025. }
  37026. // MaxResults sets the optional parameter "maxResults": The maximum
  37027. // number of results per page that should be returned. If the number of
  37028. // available results is larger than maxResults, Compute Engine returns a
  37029. // nextPageToken that can be used to get the next page of results in
  37030. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37031. // (Default: 500)
  37032. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall {
  37033. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37034. return c
  37035. }
  37036. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37037. // a certain order. By default, results are returned in alphanumerical
  37038. // order based on the resource name.
  37039. //
  37040. // You can also sort results in descending order based on the creation
  37041. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37042. // based on the creationTimestamp field in reverse chronological order
  37043. // (newest result first). Use this to sort resources like operations so
  37044. // that the newest operation is returned first.
  37045. //
  37046. // Currently, only sorting by name or creationTimestamp desc is
  37047. // supported.
  37048. func (c *ForwardingRulesAggregatedListCall) OrderBy(orderBy string) *ForwardingRulesAggregatedListCall {
  37049. c.urlParams_.Set("orderBy", orderBy)
  37050. return c
  37051. }
  37052. // PageToken sets the optional parameter "pageToken": Specifies a page
  37053. // token to use. Set pageToken to the nextPageToken returned by a
  37054. // previous list request to get the next page of results.
  37055. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall {
  37056. c.urlParams_.Set("pageToken", pageToken)
  37057. return c
  37058. }
  37059. // Fields allows partial responses to be retrieved. See
  37060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37061. // for more information.
  37062. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall {
  37063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37064. return c
  37065. }
  37066. // IfNoneMatch sets the optional parameter which makes the operation
  37067. // fail if the object's ETag matches the given value. This is useful for
  37068. // getting updates only after the object has changed since the last
  37069. // request. Use googleapi.IsNotModified to check whether the response
  37070. // error from Do is the result of In-None-Match.
  37071. func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall {
  37072. c.ifNoneMatch_ = entityTag
  37073. return c
  37074. }
  37075. // Context sets the context to be used in this call's Do method. Any
  37076. // pending HTTP request will be aborted if the provided context is
  37077. // canceled.
  37078. func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall {
  37079. c.ctx_ = ctx
  37080. return c
  37081. }
  37082. // Header returns an http.Header that can be modified by the caller to
  37083. // add HTTP headers to the request.
  37084. func (c *ForwardingRulesAggregatedListCall) Header() http.Header {
  37085. if c.header_ == nil {
  37086. c.header_ = make(http.Header)
  37087. }
  37088. return c.header_
  37089. }
  37090. func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  37091. reqHeaders := make(http.Header)
  37092. for k, v := range c.header_ {
  37093. reqHeaders[k] = v
  37094. }
  37095. reqHeaders.Set("User-Agent", c.s.userAgent())
  37096. if c.ifNoneMatch_ != "" {
  37097. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37098. }
  37099. var body io.Reader = nil
  37100. c.urlParams_.Set("alt", alt)
  37101. c.urlParams_.Set("prettyPrint", "false")
  37102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules")
  37103. urls += "?" + c.urlParams_.Encode()
  37104. req, err := http.NewRequest("GET", urls, body)
  37105. if err != nil {
  37106. return nil, err
  37107. }
  37108. req.Header = reqHeaders
  37109. googleapi.Expand(req.URL, map[string]string{
  37110. "project": c.project,
  37111. })
  37112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37113. }
  37114. // Do executes the "compute.forwardingRules.aggregatedList" call.
  37115. // Exactly one of *ForwardingRuleAggregatedList or error will be
  37116. // non-nil. Any non-2xx status code is an error. Response headers are in
  37117. // either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a
  37118. // response was returned at all) in error.(*googleapi.Error).Header. Use
  37119. // googleapi.IsNotModified to check whether the returned error was
  37120. // because http.StatusNotModified was returned.
  37121. func (c *ForwardingRulesAggregatedListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleAggregatedList, error) {
  37122. gensupport.SetOptions(c.urlParams_, opts...)
  37123. res, err := c.doRequest("json")
  37124. if res != nil && res.StatusCode == http.StatusNotModified {
  37125. if res.Body != nil {
  37126. res.Body.Close()
  37127. }
  37128. return nil, &googleapi.Error{
  37129. Code: res.StatusCode,
  37130. Header: res.Header,
  37131. }
  37132. }
  37133. if err != nil {
  37134. return nil, err
  37135. }
  37136. defer googleapi.CloseBody(res)
  37137. if err := googleapi.CheckResponse(res); err != nil {
  37138. return nil, err
  37139. }
  37140. ret := &ForwardingRuleAggregatedList{
  37141. ServerResponse: googleapi.ServerResponse{
  37142. Header: res.Header,
  37143. HTTPStatusCode: res.StatusCode,
  37144. },
  37145. }
  37146. target := &ret
  37147. if err := gensupport.DecodeResponse(target, res); err != nil {
  37148. return nil, err
  37149. }
  37150. return ret, nil
  37151. // {
  37152. // "description": "Retrieves an aggregated list of forwarding rules.",
  37153. // "httpMethod": "GET",
  37154. // "id": "compute.forwardingRules.aggregatedList",
  37155. // "parameterOrder": [
  37156. // "project"
  37157. // ],
  37158. // "parameters": {
  37159. // "filter": {
  37160. // "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).",
  37161. // "location": "query",
  37162. // "type": "string"
  37163. // },
  37164. // "maxResults": {
  37165. // "default": "500",
  37166. // "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)",
  37167. // "format": "uint32",
  37168. // "location": "query",
  37169. // "minimum": "0",
  37170. // "type": "integer"
  37171. // },
  37172. // "orderBy": {
  37173. // "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.",
  37174. // "location": "query",
  37175. // "type": "string"
  37176. // },
  37177. // "pageToken": {
  37178. // "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.",
  37179. // "location": "query",
  37180. // "type": "string"
  37181. // },
  37182. // "project": {
  37183. // "description": "Project ID for this request.",
  37184. // "location": "path",
  37185. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37186. // "required": true,
  37187. // "type": "string"
  37188. // }
  37189. // },
  37190. // "path": "{project}/aggregated/forwardingRules",
  37191. // "response": {
  37192. // "$ref": "ForwardingRuleAggregatedList"
  37193. // },
  37194. // "scopes": [
  37195. // "https://www.googleapis.com/auth/cloud-platform",
  37196. // "https://www.googleapis.com/auth/compute",
  37197. // "https://www.googleapis.com/auth/compute.readonly"
  37198. // ]
  37199. // }
  37200. }
  37201. // Pages invokes f for each page of results.
  37202. // A non-nil error returned from f will halt the iteration.
  37203. // The provided context supersedes any context provided to the Context method.
  37204. func (c *ForwardingRulesAggregatedListCall) Pages(ctx context.Context, f func(*ForwardingRuleAggregatedList) error) error {
  37205. c.ctx_ = ctx
  37206. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37207. for {
  37208. x, err := c.Do()
  37209. if err != nil {
  37210. return err
  37211. }
  37212. if err := f(x); err != nil {
  37213. return err
  37214. }
  37215. if x.NextPageToken == "" {
  37216. return nil
  37217. }
  37218. c.PageToken(x.NextPageToken)
  37219. }
  37220. }
  37221. // method id "compute.forwardingRules.delete":
  37222. type ForwardingRulesDeleteCall struct {
  37223. s *Service
  37224. project string
  37225. region string
  37226. forwardingRule string
  37227. urlParams_ gensupport.URLParams
  37228. ctx_ context.Context
  37229. header_ http.Header
  37230. }
  37231. // Delete: Deletes the specified ForwardingRule resource.
  37232. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete
  37233. func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall {
  37234. c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37235. c.project = project
  37236. c.region = region
  37237. c.forwardingRule = forwardingRule
  37238. return c
  37239. }
  37240. // RequestId sets the optional parameter "requestId": An optional
  37241. // request ID to identify requests. Specify a unique request ID so that
  37242. // if you must retry your request, the server will know to ignore the
  37243. // request if it has already been completed.
  37244. //
  37245. // For example, consider a situation where you make an initial request
  37246. // and the request times out. If you make the request again with the
  37247. // same request ID, the server can check if original operation with the
  37248. // same request ID was received, and if so, will ignore the second
  37249. // request. This prevents clients from accidentally creating duplicate
  37250. // commitments.
  37251. //
  37252. // The request ID must be a valid UUID with the exception that zero UUID
  37253. // is not supported (00000000-0000-0000-0000-000000000000).
  37254. func (c *ForwardingRulesDeleteCall) RequestId(requestId string) *ForwardingRulesDeleteCall {
  37255. c.urlParams_.Set("requestId", requestId)
  37256. return c
  37257. }
  37258. // Fields allows partial responses to be retrieved. See
  37259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37260. // for more information.
  37261. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall {
  37262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall {
  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 *ForwardingRulesDeleteCall) Header() http.Header {
  37275. if c.header_ == nil {
  37276. c.header_ = make(http.Header)
  37277. }
  37278. return c.header_
  37279. }
  37280. func (c *ForwardingRulesDeleteCall) 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. var body io.Reader = nil
  37287. c.urlParams_.Set("alt", alt)
  37288. c.urlParams_.Set("prettyPrint", "false")
  37289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  37290. urls += "?" + c.urlParams_.Encode()
  37291. req, err := http.NewRequest("DELETE", urls, body)
  37292. if err != nil {
  37293. return nil, err
  37294. }
  37295. req.Header = reqHeaders
  37296. googleapi.Expand(req.URL, map[string]string{
  37297. "project": c.project,
  37298. "region": c.region,
  37299. "forwardingRule": c.forwardingRule,
  37300. })
  37301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37302. }
  37303. // Do executes the "compute.forwardingRules.delete" call.
  37304. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37305. // status code is an error. Response headers are in either
  37306. // *Operation.ServerResponse.Header or (if a response was returned at
  37307. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37308. // to check whether the returned error was because
  37309. // http.StatusNotModified was returned.
  37310. func (c *ForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37311. gensupport.SetOptions(c.urlParams_, opts...)
  37312. res, err := c.doRequest("json")
  37313. if res != nil && res.StatusCode == http.StatusNotModified {
  37314. if res.Body != nil {
  37315. res.Body.Close()
  37316. }
  37317. return nil, &googleapi.Error{
  37318. Code: res.StatusCode,
  37319. Header: res.Header,
  37320. }
  37321. }
  37322. if err != nil {
  37323. return nil, err
  37324. }
  37325. defer googleapi.CloseBody(res)
  37326. if err := googleapi.CheckResponse(res); err != nil {
  37327. return nil, err
  37328. }
  37329. ret := &Operation{
  37330. ServerResponse: googleapi.ServerResponse{
  37331. Header: res.Header,
  37332. HTTPStatusCode: res.StatusCode,
  37333. },
  37334. }
  37335. target := &ret
  37336. if err := gensupport.DecodeResponse(target, res); err != nil {
  37337. return nil, err
  37338. }
  37339. return ret, nil
  37340. // {
  37341. // "description": "Deletes the specified ForwardingRule resource.",
  37342. // "httpMethod": "DELETE",
  37343. // "id": "compute.forwardingRules.delete",
  37344. // "parameterOrder": [
  37345. // "project",
  37346. // "region",
  37347. // "forwardingRule"
  37348. // ],
  37349. // "parameters": {
  37350. // "forwardingRule": {
  37351. // "description": "Name of the ForwardingRule resource to delete.",
  37352. // "location": "path",
  37353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37354. // "required": true,
  37355. // "type": "string"
  37356. // },
  37357. // "project": {
  37358. // "description": "Project ID for this request.",
  37359. // "location": "path",
  37360. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37361. // "required": true,
  37362. // "type": "string"
  37363. // },
  37364. // "region": {
  37365. // "description": "Name of the region scoping this request.",
  37366. // "location": "path",
  37367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37368. // "required": true,
  37369. // "type": "string"
  37370. // },
  37371. // "requestId": {
  37372. // "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).",
  37373. // "location": "query",
  37374. // "type": "string"
  37375. // }
  37376. // },
  37377. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  37378. // "response": {
  37379. // "$ref": "Operation"
  37380. // },
  37381. // "scopes": [
  37382. // "https://www.googleapis.com/auth/cloud-platform",
  37383. // "https://www.googleapis.com/auth/compute"
  37384. // ]
  37385. // }
  37386. }
  37387. // method id "compute.forwardingRules.get":
  37388. type ForwardingRulesGetCall struct {
  37389. s *Service
  37390. project string
  37391. region string
  37392. forwardingRule string
  37393. urlParams_ gensupport.URLParams
  37394. ifNoneMatch_ string
  37395. ctx_ context.Context
  37396. header_ http.Header
  37397. }
  37398. // Get: Returns the specified ForwardingRule resource.
  37399. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get
  37400. func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall {
  37401. c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37402. c.project = project
  37403. c.region = region
  37404. c.forwardingRule = forwardingRule
  37405. return c
  37406. }
  37407. // Fields allows partial responses to be retrieved. See
  37408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37409. // for more information.
  37410. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall {
  37411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37412. return c
  37413. }
  37414. // IfNoneMatch sets the optional parameter which makes the operation
  37415. // fail if the object's ETag matches the given value. This is useful for
  37416. // getting updates only after the object has changed since the last
  37417. // request. Use googleapi.IsNotModified to check whether the response
  37418. // error from Do is the result of In-None-Match.
  37419. func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall {
  37420. c.ifNoneMatch_ = entityTag
  37421. return c
  37422. }
  37423. // Context sets the context to be used in this call's Do method. Any
  37424. // pending HTTP request will be aborted if the provided context is
  37425. // canceled.
  37426. func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall {
  37427. c.ctx_ = ctx
  37428. return c
  37429. }
  37430. // Header returns an http.Header that can be modified by the caller to
  37431. // add HTTP headers to the request.
  37432. func (c *ForwardingRulesGetCall) Header() http.Header {
  37433. if c.header_ == nil {
  37434. c.header_ = make(http.Header)
  37435. }
  37436. return c.header_
  37437. }
  37438. func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  37439. reqHeaders := make(http.Header)
  37440. for k, v := range c.header_ {
  37441. reqHeaders[k] = v
  37442. }
  37443. reqHeaders.Set("User-Agent", c.s.userAgent())
  37444. if c.ifNoneMatch_ != "" {
  37445. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37446. }
  37447. var body io.Reader = nil
  37448. c.urlParams_.Set("alt", alt)
  37449. c.urlParams_.Set("prettyPrint", "false")
  37450. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}")
  37451. urls += "?" + c.urlParams_.Encode()
  37452. req, err := http.NewRequest("GET", urls, body)
  37453. if err != nil {
  37454. return nil, err
  37455. }
  37456. req.Header = reqHeaders
  37457. googleapi.Expand(req.URL, map[string]string{
  37458. "project": c.project,
  37459. "region": c.region,
  37460. "forwardingRule": c.forwardingRule,
  37461. })
  37462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37463. }
  37464. // Do executes the "compute.forwardingRules.get" call.
  37465. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  37466. // status code is an error. Response headers are in either
  37467. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  37468. // at all) in error.(*googleapi.Error).Header. Use
  37469. // googleapi.IsNotModified to check whether the returned error was
  37470. // because http.StatusNotModified was returned.
  37471. func (c *ForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  37472. gensupport.SetOptions(c.urlParams_, opts...)
  37473. res, err := c.doRequest("json")
  37474. if res != nil && res.StatusCode == http.StatusNotModified {
  37475. if res.Body != nil {
  37476. res.Body.Close()
  37477. }
  37478. return nil, &googleapi.Error{
  37479. Code: res.StatusCode,
  37480. Header: res.Header,
  37481. }
  37482. }
  37483. if err != nil {
  37484. return nil, err
  37485. }
  37486. defer googleapi.CloseBody(res)
  37487. if err := googleapi.CheckResponse(res); err != nil {
  37488. return nil, err
  37489. }
  37490. ret := &ForwardingRule{
  37491. ServerResponse: googleapi.ServerResponse{
  37492. Header: res.Header,
  37493. HTTPStatusCode: res.StatusCode,
  37494. },
  37495. }
  37496. target := &ret
  37497. if err := gensupport.DecodeResponse(target, res); err != nil {
  37498. return nil, err
  37499. }
  37500. return ret, nil
  37501. // {
  37502. // "description": "Returns the specified ForwardingRule resource.",
  37503. // "httpMethod": "GET",
  37504. // "id": "compute.forwardingRules.get",
  37505. // "parameterOrder": [
  37506. // "project",
  37507. // "region",
  37508. // "forwardingRule"
  37509. // ],
  37510. // "parameters": {
  37511. // "forwardingRule": {
  37512. // "description": "Name of the ForwardingRule resource to return.",
  37513. // "location": "path",
  37514. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  37515. // "required": true,
  37516. // "type": "string"
  37517. // },
  37518. // "project": {
  37519. // "description": "Project ID for this request.",
  37520. // "location": "path",
  37521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37522. // "required": true,
  37523. // "type": "string"
  37524. // },
  37525. // "region": {
  37526. // "description": "Name of the region scoping this request.",
  37527. // "location": "path",
  37528. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37529. // "required": true,
  37530. // "type": "string"
  37531. // }
  37532. // },
  37533. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}",
  37534. // "response": {
  37535. // "$ref": "ForwardingRule"
  37536. // },
  37537. // "scopes": [
  37538. // "https://www.googleapis.com/auth/cloud-platform",
  37539. // "https://www.googleapis.com/auth/compute",
  37540. // "https://www.googleapis.com/auth/compute.readonly"
  37541. // ]
  37542. // }
  37543. }
  37544. // method id "compute.forwardingRules.insert":
  37545. type ForwardingRulesInsertCall struct {
  37546. s *Service
  37547. project string
  37548. region string
  37549. forwardingrule *ForwardingRule
  37550. urlParams_ gensupport.URLParams
  37551. ctx_ context.Context
  37552. header_ http.Header
  37553. }
  37554. // Insert: Creates a ForwardingRule resource in the specified project
  37555. // and region using the data included in the request.
  37556. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert
  37557. func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall {
  37558. c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37559. c.project = project
  37560. c.region = region
  37561. c.forwardingrule = forwardingrule
  37562. return c
  37563. }
  37564. // RequestId sets the optional parameter "requestId": An optional
  37565. // request ID to identify requests. Specify a unique request ID so that
  37566. // if you must retry your request, the server will know to ignore the
  37567. // request if it has already been completed.
  37568. //
  37569. // For example, consider a situation where you make an initial request
  37570. // and the request times out. If you make the request again with the
  37571. // same request ID, the server can check if original operation with the
  37572. // same request ID was received, and if so, will ignore the second
  37573. // request. This prevents clients from accidentally creating duplicate
  37574. // commitments.
  37575. //
  37576. // The request ID must be a valid UUID with the exception that zero UUID
  37577. // is not supported (00000000-0000-0000-0000-000000000000).
  37578. func (c *ForwardingRulesInsertCall) RequestId(requestId string) *ForwardingRulesInsertCall {
  37579. c.urlParams_.Set("requestId", requestId)
  37580. return c
  37581. }
  37582. // Fields allows partial responses to be retrieved. See
  37583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37584. // for more information.
  37585. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall {
  37586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37587. return c
  37588. }
  37589. // Context sets the context to be used in this call's Do method. Any
  37590. // pending HTTP request will be aborted if the provided context is
  37591. // canceled.
  37592. func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall {
  37593. c.ctx_ = ctx
  37594. return c
  37595. }
  37596. // Header returns an http.Header that can be modified by the caller to
  37597. // add HTTP headers to the request.
  37598. func (c *ForwardingRulesInsertCall) Header() http.Header {
  37599. if c.header_ == nil {
  37600. c.header_ = make(http.Header)
  37601. }
  37602. return c.header_
  37603. }
  37604. func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  37605. reqHeaders := make(http.Header)
  37606. for k, v := range c.header_ {
  37607. reqHeaders[k] = v
  37608. }
  37609. reqHeaders.Set("User-Agent", c.s.userAgent())
  37610. var body io.Reader = nil
  37611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  37612. if err != nil {
  37613. return nil, err
  37614. }
  37615. reqHeaders.Set("Content-Type", "application/json")
  37616. c.urlParams_.Set("alt", alt)
  37617. c.urlParams_.Set("prettyPrint", "false")
  37618. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  37619. urls += "?" + c.urlParams_.Encode()
  37620. req, err := http.NewRequest("POST", urls, body)
  37621. if err != nil {
  37622. return nil, err
  37623. }
  37624. req.Header = reqHeaders
  37625. googleapi.Expand(req.URL, map[string]string{
  37626. "project": c.project,
  37627. "region": c.region,
  37628. })
  37629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37630. }
  37631. // Do executes the "compute.forwardingRules.insert" call.
  37632. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  37633. // status code is an error. Response headers are in either
  37634. // *Operation.ServerResponse.Header or (if a response was returned at
  37635. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37636. // to check whether the returned error was because
  37637. // http.StatusNotModified was returned.
  37638. func (c *ForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  37639. gensupport.SetOptions(c.urlParams_, opts...)
  37640. res, err := c.doRequest("json")
  37641. if res != nil && res.StatusCode == http.StatusNotModified {
  37642. if res.Body != nil {
  37643. res.Body.Close()
  37644. }
  37645. return nil, &googleapi.Error{
  37646. Code: res.StatusCode,
  37647. Header: res.Header,
  37648. }
  37649. }
  37650. if err != nil {
  37651. return nil, err
  37652. }
  37653. defer googleapi.CloseBody(res)
  37654. if err := googleapi.CheckResponse(res); err != nil {
  37655. return nil, err
  37656. }
  37657. ret := &Operation{
  37658. ServerResponse: googleapi.ServerResponse{
  37659. Header: res.Header,
  37660. HTTPStatusCode: res.StatusCode,
  37661. },
  37662. }
  37663. target := &ret
  37664. if err := gensupport.DecodeResponse(target, res); err != nil {
  37665. return nil, err
  37666. }
  37667. return ret, nil
  37668. // {
  37669. // "description": "Creates a ForwardingRule resource in the specified project and region using the data included in the request.",
  37670. // "httpMethod": "POST",
  37671. // "id": "compute.forwardingRules.insert",
  37672. // "parameterOrder": [
  37673. // "project",
  37674. // "region"
  37675. // ],
  37676. // "parameters": {
  37677. // "project": {
  37678. // "description": "Project ID for this request.",
  37679. // "location": "path",
  37680. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37681. // "required": true,
  37682. // "type": "string"
  37683. // },
  37684. // "region": {
  37685. // "description": "Name of the region scoping this request.",
  37686. // "location": "path",
  37687. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37688. // "required": true,
  37689. // "type": "string"
  37690. // },
  37691. // "requestId": {
  37692. // "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).",
  37693. // "location": "query",
  37694. // "type": "string"
  37695. // }
  37696. // },
  37697. // "path": "{project}/regions/{region}/forwardingRules",
  37698. // "request": {
  37699. // "$ref": "ForwardingRule"
  37700. // },
  37701. // "response": {
  37702. // "$ref": "Operation"
  37703. // },
  37704. // "scopes": [
  37705. // "https://www.googleapis.com/auth/cloud-platform",
  37706. // "https://www.googleapis.com/auth/compute"
  37707. // ]
  37708. // }
  37709. }
  37710. // method id "compute.forwardingRules.list":
  37711. type ForwardingRulesListCall struct {
  37712. s *Service
  37713. project string
  37714. region string
  37715. urlParams_ gensupport.URLParams
  37716. ifNoneMatch_ string
  37717. ctx_ context.Context
  37718. header_ http.Header
  37719. }
  37720. // List: Retrieves a list of ForwardingRule resources available to the
  37721. // specified project and region.
  37722. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list
  37723. func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall {
  37724. c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37725. c.project = project
  37726. c.region = region
  37727. return c
  37728. }
  37729. // Filter sets the optional parameter "filter": A filter expression that
  37730. // filters resources listed in the response. The expression must specify
  37731. // the field name, a comparison operator, and the value that you want to
  37732. // use for filtering. The value must be a string, a number, or a
  37733. // boolean. The comparison operator must be either =, !=, >, or <.
  37734. //
  37735. // For example, if you are filtering Compute Engine instances, you can
  37736. // exclude instances named example-instance by specifying name !=
  37737. // example-instance.
  37738. //
  37739. // You can also filter nested fields. For example, you could specify
  37740. // scheduling.automaticRestart = false to include instances only if they
  37741. // are not scheduled for automatic restarts. You can use filtering on
  37742. // nested fields to filter based on resource labels.
  37743. //
  37744. // To filter on multiple expressions, provide each separate expression
  37745. // within parentheses. For example, (scheduling.automaticRestart = true)
  37746. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  37747. // AND expression. However, you can include AND and OR expressions
  37748. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  37749. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  37750. // true).
  37751. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall {
  37752. c.urlParams_.Set("filter", filter)
  37753. return c
  37754. }
  37755. // MaxResults sets the optional parameter "maxResults": The maximum
  37756. // number of results per page that should be returned. If the number of
  37757. // available results is larger than maxResults, Compute Engine returns a
  37758. // nextPageToken that can be used to get the next page of results in
  37759. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  37760. // (Default: 500)
  37761. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall {
  37762. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37763. return c
  37764. }
  37765. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  37766. // a certain order. By default, results are returned in alphanumerical
  37767. // order based on the resource name.
  37768. //
  37769. // You can also sort results in descending order based on the creation
  37770. // timestamp using orderBy="creationTimestamp desc". This sorts results
  37771. // based on the creationTimestamp field in reverse chronological order
  37772. // (newest result first). Use this to sort resources like operations so
  37773. // that the newest operation is returned first.
  37774. //
  37775. // Currently, only sorting by name or creationTimestamp desc is
  37776. // supported.
  37777. func (c *ForwardingRulesListCall) OrderBy(orderBy string) *ForwardingRulesListCall {
  37778. c.urlParams_.Set("orderBy", orderBy)
  37779. return c
  37780. }
  37781. // PageToken sets the optional parameter "pageToken": Specifies a page
  37782. // token to use. Set pageToken to the nextPageToken returned by a
  37783. // previous list request to get the next page of results.
  37784. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall {
  37785. c.urlParams_.Set("pageToken", pageToken)
  37786. return c
  37787. }
  37788. // Fields allows partial responses to be retrieved. See
  37789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37790. // for more information.
  37791. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall {
  37792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37793. return c
  37794. }
  37795. // IfNoneMatch sets the optional parameter which makes the operation
  37796. // fail if the object's ETag matches the given value. This is useful for
  37797. // getting updates only after the object has changed since the last
  37798. // request. Use googleapi.IsNotModified to check whether the response
  37799. // error from Do is the result of In-None-Match.
  37800. func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall {
  37801. c.ifNoneMatch_ = entityTag
  37802. return c
  37803. }
  37804. // Context sets the context to be used in this call's Do method. Any
  37805. // pending HTTP request will be aborted if the provided context is
  37806. // canceled.
  37807. func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall {
  37808. c.ctx_ = ctx
  37809. return c
  37810. }
  37811. // Header returns an http.Header that can be modified by the caller to
  37812. // add HTTP headers to the request.
  37813. func (c *ForwardingRulesListCall) Header() http.Header {
  37814. if c.header_ == nil {
  37815. c.header_ = make(http.Header)
  37816. }
  37817. return c.header_
  37818. }
  37819. func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  37820. reqHeaders := make(http.Header)
  37821. for k, v := range c.header_ {
  37822. reqHeaders[k] = v
  37823. }
  37824. reqHeaders.Set("User-Agent", c.s.userAgent())
  37825. if c.ifNoneMatch_ != "" {
  37826. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37827. }
  37828. var body io.Reader = nil
  37829. c.urlParams_.Set("alt", alt)
  37830. c.urlParams_.Set("prettyPrint", "false")
  37831. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules")
  37832. urls += "?" + c.urlParams_.Encode()
  37833. req, err := http.NewRequest("GET", urls, body)
  37834. if err != nil {
  37835. return nil, err
  37836. }
  37837. req.Header = reqHeaders
  37838. googleapi.Expand(req.URL, map[string]string{
  37839. "project": c.project,
  37840. "region": c.region,
  37841. })
  37842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37843. }
  37844. // Do executes the "compute.forwardingRules.list" call.
  37845. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  37846. // non-2xx status code is an error. Response headers are in either
  37847. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  37848. // returned at all) in error.(*googleapi.Error).Header. Use
  37849. // googleapi.IsNotModified to check whether the returned error was
  37850. // because http.StatusNotModified was returned.
  37851. func (c *ForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  37852. gensupport.SetOptions(c.urlParams_, opts...)
  37853. res, err := c.doRequest("json")
  37854. if res != nil && res.StatusCode == http.StatusNotModified {
  37855. if res.Body != nil {
  37856. res.Body.Close()
  37857. }
  37858. return nil, &googleapi.Error{
  37859. Code: res.StatusCode,
  37860. Header: res.Header,
  37861. }
  37862. }
  37863. if err != nil {
  37864. return nil, err
  37865. }
  37866. defer googleapi.CloseBody(res)
  37867. if err := googleapi.CheckResponse(res); err != nil {
  37868. return nil, err
  37869. }
  37870. ret := &ForwardingRuleList{
  37871. ServerResponse: googleapi.ServerResponse{
  37872. Header: res.Header,
  37873. HTTPStatusCode: res.StatusCode,
  37874. },
  37875. }
  37876. target := &ret
  37877. if err := gensupport.DecodeResponse(target, res); err != nil {
  37878. return nil, err
  37879. }
  37880. return ret, nil
  37881. // {
  37882. // "description": "Retrieves a list of ForwardingRule resources available to the specified project and region.",
  37883. // "httpMethod": "GET",
  37884. // "id": "compute.forwardingRules.list",
  37885. // "parameterOrder": [
  37886. // "project",
  37887. // "region"
  37888. // ],
  37889. // "parameters": {
  37890. // "filter": {
  37891. // "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).",
  37892. // "location": "query",
  37893. // "type": "string"
  37894. // },
  37895. // "maxResults": {
  37896. // "default": "500",
  37897. // "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)",
  37898. // "format": "uint32",
  37899. // "location": "query",
  37900. // "minimum": "0",
  37901. // "type": "integer"
  37902. // },
  37903. // "orderBy": {
  37904. // "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.",
  37905. // "location": "query",
  37906. // "type": "string"
  37907. // },
  37908. // "pageToken": {
  37909. // "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.",
  37910. // "location": "query",
  37911. // "type": "string"
  37912. // },
  37913. // "project": {
  37914. // "description": "Project ID for this request.",
  37915. // "location": "path",
  37916. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  37917. // "required": true,
  37918. // "type": "string"
  37919. // },
  37920. // "region": {
  37921. // "description": "Name of the region scoping this request.",
  37922. // "location": "path",
  37923. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  37924. // "required": true,
  37925. // "type": "string"
  37926. // }
  37927. // },
  37928. // "path": "{project}/regions/{region}/forwardingRules",
  37929. // "response": {
  37930. // "$ref": "ForwardingRuleList"
  37931. // },
  37932. // "scopes": [
  37933. // "https://www.googleapis.com/auth/cloud-platform",
  37934. // "https://www.googleapis.com/auth/compute",
  37935. // "https://www.googleapis.com/auth/compute.readonly"
  37936. // ]
  37937. // }
  37938. }
  37939. // Pages invokes f for each page of results.
  37940. // A non-nil error returned from f will halt the iteration.
  37941. // The provided context supersedes any context provided to the Context method.
  37942. func (c *ForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  37943. c.ctx_ = ctx
  37944. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37945. for {
  37946. x, err := c.Do()
  37947. if err != nil {
  37948. return err
  37949. }
  37950. if err := f(x); err != nil {
  37951. return err
  37952. }
  37953. if x.NextPageToken == "" {
  37954. return nil
  37955. }
  37956. c.PageToken(x.NextPageToken)
  37957. }
  37958. }
  37959. // method id "compute.forwardingRules.setTarget":
  37960. type ForwardingRulesSetTargetCall struct {
  37961. s *Service
  37962. project string
  37963. region string
  37964. forwardingRule string
  37965. targetreference *TargetReference
  37966. urlParams_ gensupport.URLParams
  37967. ctx_ context.Context
  37968. header_ http.Header
  37969. }
  37970. // SetTarget: Changes target URL for forwarding rule. The new target
  37971. // should be of the same type as the old target.
  37972. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget
  37973. func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall {
  37974. c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37975. c.project = project
  37976. c.region = region
  37977. c.forwardingRule = forwardingRule
  37978. c.targetreference = targetreference
  37979. return c
  37980. }
  37981. // RequestId sets the optional parameter "requestId": An optional
  37982. // request ID to identify requests. Specify a unique request ID so that
  37983. // if you must retry your request, the server will know to ignore the
  37984. // request if it has already been completed.
  37985. //
  37986. // For example, consider a situation where you make an initial request
  37987. // and the request times out. If you make the request again with the
  37988. // same request ID, the server can check if original operation with the
  37989. // same request ID was received, and if so, will ignore the second
  37990. // request. This prevents clients from accidentally creating duplicate
  37991. // commitments.
  37992. //
  37993. // The request ID must be a valid UUID with the exception that zero UUID
  37994. // is not supported (00000000-0000-0000-0000-000000000000).
  37995. func (c *ForwardingRulesSetTargetCall) RequestId(requestId string) *ForwardingRulesSetTargetCall {
  37996. c.urlParams_.Set("requestId", requestId)
  37997. return c
  37998. }
  37999. // Fields allows partial responses to be retrieved. See
  38000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38001. // for more information.
  38002. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall {
  38003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38004. return c
  38005. }
  38006. // Context sets the context to be used in this call's Do method. Any
  38007. // pending HTTP request will be aborted if the provided context is
  38008. // canceled.
  38009. func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall {
  38010. c.ctx_ = ctx
  38011. return c
  38012. }
  38013. // Header returns an http.Header that can be modified by the caller to
  38014. // add HTTP headers to the request.
  38015. func (c *ForwardingRulesSetTargetCall) Header() http.Header {
  38016. if c.header_ == nil {
  38017. c.header_ = make(http.Header)
  38018. }
  38019. return c.header_
  38020. }
  38021. func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  38022. reqHeaders := make(http.Header)
  38023. for k, v := range c.header_ {
  38024. reqHeaders[k] = v
  38025. }
  38026. reqHeaders.Set("User-Agent", c.s.userAgent())
  38027. var body io.Reader = nil
  38028. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  38029. if err != nil {
  38030. return nil, err
  38031. }
  38032. reqHeaders.Set("Content-Type", "application/json")
  38033. c.urlParams_.Set("alt", alt)
  38034. c.urlParams_.Set("prettyPrint", "false")
  38035. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget")
  38036. urls += "?" + c.urlParams_.Encode()
  38037. req, err := http.NewRequest("POST", urls, body)
  38038. if err != nil {
  38039. return nil, err
  38040. }
  38041. req.Header = reqHeaders
  38042. googleapi.Expand(req.URL, map[string]string{
  38043. "project": c.project,
  38044. "region": c.region,
  38045. "forwardingRule": c.forwardingRule,
  38046. })
  38047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38048. }
  38049. // Do executes the "compute.forwardingRules.setTarget" call.
  38050. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38051. // status code is an error. Response headers are in either
  38052. // *Operation.ServerResponse.Header or (if a response was returned at
  38053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38054. // to check whether the returned error was because
  38055. // http.StatusNotModified was returned.
  38056. func (c *ForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38057. gensupport.SetOptions(c.urlParams_, opts...)
  38058. res, err := c.doRequest("json")
  38059. if res != nil && res.StatusCode == http.StatusNotModified {
  38060. if res.Body != nil {
  38061. res.Body.Close()
  38062. }
  38063. return nil, &googleapi.Error{
  38064. Code: res.StatusCode,
  38065. Header: res.Header,
  38066. }
  38067. }
  38068. if err != nil {
  38069. return nil, err
  38070. }
  38071. defer googleapi.CloseBody(res)
  38072. if err := googleapi.CheckResponse(res); err != nil {
  38073. return nil, err
  38074. }
  38075. ret := &Operation{
  38076. ServerResponse: googleapi.ServerResponse{
  38077. Header: res.Header,
  38078. HTTPStatusCode: res.StatusCode,
  38079. },
  38080. }
  38081. target := &ret
  38082. if err := gensupport.DecodeResponse(target, res); err != nil {
  38083. return nil, err
  38084. }
  38085. return ret, nil
  38086. // {
  38087. // "description": "Changes target URL for forwarding rule. The new target should be of the same type as the old target.",
  38088. // "httpMethod": "POST",
  38089. // "id": "compute.forwardingRules.setTarget",
  38090. // "parameterOrder": [
  38091. // "project",
  38092. // "region",
  38093. // "forwardingRule"
  38094. // ],
  38095. // "parameters": {
  38096. // "forwardingRule": {
  38097. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  38098. // "location": "path",
  38099. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38100. // "required": true,
  38101. // "type": "string"
  38102. // },
  38103. // "project": {
  38104. // "description": "Project ID for this request.",
  38105. // "location": "path",
  38106. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38107. // "required": true,
  38108. // "type": "string"
  38109. // },
  38110. // "region": {
  38111. // "description": "Name of the region scoping this request.",
  38112. // "location": "path",
  38113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  38114. // "required": true,
  38115. // "type": "string"
  38116. // },
  38117. // "requestId": {
  38118. // "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).",
  38119. // "location": "query",
  38120. // "type": "string"
  38121. // }
  38122. // },
  38123. // "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget",
  38124. // "request": {
  38125. // "$ref": "TargetReference"
  38126. // },
  38127. // "response": {
  38128. // "$ref": "Operation"
  38129. // },
  38130. // "scopes": [
  38131. // "https://www.googleapis.com/auth/cloud-platform",
  38132. // "https://www.googleapis.com/auth/compute"
  38133. // ]
  38134. // }
  38135. }
  38136. // method id "compute.globalAddresses.delete":
  38137. type GlobalAddressesDeleteCall struct {
  38138. s *Service
  38139. project string
  38140. address string
  38141. urlParams_ gensupport.URLParams
  38142. ctx_ context.Context
  38143. header_ http.Header
  38144. }
  38145. // Delete: Deletes the specified address resource.
  38146. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete
  38147. func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall {
  38148. c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38149. c.project = project
  38150. c.address = address
  38151. return c
  38152. }
  38153. // RequestId sets the optional parameter "requestId": An optional
  38154. // request ID to identify requests. Specify a unique request ID so that
  38155. // if you must retry your request, the server will know to ignore the
  38156. // request if it has already been completed.
  38157. //
  38158. // For example, consider a situation where you make an initial request
  38159. // and the request times out. If you make the request again with the
  38160. // same request ID, the server can check if original operation with the
  38161. // same request ID was received, and if so, will ignore the second
  38162. // request. This prevents clients from accidentally creating duplicate
  38163. // commitments.
  38164. //
  38165. // The request ID must be a valid UUID with the exception that zero UUID
  38166. // is not supported (00000000-0000-0000-0000-000000000000).
  38167. func (c *GlobalAddressesDeleteCall) RequestId(requestId string) *GlobalAddressesDeleteCall {
  38168. c.urlParams_.Set("requestId", requestId)
  38169. return c
  38170. }
  38171. // Fields allows partial responses to be retrieved. See
  38172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38173. // for more information.
  38174. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall {
  38175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38176. return c
  38177. }
  38178. // Context sets the context to be used in this call's Do method. Any
  38179. // pending HTTP request will be aborted if the provided context is
  38180. // canceled.
  38181. func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall {
  38182. c.ctx_ = ctx
  38183. return c
  38184. }
  38185. // Header returns an http.Header that can be modified by the caller to
  38186. // add HTTP headers to the request.
  38187. func (c *GlobalAddressesDeleteCall) Header() http.Header {
  38188. if c.header_ == nil {
  38189. c.header_ = make(http.Header)
  38190. }
  38191. return c.header_
  38192. }
  38193. func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
  38194. reqHeaders := make(http.Header)
  38195. for k, v := range c.header_ {
  38196. reqHeaders[k] = v
  38197. }
  38198. reqHeaders.Set("User-Agent", c.s.userAgent())
  38199. var body io.Reader = nil
  38200. c.urlParams_.Set("alt", alt)
  38201. c.urlParams_.Set("prettyPrint", "false")
  38202. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  38203. urls += "?" + c.urlParams_.Encode()
  38204. req, err := http.NewRequest("DELETE", urls, body)
  38205. if err != nil {
  38206. return nil, err
  38207. }
  38208. req.Header = reqHeaders
  38209. googleapi.Expand(req.URL, map[string]string{
  38210. "project": c.project,
  38211. "address": c.address,
  38212. })
  38213. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38214. }
  38215. // Do executes the "compute.globalAddresses.delete" call.
  38216. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38217. // status code is an error. Response headers are in either
  38218. // *Operation.ServerResponse.Header or (if a response was returned at
  38219. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38220. // to check whether the returned error was because
  38221. // http.StatusNotModified was returned.
  38222. func (c *GlobalAddressesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38223. gensupport.SetOptions(c.urlParams_, opts...)
  38224. res, err := c.doRequest("json")
  38225. if res != nil && res.StatusCode == http.StatusNotModified {
  38226. if res.Body != nil {
  38227. res.Body.Close()
  38228. }
  38229. return nil, &googleapi.Error{
  38230. Code: res.StatusCode,
  38231. Header: res.Header,
  38232. }
  38233. }
  38234. if err != nil {
  38235. return nil, err
  38236. }
  38237. defer googleapi.CloseBody(res)
  38238. if err := googleapi.CheckResponse(res); err != nil {
  38239. return nil, err
  38240. }
  38241. ret := &Operation{
  38242. ServerResponse: googleapi.ServerResponse{
  38243. Header: res.Header,
  38244. HTTPStatusCode: res.StatusCode,
  38245. },
  38246. }
  38247. target := &ret
  38248. if err := gensupport.DecodeResponse(target, res); err != nil {
  38249. return nil, err
  38250. }
  38251. return ret, nil
  38252. // {
  38253. // "description": "Deletes the specified address resource.",
  38254. // "httpMethod": "DELETE",
  38255. // "id": "compute.globalAddresses.delete",
  38256. // "parameterOrder": [
  38257. // "project",
  38258. // "address"
  38259. // ],
  38260. // "parameters": {
  38261. // "address": {
  38262. // "description": "Name of the address resource to delete.",
  38263. // "location": "path",
  38264. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38265. // "required": true,
  38266. // "type": "string"
  38267. // },
  38268. // "project": {
  38269. // "description": "Project ID for this request.",
  38270. // "location": "path",
  38271. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38272. // "required": true,
  38273. // "type": "string"
  38274. // },
  38275. // "requestId": {
  38276. // "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).",
  38277. // "location": "query",
  38278. // "type": "string"
  38279. // }
  38280. // },
  38281. // "path": "{project}/global/addresses/{address}",
  38282. // "response": {
  38283. // "$ref": "Operation"
  38284. // },
  38285. // "scopes": [
  38286. // "https://www.googleapis.com/auth/cloud-platform",
  38287. // "https://www.googleapis.com/auth/compute"
  38288. // ]
  38289. // }
  38290. }
  38291. // method id "compute.globalAddresses.get":
  38292. type GlobalAddressesGetCall struct {
  38293. s *Service
  38294. project string
  38295. address string
  38296. urlParams_ gensupport.URLParams
  38297. ifNoneMatch_ string
  38298. ctx_ context.Context
  38299. header_ http.Header
  38300. }
  38301. // Get: Returns the specified address resource. Gets a list of available
  38302. // addresses by making a list() request.
  38303. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get
  38304. func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall {
  38305. c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38306. c.project = project
  38307. c.address = address
  38308. return c
  38309. }
  38310. // Fields allows partial responses to be retrieved. See
  38311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38312. // for more information.
  38313. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall {
  38314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38315. return c
  38316. }
  38317. // IfNoneMatch sets the optional parameter which makes the operation
  38318. // fail if the object's ETag matches the given value. This is useful for
  38319. // getting updates only after the object has changed since the last
  38320. // request. Use googleapi.IsNotModified to check whether the response
  38321. // error from Do is the result of In-None-Match.
  38322. func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall {
  38323. c.ifNoneMatch_ = entityTag
  38324. return c
  38325. }
  38326. // Context sets the context to be used in this call's Do method. Any
  38327. // pending HTTP request will be aborted if the provided context is
  38328. // canceled.
  38329. func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall {
  38330. c.ctx_ = ctx
  38331. return c
  38332. }
  38333. // Header returns an http.Header that can be modified by the caller to
  38334. // add HTTP headers to the request.
  38335. func (c *GlobalAddressesGetCall) Header() http.Header {
  38336. if c.header_ == nil {
  38337. c.header_ = make(http.Header)
  38338. }
  38339. return c.header_
  38340. }
  38341. func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) {
  38342. reqHeaders := make(http.Header)
  38343. for k, v := range c.header_ {
  38344. reqHeaders[k] = v
  38345. }
  38346. reqHeaders.Set("User-Agent", c.s.userAgent())
  38347. if c.ifNoneMatch_ != "" {
  38348. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38349. }
  38350. var body io.Reader = nil
  38351. c.urlParams_.Set("alt", alt)
  38352. c.urlParams_.Set("prettyPrint", "false")
  38353. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}")
  38354. urls += "?" + c.urlParams_.Encode()
  38355. req, err := http.NewRequest("GET", urls, body)
  38356. if err != nil {
  38357. return nil, err
  38358. }
  38359. req.Header = reqHeaders
  38360. googleapi.Expand(req.URL, map[string]string{
  38361. "project": c.project,
  38362. "address": c.address,
  38363. })
  38364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38365. }
  38366. // Do executes the "compute.globalAddresses.get" call.
  38367. // Exactly one of *Address or error will be non-nil. Any non-2xx status
  38368. // code is an error. Response headers are in either
  38369. // *Address.ServerResponse.Header or (if a response was returned at all)
  38370. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38371. // check whether the returned error was because http.StatusNotModified
  38372. // was returned.
  38373. func (c *GlobalAddressesGetCall) Do(opts ...googleapi.CallOption) (*Address, error) {
  38374. gensupport.SetOptions(c.urlParams_, opts...)
  38375. res, err := c.doRequest("json")
  38376. if res != nil && res.StatusCode == http.StatusNotModified {
  38377. if res.Body != nil {
  38378. res.Body.Close()
  38379. }
  38380. return nil, &googleapi.Error{
  38381. Code: res.StatusCode,
  38382. Header: res.Header,
  38383. }
  38384. }
  38385. if err != nil {
  38386. return nil, err
  38387. }
  38388. defer googleapi.CloseBody(res)
  38389. if err := googleapi.CheckResponse(res); err != nil {
  38390. return nil, err
  38391. }
  38392. ret := &Address{
  38393. ServerResponse: googleapi.ServerResponse{
  38394. Header: res.Header,
  38395. HTTPStatusCode: res.StatusCode,
  38396. },
  38397. }
  38398. target := &ret
  38399. if err := gensupport.DecodeResponse(target, res); err != nil {
  38400. return nil, err
  38401. }
  38402. return ret, nil
  38403. // {
  38404. // "description": "Returns the specified address resource. Gets a list of available addresses by making a list() request.",
  38405. // "httpMethod": "GET",
  38406. // "id": "compute.globalAddresses.get",
  38407. // "parameterOrder": [
  38408. // "project",
  38409. // "address"
  38410. // ],
  38411. // "parameters": {
  38412. // "address": {
  38413. // "description": "Name of the address resource to return.",
  38414. // "location": "path",
  38415. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38416. // "required": true,
  38417. // "type": "string"
  38418. // },
  38419. // "project": {
  38420. // "description": "Project ID for this request.",
  38421. // "location": "path",
  38422. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38423. // "required": true,
  38424. // "type": "string"
  38425. // }
  38426. // },
  38427. // "path": "{project}/global/addresses/{address}",
  38428. // "response": {
  38429. // "$ref": "Address"
  38430. // },
  38431. // "scopes": [
  38432. // "https://www.googleapis.com/auth/cloud-platform",
  38433. // "https://www.googleapis.com/auth/compute",
  38434. // "https://www.googleapis.com/auth/compute.readonly"
  38435. // ]
  38436. // }
  38437. }
  38438. // method id "compute.globalAddresses.insert":
  38439. type GlobalAddressesInsertCall struct {
  38440. s *Service
  38441. project string
  38442. address *Address
  38443. urlParams_ gensupport.URLParams
  38444. ctx_ context.Context
  38445. header_ http.Header
  38446. }
  38447. // Insert: Creates an address resource in the specified project using
  38448. // the data included in the request.
  38449. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert
  38450. func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall {
  38451. c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38452. c.project = project
  38453. c.address = address
  38454. return c
  38455. }
  38456. // RequestId sets the optional parameter "requestId": An optional
  38457. // request ID to identify requests. Specify a unique request ID so that
  38458. // if you must retry your request, the server will know to ignore the
  38459. // request if it has already been completed.
  38460. //
  38461. // For example, consider a situation where you make an initial request
  38462. // and the request times out. If you make the request again with the
  38463. // same request ID, the server can check if original operation with the
  38464. // same request ID was received, and if so, will ignore the second
  38465. // request. This prevents clients from accidentally creating duplicate
  38466. // commitments.
  38467. //
  38468. // The request ID must be a valid UUID with the exception that zero UUID
  38469. // is not supported (00000000-0000-0000-0000-000000000000).
  38470. func (c *GlobalAddressesInsertCall) RequestId(requestId string) *GlobalAddressesInsertCall {
  38471. c.urlParams_.Set("requestId", requestId)
  38472. return c
  38473. }
  38474. // Fields allows partial responses to be retrieved. See
  38475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38476. // for more information.
  38477. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall {
  38478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38479. return c
  38480. }
  38481. // Context sets the context to be used in this call's Do method. Any
  38482. // pending HTTP request will be aborted if the provided context is
  38483. // canceled.
  38484. func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall {
  38485. c.ctx_ = ctx
  38486. return c
  38487. }
  38488. // Header returns an http.Header that can be modified by the caller to
  38489. // add HTTP headers to the request.
  38490. func (c *GlobalAddressesInsertCall) Header() http.Header {
  38491. if c.header_ == nil {
  38492. c.header_ = make(http.Header)
  38493. }
  38494. return c.header_
  38495. }
  38496. func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) {
  38497. reqHeaders := make(http.Header)
  38498. for k, v := range c.header_ {
  38499. reqHeaders[k] = v
  38500. }
  38501. reqHeaders.Set("User-Agent", c.s.userAgent())
  38502. var body io.Reader = nil
  38503. body, err := googleapi.WithoutDataWrapper.JSONReader(c.address)
  38504. if err != nil {
  38505. return nil, err
  38506. }
  38507. reqHeaders.Set("Content-Type", "application/json")
  38508. c.urlParams_.Set("alt", alt)
  38509. c.urlParams_.Set("prettyPrint", "false")
  38510. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  38511. urls += "?" + c.urlParams_.Encode()
  38512. req, err := http.NewRequest("POST", urls, body)
  38513. if err != nil {
  38514. return nil, err
  38515. }
  38516. req.Header = reqHeaders
  38517. googleapi.Expand(req.URL, map[string]string{
  38518. "project": c.project,
  38519. })
  38520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38521. }
  38522. // Do executes the "compute.globalAddresses.insert" call.
  38523. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38524. // status code is an error. Response headers are in either
  38525. // *Operation.ServerResponse.Header or (if a response was returned at
  38526. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38527. // to check whether the returned error was because
  38528. // http.StatusNotModified was returned.
  38529. func (c *GlobalAddressesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38530. gensupport.SetOptions(c.urlParams_, opts...)
  38531. res, err := c.doRequest("json")
  38532. if res != nil && res.StatusCode == http.StatusNotModified {
  38533. if res.Body != nil {
  38534. res.Body.Close()
  38535. }
  38536. return nil, &googleapi.Error{
  38537. Code: res.StatusCode,
  38538. Header: res.Header,
  38539. }
  38540. }
  38541. if err != nil {
  38542. return nil, err
  38543. }
  38544. defer googleapi.CloseBody(res)
  38545. if err := googleapi.CheckResponse(res); err != nil {
  38546. return nil, err
  38547. }
  38548. ret := &Operation{
  38549. ServerResponse: googleapi.ServerResponse{
  38550. Header: res.Header,
  38551. HTTPStatusCode: res.StatusCode,
  38552. },
  38553. }
  38554. target := &ret
  38555. if err := gensupport.DecodeResponse(target, res); err != nil {
  38556. return nil, err
  38557. }
  38558. return ret, nil
  38559. // {
  38560. // "description": "Creates an address resource in the specified project using the data included in the request.",
  38561. // "httpMethod": "POST",
  38562. // "id": "compute.globalAddresses.insert",
  38563. // "parameterOrder": [
  38564. // "project"
  38565. // ],
  38566. // "parameters": {
  38567. // "project": {
  38568. // "description": "Project ID for this request.",
  38569. // "location": "path",
  38570. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38571. // "required": true,
  38572. // "type": "string"
  38573. // },
  38574. // "requestId": {
  38575. // "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).",
  38576. // "location": "query",
  38577. // "type": "string"
  38578. // }
  38579. // },
  38580. // "path": "{project}/global/addresses",
  38581. // "request": {
  38582. // "$ref": "Address"
  38583. // },
  38584. // "response": {
  38585. // "$ref": "Operation"
  38586. // },
  38587. // "scopes": [
  38588. // "https://www.googleapis.com/auth/cloud-platform",
  38589. // "https://www.googleapis.com/auth/compute"
  38590. // ]
  38591. // }
  38592. }
  38593. // method id "compute.globalAddresses.list":
  38594. type GlobalAddressesListCall struct {
  38595. s *Service
  38596. project string
  38597. urlParams_ gensupport.URLParams
  38598. ifNoneMatch_ string
  38599. ctx_ context.Context
  38600. header_ http.Header
  38601. }
  38602. // List: Retrieves a list of global addresses.
  38603. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list
  38604. func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall {
  38605. c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38606. c.project = project
  38607. return c
  38608. }
  38609. // Filter sets the optional parameter "filter": A filter expression that
  38610. // filters resources listed in the response. The expression must specify
  38611. // the field name, a comparison operator, and the value that you want to
  38612. // use for filtering. The value must be a string, a number, or a
  38613. // boolean. The comparison operator must be either =, !=, >, or <.
  38614. //
  38615. // For example, if you are filtering Compute Engine instances, you can
  38616. // exclude instances named example-instance by specifying name !=
  38617. // example-instance.
  38618. //
  38619. // You can also filter nested fields. For example, you could specify
  38620. // scheduling.automaticRestart = false to include instances only if they
  38621. // are not scheduled for automatic restarts. You can use filtering on
  38622. // nested fields to filter based on resource labels.
  38623. //
  38624. // To filter on multiple expressions, provide each separate expression
  38625. // within parentheses. For example, (scheduling.automaticRestart = true)
  38626. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  38627. // AND expression. However, you can include AND and OR expressions
  38628. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  38629. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  38630. // true).
  38631. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall {
  38632. c.urlParams_.Set("filter", filter)
  38633. return c
  38634. }
  38635. // MaxResults sets the optional parameter "maxResults": The maximum
  38636. // number of results per page that should be returned. If the number of
  38637. // available results is larger than maxResults, Compute Engine returns a
  38638. // nextPageToken that can be used to get the next page of results in
  38639. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  38640. // (Default: 500)
  38641. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall {
  38642. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38643. return c
  38644. }
  38645. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  38646. // a certain order. By default, results are returned in alphanumerical
  38647. // order based on the resource name.
  38648. //
  38649. // You can also sort results in descending order based on the creation
  38650. // timestamp using orderBy="creationTimestamp desc". This sorts results
  38651. // based on the creationTimestamp field in reverse chronological order
  38652. // (newest result first). Use this to sort resources like operations so
  38653. // that the newest operation is returned first.
  38654. //
  38655. // Currently, only sorting by name or creationTimestamp desc is
  38656. // supported.
  38657. func (c *GlobalAddressesListCall) OrderBy(orderBy string) *GlobalAddressesListCall {
  38658. c.urlParams_.Set("orderBy", orderBy)
  38659. return c
  38660. }
  38661. // PageToken sets the optional parameter "pageToken": Specifies a page
  38662. // token to use. Set pageToken to the nextPageToken returned by a
  38663. // previous list request to get the next page of results.
  38664. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall {
  38665. c.urlParams_.Set("pageToken", pageToken)
  38666. return c
  38667. }
  38668. // Fields allows partial responses to be retrieved. See
  38669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38670. // for more information.
  38671. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall {
  38672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38673. return c
  38674. }
  38675. // IfNoneMatch sets the optional parameter which makes the operation
  38676. // fail if the object's ETag matches the given value. This is useful for
  38677. // getting updates only after the object has changed since the last
  38678. // request. Use googleapi.IsNotModified to check whether the response
  38679. // error from Do is the result of In-None-Match.
  38680. func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall {
  38681. c.ifNoneMatch_ = entityTag
  38682. return c
  38683. }
  38684. // Context sets the context to be used in this call's Do method. Any
  38685. // pending HTTP request will be aborted if the provided context is
  38686. // canceled.
  38687. func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall {
  38688. c.ctx_ = ctx
  38689. return c
  38690. }
  38691. // Header returns an http.Header that can be modified by the caller to
  38692. // add HTTP headers to the request.
  38693. func (c *GlobalAddressesListCall) Header() http.Header {
  38694. if c.header_ == nil {
  38695. c.header_ = make(http.Header)
  38696. }
  38697. return c.header_
  38698. }
  38699. func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) {
  38700. reqHeaders := make(http.Header)
  38701. for k, v := range c.header_ {
  38702. reqHeaders[k] = v
  38703. }
  38704. reqHeaders.Set("User-Agent", c.s.userAgent())
  38705. if c.ifNoneMatch_ != "" {
  38706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38707. }
  38708. var body io.Reader = nil
  38709. c.urlParams_.Set("alt", alt)
  38710. c.urlParams_.Set("prettyPrint", "false")
  38711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses")
  38712. urls += "?" + c.urlParams_.Encode()
  38713. req, err := http.NewRequest("GET", urls, body)
  38714. if err != nil {
  38715. return nil, err
  38716. }
  38717. req.Header = reqHeaders
  38718. googleapi.Expand(req.URL, map[string]string{
  38719. "project": c.project,
  38720. })
  38721. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38722. }
  38723. // Do executes the "compute.globalAddresses.list" call.
  38724. // Exactly one of *AddressList or error will be non-nil. Any non-2xx
  38725. // status code is an error. Response headers are in either
  38726. // *AddressList.ServerResponse.Header or (if a response was returned at
  38727. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38728. // to check whether the returned error was because
  38729. // http.StatusNotModified was returned.
  38730. func (c *GlobalAddressesListCall) Do(opts ...googleapi.CallOption) (*AddressList, error) {
  38731. gensupport.SetOptions(c.urlParams_, opts...)
  38732. res, err := c.doRequest("json")
  38733. if res != nil && res.StatusCode == http.StatusNotModified {
  38734. if res.Body != nil {
  38735. res.Body.Close()
  38736. }
  38737. return nil, &googleapi.Error{
  38738. Code: res.StatusCode,
  38739. Header: res.Header,
  38740. }
  38741. }
  38742. if err != nil {
  38743. return nil, err
  38744. }
  38745. defer googleapi.CloseBody(res)
  38746. if err := googleapi.CheckResponse(res); err != nil {
  38747. return nil, err
  38748. }
  38749. ret := &AddressList{
  38750. ServerResponse: googleapi.ServerResponse{
  38751. Header: res.Header,
  38752. HTTPStatusCode: res.StatusCode,
  38753. },
  38754. }
  38755. target := &ret
  38756. if err := gensupport.DecodeResponse(target, res); err != nil {
  38757. return nil, err
  38758. }
  38759. return ret, nil
  38760. // {
  38761. // "description": "Retrieves a list of global addresses.",
  38762. // "httpMethod": "GET",
  38763. // "id": "compute.globalAddresses.list",
  38764. // "parameterOrder": [
  38765. // "project"
  38766. // ],
  38767. // "parameters": {
  38768. // "filter": {
  38769. // "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).",
  38770. // "location": "query",
  38771. // "type": "string"
  38772. // },
  38773. // "maxResults": {
  38774. // "default": "500",
  38775. // "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)",
  38776. // "format": "uint32",
  38777. // "location": "query",
  38778. // "minimum": "0",
  38779. // "type": "integer"
  38780. // },
  38781. // "orderBy": {
  38782. // "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.",
  38783. // "location": "query",
  38784. // "type": "string"
  38785. // },
  38786. // "pageToken": {
  38787. // "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.",
  38788. // "location": "query",
  38789. // "type": "string"
  38790. // },
  38791. // "project": {
  38792. // "description": "Project ID for this request.",
  38793. // "location": "path",
  38794. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38795. // "required": true,
  38796. // "type": "string"
  38797. // }
  38798. // },
  38799. // "path": "{project}/global/addresses",
  38800. // "response": {
  38801. // "$ref": "AddressList"
  38802. // },
  38803. // "scopes": [
  38804. // "https://www.googleapis.com/auth/cloud-platform",
  38805. // "https://www.googleapis.com/auth/compute",
  38806. // "https://www.googleapis.com/auth/compute.readonly"
  38807. // ]
  38808. // }
  38809. }
  38810. // Pages invokes f for each page of results.
  38811. // A non-nil error returned from f will halt the iteration.
  38812. // The provided context supersedes any context provided to the Context method.
  38813. func (c *GlobalAddressesListCall) Pages(ctx context.Context, f func(*AddressList) error) error {
  38814. c.ctx_ = ctx
  38815. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38816. for {
  38817. x, err := c.Do()
  38818. if err != nil {
  38819. return err
  38820. }
  38821. if err := f(x); err != nil {
  38822. return err
  38823. }
  38824. if x.NextPageToken == "" {
  38825. return nil
  38826. }
  38827. c.PageToken(x.NextPageToken)
  38828. }
  38829. }
  38830. // method id "compute.globalForwardingRules.delete":
  38831. type GlobalForwardingRulesDeleteCall struct {
  38832. s *Service
  38833. project string
  38834. forwardingRule string
  38835. urlParams_ gensupport.URLParams
  38836. ctx_ context.Context
  38837. header_ http.Header
  38838. }
  38839. // Delete: Deletes the specified GlobalForwardingRule resource.
  38840. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete
  38841. func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall {
  38842. c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38843. c.project = project
  38844. c.forwardingRule = forwardingRule
  38845. return c
  38846. }
  38847. // RequestId sets the optional parameter "requestId": An optional
  38848. // request ID to identify requests. Specify a unique request ID so that
  38849. // if you must retry your request, the server will know to ignore the
  38850. // request if it has already been completed.
  38851. //
  38852. // For example, consider a situation where you make an initial request
  38853. // and the request times out. If you make the request again with the
  38854. // same request ID, the server can check if original operation with the
  38855. // same request ID was received, and if so, will ignore the second
  38856. // request. This prevents clients from accidentally creating duplicate
  38857. // commitments.
  38858. //
  38859. // The request ID must be a valid UUID with the exception that zero UUID
  38860. // is not supported (00000000-0000-0000-0000-000000000000).
  38861. func (c *GlobalForwardingRulesDeleteCall) RequestId(requestId string) *GlobalForwardingRulesDeleteCall {
  38862. c.urlParams_.Set("requestId", requestId)
  38863. return c
  38864. }
  38865. // Fields allows partial responses to be retrieved. See
  38866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38867. // for more information.
  38868. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall {
  38869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38870. return c
  38871. }
  38872. // Context sets the context to be used in this call's Do method. Any
  38873. // pending HTTP request will be aborted if the provided context is
  38874. // canceled.
  38875. func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall {
  38876. c.ctx_ = ctx
  38877. return c
  38878. }
  38879. // Header returns an http.Header that can be modified by the caller to
  38880. // add HTTP headers to the request.
  38881. func (c *GlobalForwardingRulesDeleteCall) Header() http.Header {
  38882. if c.header_ == nil {
  38883. c.header_ = make(http.Header)
  38884. }
  38885. return c.header_
  38886. }
  38887. func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) {
  38888. reqHeaders := make(http.Header)
  38889. for k, v := range c.header_ {
  38890. reqHeaders[k] = v
  38891. }
  38892. reqHeaders.Set("User-Agent", c.s.userAgent())
  38893. var body io.Reader = nil
  38894. c.urlParams_.Set("alt", alt)
  38895. c.urlParams_.Set("prettyPrint", "false")
  38896. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  38897. urls += "?" + c.urlParams_.Encode()
  38898. req, err := http.NewRequest("DELETE", urls, body)
  38899. if err != nil {
  38900. return nil, err
  38901. }
  38902. req.Header = reqHeaders
  38903. googleapi.Expand(req.URL, map[string]string{
  38904. "project": c.project,
  38905. "forwardingRule": c.forwardingRule,
  38906. })
  38907. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38908. }
  38909. // Do executes the "compute.globalForwardingRules.delete" call.
  38910. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  38911. // status code is an error. Response headers are in either
  38912. // *Operation.ServerResponse.Header or (if a response was returned at
  38913. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38914. // to check whether the returned error was because
  38915. // http.StatusNotModified was returned.
  38916. func (c *GlobalForwardingRulesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  38917. gensupport.SetOptions(c.urlParams_, opts...)
  38918. res, err := c.doRequest("json")
  38919. if res != nil && res.StatusCode == http.StatusNotModified {
  38920. if res.Body != nil {
  38921. res.Body.Close()
  38922. }
  38923. return nil, &googleapi.Error{
  38924. Code: res.StatusCode,
  38925. Header: res.Header,
  38926. }
  38927. }
  38928. if err != nil {
  38929. return nil, err
  38930. }
  38931. defer googleapi.CloseBody(res)
  38932. if err := googleapi.CheckResponse(res); err != nil {
  38933. return nil, err
  38934. }
  38935. ret := &Operation{
  38936. ServerResponse: googleapi.ServerResponse{
  38937. Header: res.Header,
  38938. HTTPStatusCode: res.StatusCode,
  38939. },
  38940. }
  38941. target := &ret
  38942. if err := gensupport.DecodeResponse(target, res); err != nil {
  38943. return nil, err
  38944. }
  38945. return ret, nil
  38946. // {
  38947. // "description": "Deletes the specified GlobalForwardingRule resource.",
  38948. // "httpMethod": "DELETE",
  38949. // "id": "compute.globalForwardingRules.delete",
  38950. // "parameterOrder": [
  38951. // "project",
  38952. // "forwardingRule"
  38953. // ],
  38954. // "parameters": {
  38955. // "forwardingRule": {
  38956. // "description": "Name of the ForwardingRule resource to delete.",
  38957. // "location": "path",
  38958. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  38959. // "required": true,
  38960. // "type": "string"
  38961. // },
  38962. // "project": {
  38963. // "description": "Project ID for this request.",
  38964. // "location": "path",
  38965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  38966. // "required": true,
  38967. // "type": "string"
  38968. // },
  38969. // "requestId": {
  38970. // "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).",
  38971. // "location": "query",
  38972. // "type": "string"
  38973. // }
  38974. // },
  38975. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  38976. // "response": {
  38977. // "$ref": "Operation"
  38978. // },
  38979. // "scopes": [
  38980. // "https://www.googleapis.com/auth/cloud-platform",
  38981. // "https://www.googleapis.com/auth/compute"
  38982. // ]
  38983. // }
  38984. }
  38985. // method id "compute.globalForwardingRules.get":
  38986. type GlobalForwardingRulesGetCall struct {
  38987. s *Service
  38988. project string
  38989. forwardingRule string
  38990. urlParams_ gensupport.URLParams
  38991. ifNoneMatch_ string
  38992. ctx_ context.Context
  38993. header_ http.Header
  38994. }
  38995. // Get: Returns the specified GlobalForwardingRule resource. Gets a list
  38996. // of available forwarding rules by making a list() request.
  38997. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get
  38998. func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall {
  38999. c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39000. c.project = project
  39001. c.forwardingRule = forwardingRule
  39002. return c
  39003. }
  39004. // Fields allows partial responses to be retrieved. See
  39005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39006. // for more information.
  39007. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall {
  39008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39009. return c
  39010. }
  39011. // IfNoneMatch sets the optional parameter which makes the operation
  39012. // fail if the object's ETag matches the given value. This is useful for
  39013. // getting updates only after the object has changed since the last
  39014. // request. Use googleapi.IsNotModified to check whether the response
  39015. // error from Do is the result of In-None-Match.
  39016. func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall {
  39017. c.ifNoneMatch_ = entityTag
  39018. return c
  39019. }
  39020. // Context sets the context to be used in this call's Do method. Any
  39021. // pending HTTP request will be aborted if the provided context is
  39022. // canceled.
  39023. func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall {
  39024. c.ctx_ = ctx
  39025. return c
  39026. }
  39027. // Header returns an http.Header that can be modified by the caller to
  39028. // add HTTP headers to the request.
  39029. func (c *GlobalForwardingRulesGetCall) Header() http.Header {
  39030. if c.header_ == nil {
  39031. c.header_ = make(http.Header)
  39032. }
  39033. return c.header_
  39034. }
  39035. func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) {
  39036. reqHeaders := make(http.Header)
  39037. for k, v := range c.header_ {
  39038. reqHeaders[k] = v
  39039. }
  39040. reqHeaders.Set("User-Agent", c.s.userAgent())
  39041. if c.ifNoneMatch_ != "" {
  39042. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39043. }
  39044. var body io.Reader = nil
  39045. c.urlParams_.Set("alt", alt)
  39046. c.urlParams_.Set("prettyPrint", "false")
  39047. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}")
  39048. urls += "?" + c.urlParams_.Encode()
  39049. req, err := http.NewRequest("GET", urls, body)
  39050. if err != nil {
  39051. return nil, err
  39052. }
  39053. req.Header = reqHeaders
  39054. googleapi.Expand(req.URL, map[string]string{
  39055. "project": c.project,
  39056. "forwardingRule": c.forwardingRule,
  39057. })
  39058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39059. }
  39060. // Do executes the "compute.globalForwardingRules.get" call.
  39061. // Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx
  39062. // status code is an error. Response headers are in either
  39063. // *ForwardingRule.ServerResponse.Header or (if a response was returned
  39064. // at all) in error.(*googleapi.Error).Header. Use
  39065. // googleapi.IsNotModified to check whether the returned error was
  39066. // because http.StatusNotModified was returned.
  39067. func (c *GlobalForwardingRulesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingRule, error) {
  39068. gensupport.SetOptions(c.urlParams_, opts...)
  39069. res, err := c.doRequest("json")
  39070. if res != nil && res.StatusCode == http.StatusNotModified {
  39071. if res.Body != nil {
  39072. res.Body.Close()
  39073. }
  39074. return nil, &googleapi.Error{
  39075. Code: res.StatusCode,
  39076. Header: res.Header,
  39077. }
  39078. }
  39079. if err != nil {
  39080. return nil, err
  39081. }
  39082. defer googleapi.CloseBody(res)
  39083. if err := googleapi.CheckResponse(res); err != nil {
  39084. return nil, err
  39085. }
  39086. ret := &ForwardingRule{
  39087. ServerResponse: googleapi.ServerResponse{
  39088. Header: res.Header,
  39089. HTTPStatusCode: res.StatusCode,
  39090. },
  39091. }
  39092. target := &ret
  39093. if err := gensupport.DecodeResponse(target, res); err != nil {
  39094. return nil, err
  39095. }
  39096. return ret, nil
  39097. // {
  39098. // "description": "Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request.",
  39099. // "httpMethod": "GET",
  39100. // "id": "compute.globalForwardingRules.get",
  39101. // "parameterOrder": [
  39102. // "project",
  39103. // "forwardingRule"
  39104. // ],
  39105. // "parameters": {
  39106. // "forwardingRule": {
  39107. // "description": "Name of the ForwardingRule resource to return.",
  39108. // "location": "path",
  39109. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39110. // "required": true,
  39111. // "type": "string"
  39112. // },
  39113. // "project": {
  39114. // "description": "Project ID for this request.",
  39115. // "location": "path",
  39116. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39117. // "required": true,
  39118. // "type": "string"
  39119. // }
  39120. // },
  39121. // "path": "{project}/global/forwardingRules/{forwardingRule}",
  39122. // "response": {
  39123. // "$ref": "ForwardingRule"
  39124. // },
  39125. // "scopes": [
  39126. // "https://www.googleapis.com/auth/cloud-platform",
  39127. // "https://www.googleapis.com/auth/compute",
  39128. // "https://www.googleapis.com/auth/compute.readonly"
  39129. // ]
  39130. // }
  39131. }
  39132. // method id "compute.globalForwardingRules.insert":
  39133. type GlobalForwardingRulesInsertCall struct {
  39134. s *Service
  39135. project string
  39136. forwardingrule *ForwardingRule
  39137. urlParams_ gensupport.URLParams
  39138. ctx_ context.Context
  39139. header_ http.Header
  39140. }
  39141. // Insert: Creates a GlobalForwardingRule resource in the specified
  39142. // project using the data included in the request.
  39143. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert
  39144. func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall {
  39145. c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39146. c.project = project
  39147. c.forwardingrule = forwardingrule
  39148. return c
  39149. }
  39150. // RequestId sets the optional parameter "requestId": An optional
  39151. // request ID to identify requests. Specify a unique request ID so that
  39152. // if you must retry your request, the server will know to ignore the
  39153. // request if it has already been completed.
  39154. //
  39155. // For example, consider a situation where you make an initial request
  39156. // and the request times out. If you make the request again with the
  39157. // same request ID, the server can check if original operation with the
  39158. // same request ID was received, and if so, will ignore the second
  39159. // request. This prevents clients from accidentally creating duplicate
  39160. // commitments.
  39161. //
  39162. // The request ID must be a valid UUID with the exception that zero UUID
  39163. // is not supported (00000000-0000-0000-0000-000000000000).
  39164. func (c *GlobalForwardingRulesInsertCall) RequestId(requestId string) *GlobalForwardingRulesInsertCall {
  39165. c.urlParams_.Set("requestId", requestId)
  39166. return c
  39167. }
  39168. // Fields allows partial responses to be retrieved. See
  39169. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39170. // for more information.
  39171. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall {
  39172. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39173. return c
  39174. }
  39175. // Context sets the context to be used in this call's Do method. Any
  39176. // pending HTTP request will be aborted if the provided context is
  39177. // canceled.
  39178. func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall {
  39179. c.ctx_ = ctx
  39180. return c
  39181. }
  39182. // Header returns an http.Header that can be modified by the caller to
  39183. // add HTTP headers to the request.
  39184. func (c *GlobalForwardingRulesInsertCall) Header() http.Header {
  39185. if c.header_ == nil {
  39186. c.header_ = make(http.Header)
  39187. }
  39188. return c.header_
  39189. }
  39190. func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) {
  39191. reqHeaders := make(http.Header)
  39192. for k, v := range c.header_ {
  39193. reqHeaders[k] = v
  39194. }
  39195. reqHeaders.Set("User-Agent", c.s.userAgent())
  39196. var body io.Reader = nil
  39197. body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule)
  39198. if err != nil {
  39199. return nil, err
  39200. }
  39201. reqHeaders.Set("Content-Type", "application/json")
  39202. c.urlParams_.Set("alt", alt)
  39203. c.urlParams_.Set("prettyPrint", "false")
  39204. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  39205. urls += "?" + c.urlParams_.Encode()
  39206. req, err := http.NewRequest("POST", urls, body)
  39207. if err != nil {
  39208. return nil, err
  39209. }
  39210. req.Header = reqHeaders
  39211. googleapi.Expand(req.URL, map[string]string{
  39212. "project": c.project,
  39213. })
  39214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39215. }
  39216. // Do executes the "compute.globalForwardingRules.insert" call.
  39217. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39218. // status code is an error. Response headers are in either
  39219. // *Operation.ServerResponse.Header or (if a response was returned at
  39220. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39221. // to check whether the returned error was because
  39222. // http.StatusNotModified was returned.
  39223. func (c *GlobalForwardingRulesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39224. gensupport.SetOptions(c.urlParams_, opts...)
  39225. res, err := c.doRequest("json")
  39226. if res != nil && res.StatusCode == http.StatusNotModified {
  39227. if res.Body != nil {
  39228. res.Body.Close()
  39229. }
  39230. return nil, &googleapi.Error{
  39231. Code: res.StatusCode,
  39232. Header: res.Header,
  39233. }
  39234. }
  39235. if err != nil {
  39236. return nil, err
  39237. }
  39238. defer googleapi.CloseBody(res)
  39239. if err := googleapi.CheckResponse(res); err != nil {
  39240. return nil, err
  39241. }
  39242. ret := &Operation{
  39243. ServerResponse: googleapi.ServerResponse{
  39244. Header: res.Header,
  39245. HTTPStatusCode: res.StatusCode,
  39246. },
  39247. }
  39248. target := &ret
  39249. if err := gensupport.DecodeResponse(target, res); err != nil {
  39250. return nil, err
  39251. }
  39252. return ret, nil
  39253. // {
  39254. // "description": "Creates a GlobalForwardingRule resource in the specified project using the data included in the request.",
  39255. // "httpMethod": "POST",
  39256. // "id": "compute.globalForwardingRules.insert",
  39257. // "parameterOrder": [
  39258. // "project"
  39259. // ],
  39260. // "parameters": {
  39261. // "project": {
  39262. // "description": "Project ID for this request.",
  39263. // "location": "path",
  39264. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39265. // "required": true,
  39266. // "type": "string"
  39267. // },
  39268. // "requestId": {
  39269. // "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).",
  39270. // "location": "query",
  39271. // "type": "string"
  39272. // }
  39273. // },
  39274. // "path": "{project}/global/forwardingRules",
  39275. // "request": {
  39276. // "$ref": "ForwardingRule"
  39277. // },
  39278. // "response": {
  39279. // "$ref": "Operation"
  39280. // },
  39281. // "scopes": [
  39282. // "https://www.googleapis.com/auth/cloud-platform",
  39283. // "https://www.googleapis.com/auth/compute"
  39284. // ]
  39285. // }
  39286. }
  39287. // method id "compute.globalForwardingRules.list":
  39288. type GlobalForwardingRulesListCall struct {
  39289. s *Service
  39290. project string
  39291. urlParams_ gensupport.URLParams
  39292. ifNoneMatch_ string
  39293. ctx_ context.Context
  39294. header_ http.Header
  39295. }
  39296. // List: Retrieves a list of GlobalForwardingRule resources available to
  39297. // the specified project.
  39298. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list
  39299. func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall {
  39300. c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39301. c.project = project
  39302. return c
  39303. }
  39304. // Filter sets the optional parameter "filter": A filter expression that
  39305. // filters resources listed in the response. The expression must specify
  39306. // the field name, a comparison operator, and the value that you want to
  39307. // use for filtering. The value must be a string, a number, or a
  39308. // boolean. The comparison operator must be either =, !=, >, or <.
  39309. //
  39310. // For example, if you are filtering Compute Engine instances, you can
  39311. // exclude instances named example-instance by specifying name !=
  39312. // example-instance.
  39313. //
  39314. // You can also filter nested fields. For example, you could specify
  39315. // scheduling.automaticRestart = false to include instances only if they
  39316. // are not scheduled for automatic restarts. You can use filtering on
  39317. // nested fields to filter based on resource labels.
  39318. //
  39319. // To filter on multiple expressions, provide each separate expression
  39320. // within parentheses. For example, (scheduling.automaticRestart = true)
  39321. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39322. // AND expression. However, you can include AND and OR expressions
  39323. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39324. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39325. // true).
  39326. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall {
  39327. c.urlParams_.Set("filter", filter)
  39328. return c
  39329. }
  39330. // MaxResults sets the optional parameter "maxResults": The maximum
  39331. // number of results per page that should be returned. If the number of
  39332. // available results is larger than maxResults, Compute Engine returns a
  39333. // nextPageToken that can be used to get the next page of results in
  39334. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39335. // (Default: 500)
  39336. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall {
  39337. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39338. return c
  39339. }
  39340. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39341. // a certain order. By default, results are returned in alphanumerical
  39342. // order based on the resource name.
  39343. //
  39344. // You can also sort results in descending order based on the creation
  39345. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39346. // based on the creationTimestamp field in reverse chronological order
  39347. // (newest result first). Use this to sort resources like operations so
  39348. // that the newest operation is returned first.
  39349. //
  39350. // Currently, only sorting by name or creationTimestamp desc is
  39351. // supported.
  39352. func (c *GlobalForwardingRulesListCall) OrderBy(orderBy string) *GlobalForwardingRulesListCall {
  39353. c.urlParams_.Set("orderBy", orderBy)
  39354. return c
  39355. }
  39356. // PageToken sets the optional parameter "pageToken": Specifies a page
  39357. // token to use. Set pageToken to the nextPageToken returned by a
  39358. // previous list request to get the next page of results.
  39359. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall {
  39360. c.urlParams_.Set("pageToken", pageToken)
  39361. return c
  39362. }
  39363. // Fields allows partial responses to be retrieved. See
  39364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39365. // for more information.
  39366. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall {
  39367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39368. return c
  39369. }
  39370. // IfNoneMatch sets the optional parameter which makes the operation
  39371. // fail if the object's ETag matches the given value. This is useful for
  39372. // getting updates only after the object has changed since the last
  39373. // request. Use googleapi.IsNotModified to check whether the response
  39374. // error from Do is the result of In-None-Match.
  39375. func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall {
  39376. c.ifNoneMatch_ = entityTag
  39377. return c
  39378. }
  39379. // Context sets the context to be used in this call's Do method. Any
  39380. // pending HTTP request will be aborted if the provided context is
  39381. // canceled.
  39382. func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall {
  39383. c.ctx_ = ctx
  39384. return c
  39385. }
  39386. // Header returns an http.Header that can be modified by the caller to
  39387. // add HTTP headers to the request.
  39388. func (c *GlobalForwardingRulesListCall) Header() http.Header {
  39389. if c.header_ == nil {
  39390. c.header_ = make(http.Header)
  39391. }
  39392. return c.header_
  39393. }
  39394. func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) {
  39395. reqHeaders := make(http.Header)
  39396. for k, v := range c.header_ {
  39397. reqHeaders[k] = v
  39398. }
  39399. reqHeaders.Set("User-Agent", c.s.userAgent())
  39400. if c.ifNoneMatch_ != "" {
  39401. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39402. }
  39403. var body io.Reader = nil
  39404. c.urlParams_.Set("alt", alt)
  39405. c.urlParams_.Set("prettyPrint", "false")
  39406. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules")
  39407. urls += "?" + c.urlParams_.Encode()
  39408. req, err := http.NewRequest("GET", urls, body)
  39409. if err != nil {
  39410. return nil, err
  39411. }
  39412. req.Header = reqHeaders
  39413. googleapi.Expand(req.URL, map[string]string{
  39414. "project": c.project,
  39415. })
  39416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39417. }
  39418. // Do executes the "compute.globalForwardingRules.list" call.
  39419. // Exactly one of *ForwardingRuleList or error will be non-nil. Any
  39420. // non-2xx status code is an error. Response headers are in either
  39421. // *ForwardingRuleList.ServerResponse.Header or (if a response was
  39422. // returned at all) in error.(*googleapi.Error).Header. Use
  39423. // googleapi.IsNotModified to check whether the returned error was
  39424. // because http.StatusNotModified was returned.
  39425. func (c *GlobalForwardingRulesListCall) Do(opts ...googleapi.CallOption) (*ForwardingRuleList, error) {
  39426. gensupport.SetOptions(c.urlParams_, opts...)
  39427. res, err := c.doRequest("json")
  39428. if res != nil && res.StatusCode == http.StatusNotModified {
  39429. if res.Body != nil {
  39430. res.Body.Close()
  39431. }
  39432. return nil, &googleapi.Error{
  39433. Code: res.StatusCode,
  39434. Header: res.Header,
  39435. }
  39436. }
  39437. if err != nil {
  39438. return nil, err
  39439. }
  39440. defer googleapi.CloseBody(res)
  39441. if err := googleapi.CheckResponse(res); err != nil {
  39442. return nil, err
  39443. }
  39444. ret := &ForwardingRuleList{
  39445. ServerResponse: googleapi.ServerResponse{
  39446. Header: res.Header,
  39447. HTTPStatusCode: res.StatusCode,
  39448. },
  39449. }
  39450. target := &ret
  39451. if err := gensupport.DecodeResponse(target, res); err != nil {
  39452. return nil, err
  39453. }
  39454. return ret, nil
  39455. // {
  39456. // "description": "Retrieves a list of GlobalForwardingRule resources available to the specified project.",
  39457. // "httpMethod": "GET",
  39458. // "id": "compute.globalForwardingRules.list",
  39459. // "parameterOrder": [
  39460. // "project"
  39461. // ],
  39462. // "parameters": {
  39463. // "filter": {
  39464. // "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).",
  39465. // "location": "query",
  39466. // "type": "string"
  39467. // },
  39468. // "maxResults": {
  39469. // "default": "500",
  39470. // "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)",
  39471. // "format": "uint32",
  39472. // "location": "query",
  39473. // "minimum": "0",
  39474. // "type": "integer"
  39475. // },
  39476. // "orderBy": {
  39477. // "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.",
  39478. // "location": "query",
  39479. // "type": "string"
  39480. // },
  39481. // "pageToken": {
  39482. // "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.",
  39483. // "location": "query",
  39484. // "type": "string"
  39485. // },
  39486. // "project": {
  39487. // "description": "Project ID for this request.",
  39488. // "location": "path",
  39489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39490. // "required": true,
  39491. // "type": "string"
  39492. // }
  39493. // },
  39494. // "path": "{project}/global/forwardingRules",
  39495. // "response": {
  39496. // "$ref": "ForwardingRuleList"
  39497. // },
  39498. // "scopes": [
  39499. // "https://www.googleapis.com/auth/cloud-platform",
  39500. // "https://www.googleapis.com/auth/compute",
  39501. // "https://www.googleapis.com/auth/compute.readonly"
  39502. // ]
  39503. // }
  39504. }
  39505. // Pages invokes f for each page of results.
  39506. // A non-nil error returned from f will halt the iteration.
  39507. // The provided context supersedes any context provided to the Context method.
  39508. func (c *GlobalForwardingRulesListCall) Pages(ctx context.Context, f func(*ForwardingRuleList) error) error {
  39509. c.ctx_ = ctx
  39510. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39511. for {
  39512. x, err := c.Do()
  39513. if err != nil {
  39514. return err
  39515. }
  39516. if err := f(x); err != nil {
  39517. return err
  39518. }
  39519. if x.NextPageToken == "" {
  39520. return nil
  39521. }
  39522. c.PageToken(x.NextPageToken)
  39523. }
  39524. }
  39525. // method id "compute.globalForwardingRules.setTarget":
  39526. type GlobalForwardingRulesSetTargetCall struct {
  39527. s *Service
  39528. project string
  39529. forwardingRule string
  39530. targetreference *TargetReference
  39531. urlParams_ gensupport.URLParams
  39532. ctx_ context.Context
  39533. header_ http.Header
  39534. }
  39535. // SetTarget: Changes target URL for the GlobalForwardingRule resource.
  39536. // The new target should be of the same type as the old target.
  39537. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget
  39538. func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall {
  39539. c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39540. c.project = project
  39541. c.forwardingRule = forwardingRule
  39542. c.targetreference = targetreference
  39543. return c
  39544. }
  39545. // RequestId sets the optional parameter "requestId": An optional
  39546. // request ID to identify requests. Specify a unique request ID so that
  39547. // if you must retry your request, the server will know to ignore the
  39548. // request if it has already been completed.
  39549. //
  39550. // For example, consider a situation where you make an initial request
  39551. // and the request times out. If you make the request again with the
  39552. // same request ID, the server can check if original operation with the
  39553. // same request ID was received, and if so, will ignore the second
  39554. // request. This prevents clients from accidentally creating duplicate
  39555. // commitments.
  39556. //
  39557. // The request ID must be a valid UUID with the exception that zero UUID
  39558. // is not supported (00000000-0000-0000-0000-000000000000).
  39559. func (c *GlobalForwardingRulesSetTargetCall) RequestId(requestId string) *GlobalForwardingRulesSetTargetCall {
  39560. c.urlParams_.Set("requestId", requestId)
  39561. return c
  39562. }
  39563. // Fields allows partial responses to be retrieved. See
  39564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39565. // for more information.
  39566. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall {
  39567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39568. return c
  39569. }
  39570. // Context sets the context to be used in this call's Do method. Any
  39571. // pending HTTP request will be aborted if the provided context is
  39572. // canceled.
  39573. func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall {
  39574. c.ctx_ = ctx
  39575. return c
  39576. }
  39577. // Header returns an http.Header that can be modified by the caller to
  39578. // add HTTP headers to the request.
  39579. func (c *GlobalForwardingRulesSetTargetCall) Header() http.Header {
  39580. if c.header_ == nil {
  39581. c.header_ = make(http.Header)
  39582. }
  39583. return c.header_
  39584. }
  39585. func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) {
  39586. reqHeaders := make(http.Header)
  39587. for k, v := range c.header_ {
  39588. reqHeaders[k] = v
  39589. }
  39590. reqHeaders.Set("User-Agent", c.s.userAgent())
  39591. var body io.Reader = nil
  39592. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  39593. if err != nil {
  39594. return nil, err
  39595. }
  39596. reqHeaders.Set("Content-Type", "application/json")
  39597. c.urlParams_.Set("alt", alt)
  39598. c.urlParams_.Set("prettyPrint", "false")
  39599. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget")
  39600. urls += "?" + c.urlParams_.Encode()
  39601. req, err := http.NewRequest("POST", urls, body)
  39602. if err != nil {
  39603. return nil, err
  39604. }
  39605. req.Header = reqHeaders
  39606. googleapi.Expand(req.URL, map[string]string{
  39607. "project": c.project,
  39608. "forwardingRule": c.forwardingRule,
  39609. })
  39610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39611. }
  39612. // Do executes the "compute.globalForwardingRules.setTarget" call.
  39613. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  39614. // status code is an error. Response headers are in either
  39615. // *Operation.ServerResponse.Header or (if a response was returned at
  39616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39617. // to check whether the returned error was because
  39618. // http.StatusNotModified was returned.
  39619. func (c *GlobalForwardingRulesSetTargetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  39620. gensupport.SetOptions(c.urlParams_, opts...)
  39621. res, err := c.doRequest("json")
  39622. if res != nil && res.StatusCode == http.StatusNotModified {
  39623. if res.Body != nil {
  39624. res.Body.Close()
  39625. }
  39626. return nil, &googleapi.Error{
  39627. Code: res.StatusCode,
  39628. Header: res.Header,
  39629. }
  39630. }
  39631. if err != nil {
  39632. return nil, err
  39633. }
  39634. defer googleapi.CloseBody(res)
  39635. if err := googleapi.CheckResponse(res); err != nil {
  39636. return nil, err
  39637. }
  39638. ret := &Operation{
  39639. ServerResponse: googleapi.ServerResponse{
  39640. Header: res.Header,
  39641. HTTPStatusCode: res.StatusCode,
  39642. },
  39643. }
  39644. target := &ret
  39645. if err := gensupport.DecodeResponse(target, res); err != nil {
  39646. return nil, err
  39647. }
  39648. return ret, nil
  39649. // {
  39650. // "description": "Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target.",
  39651. // "httpMethod": "POST",
  39652. // "id": "compute.globalForwardingRules.setTarget",
  39653. // "parameterOrder": [
  39654. // "project",
  39655. // "forwardingRule"
  39656. // ],
  39657. // "parameters": {
  39658. // "forwardingRule": {
  39659. // "description": "Name of the ForwardingRule resource in which target is to be set.",
  39660. // "location": "path",
  39661. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  39662. // "required": true,
  39663. // "type": "string"
  39664. // },
  39665. // "project": {
  39666. // "description": "Project ID for this request.",
  39667. // "location": "path",
  39668. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39669. // "required": true,
  39670. // "type": "string"
  39671. // },
  39672. // "requestId": {
  39673. // "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).",
  39674. // "location": "query",
  39675. // "type": "string"
  39676. // }
  39677. // },
  39678. // "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget",
  39679. // "request": {
  39680. // "$ref": "TargetReference"
  39681. // },
  39682. // "response": {
  39683. // "$ref": "Operation"
  39684. // },
  39685. // "scopes": [
  39686. // "https://www.googleapis.com/auth/cloud-platform",
  39687. // "https://www.googleapis.com/auth/compute"
  39688. // ]
  39689. // }
  39690. }
  39691. // method id "compute.globalOperations.aggregatedList":
  39692. type GlobalOperationsAggregatedListCall struct {
  39693. s *Service
  39694. project string
  39695. urlParams_ gensupport.URLParams
  39696. ifNoneMatch_ string
  39697. ctx_ context.Context
  39698. header_ http.Header
  39699. }
  39700. // AggregatedList: Retrieves an aggregated list of all operations.
  39701. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList
  39702. func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall {
  39703. c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39704. c.project = project
  39705. return c
  39706. }
  39707. // Filter sets the optional parameter "filter": A filter expression that
  39708. // filters resources listed in the response. The expression must specify
  39709. // the field name, a comparison operator, and the value that you want to
  39710. // use for filtering. The value must be a string, a number, or a
  39711. // boolean. The comparison operator must be either =, !=, >, or <.
  39712. //
  39713. // For example, if you are filtering Compute Engine instances, you can
  39714. // exclude instances named example-instance by specifying name !=
  39715. // example-instance.
  39716. //
  39717. // You can also filter nested fields. For example, you could specify
  39718. // scheduling.automaticRestart = false to include instances only if they
  39719. // are not scheduled for automatic restarts. You can use filtering on
  39720. // nested fields to filter based on resource labels.
  39721. //
  39722. // To filter on multiple expressions, provide each separate expression
  39723. // within parentheses. For example, (scheduling.automaticRestart = true)
  39724. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  39725. // AND expression. However, you can include AND and OR expressions
  39726. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  39727. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  39728. // true).
  39729. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall {
  39730. c.urlParams_.Set("filter", filter)
  39731. return c
  39732. }
  39733. // MaxResults sets the optional parameter "maxResults": The maximum
  39734. // number of results per page that should be returned. If the number of
  39735. // available results is larger than maxResults, Compute Engine returns a
  39736. // nextPageToken that can be used to get the next page of results in
  39737. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  39738. // (Default: 500)
  39739. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall {
  39740. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39741. return c
  39742. }
  39743. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  39744. // a certain order. By default, results are returned in alphanumerical
  39745. // order based on the resource name.
  39746. //
  39747. // You can also sort results in descending order based on the creation
  39748. // timestamp using orderBy="creationTimestamp desc". This sorts results
  39749. // based on the creationTimestamp field in reverse chronological order
  39750. // (newest result first). Use this to sort resources like operations so
  39751. // that the newest operation is returned first.
  39752. //
  39753. // Currently, only sorting by name or creationTimestamp desc is
  39754. // supported.
  39755. func (c *GlobalOperationsAggregatedListCall) OrderBy(orderBy string) *GlobalOperationsAggregatedListCall {
  39756. c.urlParams_.Set("orderBy", orderBy)
  39757. return c
  39758. }
  39759. // PageToken sets the optional parameter "pageToken": Specifies a page
  39760. // token to use. Set pageToken to the nextPageToken returned by a
  39761. // previous list request to get the next page of results.
  39762. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall {
  39763. c.urlParams_.Set("pageToken", pageToken)
  39764. return c
  39765. }
  39766. // Fields allows partial responses to be retrieved. See
  39767. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39768. // for more information.
  39769. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall {
  39770. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39771. return c
  39772. }
  39773. // IfNoneMatch sets the optional parameter which makes the operation
  39774. // fail if the object's ETag matches the given value. This is useful for
  39775. // getting updates only after the object has changed since the last
  39776. // request. Use googleapi.IsNotModified to check whether the response
  39777. // error from Do is the result of In-None-Match.
  39778. func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall {
  39779. c.ifNoneMatch_ = entityTag
  39780. return c
  39781. }
  39782. // Context sets the context to be used in this call's Do method. Any
  39783. // pending HTTP request will be aborted if the provided context is
  39784. // canceled.
  39785. func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall {
  39786. c.ctx_ = ctx
  39787. return c
  39788. }
  39789. // Header returns an http.Header that can be modified by the caller to
  39790. // add HTTP headers to the request.
  39791. func (c *GlobalOperationsAggregatedListCall) Header() http.Header {
  39792. if c.header_ == nil {
  39793. c.header_ = make(http.Header)
  39794. }
  39795. return c.header_
  39796. }
  39797. func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  39798. reqHeaders := make(http.Header)
  39799. for k, v := range c.header_ {
  39800. reqHeaders[k] = v
  39801. }
  39802. reqHeaders.Set("User-Agent", c.s.userAgent())
  39803. if c.ifNoneMatch_ != "" {
  39804. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39805. }
  39806. var body io.Reader = nil
  39807. c.urlParams_.Set("alt", alt)
  39808. c.urlParams_.Set("prettyPrint", "false")
  39809. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations")
  39810. urls += "?" + c.urlParams_.Encode()
  39811. req, err := http.NewRequest("GET", urls, body)
  39812. if err != nil {
  39813. return nil, err
  39814. }
  39815. req.Header = reqHeaders
  39816. googleapi.Expand(req.URL, map[string]string{
  39817. "project": c.project,
  39818. })
  39819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39820. }
  39821. // Do executes the "compute.globalOperations.aggregatedList" call.
  39822. // Exactly one of *OperationAggregatedList or error will be non-nil. Any
  39823. // non-2xx status code is an error. Response headers are in either
  39824. // *OperationAggregatedList.ServerResponse.Header or (if a response was
  39825. // returned at all) in error.(*googleapi.Error).Header. Use
  39826. // googleapi.IsNotModified to check whether the returned error was
  39827. // because http.StatusNotModified was returned.
  39828. func (c *GlobalOperationsAggregatedListCall) Do(opts ...googleapi.CallOption) (*OperationAggregatedList, error) {
  39829. gensupport.SetOptions(c.urlParams_, opts...)
  39830. res, err := c.doRequest("json")
  39831. if res != nil && res.StatusCode == http.StatusNotModified {
  39832. if res.Body != nil {
  39833. res.Body.Close()
  39834. }
  39835. return nil, &googleapi.Error{
  39836. Code: res.StatusCode,
  39837. Header: res.Header,
  39838. }
  39839. }
  39840. if err != nil {
  39841. return nil, err
  39842. }
  39843. defer googleapi.CloseBody(res)
  39844. if err := googleapi.CheckResponse(res); err != nil {
  39845. return nil, err
  39846. }
  39847. ret := &OperationAggregatedList{
  39848. ServerResponse: googleapi.ServerResponse{
  39849. Header: res.Header,
  39850. HTTPStatusCode: res.StatusCode,
  39851. },
  39852. }
  39853. target := &ret
  39854. if err := gensupport.DecodeResponse(target, res); err != nil {
  39855. return nil, err
  39856. }
  39857. return ret, nil
  39858. // {
  39859. // "description": "Retrieves an aggregated list of all operations.",
  39860. // "httpMethod": "GET",
  39861. // "id": "compute.globalOperations.aggregatedList",
  39862. // "parameterOrder": [
  39863. // "project"
  39864. // ],
  39865. // "parameters": {
  39866. // "filter": {
  39867. // "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).",
  39868. // "location": "query",
  39869. // "type": "string"
  39870. // },
  39871. // "maxResults": {
  39872. // "default": "500",
  39873. // "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)",
  39874. // "format": "uint32",
  39875. // "location": "query",
  39876. // "minimum": "0",
  39877. // "type": "integer"
  39878. // },
  39879. // "orderBy": {
  39880. // "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.",
  39881. // "location": "query",
  39882. // "type": "string"
  39883. // },
  39884. // "pageToken": {
  39885. // "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.",
  39886. // "location": "query",
  39887. // "type": "string"
  39888. // },
  39889. // "project": {
  39890. // "description": "Project ID for this request.",
  39891. // "location": "path",
  39892. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  39893. // "required": true,
  39894. // "type": "string"
  39895. // }
  39896. // },
  39897. // "path": "{project}/aggregated/operations",
  39898. // "response": {
  39899. // "$ref": "OperationAggregatedList"
  39900. // },
  39901. // "scopes": [
  39902. // "https://www.googleapis.com/auth/cloud-platform",
  39903. // "https://www.googleapis.com/auth/compute",
  39904. // "https://www.googleapis.com/auth/compute.readonly"
  39905. // ]
  39906. // }
  39907. }
  39908. // Pages invokes f for each page of results.
  39909. // A non-nil error returned from f will halt the iteration.
  39910. // The provided context supersedes any context provided to the Context method.
  39911. func (c *GlobalOperationsAggregatedListCall) Pages(ctx context.Context, f func(*OperationAggregatedList) error) error {
  39912. c.ctx_ = ctx
  39913. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39914. for {
  39915. x, err := c.Do()
  39916. if err != nil {
  39917. return err
  39918. }
  39919. if err := f(x); err != nil {
  39920. return err
  39921. }
  39922. if x.NextPageToken == "" {
  39923. return nil
  39924. }
  39925. c.PageToken(x.NextPageToken)
  39926. }
  39927. }
  39928. // method id "compute.globalOperations.delete":
  39929. type GlobalOperationsDeleteCall struct {
  39930. s *Service
  39931. project string
  39932. operation string
  39933. urlParams_ gensupport.URLParams
  39934. ctx_ context.Context
  39935. header_ http.Header
  39936. }
  39937. // Delete: Deletes the specified Operations resource.
  39938. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete
  39939. func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall {
  39940. c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39941. c.project = project
  39942. c.operation = operation
  39943. return c
  39944. }
  39945. // Fields allows partial responses to be retrieved. See
  39946. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39947. // for more information.
  39948. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall {
  39949. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39950. return c
  39951. }
  39952. // Context sets the context to be used in this call's Do method. Any
  39953. // pending HTTP request will be aborted if the provided context is
  39954. // canceled.
  39955. func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall {
  39956. c.ctx_ = ctx
  39957. return c
  39958. }
  39959. // Header returns an http.Header that can be modified by the caller to
  39960. // add HTTP headers to the request.
  39961. func (c *GlobalOperationsDeleteCall) Header() http.Header {
  39962. if c.header_ == nil {
  39963. c.header_ = make(http.Header)
  39964. }
  39965. return c.header_
  39966. }
  39967. func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39968. reqHeaders := make(http.Header)
  39969. for k, v := range c.header_ {
  39970. reqHeaders[k] = v
  39971. }
  39972. reqHeaders.Set("User-Agent", c.s.userAgent())
  39973. var body io.Reader = nil
  39974. c.urlParams_.Set("alt", alt)
  39975. c.urlParams_.Set("prettyPrint", "false")
  39976. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  39977. urls += "?" + c.urlParams_.Encode()
  39978. req, err := http.NewRequest("DELETE", urls, body)
  39979. if err != nil {
  39980. return nil, err
  39981. }
  39982. req.Header = reqHeaders
  39983. googleapi.Expand(req.URL, map[string]string{
  39984. "project": c.project,
  39985. "operation": c.operation,
  39986. })
  39987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39988. }
  39989. // Do executes the "compute.globalOperations.delete" call.
  39990. func (c *GlobalOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  39991. gensupport.SetOptions(c.urlParams_, opts...)
  39992. res, err := c.doRequest("json")
  39993. if err != nil {
  39994. return err
  39995. }
  39996. defer googleapi.CloseBody(res)
  39997. if err := googleapi.CheckResponse(res); err != nil {
  39998. return err
  39999. }
  40000. return nil
  40001. // {
  40002. // "description": "Deletes the specified Operations resource.",
  40003. // "httpMethod": "DELETE",
  40004. // "id": "compute.globalOperations.delete",
  40005. // "parameterOrder": [
  40006. // "project",
  40007. // "operation"
  40008. // ],
  40009. // "parameters": {
  40010. // "operation": {
  40011. // "description": "Name of the Operations resource to delete.",
  40012. // "location": "path",
  40013. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40014. // "required": true,
  40015. // "type": "string"
  40016. // },
  40017. // "project": {
  40018. // "description": "Project ID for this request.",
  40019. // "location": "path",
  40020. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40021. // "required": true,
  40022. // "type": "string"
  40023. // }
  40024. // },
  40025. // "path": "{project}/global/operations/{operation}",
  40026. // "scopes": [
  40027. // "https://www.googleapis.com/auth/cloud-platform",
  40028. // "https://www.googleapis.com/auth/compute"
  40029. // ]
  40030. // }
  40031. }
  40032. // method id "compute.globalOperations.get":
  40033. type GlobalOperationsGetCall struct {
  40034. s *Service
  40035. project string
  40036. operation string
  40037. urlParams_ gensupport.URLParams
  40038. ifNoneMatch_ string
  40039. ctx_ context.Context
  40040. header_ http.Header
  40041. }
  40042. // Get: Retrieves the specified Operations resource. Gets a list of
  40043. // operations by making a list() request.
  40044. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get
  40045. func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall {
  40046. c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40047. c.project = project
  40048. c.operation = operation
  40049. return c
  40050. }
  40051. // Fields allows partial responses to be retrieved. See
  40052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40053. // for more information.
  40054. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall {
  40055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40056. return c
  40057. }
  40058. // IfNoneMatch sets the optional parameter which makes the operation
  40059. // fail if the object's ETag matches the given value. This is useful for
  40060. // getting updates only after the object has changed since the last
  40061. // request. Use googleapi.IsNotModified to check whether the response
  40062. // error from Do is the result of In-None-Match.
  40063. func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall {
  40064. c.ifNoneMatch_ = entityTag
  40065. return c
  40066. }
  40067. // Context sets the context to be used in this call's Do method. Any
  40068. // pending HTTP request will be aborted if the provided context is
  40069. // canceled.
  40070. func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall {
  40071. c.ctx_ = ctx
  40072. return c
  40073. }
  40074. // Header returns an http.Header that can be modified by the caller to
  40075. // add HTTP headers to the request.
  40076. func (c *GlobalOperationsGetCall) Header() http.Header {
  40077. if c.header_ == nil {
  40078. c.header_ = make(http.Header)
  40079. }
  40080. return c.header_
  40081. }
  40082. func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  40083. reqHeaders := make(http.Header)
  40084. for k, v := range c.header_ {
  40085. reqHeaders[k] = v
  40086. }
  40087. reqHeaders.Set("User-Agent", c.s.userAgent())
  40088. if c.ifNoneMatch_ != "" {
  40089. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40090. }
  40091. var body io.Reader = nil
  40092. c.urlParams_.Set("alt", alt)
  40093. c.urlParams_.Set("prettyPrint", "false")
  40094. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  40095. urls += "?" + c.urlParams_.Encode()
  40096. req, err := http.NewRequest("GET", urls, body)
  40097. if err != nil {
  40098. return nil, err
  40099. }
  40100. req.Header = reqHeaders
  40101. googleapi.Expand(req.URL, map[string]string{
  40102. "project": c.project,
  40103. "operation": c.operation,
  40104. })
  40105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40106. }
  40107. // Do executes the "compute.globalOperations.get" call.
  40108. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40109. // status code is an error. Response headers are in either
  40110. // *Operation.ServerResponse.Header or (if a response was returned at
  40111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40112. // to check whether the returned error was because
  40113. // http.StatusNotModified was returned.
  40114. func (c *GlobalOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40115. gensupport.SetOptions(c.urlParams_, opts...)
  40116. res, err := c.doRequest("json")
  40117. if res != nil && res.StatusCode == http.StatusNotModified {
  40118. if res.Body != nil {
  40119. res.Body.Close()
  40120. }
  40121. return nil, &googleapi.Error{
  40122. Code: res.StatusCode,
  40123. Header: res.Header,
  40124. }
  40125. }
  40126. if err != nil {
  40127. return nil, err
  40128. }
  40129. defer googleapi.CloseBody(res)
  40130. if err := googleapi.CheckResponse(res); err != nil {
  40131. return nil, err
  40132. }
  40133. ret := &Operation{
  40134. ServerResponse: googleapi.ServerResponse{
  40135. Header: res.Header,
  40136. HTTPStatusCode: res.StatusCode,
  40137. },
  40138. }
  40139. target := &ret
  40140. if err := gensupport.DecodeResponse(target, res); err != nil {
  40141. return nil, err
  40142. }
  40143. return ret, nil
  40144. // {
  40145. // "description": "Retrieves the specified Operations resource. Gets a list of operations by making a list() request.",
  40146. // "httpMethod": "GET",
  40147. // "id": "compute.globalOperations.get",
  40148. // "parameterOrder": [
  40149. // "project",
  40150. // "operation"
  40151. // ],
  40152. // "parameters": {
  40153. // "operation": {
  40154. // "description": "Name of the Operations resource to return.",
  40155. // "location": "path",
  40156. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40157. // "required": true,
  40158. // "type": "string"
  40159. // },
  40160. // "project": {
  40161. // "description": "Project ID for this request.",
  40162. // "location": "path",
  40163. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40164. // "required": true,
  40165. // "type": "string"
  40166. // }
  40167. // },
  40168. // "path": "{project}/global/operations/{operation}",
  40169. // "response": {
  40170. // "$ref": "Operation"
  40171. // },
  40172. // "scopes": [
  40173. // "https://www.googleapis.com/auth/cloud-platform",
  40174. // "https://www.googleapis.com/auth/compute",
  40175. // "https://www.googleapis.com/auth/compute.readonly"
  40176. // ]
  40177. // }
  40178. }
  40179. // method id "compute.globalOperations.list":
  40180. type GlobalOperationsListCall struct {
  40181. s *Service
  40182. project string
  40183. urlParams_ gensupport.URLParams
  40184. ifNoneMatch_ string
  40185. ctx_ context.Context
  40186. header_ http.Header
  40187. }
  40188. // List: Retrieves a list of Operation resources contained within the
  40189. // specified project.
  40190. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list
  40191. func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall {
  40192. c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40193. c.project = project
  40194. return c
  40195. }
  40196. // Filter sets the optional parameter "filter": A filter expression that
  40197. // filters resources listed in the response. The expression must specify
  40198. // the field name, a comparison operator, and the value that you want to
  40199. // use for filtering. The value must be a string, a number, or a
  40200. // boolean. The comparison operator must be either =, !=, >, or <.
  40201. //
  40202. // For example, if you are filtering Compute Engine instances, you can
  40203. // exclude instances named example-instance by specifying name !=
  40204. // example-instance.
  40205. //
  40206. // You can also filter nested fields. For example, you could specify
  40207. // scheduling.automaticRestart = false to include instances only if they
  40208. // are not scheduled for automatic restarts. You can use filtering on
  40209. // nested fields to filter based on resource labels.
  40210. //
  40211. // To filter on multiple expressions, provide each separate expression
  40212. // within parentheses. For example, (scheduling.automaticRestart = true)
  40213. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40214. // AND expression. However, you can include AND and OR expressions
  40215. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40216. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40217. // true).
  40218. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall {
  40219. c.urlParams_.Set("filter", filter)
  40220. return c
  40221. }
  40222. // MaxResults sets the optional parameter "maxResults": The maximum
  40223. // number of results per page that should be returned. If the number of
  40224. // available results is larger than maxResults, Compute Engine returns a
  40225. // nextPageToken that can be used to get the next page of results in
  40226. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40227. // (Default: 500)
  40228. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall {
  40229. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40230. return c
  40231. }
  40232. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40233. // a certain order. By default, results are returned in alphanumerical
  40234. // order based on the resource name.
  40235. //
  40236. // You can also sort results in descending order based on the creation
  40237. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40238. // based on the creationTimestamp field in reverse chronological order
  40239. // (newest result first). Use this to sort resources like operations so
  40240. // that the newest operation is returned first.
  40241. //
  40242. // Currently, only sorting by name or creationTimestamp desc is
  40243. // supported.
  40244. func (c *GlobalOperationsListCall) OrderBy(orderBy string) *GlobalOperationsListCall {
  40245. c.urlParams_.Set("orderBy", orderBy)
  40246. return c
  40247. }
  40248. // PageToken sets the optional parameter "pageToken": Specifies a page
  40249. // token to use. Set pageToken to the nextPageToken returned by a
  40250. // previous list request to get the next page of results.
  40251. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall {
  40252. c.urlParams_.Set("pageToken", pageToken)
  40253. return c
  40254. }
  40255. // Fields allows partial responses to be retrieved. See
  40256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40257. // for more information.
  40258. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall {
  40259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40260. return c
  40261. }
  40262. // IfNoneMatch sets the optional parameter which makes the operation
  40263. // fail if the object's ETag matches the given value. This is useful for
  40264. // getting updates only after the object has changed since the last
  40265. // request. Use googleapi.IsNotModified to check whether the response
  40266. // error from Do is the result of In-None-Match.
  40267. func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall {
  40268. c.ifNoneMatch_ = entityTag
  40269. return c
  40270. }
  40271. // Context sets the context to be used in this call's Do method. Any
  40272. // pending HTTP request will be aborted if the provided context is
  40273. // canceled.
  40274. func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall {
  40275. c.ctx_ = ctx
  40276. return c
  40277. }
  40278. // Header returns an http.Header that can be modified by the caller to
  40279. // add HTTP headers to the request.
  40280. func (c *GlobalOperationsListCall) Header() http.Header {
  40281. if c.header_ == nil {
  40282. c.header_ = make(http.Header)
  40283. }
  40284. return c.header_
  40285. }
  40286. func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) {
  40287. reqHeaders := make(http.Header)
  40288. for k, v := range c.header_ {
  40289. reqHeaders[k] = v
  40290. }
  40291. reqHeaders.Set("User-Agent", c.s.userAgent())
  40292. if c.ifNoneMatch_ != "" {
  40293. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40294. }
  40295. var body io.Reader = nil
  40296. c.urlParams_.Set("alt", alt)
  40297. c.urlParams_.Set("prettyPrint", "false")
  40298. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  40299. urls += "?" + c.urlParams_.Encode()
  40300. req, err := http.NewRequest("GET", urls, body)
  40301. if err != nil {
  40302. return nil, err
  40303. }
  40304. req.Header = reqHeaders
  40305. googleapi.Expand(req.URL, map[string]string{
  40306. "project": c.project,
  40307. })
  40308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40309. }
  40310. // Do executes the "compute.globalOperations.list" call.
  40311. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  40312. // status code is an error. Response headers are in either
  40313. // *OperationList.ServerResponse.Header or (if a response was returned
  40314. // at all) in error.(*googleapi.Error).Header. Use
  40315. // googleapi.IsNotModified to check whether the returned error was
  40316. // because http.StatusNotModified was returned.
  40317. func (c *GlobalOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  40318. gensupport.SetOptions(c.urlParams_, opts...)
  40319. res, err := c.doRequest("json")
  40320. if res != nil && res.StatusCode == http.StatusNotModified {
  40321. if res.Body != nil {
  40322. res.Body.Close()
  40323. }
  40324. return nil, &googleapi.Error{
  40325. Code: res.StatusCode,
  40326. Header: res.Header,
  40327. }
  40328. }
  40329. if err != nil {
  40330. return nil, err
  40331. }
  40332. defer googleapi.CloseBody(res)
  40333. if err := googleapi.CheckResponse(res); err != nil {
  40334. return nil, err
  40335. }
  40336. ret := &OperationList{
  40337. ServerResponse: googleapi.ServerResponse{
  40338. Header: res.Header,
  40339. HTTPStatusCode: res.StatusCode,
  40340. },
  40341. }
  40342. target := &ret
  40343. if err := gensupport.DecodeResponse(target, res); err != nil {
  40344. return nil, err
  40345. }
  40346. return ret, nil
  40347. // {
  40348. // "description": "Retrieves a list of Operation resources contained within the specified project.",
  40349. // "httpMethod": "GET",
  40350. // "id": "compute.globalOperations.list",
  40351. // "parameterOrder": [
  40352. // "project"
  40353. // ],
  40354. // "parameters": {
  40355. // "filter": {
  40356. // "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).",
  40357. // "location": "query",
  40358. // "type": "string"
  40359. // },
  40360. // "maxResults": {
  40361. // "default": "500",
  40362. // "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)",
  40363. // "format": "uint32",
  40364. // "location": "query",
  40365. // "minimum": "0",
  40366. // "type": "integer"
  40367. // },
  40368. // "orderBy": {
  40369. // "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.",
  40370. // "location": "query",
  40371. // "type": "string"
  40372. // },
  40373. // "pageToken": {
  40374. // "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.",
  40375. // "location": "query",
  40376. // "type": "string"
  40377. // },
  40378. // "project": {
  40379. // "description": "Project ID for this request.",
  40380. // "location": "path",
  40381. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40382. // "required": true,
  40383. // "type": "string"
  40384. // }
  40385. // },
  40386. // "path": "{project}/global/operations",
  40387. // "response": {
  40388. // "$ref": "OperationList"
  40389. // },
  40390. // "scopes": [
  40391. // "https://www.googleapis.com/auth/cloud-platform",
  40392. // "https://www.googleapis.com/auth/compute",
  40393. // "https://www.googleapis.com/auth/compute.readonly"
  40394. // ]
  40395. // }
  40396. }
  40397. // Pages invokes f for each page of results.
  40398. // A non-nil error returned from f will halt the iteration.
  40399. // The provided context supersedes any context provided to the Context method.
  40400. func (c *GlobalOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  40401. c.ctx_ = ctx
  40402. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40403. for {
  40404. x, err := c.Do()
  40405. if err != nil {
  40406. return err
  40407. }
  40408. if err := f(x); err != nil {
  40409. return err
  40410. }
  40411. if x.NextPageToken == "" {
  40412. return nil
  40413. }
  40414. c.PageToken(x.NextPageToken)
  40415. }
  40416. }
  40417. // method id "compute.healthChecks.delete":
  40418. type HealthChecksDeleteCall struct {
  40419. s *Service
  40420. project string
  40421. healthCheck string
  40422. urlParams_ gensupport.URLParams
  40423. ctx_ context.Context
  40424. header_ http.Header
  40425. }
  40426. // Delete: Deletes the specified HealthCheck resource.
  40427. func (r *HealthChecksService) Delete(project string, healthCheck string) *HealthChecksDeleteCall {
  40428. c := &HealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40429. c.project = project
  40430. c.healthCheck = healthCheck
  40431. return c
  40432. }
  40433. // RequestId sets the optional parameter "requestId": An optional
  40434. // request ID to identify requests. Specify a unique request ID so that
  40435. // if you must retry your request, the server will know to ignore the
  40436. // request if it has already been completed.
  40437. //
  40438. // For example, consider a situation where you make an initial request
  40439. // and the request times out. If you make the request again with the
  40440. // same request ID, the server can check if original operation with the
  40441. // same request ID was received, and if so, will ignore the second
  40442. // request. This prevents clients from accidentally creating duplicate
  40443. // commitments.
  40444. //
  40445. // The request ID must be a valid UUID with the exception that zero UUID
  40446. // is not supported (00000000-0000-0000-0000-000000000000).
  40447. func (c *HealthChecksDeleteCall) RequestId(requestId string) *HealthChecksDeleteCall {
  40448. c.urlParams_.Set("requestId", requestId)
  40449. return c
  40450. }
  40451. // Fields allows partial responses to be retrieved. See
  40452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40453. // for more information.
  40454. func (c *HealthChecksDeleteCall) Fields(s ...googleapi.Field) *HealthChecksDeleteCall {
  40455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40456. return c
  40457. }
  40458. // Context sets the context to be used in this call's Do method. Any
  40459. // pending HTTP request will be aborted if the provided context is
  40460. // canceled.
  40461. func (c *HealthChecksDeleteCall) Context(ctx context.Context) *HealthChecksDeleteCall {
  40462. c.ctx_ = ctx
  40463. return c
  40464. }
  40465. // Header returns an http.Header that can be modified by the caller to
  40466. // add HTTP headers to the request.
  40467. func (c *HealthChecksDeleteCall) Header() http.Header {
  40468. if c.header_ == nil {
  40469. c.header_ = make(http.Header)
  40470. }
  40471. return c.header_
  40472. }
  40473. func (c *HealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  40474. reqHeaders := make(http.Header)
  40475. for k, v := range c.header_ {
  40476. reqHeaders[k] = v
  40477. }
  40478. reqHeaders.Set("User-Agent", c.s.userAgent())
  40479. var body io.Reader = nil
  40480. c.urlParams_.Set("alt", alt)
  40481. c.urlParams_.Set("prettyPrint", "false")
  40482. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  40483. urls += "?" + c.urlParams_.Encode()
  40484. req, err := http.NewRequest("DELETE", urls, body)
  40485. if err != nil {
  40486. return nil, err
  40487. }
  40488. req.Header = reqHeaders
  40489. googleapi.Expand(req.URL, map[string]string{
  40490. "project": c.project,
  40491. "healthCheck": c.healthCheck,
  40492. })
  40493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40494. }
  40495. // Do executes the "compute.healthChecks.delete" call.
  40496. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40497. // status code is an error. Response headers are in either
  40498. // *Operation.ServerResponse.Header or (if a response was returned at
  40499. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40500. // to check whether the returned error was because
  40501. // http.StatusNotModified was returned.
  40502. func (c *HealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40503. gensupport.SetOptions(c.urlParams_, opts...)
  40504. res, err := c.doRequest("json")
  40505. if res != nil && res.StatusCode == http.StatusNotModified {
  40506. if res.Body != nil {
  40507. res.Body.Close()
  40508. }
  40509. return nil, &googleapi.Error{
  40510. Code: res.StatusCode,
  40511. Header: res.Header,
  40512. }
  40513. }
  40514. if err != nil {
  40515. return nil, err
  40516. }
  40517. defer googleapi.CloseBody(res)
  40518. if err := googleapi.CheckResponse(res); err != nil {
  40519. return nil, err
  40520. }
  40521. ret := &Operation{
  40522. ServerResponse: googleapi.ServerResponse{
  40523. Header: res.Header,
  40524. HTTPStatusCode: res.StatusCode,
  40525. },
  40526. }
  40527. target := &ret
  40528. if err := gensupport.DecodeResponse(target, res); err != nil {
  40529. return nil, err
  40530. }
  40531. return ret, nil
  40532. // {
  40533. // "description": "Deletes the specified HealthCheck resource.",
  40534. // "httpMethod": "DELETE",
  40535. // "id": "compute.healthChecks.delete",
  40536. // "parameterOrder": [
  40537. // "project",
  40538. // "healthCheck"
  40539. // ],
  40540. // "parameters": {
  40541. // "healthCheck": {
  40542. // "description": "Name of the HealthCheck resource to delete.",
  40543. // "location": "path",
  40544. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40545. // "required": true,
  40546. // "type": "string"
  40547. // },
  40548. // "project": {
  40549. // "description": "Project ID for this request.",
  40550. // "location": "path",
  40551. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40552. // "required": true,
  40553. // "type": "string"
  40554. // },
  40555. // "requestId": {
  40556. // "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).",
  40557. // "location": "query",
  40558. // "type": "string"
  40559. // }
  40560. // },
  40561. // "path": "{project}/global/healthChecks/{healthCheck}",
  40562. // "response": {
  40563. // "$ref": "Operation"
  40564. // },
  40565. // "scopes": [
  40566. // "https://www.googleapis.com/auth/cloud-platform",
  40567. // "https://www.googleapis.com/auth/compute"
  40568. // ]
  40569. // }
  40570. }
  40571. // method id "compute.healthChecks.get":
  40572. type HealthChecksGetCall struct {
  40573. s *Service
  40574. project string
  40575. healthCheck string
  40576. urlParams_ gensupport.URLParams
  40577. ifNoneMatch_ string
  40578. ctx_ context.Context
  40579. header_ http.Header
  40580. }
  40581. // Get: Returns the specified HealthCheck resource. Gets a list of
  40582. // available health checks by making a list() request.
  40583. func (r *HealthChecksService) Get(project string, healthCheck string) *HealthChecksGetCall {
  40584. c := &HealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40585. c.project = project
  40586. c.healthCheck = healthCheck
  40587. return c
  40588. }
  40589. // Fields allows partial responses to be retrieved. See
  40590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40591. // for more information.
  40592. func (c *HealthChecksGetCall) Fields(s ...googleapi.Field) *HealthChecksGetCall {
  40593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40594. return c
  40595. }
  40596. // IfNoneMatch sets the optional parameter which makes the operation
  40597. // fail if the object's ETag matches the given value. This is useful for
  40598. // getting updates only after the object has changed since the last
  40599. // request. Use googleapi.IsNotModified to check whether the response
  40600. // error from Do is the result of In-None-Match.
  40601. func (c *HealthChecksGetCall) IfNoneMatch(entityTag string) *HealthChecksGetCall {
  40602. c.ifNoneMatch_ = entityTag
  40603. return c
  40604. }
  40605. // Context sets the context to be used in this call's Do method. Any
  40606. // pending HTTP request will be aborted if the provided context is
  40607. // canceled.
  40608. func (c *HealthChecksGetCall) Context(ctx context.Context) *HealthChecksGetCall {
  40609. c.ctx_ = ctx
  40610. return c
  40611. }
  40612. // Header returns an http.Header that can be modified by the caller to
  40613. // add HTTP headers to the request.
  40614. func (c *HealthChecksGetCall) Header() http.Header {
  40615. if c.header_ == nil {
  40616. c.header_ = make(http.Header)
  40617. }
  40618. return c.header_
  40619. }
  40620. func (c *HealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  40621. reqHeaders := make(http.Header)
  40622. for k, v := range c.header_ {
  40623. reqHeaders[k] = v
  40624. }
  40625. reqHeaders.Set("User-Agent", c.s.userAgent())
  40626. if c.ifNoneMatch_ != "" {
  40627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40628. }
  40629. var body io.Reader = nil
  40630. c.urlParams_.Set("alt", alt)
  40631. c.urlParams_.Set("prettyPrint", "false")
  40632. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  40633. urls += "?" + c.urlParams_.Encode()
  40634. req, err := http.NewRequest("GET", urls, body)
  40635. if err != nil {
  40636. return nil, err
  40637. }
  40638. req.Header = reqHeaders
  40639. googleapi.Expand(req.URL, map[string]string{
  40640. "project": c.project,
  40641. "healthCheck": c.healthCheck,
  40642. })
  40643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40644. }
  40645. // Do executes the "compute.healthChecks.get" call.
  40646. // Exactly one of *HealthCheck or error will be non-nil. Any non-2xx
  40647. // status code is an error. Response headers are in either
  40648. // *HealthCheck.ServerResponse.Header or (if a response was returned at
  40649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40650. // to check whether the returned error was because
  40651. // http.StatusNotModified was returned.
  40652. func (c *HealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) {
  40653. gensupport.SetOptions(c.urlParams_, opts...)
  40654. res, err := c.doRequest("json")
  40655. if res != nil && res.StatusCode == http.StatusNotModified {
  40656. if res.Body != nil {
  40657. res.Body.Close()
  40658. }
  40659. return nil, &googleapi.Error{
  40660. Code: res.StatusCode,
  40661. Header: res.Header,
  40662. }
  40663. }
  40664. if err != nil {
  40665. return nil, err
  40666. }
  40667. defer googleapi.CloseBody(res)
  40668. if err := googleapi.CheckResponse(res); err != nil {
  40669. return nil, err
  40670. }
  40671. ret := &HealthCheck{
  40672. ServerResponse: googleapi.ServerResponse{
  40673. Header: res.Header,
  40674. HTTPStatusCode: res.StatusCode,
  40675. },
  40676. }
  40677. target := &ret
  40678. if err := gensupport.DecodeResponse(target, res); err != nil {
  40679. return nil, err
  40680. }
  40681. return ret, nil
  40682. // {
  40683. // "description": "Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.",
  40684. // "httpMethod": "GET",
  40685. // "id": "compute.healthChecks.get",
  40686. // "parameterOrder": [
  40687. // "project",
  40688. // "healthCheck"
  40689. // ],
  40690. // "parameters": {
  40691. // "healthCheck": {
  40692. // "description": "Name of the HealthCheck resource to return.",
  40693. // "location": "path",
  40694. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  40695. // "required": true,
  40696. // "type": "string"
  40697. // },
  40698. // "project": {
  40699. // "description": "Project ID for this request.",
  40700. // "location": "path",
  40701. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40702. // "required": true,
  40703. // "type": "string"
  40704. // }
  40705. // },
  40706. // "path": "{project}/global/healthChecks/{healthCheck}",
  40707. // "response": {
  40708. // "$ref": "HealthCheck"
  40709. // },
  40710. // "scopes": [
  40711. // "https://www.googleapis.com/auth/cloud-platform",
  40712. // "https://www.googleapis.com/auth/compute",
  40713. // "https://www.googleapis.com/auth/compute.readonly"
  40714. // ]
  40715. // }
  40716. }
  40717. // method id "compute.healthChecks.insert":
  40718. type HealthChecksInsertCall struct {
  40719. s *Service
  40720. project string
  40721. healthcheck *HealthCheck
  40722. urlParams_ gensupport.URLParams
  40723. ctx_ context.Context
  40724. header_ http.Header
  40725. }
  40726. // Insert: Creates a HealthCheck resource in the specified project using
  40727. // the data included in the request.
  40728. func (r *HealthChecksService) Insert(project string, healthcheck *HealthCheck) *HealthChecksInsertCall {
  40729. c := &HealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40730. c.project = project
  40731. c.healthcheck = healthcheck
  40732. return c
  40733. }
  40734. // RequestId sets the optional parameter "requestId": An optional
  40735. // request ID to identify requests. Specify a unique request ID so that
  40736. // if you must retry your request, the server will know to ignore the
  40737. // request if it has already been completed.
  40738. //
  40739. // For example, consider a situation where you make an initial request
  40740. // and the request times out. If you make the request again with the
  40741. // same request ID, the server can check if original operation with the
  40742. // same request ID was received, and if so, will ignore the second
  40743. // request. This prevents clients from accidentally creating duplicate
  40744. // commitments.
  40745. //
  40746. // The request ID must be a valid UUID with the exception that zero UUID
  40747. // is not supported (00000000-0000-0000-0000-000000000000).
  40748. func (c *HealthChecksInsertCall) RequestId(requestId string) *HealthChecksInsertCall {
  40749. c.urlParams_.Set("requestId", requestId)
  40750. return c
  40751. }
  40752. // Fields allows partial responses to be retrieved. See
  40753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40754. // for more information.
  40755. func (c *HealthChecksInsertCall) Fields(s ...googleapi.Field) *HealthChecksInsertCall {
  40756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40757. return c
  40758. }
  40759. // Context sets the context to be used in this call's Do method. Any
  40760. // pending HTTP request will be aborted if the provided context is
  40761. // canceled.
  40762. func (c *HealthChecksInsertCall) Context(ctx context.Context) *HealthChecksInsertCall {
  40763. c.ctx_ = ctx
  40764. return c
  40765. }
  40766. // Header returns an http.Header that can be modified by the caller to
  40767. // add HTTP headers to the request.
  40768. func (c *HealthChecksInsertCall) Header() http.Header {
  40769. if c.header_ == nil {
  40770. c.header_ = make(http.Header)
  40771. }
  40772. return c.header_
  40773. }
  40774. func (c *HealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  40775. reqHeaders := make(http.Header)
  40776. for k, v := range c.header_ {
  40777. reqHeaders[k] = v
  40778. }
  40779. reqHeaders.Set("User-Agent", c.s.userAgent())
  40780. var body io.Reader = nil
  40781. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  40782. if err != nil {
  40783. return nil, err
  40784. }
  40785. reqHeaders.Set("Content-Type", "application/json")
  40786. c.urlParams_.Set("alt", alt)
  40787. c.urlParams_.Set("prettyPrint", "false")
  40788. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  40789. urls += "?" + c.urlParams_.Encode()
  40790. req, err := http.NewRequest("POST", urls, body)
  40791. if err != nil {
  40792. return nil, err
  40793. }
  40794. req.Header = reqHeaders
  40795. googleapi.Expand(req.URL, map[string]string{
  40796. "project": c.project,
  40797. })
  40798. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40799. }
  40800. // Do executes the "compute.healthChecks.insert" call.
  40801. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  40802. // status code is an error. Response headers are in either
  40803. // *Operation.ServerResponse.Header or (if a response was returned at
  40804. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40805. // to check whether the returned error was because
  40806. // http.StatusNotModified was returned.
  40807. func (c *HealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  40808. gensupport.SetOptions(c.urlParams_, opts...)
  40809. res, err := c.doRequest("json")
  40810. if res != nil && res.StatusCode == http.StatusNotModified {
  40811. if res.Body != nil {
  40812. res.Body.Close()
  40813. }
  40814. return nil, &googleapi.Error{
  40815. Code: res.StatusCode,
  40816. Header: res.Header,
  40817. }
  40818. }
  40819. if err != nil {
  40820. return nil, err
  40821. }
  40822. defer googleapi.CloseBody(res)
  40823. if err := googleapi.CheckResponse(res); err != nil {
  40824. return nil, err
  40825. }
  40826. ret := &Operation{
  40827. ServerResponse: googleapi.ServerResponse{
  40828. Header: res.Header,
  40829. HTTPStatusCode: res.StatusCode,
  40830. },
  40831. }
  40832. target := &ret
  40833. if err := gensupport.DecodeResponse(target, res); err != nil {
  40834. return nil, err
  40835. }
  40836. return ret, nil
  40837. // {
  40838. // "description": "Creates a HealthCheck resource in the specified project using the data included in the request.",
  40839. // "httpMethod": "POST",
  40840. // "id": "compute.healthChecks.insert",
  40841. // "parameterOrder": [
  40842. // "project"
  40843. // ],
  40844. // "parameters": {
  40845. // "project": {
  40846. // "description": "Project ID for this request.",
  40847. // "location": "path",
  40848. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  40849. // "required": true,
  40850. // "type": "string"
  40851. // },
  40852. // "requestId": {
  40853. // "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).",
  40854. // "location": "query",
  40855. // "type": "string"
  40856. // }
  40857. // },
  40858. // "path": "{project}/global/healthChecks",
  40859. // "request": {
  40860. // "$ref": "HealthCheck"
  40861. // },
  40862. // "response": {
  40863. // "$ref": "Operation"
  40864. // },
  40865. // "scopes": [
  40866. // "https://www.googleapis.com/auth/cloud-platform",
  40867. // "https://www.googleapis.com/auth/compute"
  40868. // ]
  40869. // }
  40870. }
  40871. // method id "compute.healthChecks.list":
  40872. type HealthChecksListCall struct {
  40873. s *Service
  40874. project string
  40875. urlParams_ gensupport.URLParams
  40876. ifNoneMatch_ string
  40877. ctx_ context.Context
  40878. header_ http.Header
  40879. }
  40880. // List: Retrieves the list of HealthCheck resources available to the
  40881. // specified project.
  40882. func (r *HealthChecksService) List(project string) *HealthChecksListCall {
  40883. c := &HealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40884. c.project = project
  40885. return c
  40886. }
  40887. // Filter sets the optional parameter "filter": A filter expression that
  40888. // filters resources listed in the response. The expression must specify
  40889. // the field name, a comparison operator, and the value that you want to
  40890. // use for filtering. The value must be a string, a number, or a
  40891. // boolean. The comparison operator must be either =, !=, >, or <.
  40892. //
  40893. // For example, if you are filtering Compute Engine instances, you can
  40894. // exclude instances named example-instance by specifying name !=
  40895. // example-instance.
  40896. //
  40897. // You can also filter nested fields. For example, you could specify
  40898. // scheduling.automaticRestart = false to include instances only if they
  40899. // are not scheduled for automatic restarts. You can use filtering on
  40900. // nested fields to filter based on resource labels.
  40901. //
  40902. // To filter on multiple expressions, provide each separate expression
  40903. // within parentheses. For example, (scheduling.automaticRestart = true)
  40904. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  40905. // AND expression. However, you can include AND and OR expressions
  40906. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  40907. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  40908. // true).
  40909. func (c *HealthChecksListCall) Filter(filter string) *HealthChecksListCall {
  40910. c.urlParams_.Set("filter", filter)
  40911. return c
  40912. }
  40913. // MaxResults sets the optional parameter "maxResults": The maximum
  40914. // number of results per page that should be returned. If the number of
  40915. // available results is larger than maxResults, Compute Engine returns a
  40916. // nextPageToken that can be used to get the next page of results in
  40917. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  40918. // (Default: 500)
  40919. func (c *HealthChecksListCall) MaxResults(maxResults int64) *HealthChecksListCall {
  40920. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40921. return c
  40922. }
  40923. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  40924. // a certain order. By default, results are returned in alphanumerical
  40925. // order based on the resource name.
  40926. //
  40927. // You can also sort results in descending order based on the creation
  40928. // timestamp using orderBy="creationTimestamp desc". This sorts results
  40929. // based on the creationTimestamp field in reverse chronological order
  40930. // (newest result first). Use this to sort resources like operations so
  40931. // that the newest operation is returned first.
  40932. //
  40933. // Currently, only sorting by name or creationTimestamp desc is
  40934. // supported.
  40935. func (c *HealthChecksListCall) OrderBy(orderBy string) *HealthChecksListCall {
  40936. c.urlParams_.Set("orderBy", orderBy)
  40937. return c
  40938. }
  40939. // PageToken sets the optional parameter "pageToken": Specifies a page
  40940. // token to use. Set pageToken to the nextPageToken returned by a
  40941. // previous list request to get the next page of results.
  40942. func (c *HealthChecksListCall) PageToken(pageToken string) *HealthChecksListCall {
  40943. c.urlParams_.Set("pageToken", pageToken)
  40944. return c
  40945. }
  40946. // Fields allows partial responses to be retrieved. See
  40947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40948. // for more information.
  40949. func (c *HealthChecksListCall) Fields(s ...googleapi.Field) *HealthChecksListCall {
  40950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40951. return c
  40952. }
  40953. // IfNoneMatch sets the optional parameter which makes the operation
  40954. // fail if the object's ETag matches the given value. This is useful for
  40955. // getting updates only after the object has changed since the last
  40956. // request. Use googleapi.IsNotModified to check whether the response
  40957. // error from Do is the result of In-None-Match.
  40958. func (c *HealthChecksListCall) IfNoneMatch(entityTag string) *HealthChecksListCall {
  40959. c.ifNoneMatch_ = entityTag
  40960. return c
  40961. }
  40962. // Context sets the context to be used in this call's Do method. Any
  40963. // pending HTTP request will be aborted if the provided context is
  40964. // canceled.
  40965. func (c *HealthChecksListCall) Context(ctx context.Context) *HealthChecksListCall {
  40966. c.ctx_ = ctx
  40967. return c
  40968. }
  40969. // Header returns an http.Header that can be modified by the caller to
  40970. // add HTTP headers to the request.
  40971. func (c *HealthChecksListCall) Header() http.Header {
  40972. if c.header_ == nil {
  40973. c.header_ = make(http.Header)
  40974. }
  40975. return c.header_
  40976. }
  40977. func (c *HealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  40978. reqHeaders := make(http.Header)
  40979. for k, v := range c.header_ {
  40980. reqHeaders[k] = v
  40981. }
  40982. reqHeaders.Set("User-Agent", c.s.userAgent())
  40983. if c.ifNoneMatch_ != "" {
  40984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40985. }
  40986. var body io.Reader = nil
  40987. c.urlParams_.Set("alt", alt)
  40988. c.urlParams_.Set("prettyPrint", "false")
  40989. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks")
  40990. urls += "?" + c.urlParams_.Encode()
  40991. req, err := http.NewRequest("GET", urls, body)
  40992. if err != nil {
  40993. return nil, err
  40994. }
  40995. req.Header = reqHeaders
  40996. googleapi.Expand(req.URL, map[string]string{
  40997. "project": c.project,
  40998. })
  40999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41000. }
  41001. // Do executes the "compute.healthChecks.list" call.
  41002. // Exactly one of *HealthCheckList or error will be non-nil. Any non-2xx
  41003. // status code is an error. Response headers are in either
  41004. // *HealthCheckList.ServerResponse.Header or (if a response was returned
  41005. // at all) in error.(*googleapi.Error).Header. Use
  41006. // googleapi.IsNotModified to check whether the returned error was
  41007. // because http.StatusNotModified was returned.
  41008. func (c *HealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) {
  41009. gensupport.SetOptions(c.urlParams_, opts...)
  41010. res, err := c.doRequest("json")
  41011. if res != nil && res.StatusCode == http.StatusNotModified {
  41012. if res.Body != nil {
  41013. res.Body.Close()
  41014. }
  41015. return nil, &googleapi.Error{
  41016. Code: res.StatusCode,
  41017. Header: res.Header,
  41018. }
  41019. }
  41020. if err != nil {
  41021. return nil, err
  41022. }
  41023. defer googleapi.CloseBody(res)
  41024. if err := googleapi.CheckResponse(res); err != nil {
  41025. return nil, err
  41026. }
  41027. ret := &HealthCheckList{
  41028. ServerResponse: googleapi.ServerResponse{
  41029. Header: res.Header,
  41030. HTTPStatusCode: res.StatusCode,
  41031. },
  41032. }
  41033. target := &ret
  41034. if err := gensupport.DecodeResponse(target, res); err != nil {
  41035. return nil, err
  41036. }
  41037. return ret, nil
  41038. // {
  41039. // "description": "Retrieves the list of HealthCheck resources available to the specified project.",
  41040. // "httpMethod": "GET",
  41041. // "id": "compute.healthChecks.list",
  41042. // "parameterOrder": [
  41043. // "project"
  41044. // ],
  41045. // "parameters": {
  41046. // "filter": {
  41047. // "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).",
  41048. // "location": "query",
  41049. // "type": "string"
  41050. // },
  41051. // "maxResults": {
  41052. // "default": "500",
  41053. // "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)",
  41054. // "format": "uint32",
  41055. // "location": "query",
  41056. // "minimum": "0",
  41057. // "type": "integer"
  41058. // },
  41059. // "orderBy": {
  41060. // "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.",
  41061. // "location": "query",
  41062. // "type": "string"
  41063. // },
  41064. // "pageToken": {
  41065. // "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.",
  41066. // "location": "query",
  41067. // "type": "string"
  41068. // },
  41069. // "project": {
  41070. // "description": "Project ID for this request.",
  41071. // "location": "path",
  41072. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41073. // "required": true,
  41074. // "type": "string"
  41075. // }
  41076. // },
  41077. // "path": "{project}/global/healthChecks",
  41078. // "response": {
  41079. // "$ref": "HealthCheckList"
  41080. // },
  41081. // "scopes": [
  41082. // "https://www.googleapis.com/auth/cloud-platform",
  41083. // "https://www.googleapis.com/auth/compute",
  41084. // "https://www.googleapis.com/auth/compute.readonly"
  41085. // ]
  41086. // }
  41087. }
  41088. // Pages invokes f for each page of results.
  41089. // A non-nil error returned from f will halt the iteration.
  41090. // The provided context supersedes any context provided to the Context method.
  41091. func (c *HealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error {
  41092. c.ctx_ = ctx
  41093. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41094. for {
  41095. x, err := c.Do()
  41096. if err != nil {
  41097. return err
  41098. }
  41099. if err := f(x); err != nil {
  41100. return err
  41101. }
  41102. if x.NextPageToken == "" {
  41103. return nil
  41104. }
  41105. c.PageToken(x.NextPageToken)
  41106. }
  41107. }
  41108. // method id "compute.healthChecks.patch":
  41109. type HealthChecksPatchCall struct {
  41110. s *Service
  41111. project string
  41112. healthCheck string
  41113. healthcheck *HealthCheck
  41114. urlParams_ gensupport.URLParams
  41115. ctx_ context.Context
  41116. header_ http.Header
  41117. }
  41118. // Patch: Updates a HealthCheck resource in the specified project using
  41119. // the data included in the request. This method supports PATCH
  41120. // semantics and uses the JSON merge patch format and processing rules.
  41121. func (r *HealthChecksService) Patch(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksPatchCall {
  41122. c := &HealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41123. c.project = project
  41124. c.healthCheck = healthCheck
  41125. c.healthcheck = healthcheck
  41126. return c
  41127. }
  41128. // RequestId sets the optional parameter "requestId": An optional
  41129. // request ID to identify requests. Specify a unique request ID so that
  41130. // if you must retry your request, the server will know to ignore the
  41131. // request if it has already been completed.
  41132. //
  41133. // For example, consider a situation where you make an initial request
  41134. // and the request times out. If you make the request again with the
  41135. // same request ID, the server can check if original operation with the
  41136. // same request ID was received, and if so, will ignore the second
  41137. // request. This prevents clients from accidentally creating duplicate
  41138. // commitments.
  41139. //
  41140. // The request ID must be a valid UUID with the exception that zero UUID
  41141. // is not supported (00000000-0000-0000-0000-000000000000).
  41142. func (c *HealthChecksPatchCall) RequestId(requestId string) *HealthChecksPatchCall {
  41143. c.urlParams_.Set("requestId", requestId)
  41144. return c
  41145. }
  41146. // Fields allows partial responses to be retrieved. See
  41147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41148. // for more information.
  41149. func (c *HealthChecksPatchCall) Fields(s ...googleapi.Field) *HealthChecksPatchCall {
  41150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41151. return c
  41152. }
  41153. // Context sets the context to be used in this call's Do method. Any
  41154. // pending HTTP request will be aborted if the provided context is
  41155. // canceled.
  41156. func (c *HealthChecksPatchCall) Context(ctx context.Context) *HealthChecksPatchCall {
  41157. c.ctx_ = ctx
  41158. return c
  41159. }
  41160. // Header returns an http.Header that can be modified by the caller to
  41161. // add HTTP headers to the request.
  41162. func (c *HealthChecksPatchCall) Header() http.Header {
  41163. if c.header_ == nil {
  41164. c.header_ = make(http.Header)
  41165. }
  41166. return c.header_
  41167. }
  41168. func (c *HealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  41169. reqHeaders := make(http.Header)
  41170. for k, v := range c.header_ {
  41171. reqHeaders[k] = v
  41172. }
  41173. reqHeaders.Set("User-Agent", c.s.userAgent())
  41174. var body io.Reader = nil
  41175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  41176. if err != nil {
  41177. return nil, err
  41178. }
  41179. reqHeaders.Set("Content-Type", "application/json")
  41180. c.urlParams_.Set("alt", alt)
  41181. c.urlParams_.Set("prettyPrint", "false")
  41182. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  41183. urls += "?" + c.urlParams_.Encode()
  41184. req, err := http.NewRequest("PATCH", urls, body)
  41185. if err != nil {
  41186. return nil, err
  41187. }
  41188. req.Header = reqHeaders
  41189. googleapi.Expand(req.URL, map[string]string{
  41190. "project": c.project,
  41191. "healthCheck": c.healthCheck,
  41192. })
  41193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41194. }
  41195. // Do executes the "compute.healthChecks.patch" call.
  41196. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41197. // status code is an error. Response headers are in either
  41198. // *Operation.ServerResponse.Header or (if a response was returned at
  41199. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41200. // to check whether the returned error was because
  41201. // http.StatusNotModified was returned.
  41202. func (c *HealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41203. gensupport.SetOptions(c.urlParams_, opts...)
  41204. res, err := c.doRequest("json")
  41205. if res != nil && res.StatusCode == http.StatusNotModified {
  41206. if res.Body != nil {
  41207. res.Body.Close()
  41208. }
  41209. return nil, &googleapi.Error{
  41210. Code: res.StatusCode,
  41211. Header: res.Header,
  41212. }
  41213. }
  41214. if err != nil {
  41215. return nil, err
  41216. }
  41217. defer googleapi.CloseBody(res)
  41218. if err := googleapi.CheckResponse(res); err != nil {
  41219. return nil, err
  41220. }
  41221. ret := &Operation{
  41222. ServerResponse: googleapi.ServerResponse{
  41223. Header: res.Header,
  41224. HTTPStatusCode: res.StatusCode,
  41225. },
  41226. }
  41227. target := &ret
  41228. if err := gensupport.DecodeResponse(target, res); err != nil {
  41229. return nil, err
  41230. }
  41231. return ret, nil
  41232. // {
  41233. // "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.",
  41234. // "httpMethod": "PATCH",
  41235. // "id": "compute.healthChecks.patch",
  41236. // "parameterOrder": [
  41237. // "project",
  41238. // "healthCheck"
  41239. // ],
  41240. // "parameters": {
  41241. // "healthCheck": {
  41242. // "description": "Name of the HealthCheck resource to patch.",
  41243. // "location": "path",
  41244. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41245. // "required": true,
  41246. // "type": "string"
  41247. // },
  41248. // "project": {
  41249. // "description": "Project ID for this request.",
  41250. // "location": "path",
  41251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41252. // "required": true,
  41253. // "type": "string"
  41254. // },
  41255. // "requestId": {
  41256. // "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).",
  41257. // "location": "query",
  41258. // "type": "string"
  41259. // }
  41260. // },
  41261. // "path": "{project}/global/healthChecks/{healthCheck}",
  41262. // "request": {
  41263. // "$ref": "HealthCheck"
  41264. // },
  41265. // "response": {
  41266. // "$ref": "Operation"
  41267. // },
  41268. // "scopes": [
  41269. // "https://www.googleapis.com/auth/cloud-platform",
  41270. // "https://www.googleapis.com/auth/compute"
  41271. // ]
  41272. // }
  41273. }
  41274. // method id "compute.healthChecks.update":
  41275. type HealthChecksUpdateCall struct {
  41276. s *Service
  41277. project string
  41278. healthCheck string
  41279. healthcheck *HealthCheck
  41280. urlParams_ gensupport.URLParams
  41281. ctx_ context.Context
  41282. header_ http.Header
  41283. }
  41284. // Update: Updates a HealthCheck resource in the specified project using
  41285. // the data included in the request.
  41286. func (r *HealthChecksService) Update(project string, healthCheck string, healthcheck *HealthCheck) *HealthChecksUpdateCall {
  41287. c := &HealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41288. c.project = project
  41289. c.healthCheck = healthCheck
  41290. c.healthcheck = healthcheck
  41291. return c
  41292. }
  41293. // RequestId sets the optional parameter "requestId": An optional
  41294. // request ID to identify requests. Specify a unique request ID so that
  41295. // if you must retry your request, the server will know to ignore the
  41296. // request if it has already been completed.
  41297. //
  41298. // For example, consider a situation where you make an initial request
  41299. // and the request times out. If you make the request again with the
  41300. // same request ID, the server can check if original operation with the
  41301. // same request ID was received, and if so, will ignore the second
  41302. // request. This prevents clients from accidentally creating duplicate
  41303. // commitments.
  41304. //
  41305. // The request ID must be a valid UUID with the exception that zero UUID
  41306. // is not supported (00000000-0000-0000-0000-000000000000).
  41307. func (c *HealthChecksUpdateCall) RequestId(requestId string) *HealthChecksUpdateCall {
  41308. c.urlParams_.Set("requestId", requestId)
  41309. return c
  41310. }
  41311. // Fields allows partial responses to be retrieved. See
  41312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41313. // for more information.
  41314. func (c *HealthChecksUpdateCall) Fields(s ...googleapi.Field) *HealthChecksUpdateCall {
  41315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41316. return c
  41317. }
  41318. // Context sets the context to be used in this call's Do method. Any
  41319. // pending HTTP request will be aborted if the provided context is
  41320. // canceled.
  41321. func (c *HealthChecksUpdateCall) Context(ctx context.Context) *HealthChecksUpdateCall {
  41322. c.ctx_ = ctx
  41323. return c
  41324. }
  41325. // Header returns an http.Header that can be modified by the caller to
  41326. // add HTTP headers to the request.
  41327. func (c *HealthChecksUpdateCall) Header() http.Header {
  41328. if c.header_ == nil {
  41329. c.header_ = make(http.Header)
  41330. }
  41331. return c.header_
  41332. }
  41333. func (c *HealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  41334. reqHeaders := make(http.Header)
  41335. for k, v := range c.header_ {
  41336. reqHeaders[k] = v
  41337. }
  41338. reqHeaders.Set("User-Agent", c.s.userAgent())
  41339. var body io.Reader = nil
  41340. body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck)
  41341. if err != nil {
  41342. return nil, err
  41343. }
  41344. reqHeaders.Set("Content-Type", "application/json")
  41345. c.urlParams_.Set("alt", alt)
  41346. c.urlParams_.Set("prettyPrint", "false")
  41347. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/healthChecks/{healthCheck}")
  41348. urls += "?" + c.urlParams_.Encode()
  41349. req, err := http.NewRequest("PUT", urls, body)
  41350. if err != nil {
  41351. return nil, err
  41352. }
  41353. req.Header = reqHeaders
  41354. googleapi.Expand(req.URL, map[string]string{
  41355. "project": c.project,
  41356. "healthCheck": c.healthCheck,
  41357. })
  41358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41359. }
  41360. // Do executes the "compute.healthChecks.update" call.
  41361. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41362. // status code is an error. Response headers are in either
  41363. // *Operation.ServerResponse.Header or (if a response was returned at
  41364. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41365. // to check whether the returned error was because
  41366. // http.StatusNotModified was returned.
  41367. func (c *HealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41368. gensupport.SetOptions(c.urlParams_, opts...)
  41369. res, err := c.doRequest("json")
  41370. if res != nil && res.StatusCode == http.StatusNotModified {
  41371. if res.Body != nil {
  41372. res.Body.Close()
  41373. }
  41374. return nil, &googleapi.Error{
  41375. Code: res.StatusCode,
  41376. Header: res.Header,
  41377. }
  41378. }
  41379. if err != nil {
  41380. return nil, err
  41381. }
  41382. defer googleapi.CloseBody(res)
  41383. if err := googleapi.CheckResponse(res); err != nil {
  41384. return nil, err
  41385. }
  41386. ret := &Operation{
  41387. ServerResponse: googleapi.ServerResponse{
  41388. Header: res.Header,
  41389. HTTPStatusCode: res.StatusCode,
  41390. },
  41391. }
  41392. target := &ret
  41393. if err := gensupport.DecodeResponse(target, res); err != nil {
  41394. return nil, err
  41395. }
  41396. return ret, nil
  41397. // {
  41398. // "description": "Updates a HealthCheck resource in the specified project using the data included in the request.",
  41399. // "httpMethod": "PUT",
  41400. // "id": "compute.healthChecks.update",
  41401. // "parameterOrder": [
  41402. // "project",
  41403. // "healthCheck"
  41404. // ],
  41405. // "parameters": {
  41406. // "healthCheck": {
  41407. // "description": "Name of the HealthCheck resource to update.",
  41408. // "location": "path",
  41409. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41410. // "required": true,
  41411. // "type": "string"
  41412. // },
  41413. // "project": {
  41414. // "description": "Project ID for this request.",
  41415. // "location": "path",
  41416. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41417. // "required": true,
  41418. // "type": "string"
  41419. // },
  41420. // "requestId": {
  41421. // "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).",
  41422. // "location": "query",
  41423. // "type": "string"
  41424. // }
  41425. // },
  41426. // "path": "{project}/global/healthChecks/{healthCheck}",
  41427. // "request": {
  41428. // "$ref": "HealthCheck"
  41429. // },
  41430. // "response": {
  41431. // "$ref": "Operation"
  41432. // },
  41433. // "scopes": [
  41434. // "https://www.googleapis.com/auth/cloud-platform",
  41435. // "https://www.googleapis.com/auth/compute"
  41436. // ]
  41437. // }
  41438. }
  41439. // method id "compute.httpHealthChecks.delete":
  41440. type HttpHealthChecksDeleteCall struct {
  41441. s *Service
  41442. project string
  41443. httpHealthCheck string
  41444. urlParams_ gensupport.URLParams
  41445. ctx_ context.Context
  41446. header_ http.Header
  41447. }
  41448. // Delete: Deletes the specified HttpHealthCheck resource.
  41449. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete
  41450. func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall {
  41451. c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41452. c.project = project
  41453. c.httpHealthCheck = httpHealthCheck
  41454. return c
  41455. }
  41456. // RequestId sets the optional parameter "requestId": An optional
  41457. // request ID to identify requests. Specify a unique request ID so that
  41458. // if you must retry your request, the server will know to ignore the
  41459. // request if it has already been completed.
  41460. //
  41461. // For example, consider a situation where you make an initial request
  41462. // and the request times out. If you make the request again with the
  41463. // same request ID, the server can check if original operation with the
  41464. // same request ID was received, and if so, will ignore the second
  41465. // request. This prevents clients from accidentally creating duplicate
  41466. // commitments.
  41467. //
  41468. // The request ID must be a valid UUID with the exception that zero UUID
  41469. // is not supported (00000000-0000-0000-0000-000000000000).
  41470. func (c *HttpHealthChecksDeleteCall) RequestId(requestId string) *HttpHealthChecksDeleteCall {
  41471. c.urlParams_.Set("requestId", requestId)
  41472. return c
  41473. }
  41474. // Fields allows partial responses to be retrieved. See
  41475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41476. // for more information.
  41477. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall {
  41478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41479. return c
  41480. }
  41481. // Context sets the context to be used in this call's Do method. Any
  41482. // pending HTTP request will be aborted if the provided context is
  41483. // canceled.
  41484. func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall {
  41485. c.ctx_ = ctx
  41486. return c
  41487. }
  41488. // Header returns an http.Header that can be modified by the caller to
  41489. // add HTTP headers to the request.
  41490. func (c *HttpHealthChecksDeleteCall) Header() http.Header {
  41491. if c.header_ == nil {
  41492. c.header_ = make(http.Header)
  41493. }
  41494. return c.header_
  41495. }
  41496. func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  41497. reqHeaders := make(http.Header)
  41498. for k, v := range c.header_ {
  41499. reqHeaders[k] = v
  41500. }
  41501. reqHeaders.Set("User-Agent", c.s.userAgent())
  41502. var body io.Reader = nil
  41503. c.urlParams_.Set("alt", alt)
  41504. c.urlParams_.Set("prettyPrint", "false")
  41505. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  41506. urls += "?" + c.urlParams_.Encode()
  41507. req, err := http.NewRequest("DELETE", urls, body)
  41508. if err != nil {
  41509. return nil, err
  41510. }
  41511. req.Header = reqHeaders
  41512. googleapi.Expand(req.URL, map[string]string{
  41513. "project": c.project,
  41514. "httpHealthCheck": c.httpHealthCheck,
  41515. })
  41516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41517. }
  41518. // Do executes the "compute.httpHealthChecks.delete" call.
  41519. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41520. // status code is an error. Response headers are in either
  41521. // *Operation.ServerResponse.Header or (if a response was returned at
  41522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41523. // to check whether the returned error was because
  41524. // http.StatusNotModified was returned.
  41525. func (c *HttpHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41526. gensupport.SetOptions(c.urlParams_, opts...)
  41527. res, err := c.doRequest("json")
  41528. if res != nil && res.StatusCode == http.StatusNotModified {
  41529. if res.Body != nil {
  41530. res.Body.Close()
  41531. }
  41532. return nil, &googleapi.Error{
  41533. Code: res.StatusCode,
  41534. Header: res.Header,
  41535. }
  41536. }
  41537. if err != nil {
  41538. return nil, err
  41539. }
  41540. defer googleapi.CloseBody(res)
  41541. if err := googleapi.CheckResponse(res); err != nil {
  41542. return nil, err
  41543. }
  41544. ret := &Operation{
  41545. ServerResponse: googleapi.ServerResponse{
  41546. Header: res.Header,
  41547. HTTPStatusCode: res.StatusCode,
  41548. },
  41549. }
  41550. target := &ret
  41551. if err := gensupport.DecodeResponse(target, res); err != nil {
  41552. return nil, err
  41553. }
  41554. return ret, nil
  41555. // {
  41556. // "description": "Deletes the specified HttpHealthCheck resource.",
  41557. // "httpMethod": "DELETE",
  41558. // "id": "compute.httpHealthChecks.delete",
  41559. // "parameterOrder": [
  41560. // "project",
  41561. // "httpHealthCheck"
  41562. // ],
  41563. // "parameters": {
  41564. // "httpHealthCheck": {
  41565. // "description": "Name of the HttpHealthCheck resource to delete.",
  41566. // "location": "path",
  41567. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41568. // "required": true,
  41569. // "type": "string"
  41570. // },
  41571. // "project": {
  41572. // "description": "Project ID for this request.",
  41573. // "location": "path",
  41574. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41575. // "required": true,
  41576. // "type": "string"
  41577. // },
  41578. // "requestId": {
  41579. // "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).",
  41580. // "location": "query",
  41581. // "type": "string"
  41582. // }
  41583. // },
  41584. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  41585. // "response": {
  41586. // "$ref": "Operation"
  41587. // },
  41588. // "scopes": [
  41589. // "https://www.googleapis.com/auth/cloud-platform",
  41590. // "https://www.googleapis.com/auth/compute"
  41591. // ]
  41592. // }
  41593. }
  41594. // method id "compute.httpHealthChecks.get":
  41595. type HttpHealthChecksGetCall struct {
  41596. s *Service
  41597. project string
  41598. httpHealthCheck string
  41599. urlParams_ gensupport.URLParams
  41600. ifNoneMatch_ string
  41601. ctx_ context.Context
  41602. header_ http.Header
  41603. }
  41604. // Get: Returns the specified HttpHealthCheck resource. Gets a list of
  41605. // available HTTP health checks by making a list() request.
  41606. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get
  41607. func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall {
  41608. c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41609. c.project = project
  41610. c.httpHealthCheck = httpHealthCheck
  41611. return c
  41612. }
  41613. // Fields allows partial responses to be retrieved. See
  41614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41615. // for more information.
  41616. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall {
  41617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41618. return c
  41619. }
  41620. // IfNoneMatch sets the optional parameter which makes the operation
  41621. // fail if the object's ETag matches the given value. This is useful for
  41622. // getting updates only after the object has changed since the last
  41623. // request. Use googleapi.IsNotModified to check whether the response
  41624. // error from Do is the result of In-None-Match.
  41625. func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall {
  41626. c.ifNoneMatch_ = entityTag
  41627. return c
  41628. }
  41629. // Context sets the context to be used in this call's Do method. Any
  41630. // pending HTTP request will be aborted if the provided context is
  41631. // canceled.
  41632. func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall {
  41633. c.ctx_ = ctx
  41634. return c
  41635. }
  41636. // Header returns an http.Header that can be modified by the caller to
  41637. // add HTTP headers to the request.
  41638. func (c *HttpHealthChecksGetCall) Header() http.Header {
  41639. if c.header_ == nil {
  41640. c.header_ = make(http.Header)
  41641. }
  41642. return c.header_
  41643. }
  41644. func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  41645. reqHeaders := make(http.Header)
  41646. for k, v := range c.header_ {
  41647. reqHeaders[k] = v
  41648. }
  41649. reqHeaders.Set("User-Agent", c.s.userAgent())
  41650. if c.ifNoneMatch_ != "" {
  41651. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41652. }
  41653. var body io.Reader = nil
  41654. c.urlParams_.Set("alt", alt)
  41655. c.urlParams_.Set("prettyPrint", "false")
  41656. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  41657. urls += "?" + c.urlParams_.Encode()
  41658. req, err := http.NewRequest("GET", urls, body)
  41659. if err != nil {
  41660. return nil, err
  41661. }
  41662. req.Header = reqHeaders
  41663. googleapi.Expand(req.URL, map[string]string{
  41664. "project": c.project,
  41665. "httpHealthCheck": c.httpHealthCheck,
  41666. })
  41667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41668. }
  41669. // Do executes the "compute.httpHealthChecks.get" call.
  41670. // Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx
  41671. // status code is an error. Response headers are in either
  41672. // *HttpHealthCheck.ServerResponse.Header or (if a response was returned
  41673. // at all) in error.(*googleapi.Error).Header. Use
  41674. // googleapi.IsNotModified to check whether the returned error was
  41675. // because http.StatusNotModified was returned.
  41676. func (c *HttpHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheck, error) {
  41677. gensupport.SetOptions(c.urlParams_, opts...)
  41678. res, err := c.doRequest("json")
  41679. if res != nil && res.StatusCode == http.StatusNotModified {
  41680. if res.Body != nil {
  41681. res.Body.Close()
  41682. }
  41683. return nil, &googleapi.Error{
  41684. Code: res.StatusCode,
  41685. Header: res.Header,
  41686. }
  41687. }
  41688. if err != nil {
  41689. return nil, err
  41690. }
  41691. defer googleapi.CloseBody(res)
  41692. if err := googleapi.CheckResponse(res); err != nil {
  41693. return nil, err
  41694. }
  41695. ret := &HttpHealthCheck{
  41696. ServerResponse: googleapi.ServerResponse{
  41697. Header: res.Header,
  41698. HTTPStatusCode: res.StatusCode,
  41699. },
  41700. }
  41701. target := &ret
  41702. if err := gensupport.DecodeResponse(target, res); err != nil {
  41703. return nil, err
  41704. }
  41705. return ret, nil
  41706. // {
  41707. // "description": "Returns the specified HttpHealthCheck resource. Gets a list of available HTTP health checks by making a list() request.",
  41708. // "httpMethod": "GET",
  41709. // "id": "compute.httpHealthChecks.get",
  41710. // "parameterOrder": [
  41711. // "project",
  41712. // "httpHealthCheck"
  41713. // ],
  41714. // "parameters": {
  41715. // "httpHealthCheck": {
  41716. // "description": "Name of the HttpHealthCheck resource to return.",
  41717. // "location": "path",
  41718. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  41719. // "required": true,
  41720. // "type": "string"
  41721. // },
  41722. // "project": {
  41723. // "description": "Project ID for this request.",
  41724. // "location": "path",
  41725. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41726. // "required": true,
  41727. // "type": "string"
  41728. // }
  41729. // },
  41730. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  41731. // "response": {
  41732. // "$ref": "HttpHealthCheck"
  41733. // },
  41734. // "scopes": [
  41735. // "https://www.googleapis.com/auth/cloud-platform",
  41736. // "https://www.googleapis.com/auth/compute",
  41737. // "https://www.googleapis.com/auth/compute.readonly"
  41738. // ]
  41739. // }
  41740. }
  41741. // method id "compute.httpHealthChecks.insert":
  41742. type HttpHealthChecksInsertCall struct {
  41743. s *Service
  41744. project string
  41745. httphealthcheck *HttpHealthCheck
  41746. urlParams_ gensupport.URLParams
  41747. ctx_ context.Context
  41748. header_ http.Header
  41749. }
  41750. // Insert: Creates a HttpHealthCheck resource in the specified project
  41751. // using the data included in the request.
  41752. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert
  41753. func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall {
  41754. c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41755. c.project = project
  41756. c.httphealthcheck = httphealthcheck
  41757. return c
  41758. }
  41759. // RequestId sets the optional parameter "requestId": An optional
  41760. // request ID to identify requests. Specify a unique request ID so that
  41761. // if you must retry your request, the server will know to ignore the
  41762. // request if it has already been completed.
  41763. //
  41764. // For example, consider a situation where you make an initial request
  41765. // and the request times out. If you make the request again with the
  41766. // same request ID, the server can check if original operation with the
  41767. // same request ID was received, and if so, will ignore the second
  41768. // request. This prevents clients from accidentally creating duplicate
  41769. // commitments.
  41770. //
  41771. // The request ID must be a valid UUID with the exception that zero UUID
  41772. // is not supported (00000000-0000-0000-0000-000000000000).
  41773. func (c *HttpHealthChecksInsertCall) RequestId(requestId string) *HttpHealthChecksInsertCall {
  41774. c.urlParams_.Set("requestId", requestId)
  41775. return c
  41776. }
  41777. // Fields allows partial responses to be retrieved. See
  41778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41779. // for more information.
  41780. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall {
  41781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41782. return c
  41783. }
  41784. // Context sets the context to be used in this call's Do method. Any
  41785. // pending HTTP request will be aborted if the provided context is
  41786. // canceled.
  41787. func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall {
  41788. c.ctx_ = ctx
  41789. return c
  41790. }
  41791. // Header returns an http.Header that can be modified by the caller to
  41792. // add HTTP headers to the request.
  41793. func (c *HttpHealthChecksInsertCall) Header() http.Header {
  41794. if c.header_ == nil {
  41795. c.header_ = make(http.Header)
  41796. }
  41797. return c.header_
  41798. }
  41799. func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  41800. reqHeaders := make(http.Header)
  41801. for k, v := range c.header_ {
  41802. reqHeaders[k] = v
  41803. }
  41804. reqHeaders.Set("User-Agent", c.s.userAgent())
  41805. var body io.Reader = nil
  41806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  41807. if err != nil {
  41808. return nil, err
  41809. }
  41810. reqHeaders.Set("Content-Type", "application/json")
  41811. c.urlParams_.Set("alt", alt)
  41812. c.urlParams_.Set("prettyPrint", "false")
  41813. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  41814. urls += "?" + c.urlParams_.Encode()
  41815. req, err := http.NewRequest("POST", urls, body)
  41816. if err != nil {
  41817. return nil, err
  41818. }
  41819. req.Header = reqHeaders
  41820. googleapi.Expand(req.URL, map[string]string{
  41821. "project": c.project,
  41822. })
  41823. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41824. }
  41825. // Do executes the "compute.httpHealthChecks.insert" call.
  41826. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  41827. // status code is an error. Response headers are in either
  41828. // *Operation.ServerResponse.Header or (if a response was returned at
  41829. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41830. // to check whether the returned error was because
  41831. // http.StatusNotModified was returned.
  41832. func (c *HttpHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  41833. gensupport.SetOptions(c.urlParams_, opts...)
  41834. res, err := c.doRequest("json")
  41835. if res != nil && res.StatusCode == http.StatusNotModified {
  41836. if res.Body != nil {
  41837. res.Body.Close()
  41838. }
  41839. return nil, &googleapi.Error{
  41840. Code: res.StatusCode,
  41841. Header: res.Header,
  41842. }
  41843. }
  41844. if err != nil {
  41845. return nil, err
  41846. }
  41847. defer googleapi.CloseBody(res)
  41848. if err := googleapi.CheckResponse(res); err != nil {
  41849. return nil, err
  41850. }
  41851. ret := &Operation{
  41852. ServerResponse: googleapi.ServerResponse{
  41853. Header: res.Header,
  41854. HTTPStatusCode: res.StatusCode,
  41855. },
  41856. }
  41857. target := &ret
  41858. if err := gensupport.DecodeResponse(target, res); err != nil {
  41859. return nil, err
  41860. }
  41861. return ret, nil
  41862. // {
  41863. // "description": "Creates a HttpHealthCheck resource in the specified project using the data included in the request.",
  41864. // "httpMethod": "POST",
  41865. // "id": "compute.httpHealthChecks.insert",
  41866. // "parameterOrder": [
  41867. // "project"
  41868. // ],
  41869. // "parameters": {
  41870. // "project": {
  41871. // "description": "Project ID for this request.",
  41872. // "location": "path",
  41873. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  41874. // "required": true,
  41875. // "type": "string"
  41876. // },
  41877. // "requestId": {
  41878. // "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).",
  41879. // "location": "query",
  41880. // "type": "string"
  41881. // }
  41882. // },
  41883. // "path": "{project}/global/httpHealthChecks",
  41884. // "request": {
  41885. // "$ref": "HttpHealthCheck"
  41886. // },
  41887. // "response": {
  41888. // "$ref": "Operation"
  41889. // },
  41890. // "scopes": [
  41891. // "https://www.googleapis.com/auth/cloud-platform",
  41892. // "https://www.googleapis.com/auth/compute"
  41893. // ]
  41894. // }
  41895. }
  41896. // method id "compute.httpHealthChecks.list":
  41897. type HttpHealthChecksListCall struct {
  41898. s *Service
  41899. project string
  41900. urlParams_ gensupport.URLParams
  41901. ifNoneMatch_ string
  41902. ctx_ context.Context
  41903. header_ http.Header
  41904. }
  41905. // List: Retrieves the list of HttpHealthCheck resources available to
  41906. // the specified project.
  41907. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list
  41908. func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall {
  41909. c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41910. c.project = project
  41911. return c
  41912. }
  41913. // Filter sets the optional parameter "filter": A filter expression that
  41914. // filters resources listed in the response. The expression must specify
  41915. // the field name, a comparison operator, and the value that you want to
  41916. // use for filtering. The value must be a string, a number, or a
  41917. // boolean. The comparison operator must be either =, !=, >, or <.
  41918. //
  41919. // For example, if you are filtering Compute Engine instances, you can
  41920. // exclude instances named example-instance by specifying name !=
  41921. // example-instance.
  41922. //
  41923. // You can also filter nested fields. For example, you could specify
  41924. // scheduling.automaticRestart = false to include instances only if they
  41925. // are not scheduled for automatic restarts. You can use filtering on
  41926. // nested fields to filter based on resource labels.
  41927. //
  41928. // To filter on multiple expressions, provide each separate expression
  41929. // within parentheses. For example, (scheduling.automaticRestart = true)
  41930. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  41931. // AND expression. However, you can include AND and OR expressions
  41932. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  41933. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  41934. // true).
  41935. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall {
  41936. c.urlParams_.Set("filter", filter)
  41937. return c
  41938. }
  41939. // MaxResults sets the optional parameter "maxResults": The maximum
  41940. // number of results per page that should be returned. If the number of
  41941. // available results is larger than maxResults, Compute Engine returns a
  41942. // nextPageToken that can be used to get the next page of results in
  41943. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  41944. // (Default: 500)
  41945. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall {
  41946. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41947. return c
  41948. }
  41949. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  41950. // a certain order. By default, results are returned in alphanumerical
  41951. // order based on the resource name.
  41952. //
  41953. // You can also sort results in descending order based on the creation
  41954. // timestamp using orderBy="creationTimestamp desc". This sorts results
  41955. // based on the creationTimestamp field in reverse chronological order
  41956. // (newest result first). Use this to sort resources like operations so
  41957. // that the newest operation is returned first.
  41958. //
  41959. // Currently, only sorting by name or creationTimestamp desc is
  41960. // supported.
  41961. func (c *HttpHealthChecksListCall) OrderBy(orderBy string) *HttpHealthChecksListCall {
  41962. c.urlParams_.Set("orderBy", orderBy)
  41963. return c
  41964. }
  41965. // PageToken sets the optional parameter "pageToken": Specifies a page
  41966. // token to use. Set pageToken to the nextPageToken returned by a
  41967. // previous list request to get the next page of results.
  41968. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall {
  41969. c.urlParams_.Set("pageToken", pageToken)
  41970. return c
  41971. }
  41972. // Fields allows partial responses to be retrieved. See
  41973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41974. // for more information.
  41975. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall {
  41976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41977. return c
  41978. }
  41979. // IfNoneMatch sets the optional parameter which makes the operation
  41980. // fail if the object's ETag matches the given value. This is useful for
  41981. // getting updates only after the object has changed since the last
  41982. // request. Use googleapi.IsNotModified to check whether the response
  41983. // error from Do is the result of In-None-Match.
  41984. func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall {
  41985. c.ifNoneMatch_ = entityTag
  41986. return c
  41987. }
  41988. // Context sets the context to be used in this call's Do method. Any
  41989. // pending HTTP request will be aborted if the provided context is
  41990. // canceled.
  41991. func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall {
  41992. c.ctx_ = ctx
  41993. return c
  41994. }
  41995. // Header returns an http.Header that can be modified by the caller to
  41996. // add HTTP headers to the request.
  41997. func (c *HttpHealthChecksListCall) Header() http.Header {
  41998. if c.header_ == nil {
  41999. c.header_ = make(http.Header)
  42000. }
  42001. return c.header_
  42002. }
  42003. func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  42004. reqHeaders := make(http.Header)
  42005. for k, v := range c.header_ {
  42006. reqHeaders[k] = v
  42007. }
  42008. reqHeaders.Set("User-Agent", c.s.userAgent())
  42009. if c.ifNoneMatch_ != "" {
  42010. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42011. }
  42012. var body io.Reader = nil
  42013. c.urlParams_.Set("alt", alt)
  42014. c.urlParams_.Set("prettyPrint", "false")
  42015. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks")
  42016. urls += "?" + c.urlParams_.Encode()
  42017. req, err := http.NewRequest("GET", urls, body)
  42018. if err != nil {
  42019. return nil, err
  42020. }
  42021. req.Header = reqHeaders
  42022. googleapi.Expand(req.URL, map[string]string{
  42023. "project": c.project,
  42024. })
  42025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42026. }
  42027. // Do executes the "compute.httpHealthChecks.list" call.
  42028. // Exactly one of *HttpHealthCheckList or error will be non-nil. Any
  42029. // non-2xx status code is an error. Response headers are in either
  42030. // *HttpHealthCheckList.ServerResponse.Header or (if a response was
  42031. // returned at all) in error.(*googleapi.Error).Header. Use
  42032. // googleapi.IsNotModified to check whether the returned error was
  42033. // because http.StatusNotModified was returned.
  42034. func (c *HttpHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpHealthCheckList, error) {
  42035. gensupport.SetOptions(c.urlParams_, opts...)
  42036. res, err := c.doRequest("json")
  42037. if res != nil && res.StatusCode == http.StatusNotModified {
  42038. if res.Body != nil {
  42039. res.Body.Close()
  42040. }
  42041. return nil, &googleapi.Error{
  42042. Code: res.StatusCode,
  42043. Header: res.Header,
  42044. }
  42045. }
  42046. if err != nil {
  42047. return nil, err
  42048. }
  42049. defer googleapi.CloseBody(res)
  42050. if err := googleapi.CheckResponse(res); err != nil {
  42051. return nil, err
  42052. }
  42053. ret := &HttpHealthCheckList{
  42054. ServerResponse: googleapi.ServerResponse{
  42055. Header: res.Header,
  42056. HTTPStatusCode: res.StatusCode,
  42057. },
  42058. }
  42059. target := &ret
  42060. if err := gensupport.DecodeResponse(target, res); err != nil {
  42061. return nil, err
  42062. }
  42063. return ret, nil
  42064. // {
  42065. // "description": "Retrieves the list of HttpHealthCheck resources available to the specified project.",
  42066. // "httpMethod": "GET",
  42067. // "id": "compute.httpHealthChecks.list",
  42068. // "parameterOrder": [
  42069. // "project"
  42070. // ],
  42071. // "parameters": {
  42072. // "filter": {
  42073. // "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).",
  42074. // "location": "query",
  42075. // "type": "string"
  42076. // },
  42077. // "maxResults": {
  42078. // "default": "500",
  42079. // "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)",
  42080. // "format": "uint32",
  42081. // "location": "query",
  42082. // "minimum": "0",
  42083. // "type": "integer"
  42084. // },
  42085. // "orderBy": {
  42086. // "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.",
  42087. // "location": "query",
  42088. // "type": "string"
  42089. // },
  42090. // "pageToken": {
  42091. // "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.",
  42092. // "location": "query",
  42093. // "type": "string"
  42094. // },
  42095. // "project": {
  42096. // "description": "Project ID for this request.",
  42097. // "location": "path",
  42098. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42099. // "required": true,
  42100. // "type": "string"
  42101. // }
  42102. // },
  42103. // "path": "{project}/global/httpHealthChecks",
  42104. // "response": {
  42105. // "$ref": "HttpHealthCheckList"
  42106. // },
  42107. // "scopes": [
  42108. // "https://www.googleapis.com/auth/cloud-platform",
  42109. // "https://www.googleapis.com/auth/compute",
  42110. // "https://www.googleapis.com/auth/compute.readonly"
  42111. // ]
  42112. // }
  42113. }
  42114. // Pages invokes f for each page of results.
  42115. // A non-nil error returned from f will halt the iteration.
  42116. // The provided context supersedes any context provided to the Context method.
  42117. func (c *HttpHealthChecksListCall) Pages(ctx context.Context, f func(*HttpHealthCheckList) error) error {
  42118. c.ctx_ = ctx
  42119. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42120. for {
  42121. x, err := c.Do()
  42122. if err != nil {
  42123. return err
  42124. }
  42125. if err := f(x); err != nil {
  42126. return err
  42127. }
  42128. if x.NextPageToken == "" {
  42129. return nil
  42130. }
  42131. c.PageToken(x.NextPageToken)
  42132. }
  42133. }
  42134. // method id "compute.httpHealthChecks.patch":
  42135. type HttpHealthChecksPatchCall struct {
  42136. s *Service
  42137. project string
  42138. httpHealthCheck string
  42139. httphealthcheck *HttpHealthCheck
  42140. urlParams_ gensupport.URLParams
  42141. ctx_ context.Context
  42142. header_ http.Header
  42143. }
  42144. // Patch: Updates a HttpHealthCheck resource in the specified project
  42145. // using the data included in the request. This method supports PATCH
  42146. // semantics and uses the JSON merge patch format and processing rules.
  42147. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch
  42148. func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall {
  42149. c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42150. c.project = project
  42151. c.httpHealthCheck = httpHealthCheck
  42152. c.httphealthcheck = httphealthcheck
  42153. return c
  42154. }
  42155. // RequestId sets the optional parameter "requestId": An optional
  42156. // request ID to identify requests. Specify a unique request ID so that
  42157. // if you must retry your request, the server will know to ignore the
  42158. // request if it has already been completed.
  42159. //
  42160. // For example, consider a situation where you make an initial request
  42161. // and the request times out. If you make the request again with the
  42162. // same request ID, the server can check if original operation with the
  42163. // same request ID was received, and if so, will ignore the second
  42164. // request. This prevents clients from accidentally creating duplicate
  42165. // commitments.
  42166. //
  42167. // The request ID must be a valid UUID with the exception that zero UUID
  42168. // is not supported (00000000-0000-0000-0000-000000000000).
  42169. func (c *HttpHealthChecksPatchCall) RequestId(requestId string) *HttpHealthChecksPatchCall {
  42170. c.urlParams_.Set("requestId", requestId)
  42171. return c
  42172. }
  42173. // Fields allows partial responses to be retrieved. See
  42174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42175. // for more information.
  42176. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall {
  42177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42178. return c
  42179. }
  42180. // Context sets the context to be used in this call's Do method. Any
  42181. // pending HTTP request will be aborted if the provided context is
  42182. // canceled.
  42183. func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall {
  42184. c.ctx_ = ctx
  42185. return c
  42186. }
  42187. // Header returns an http.Header that can be modified by the caller to
  42188. // add HTTP headers to the request.
  42189. func (c *HttpHealthChecksPatchCall) Header() http.Header {
  42190. if c.header_ == nil {
  42191. c.header_ = make(http.Header)
  42192. }
  42193. return c.header_
  42194. }
  42195. func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  42196. reqHeaders := make(http.Header)
  42197. for k, v := range c.header_ {
  42198. reqHeaders[k] = v
  42199. }
  42200. reqHeaders.Set("User-Agent", c.s.userAgent())
  42201. var body io.Reader = nil
  42202. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  42203. if err != nil {
  42204. return nil, err
  42205. }
  42206. reqHeaders.Set("Content-Type", "application/json")
  42207. c.urlParams_.Set("alt", alt)
  42208. c.urlParams_.Set("prettyPrint", "false")
  42209. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  42210. urls += "?" + c.urlParams_.Encode()
  42211. req, err := http.NewRequest("PATCH", urls, body)
  42212. if err != nil {
  42213. return nil, err
  42214. }
  42215. req.Header = reqHeaders
  42216. googleapi.Expand(req.URL, map[string]string{
  42217. "project": c.project,
  42218. "httpHealthCheck": c.httpHealthCheck,
  42219. })
  42220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42221. }
  42222. // Do executes the "compute.httpHealthChecks.patch" call.
  42223. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42224. // status code is an error. Response headers are in either
  42225. // *Operation.ServerResponse.Header or (if a response was returned at
  42226. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42227. // to check whether the returned error was because
  42228. // http.StatusNotModified was returned.
  42229. func (c *HttpHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42230. gensupport.SetOptions(c.urlParams_, opts...)
  42231. res, err := c.doRequest("json")
  42232. if res != nil && res.StatusCode == http.StatusNotModified {
  42233. if res.Body != nil {
  42234. res.Body.Close()
  42235. }
  42236. return nil, &googleapi.Error{
  42237. Code: res.StatusCode,
  42238. Header: res.Header,
  42239. }
  42240. }
  42241. if err != nil {
  42242. return nil, err
  42243. }
  42244. defer googleapi.CloseBody(res)
  42245. if err := googleapi.CheckResponse(res); err != nil {
  42246. return nil, err
  42247. }
  42248. ret := &Operation{
  42249. ServerResponse: googleapi.ServerResponse{
  42250. Header: res.Header,
  42251. HTTPStatusCode: res.StatusCode,
  42252. },
  42253. }
  42254. target := &ret
  42255. if err := gensupport.DecodeResponse(target, res); err != nil {
  42256. return nil, err
  42257. }
  42258. return ret, nil
  42259. // {
  42260. // "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.",
  42261. // "httpMethod": "PATCH",
  42262. // "id": "compute.httpHealthChecks.patch",
  42263. // "parameterOrder": [
  42264. // "project",
  42265. // "httpHealthCheck"
  42266. // ],
  42267. // "parameters": {
  42268. // "httpHealthCheck": {
  42269. // "description": "Name of the HttpHealthCheck resource to patch.",
  42270. // "location": "path",
  42271. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42272. // "required": true,
  42273. // "type": "string"
  42274. // },
  42275. // "project": {
  42276. // "description": "Project ID for this request.",
  42277. // "location": "path",
  42278. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42279. // "required": true,
  42280. // "type": "string"
  42281. // },
  42282. // "requestId": {
  42283. // "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).",
  42284. // "location": "query",
  42285. // "type": "string"
  42286. // }
  42287. // },
  42288. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  42289. // "request": {
  42290. // "$ref": "HttpHealthCheck"
  42291. // },
  42292. // "response": {
  42293. // "$ref": "Operation"
  42294. // },
  42295. // "scopes": [
  42296. // "https://www.googleapis.com/auth/cloud-platform",
  42297. // "https://www.googleapis.com/auth/compute"
  42298. // ]
  42299. // }
  42300. }
  42301. // method id "compute.httpHealthChecks.update":
  42302. type HttpHealthChecksUpdateCall struct {
  42303. s *Service
  42304. project string
  42305. httpHealthCheck string
  42306. httphealthcheck *HttpHealthCheck
  42307. urlParams_ gensupport.URLParams
  42308. ctx_ context.Context
  42309. header_ http.Header
  42310. }
  42311. // Update: Updates a HttpHealthCheck resource in the specified project
  42312. // using the data included in the request.
  42313. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update
  42314. func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall {
  42315. c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42316. c.project = project
  42317. c.httpHealthCheck = httpHealthCheck
  42318. c.httphealthcheck = httphealthcheck
  42319. return c
  42320. }
  42321. // RequestId sets the optional parameter "requestId": An optional
  42322. // request ID to identify requests. Specify a unique request ID so that
  42323. // if you must retry your request, the server will know to ignore the
  42324. // request if it has already been completed.
  42325. //
  42326. // For example, consider a situation where you make an initial request
  42327. // and the request times out. If you make the request again with the
  42328. // same request ID, the server can check if original operation with the
  42329. // same request ID was received, and if so, will ignore the second
  42330. // request. This prevents clients from accidentally creating duplicate
  42331. // commitments.
  42332. //
  42333. // The request ID must be a valid UUID with the exception that zero UUID
  42334. // is not supported (00000000-0000-0000-0000-000000000000).
  42335. func (c *HttpHealthChecksUpdateCall) RequestId(requestId string) *HttpHealthChecksUpdateCall {
  42336. c.urlParams_.Set("requestId", requestId)
  42337. return c
  42338. }
  42339. // Fields allows partial responses to be retrieved. See
  42340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42341. // for more information.
  42342. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall {
  42343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42344. return c
  42345. }
  42346. // Context sets the context to be used in this call's Do method. Any
  42347. // pending HTTP request will be aborted if the provided context is
  42348. // canceled.
  42349. func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall {
  42350. c.ctx_ = ctx
  42351. return c
  42352. }
  42353. // Header returns an http.Header that can be modified by the caller to
  42354. // add HTTP headers to the request.
  42355. func (c *HttpHealthChecksUpdateCall) Header() http.Header {
  42356. if c.header_ == nil {
  42357. c.header_ = make(http.Header)
  42358. }
  42359. return c.header_
  42360. }
  42361. func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  42362. reqHeaders := make(http.Header)
  42363. for k, v := range c.header_ {
  42364. reqHeaders[k] = v
  42365. }
  42366. reqHeaders.Set("User-Agent", c.s.userAgent())
  42367. var body io.Reader = nil
  42368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck)
  42369. if err != nil {
  42370. return nil, err
  42371. }
  42372. reqHeaders.Set("Content-Type", "application/json")
  42373. c.urlParams_.Set("alt", alt)
  42374. c.urlParams_.Set("prettyPrint", "false")
  42375. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}")
  42376. urls += "?" + c.urlParams_.Encode()
  42377. req, err := http.NewRequest("PUT", urls, body)
  42378. if err != nil {
  42379. return nil, err
  42380. }
  42381. req.Header = reqHeaders
  42382. googleapi.Expand(req.URL, map[string]string{
  42383. "project": c.project,
  42384. "httpHealthCheck": c.httpHealthCheck,
  42385. })
  42386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42387. }
  42388. // Do executes the "compute.httpHealthChecks.update" call.
  42389. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42390. // status code is an error. Response headers are in either
  42391. // *Operation.ServerResponse.Header or (if a response was returned at
  42392. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42393. // to check whether the returned error was because
  42394. // http.StatusNotModified was returned.
  42395. func (c *HttpHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42396. gensupport.SetOptions(c.urlParams_, opts...)
  42397. res, err := c.doRequest("json")
  42398. if res != nil && res.StatusCode == http.StatusNotModified {
  42399. if res.Body != nil {
  42400. res.Body.Close()
  42401. }
  42402. return nil, &googleapi.Error{
  42403. Code: res.StatusCode,
  42404. Header: res.Header,
  42405. }
  42406. }
  42407. if err != nil {
  42408. return nil, err
  42409. }
  42410. defer googleapi.CloseBody(res)
  42411. if err := googleapi.CheckResponse(res); err != nil {
  42412. return nil, err
  42413. }
  42414. ret := &Operation{
  42415. ServerResponse: googleapi.ServerResponse{
  42416. Header: res.Header,
  42417. HTTPStatusCode: res.StatusCode,
  42418. },
  42419. }
  42420. target := &ret
  42421. if err := gensupport.DecodeResponse(target, res); err != nil {
  42422. return nil, err
  42423. }
  42424. return ret, nil
  42425. // {
  42426. // "description": "Updates a HttpHealthCheck resource in the specified project using the data included in the request.",
  42427. // "httpMethod": "PUT",
  42428. // "id": "compute.httpHealthChecks.update",
  42429. // "parameterOrder": [
  42430. // "project",
  42431. // "httpHealthCheck"
  42432. // ],
  42433. // "parameters": {
  42434. // "httpHealthCheck": {
  42435. // "description": "Name of the HttpHealthCheck resource to update.",
  42436. // "location": "path",
  42437. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42438. // "required": true,
  42439. // "type": "string"
  42440. // },
  42441. // "project": {
  42442. // "description": "Project ID for this request.",
  42443. // "location": "path",
  42444. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42445. // "required": true,
  42446. // "type": "string"
  42447. // },
  42448. // "requestId": {
  42449. // "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).",
  42450. // "location": "query",
  42451. // "type": "string"
  42452. // }
  42453. // },
  42454. // "path": "{project}/global/httpHealthChecks/{httpHealthCheck}",
  42455. // "request": {
  42456. // "$ref": "HttpHealthCheck"
  42457. // },
  42458. // "response": {
  42459. // "$ref": "Operation"
  42460. // },
  42461. // "scopes": [
  42462. // "https://www.googleapis.com/auth/cloud-platform",
  42463. // "https://www.googleapis.com/auth/compute"
  42464. // ]
  42465. // }
  42466. }
  42467. // method id "compute.httpsHealthChecks.delete":
  42468. type HttpsHealthChecksDeleteCall struct {
  42469. s *Service
  42470. project string
  42471. httpsHealthCheck string
  42472. urlParams_ gensupport.URLParams
  42473. ctx_ context.Context
  42474. header_ http.Header
  42475. }
  42476. // Delete: Deletes the specified HttpsHealthCheck resource.
  42477. func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall {
  42478. c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42479. c.project = project
  42480. c.httpsHealthCheck = httpsHealthCheck
  42481. return c
  42482. }
  42483. // RequestId sets the optional parameter "requestId": An optional
  42484. // request ID to identify requests. Specify a unique request ID so that
  42485. // if you must retry your request, the server will know to ignore the
  42486. // request if it has already been completed.
  42487. //
  42488. // For example, consider a situation where you make an initial request
  42489. // and the request times out. If you make the request again with the
  42490. // same request ID, the server can check if original operation with the
  42491. // same request ID was received, and if so, will ignore the second
  42492. // request. This prevents clients from accidentally creating duplicate
  42493. // commitments.
  42494. //
  42495. // The request ID must be a valid UUID with the exception that zero UUID
  42496. // is not supported (00000000-0000-0000-0000-000000000000).
  42497. func (c *HttpsHealthChecksDeleteCall) RequestId(requestId string) *HttpsHealthChecksDeleteCall {
  42498. c.urlParams_.Set("requestId", requestId)
  42499. return c
  42500. }
  42501. // Fields allows partial responses to be retrieved. See
  42502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42503. // for more information.
  42504. func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall {
  42505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42506. return c
  42507. }
  42508. // Context sets the context to be used in this call's Do method. Any
  42509. // pending HTTP request will be aborted if the provided context is
  42510. // canceled.
  42511. func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall {
  42512. c.ctx_ = ctx
  42513. return c
  42514. }
  42515. // Header returns an http.Header that can be modified by the caller to
  42516. // add HTTP headers to the request.
  42517. func (c *HttpsHealthChecksDeleteCall) Header() http.Header {
  42518. if c.header_ == nil {
  42519. c.header_ = make(http.Header)
  42520. }
  42521. return c.header_
  42522. }
  42523. func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) {
  42524. reqHeaders := make(http.Header)
  42525. for k, v := range c.header_ {
  42526. reqHeaders[k] = v
  42527. }
  42528. reqHeaders.Set("User-Agent", c.s.userAgent())
  42529. var body io.Reader = nil
  42530. c.urlParams_.Set("alt", alt)
  42531. c.urlParams_.Set("prettyPrint", "false")
  42532. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  42533. urls += "?" + c.urlParams_.Encode()
  42534. req, err := http.NewRequest("DELETE", urls, body)
  42535. if err != nil {
  42536. return nil, err
  42537. }
  42538. req.Header = reqHeaders
  42539. googleapi.Expand(req.URL, map[string]string{
  42540. "project": c.project,
  42541. "httpsHealthCheck": c.httpsHealthCheck,
  42542. })
  42543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42544. }
  42545. // Do executes the "compute.httpsHealthChecks.delete" call.
  42546. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42547. // status code is an error. Response headers are in either
  42548. // *Operation.ServerResponse.Header or (if a response was returned at
  42549. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42550. // to check whether the returned error was because
  42551. // http.StatusNotModified was returned.
  42552. func (c *HttpsHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42553. gensupport.SetOptions(c.urlParams_, opts...)
  42554. res, err := c.doRequest("json")
  42555. if res != nil && res.StatusCode == http.StatusNotModified {
  42556. if res.Body != nil {
  42557. res.Body.Close()
  42558. }
  42559. return nil, &googleapi.Error{
  42560. Code: res.StatusCode,
  42561. Header: res.Header,
  42562. }
  42563. }
  42564. if err != nil {
  42565. return nil, err
  42566. }
  42567. defer googleapi.CloseBody(res)
  42568. if err := googleapi.CheckResponse(res); err != nil {
  42569. return nil, err
  42570. }
  42571. ret := &Operation{
  42572. ServerResponse: googleapi.ServerResponse{
  42573. Header: res.Header,
  42574. HTTPStatusCode: res.StatusCode,
  42575. },
  42576. }
  42577. target := &ret
  42578. if err := gensupport.DecodeResponse(target, res); err != nil {
  42579. return nil, err
  42580. }
  42581. return ret, nil
  42582. // {
  42583. // "description": "Deletes the specified HttpsHealthCheck resource.",
  42584. // "httpMethod": "DELETE",
  42585. // "id": "compute.httpsHealthChecks.delete",
  42586. // "parameterOrder": [
  42587. // "project",
  42588. // "httpsHealthCheck"
  42589. // ],
  42590. // "parameters": {
  42591. // "httpsHealthCheck": {
  42592. // "description": "Name of the HttpsHealthCheck resource to delete.",
  42593. // "location": "path",
  42594. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42595. // "required": true,
  42596. // "type": "string"
  42597. // },
  42598. // "project": {
  42599. // "description": "Project ID for this request.",
  42600. // "location": "path",
  42601. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42602. // "required": true,
  42603. // "type": "string"
  42604. // },
  42605. // "requestId": {
  42606. // "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).",
  42607. // "location": "query",
  42608. // "type": "string"
  42609. // }
  42610. // },
  42611. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  42612. // "response": {
  42613. // "$ref": "Operation"
  42614. // },
  42615. // "scopes": [
  42616. // "https://www.googleapis.com/auth/cloud-platform",
  42617. // "https://www.googleapis.com/auth/compute"
  42618. // ]
  42619. // }
  42620. }
  42621. // method id "compute.httpsHealthChecks.get":
  42622. type HttpsHealthChecksGetCall struct {
  42623. s *Service
  42624. project string
  42625. httpsHealthCheck string
  42626. urlParams_ gensupport.URLParams
  42627. ifNoneMatch_ string
  42628. ctx_ context.Context
  42629. header_ http.Header
  42630. }
  42631. // Get: Returns the specified HttpsHealthCheck resource. Gets a list of
  42632. // available HTTPS health checks by making a list() request.
  42633. func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall {
  42634. c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42635. c.project = project
  42636. c.httpsHealthCheck = httpsHealthCheck
  42637. return c
  42638. }
  42639. // Fields allows partial responses to be retrieved. See
  42640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42641. // for more information.
  42642. func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall {
  42643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42644. return c
  42645. }
  42646. // IfNoneMatch sets the optional parameter which makes the operation
  42647. // fail if the object's ETag matches the given value. This is useful for
  42648. // getting updates only after the object has changed since the last
  42649. // request. Use googleapi.IsNotModified to check whether the response
  42650. // error from Do is the result of In-None-Match.
  42651. func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall {
  42652. c.ifNoneMatch_ = entityTag
  42653. return c
  42654. }
  42655. // Context sets the context to be used in this call's Do method. Any
  42656. // pending HTTP request will be aborted if the provided context is
  42657. // canceled.
  42658. func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall {
  42659. c.ctx_ = ctx
  42660. return c
  42661. }
  42662. // Header returns an http.Header that can be modified by the caller to
  42663. // add HTTP headers to the request.
  42664. func (c *HttpsHealthChecksGetCall) Header() http.Header {
  42665. if c.header_ == nil {
  42666. c.header_ = make(http.Header)
  42667. }
  42668. return c.header_
  42669. }
  42670. func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) {
  42671. reqHeaders := make(http.Header)
  42672. for k, v := range c.header_ {
  42673. reqHeaders[k] = v
  42674. }
  42675. reqHeaders.Set("User-Agent", c.s.userAgent())
  42676. if c.ifNoneMatch_ != "" {
  42677. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42678. }
  42679. var body io.Reader = nil
  42680. c.urlParams_.Set("alt", alt)
  42681. c.urlParams_.Set("prettyPrint", "false")
  42682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  42683. urls += "?" + c.urlParams_.Encode()
  42684. req, err := http.NewRequest("GET", urls, body)
  42685. if err != nil {
  42686. return nil, err
  42687. }
  42688. req.Header = reqHeaders
  42689. googleapi.Expand(req.URL, map[string]string{
  42690. "project": c.project,
  42691. "httpsHealthCheck": c.httpsHealthCheck,
  42692. })
  42693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42694. }
  42695. // Do executes the "compute.httpsHealthChecks.get" call.
  42696. // Exactly one of *HttpsHealthCheck or error will be non-nil. Any
  42697. // non-2xx status code is an error. Response headers are in either
  42698. // *HttpsHealthCheck.ServerResponse.Header or (if a response was
  42699. // returned at all) in error.(*googleapi.Error).Header. Use
  42700. // googleapi.IsNotModified to check whether the returned error was
  42701. // because http.StatusNotModified was returned.
  42702. func (c *HttpsHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheck, error) {
  42703. gensupport.SetOptions(c.urlParams_, opts...)
  42704. res, err := c.doRequest("json")
  42705. if res != nil && res.StatusCode == http.StatusNotModified {
  42706. if res.Body != nil {
  42707. res.Body.Close()
  42708. }
  42709. return nil, &googleapi.Error{
  42710. Code: res.StatusCode,
  42711. Header: res.Header,
  42712. }
  42713. }
  42714. if err != nil {
  42715. return nil, err
  42716. }
  42717. defer googleapi.CloseBody(res)
  42718. if err := googleapi.CheckResponse(res); err != nil {
  42719. return nil, err
  42720. }
  42721. ret := &HttpsHealthCheck{
  42722. ServerResponse: googleapi.ServerResponse{
  42723. Header: res.Header,
  42724. HTTPStatusCode: res.StatusCode,
  42725. },
  42726. }
  42727. target := &ret
  42728. if err := gensupport.DecodeResponse(target, res); err != nil {
  42729. return nil, err
  42730. }
  42731. return ret, nil
  42732. // {
  42733. // "description": "Returns the specified HttpsHealthCheck resource. Gets a list of available HTTPS health checks by making a list() request.",
  42734. // "httpMethod": "GET",
  42735. // "id": "compute.httpsHealthChecks.get",
  42736. // "parameterOrder": [
  42737. // "project",
  42738. // "httpsHealthCheck"
  42739. // ],
  42740. // "parameters": {
  42741. // "httpsHealthCheck": {
  42742. // "description": "Name of the HttpsHealthCheck resource to return.",
  42743. // "location": "path",
  42744. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  42745. // "required": true,
  42746. // "type": "string"
  42747. // },
  42748. // "project": {
  42749. // "description": "Project ID for this request.",
  42750. // "location": "path",
  42751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42752. // "required": true,
  42753. // "type": "string"
  42754. // }
  42755. // },
  42756. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  42757. // "response": {
  42758. // "$ref": "HttpsHealthCheck"
  42759. // },
  42760. // "scopes": [
  42761. // "https://www.googleapis.com/auth/cloud-platform",
  42762. // "https://www.googleapis.com/auth/compute",
  42763. // "https://www.googleapis.com/auth/compute.readonly"
  42764. // ]
  42765. // }
  42766. }
  42767. // method id "compute.httpsHealthChecks.insert":
  42768. type HttpsHealthChecksInsertCall struct {
  42769. s *Service
  42770. project string
  42771. httpshealthcheck *HttpsHealthCheck
  42772. urlParams_ gensupport.URLParams
  42773. ctx_ context.Context
  42774. header_ http.Header
  42775. }
  42776. // Insert: Creates a HttpsHealthCheck resource in the specified project
  42777. // using the data included in the request.
  42778. func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall {
  42779. c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42780. c.project = project
  42781. c.httpshealthcheck = httpshealthcheck
  42782. return c
  42783. }
  42784. // RequestId sets the optional parameter "requestId": An optional
  42785. // request ID to identify requests. Specify a unique request ID so that
  42786. // if you must retry your request, the server will know to ignore the
  42787. // request if it has already been completed.
  42788. //
  42789. // For example, consider a situation where you make an initial request
  42790. // and the request times out. If you make the request again with the
  42791. // same request ID, the server can check if original operation with the
  42792. // same request ID was received, and if so, will ignore the second
  42793. // request. This prevents clients from accidentally creating duplicate
  42794. // commitments.
  42795. //
  42796. // The request ID must be a valid UUID with the exception that zero UUID
  42797. // is not supported (00000000-0000-0000-0000-000000000000).
  42798. func (c *HttpsHealthChecksInsertCall) RequestId(requestId string) *HttpsHealthChecksInsertCall {
  42799. c.urlParams_.Set("requestId", requestId)
  42800. return c
  42801. }
  42802. // Fields allows partial responses to be retrieved. See
  42803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42804. // for more information.
  42805. func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall {
  42806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42807. return c
  42808. }
  42809. // Context sets the context to be used in this call's Do method. Any
  42810. // pending HTTP request will be aborted if the provided context is
  42811. // canceled.
  42812. func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall {
  42813. c.ctx_ = ctx
  42814. return c
  42815. }
  42816. // Header returns an http.Header that can be modified by the caller to
  42817. // add HTTP headers to the request.
  42818. func (c *HttpsHealthChecksInsertCall) Header() http.Header {
  42819. if c.header_ == nil {
  42820. c.header_ = make(http.Header)
  42821. }
  42822. return c.header_
  42823. }
  42824. func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) {
  42825. reqHeaders := make(http.Header)
  42826. for k, v := range c.header_ {
  42827. reqHeaders[k] = v
  42828. }
  42829. reqHeaders.Set("User-Agent", c.s.userAgent())
  42830. var body io.Reader = nil
  42831. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  42832. if err != nil {
  42833. return nil, err
  42834. }
  42835. reqHeaders.Set("Content-Type", "application/json")
  42836. c.urlParams_.Set("alt", alt)
  42837. c.urlParams_.Set("prettyPrint", "false")
  42838. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  42839. urls += "?" + c.urlParams_.Encode()
  42840. req, err := http.NewRequest("POST", urls, body)
  42841. if err != nil {
  42842. return nil, err
  42843. }
  42844. req.Header = reqHeaders
  42845. googleapi.Expand(req.URL, map[string]string{
  42846. "project": c.project,
  42847. })
  42848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42849. }
  42850. // Do executes the "compute.httpsHealthChecks.insert" call.
  42851. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  42852. // status code is an error. Response headers are in either
  42853. // *Operation.ServerResponse.Header or (if a response was returned at
  42854. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42855. // to check whether the returned error was because
  42856. // http.StatusNotModified was returned.
  42857. func (c *HttpsHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  42858. gensupport.SetOptions(c.urlParams_, opts...)
  42859. res, err := c.doRequest("json")
  42860. if res != nil && res.StatusCode == http.StatusNotModified {
  42861. if res.Body != nil {
  42862. res.Body.Close()
  42863. }
  42864. return nil, &googleapi.Error{
  42865. Code: res.StatusCode,
  42866. Header: res.Header,
  42867. }
  42868. }
  42869. if err != nil {
  42870. return nil, err
  42871. }
  42872. defer googleapi.CloseBody(res)
  42873. if err := googleapi.CheckResponse(res); err != nil {
  42874. return nil, err
  42875. }
  42876. ret := &Operation{
  42877. ServerResponse: googleapi.ServerResponse{
  42878. Header: res.Header,
  42879. HTTPStatusCode: res.StatusCode,
  42880. },
  42881. }
  42882. target := &ret
  42883. if err := gensupport.DecodeResponse(target, res); err != nil {
  42884. return nil, err
  42885. }
  42886. return ret, nil
  42887. // {
  42888. // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  42889. // "httpMethod": "POST",
  42890. // "id": "compute.httpsHealthChecks.insert",
  42891. // "parameterOrder": [
  42892. // "project"
  42893. // ],
  42894. // "parameters": {
  42895. // "project": {
  42896. // "description": "Project ID for this request.",
  42897. // "location": "path",
  42898. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  42899. // "required": true,
  42900. // "type": "string"
  42901. // },
  42902. // "requestId": {
  42903. // "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).",
  42904. // "location": "query",
  42905. // "type": "string"
  42906. // }
  42907. // },
  42908. // "path": "{project}/global/httpsHealthChecks",
  42909. // "request": {
  42910. // "$ref": "HttpsHealthCheck"
  42911. // },
  42912. // "response": {
  42913. // "$ref": "Operation"
  42914. // },
  42915. // "scopes": [
  42916. // "https://www.googleapis.com/auth/cloud-platform",
  42917. // "https://www.googleapis.com/auth/compute"
  42918. // ]
  42919. // }
  42920. }
  42921. // method id "compute.httpsHealthChecks.list":
  42922. type HttpsHealthChecksListCall struct {
  42923. s *Service
  42924. project string
  42925. urlParams_ gensupport.URLParams
  42926. ifNoneMatch_ string
  42927. ctx_ context.Context
  42928. header_ http.Header
  42929. }
  42930. // List: Retrieves the list of HttpsHealthCheck resources available to
  42931. // the specified project.
  42932. func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall {
  42933. c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42934. c.project = project
  42935. return c
  42936. }
  42937. // Filter sets the optional parameter "filter": A filter expression that
  42938. // filters resources listed in the response. The expression must specify
  42939. // the field name, a comparison operator, and the value that you want to
  42940. // use for filtering. The value must be a string, a number, or a
  42941. // boolean. The comparison operator must be either =, !=, >, or <.
  42942. //
  42943. // For example, if you are filtering Compute Engine instances, you can
  42944. // exclude instances named example-instance by specifying name !=
  42945. // example-instance.
  42946. //
  42947. // You can also filter nested fields. For example, you could specify
  42948. // scheduling.automaticRestart = false to include instances only if they
  42949. // are not scheduled for automatic restarts. You can use filtering on
  42950. // nested fields to filter based on resource labels.
  42951. //
  42952. // To filter on multiple expressions, provide each separate expression
  42953. // within parentheses. For example, (scheduling.automaticRestart = true)
  42954. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  42955. // AND expression. However, you can include AND and OR expressions
  42956. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  42957. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  42958. // true).
  42959. func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall {
  42960. c.urlParams_.Set("filter", filter)
  42961. return c
  42962. }
  42963. // MaxResults sets the optional parameter "maxResults": The maximum
  42964. // number of results per page that should be returned. If the number of
  42965. // available results is larger than maxResults, Compute Engine returns a
  42966. // nextPageToken that can be used to get the next page of results in
  42967. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  42968. // (Default: 500)
  42969. func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall {
  42970. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42971. return c
  42972. }
  42973. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  42974. // a certain order. By default, results are returned in alphanumerical
  42975. // order based on the resource name.
  42976. //
  42977. // You can also sort results in descending order based on the creation
  42978. // timestamp using orderBy="creationTimestamp desc". This sorts results
  42979. // based on the creationTimestamp field in reverse chronological order
  42980. // (newest result first). Use this to sort resources like operations so
  42981. // that the newest operation is returned first.
  42982. //
  42983. // Currently, only sorting by name or creationTimestamp desc is
  42984. // supported.
  42985. func (c *HttpsHealthChecksListCall) OrderBy(orderBy string) *HttpsHealthChecksListCall {
  42986. c.urlParams_.Set("orderBy", orderBy)
  42987. return c
  42988. }
  42989. // PageToken sets the optional parameter "pageToken": Specifies a page
  42990. // token to use. Set pageToken to the nextPageToken returned by a
  42991. // previous list request to get the next page of results.
  42992. func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall {
  42993. c.urlParams_.Set("pageToken", pageToken)
  42994. return c
  42995. }
  42996. // Fields allows partial responses to be retrieved. See
  42997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42998. // for more information.
  42999. func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall {
  43000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43001. return c
  43002. }
  43003. // IfNoneMatch sets the optional parameter which makes the operation
  43004. // fail if the object's ETag matches the given value. This is useful for
  43005. // getting updates only after the object has changed since the last
  43006. // request. Use googleapi.IsNotModified to check whether the response
  43007. // error from Do is the result of In-None-Match.
  43008. func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall {
  43009. c.ifNoneMatch_ = entityTag
  43010. return c
  43011. }
  43012. // Context sets the context to be used in this call's Do method. Any
  43013. // pending HTTP request will be aborted if the provided context is
  43014. // canceled.
  43015. func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall {
  43016. c.ctx_ = ctx
  43017. return c
  43018. }
  43019. // Header returns an http.Header that can be modified by the caller to
  43020. // add HTTP headers to the request.
  43021. func (c *HttpsHealthChecksListCall) Header() http.Header {
  43022. if c.header_ == nil {
  43023. c.header_ = make(http.Header)
  43024. }
  43025. return c.header_
  43026. }
  43027. func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) {
  43028. reqHeaders := make(http.Header)
  43029. for k, v := range c.header_ {
  43030. reqHeaders[k] = v
  43031. }
  43032. reqHeaders.Set("User-Agent", c.s.userAgent())
  43033. if c.ifNoneMatch_ != "" {
  43034. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43035. }
  43036. var body io.Reader = nil
  43037. c.urlParams_.Set("alt", alt)
  43038. c.urlParams_.Set("prettyPrint", "false")
  43039. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks")
  43040. urls += "?" + c.urlParams_.Encode()
  43041. req, err := http.NewRequest("GET", urls, body)
  43042. if err != nil {
  43043. return nil, err
  43044. }
  43045. req.Header = reqHeaders
  43046. googleapi.Expand(req.URL, map[string]string{
  43047. "project": c.project,
  43048. })
  43049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43050. }
  43051. // Do executes the "compute.httpsHealthChecks.list" call.
  43052. // Exactly one of *HttpsHealthCheckList or error will be non-nil. Any
  43053. // non-2xx status code is an error. Response headers are in either
  43054. // *HttpsHealthCheckList.ServerResponse.Header or (if a response was
  43055. // returned at all) in error.(*googleapi.Error).Header. Use
  43056. // googleapi.IsNotModified to check whether the returned error was
  43057. // because http.StatusNotModified was returned.
  43058. func (c *HttpsHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HttpsHealthCheckList, error) {
  43059. gensupport.SetOptions(c.urlParams_, opts...)
  43060. res, err := c.doRequest("json")
  43061. if res != nil && res.StatusCode == http.StatusNotModified {
  43062. if res.Body != nil {
  43063. res.Body.Close()
  43064. }
  43065. return nil, &googleapi.Error{
  43066. Code: res.StatusCode,
  43067. Header: res.Header,
  43068. }
  43069. }
  43070. if err != nil {
  43071. return nil, err
  43072. }
  43073. defer googleapi.CloseBody(res)
  43074. if err := googleapi.CheckResponse(res); err != nil {
  43075. return nil, err
  43076. }
  43077. ret := &HttpsHealthCheckList{
  43078. ServerResponse: googleapi.ServerResponse{
  43079. Header: res.Header,
  43080. HTTPStatusCode: res.StatusCode,
  43081. },
  43082. }
  43083. target := &ret
  43084. if err := gensupport.DecodeResponse(target, res); err != nil {
  43085. return nil, err
  43086. }
  43087. return ret, nil
  43088. // {
  43089. // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.",
  43090. // "httpMethod": "GET",
  43091. // "id": "compute.httpsHealthChecks.list",
  43092. // "parameterOrder": [
  43093. // "project"
  43094. // ],
  43095. // "parameters": {
  43096. // "filter": {
  43097. // "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).",
  43098. // "location": "query",
  43099. // "type": "string"
  43100. // },
  43101. // "maxResults": {
  43102. // "default": "500",
  43103. // "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)",
  43104. // "format": "uint32",
  43105. // "location": "query",
  43106. // "minimum": "0",
  43107. // "type": "integer"
  43108. // },
  43109. // "orderBy": {
  43110. // "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.",
  43111. // "location": "query",
  43112. // "type": "string"
  43113. // },
  43114. // "pageToken": {
  43115. // "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.",
  43116. // "location": "query",
  43117. // "type": "string"
  43118. // },
  43119. // "project": {
  43120. // "description": "Project ID for this request.",
  43121. // "location": "path",
  43122. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43123. // "required": true,
  43124. // "type": "string"
  43125. // }
  43126. // },
  43127. // "path": "{project}/global/httpsHealthChecks",
  43128. // "response": {
  43129. // "$ref": "HttpsHealthCheckList"
  43130. // },
  43131. // "scopes": [
  43132. // "https://www.googleapis.com/auth/cloud-platform",
  43133. // "https://www.googleapis.com/auth/compute",
  43134. // "https://www.googleapis.com/auth/compute.readonly"
  43135. // ]
  43136. // }
  43137. }
  43138. // Pages invokes f for each page of results.
  43139. // A non-nil error returned from f will halt the iteration.
  43140. // The provided context supersedes any context provided to the Context method.
  43141. func (c *HttpsHealthChecksListCall) Pages(ctx context.Context, f func(*HttpsHealthCheckList) error) error {
  43142. c.ctx_ = ctx
  43143. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43144. for {
  43145. x, err := c.Do()
  43146. if err != nil {
  43147. return err
  43148. }
  43149. if err := f(x); err != nil {
  43150. return err
  43151. }
  43152. if x.NextPageToken == "" {
  43153. return nil
  43154. }
  43155. c.PageToken(x.NextPageToken)
  43156. }
  43157. }
  43158. // method id "compute.httpsHealthChecks.patch":
  43159. type HttpsHealthChecksPatchCall struct {
  43160. s *Service
  43161. project string
  43162. httpsHealthCheck string
  43163. httpshealthcheck *HttpsHealthCheck
  43164. urlParams_ gensupport.URLParams
  43165. ctx_ context.Context
  43166. header_ http.Header
  43167. }
  43168. // Patch: Updates a HttpsHealthCheck resource in the specified project
  43169. // using the data included in the request. This method supports PATCH
  43170. // semantics and uses the JSON merge patch format and processing rules.
  43171. func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall {
  43172. c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43173. c.project = project
  43174. c.httpsHealthCheck = httpsHealthCheck
  43175. c.httpshealthcheck = httpshealthcheck
  43176. return c
  43177. }
  43178. // RequestId sets the optional parameter "requestId": An optional
  43179. // request ID to identify requests. Specify a unique request ID so that
  43180. // if you must retry your request, the server will know to ignore the
  43181. // request if it has already been completed.
  43182. //
  43183. // For example, consider a situation where you make an initial request
  43184. // and the request times out. If you make the request again with the
  43185. // same request ID, the server can check if original operation with the
  43186. // same request ID was received, and if so, will ignore the second
  43187. // request. This prevents clients from accidentally creating duplicate
  43188. // commitments.
  43189. //
  43190. // The request ID must be a valid UUID with the exception that zero UUID
  43191. // is not supported (00000000-0000-0000-0000-000000000000).
  43192. func (c *HttpsHealthChecksPatchCall) RequestId(requestId string) *HttpsHealthChecksPatchCall {
  43193. c.urlParams_.Set("requestId", requestId)
  43194. return c
  43195. }
  43196. // Fields allows partial responses to be retrieved. See
  43197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43198. // for more information.
  43199. func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall {
  43200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43201. return c
  43202. }
  43203. // Context sets the context to be used in this call's Do method. Any
  43204. // pending HTTP request will be aborted if the provided context is
  43205. // canceled.
  43206. func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall {
  43207. c.ctx_ = ctx
  43208. return c
  43209. }
  43210. // Header returns an http.Header that can be modified by the caller to
  43211. // add HTTP headers to the request.
  43212. func (c *HttpsHealthChecksPatchCall) Header() http.Header {
  43213. if c.header_ == nil {
  43214. c.header_ = make(http.Header)
  43215. }
  43216. return c.header_
  43217. }
  43218. func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) {
  43219. reqHeaders := make(http.Header)
  43220. for k, v := range c.header_ {
  43221. reqHeaders[k] = v
  43222. }
  43223. reqHeaders.Set("User-Agent", c.s.userAgent())
  43224. var body io.Reader = nil
  43225. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  43226. if err != nil {
  43227. return nil, err
  43228. }
  43229. reqHeaders.Set("Content-Type", "application/json")
  43230. c.urlParams_.Set("alt", alt)
  43231. c.urlParams_.Set("prettyPrint", "false")
  43232. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  43233. urls += "?" + c.urlParams_.Encode()
  43234. req, err := http.NewRequest("PATCH", urls, body)
  43235. if err != nil {
  43236. return nil, err
  43237. }
  43238. req.Header = reqHeaders
  43239. googleapi.Expand(req.URL, map[string]string{
  43240. "project": c.project,
  43241. "httpsHealthCheck": c.httpsHealthCheck,
  43242. })
  43243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43244. }
  43245. // Do executes the "compute.httpsHealthChecks.patch" call.
  43246. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43247. // status code is an error. Response headers are in either
  43248. // *Operation.ServerResponse.Header or (if a response was returned at
  43249. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43250. // to check whether the returned error was because
  43251. // http.StatusNotModified was returned.
  43252. func (c *HttpsHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43253. gensupport.SetOptions(c.urlParams_, opts...)
  43254. res, err := c.doRequest("json")
  43255. if res != nil && res.StatusCode == http.StatusNotModified {
  43256. if res.Body != nil {
  43257. res.Body.Close()
  43258. }
  43259. return nil, &googleapi.Error{
  43260. Code: res.StatusCode,
  43261. Header: res.Header,
  43262. }
  43263. }
  43264. if err != nil {
  43265. return nil, err
  43266. }
  43267. defer googleapi.CloseBody(res)
  43268. if err := googleapi.CheckResponse(res); err != nil {
  43269. return nil, err
  43270. }
  43271. ret := &Operation{
  43272. ServerResponse: googleapi.ServerResponse{
  43273. Header: res.Header,
  43274. HTTPStatusCode: res.StatusCode,
  43275. },
  43276. }
  43277. target := &ret
  43278. if err := gensupport.DecodeResponse(target, res); err != nil {
  43279. return nil, err
  43280. }
  43281. return ret, nil
  43282. // {
  43283. // "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.",
  43284. // "httpMethod": "PATCH",
  43285. // "id": "compute.httpsHealthChecks.patch",
  43286. // "parameterOrder": [
  43287. // "project",
  43288. // "httpsHealthCheck"
  43289. // ],
  43290. // "parameters": {
  43291. // "httpsHealthCheck": {
  43292. // "description": "Name of the HttpsHealthCheck resource to patch.",
  43293. // "location": "path",
  43294. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43295. // "required": true,
  43296. // "type": "string"
  43297. // },
  43298. // "project": {
  43299. // "description": "Project ID for this request.",
  43300. // "location": "path",
  43301. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43302. // "required": true,
  43303. // "type": "string"
  43304. // },
  43305. // "requestId": {
  43306. // "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).",
  43307. // "location": "query",
  43308. // "type": "string"
  43309. // }
  43310. // },
  43311. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  43312. // "request": {
  43313. // "$ref": "HttpsHealthCheck"
  43314. // },
  43315. // "response": {
  43316. // "$ref": "Operation"
  43317. // },
  43318. // "scopes": [
  43319. // "https://www.googleapis.com/auth/cloud-platform",
  43320. // "https://www.googleapis.com/auth/compute"
  43321. // ]
  43322. // }
  43323. }
  43324. // method id "compute.httpsHealthChecks.update":
  43325. type HttpsHealthChecksUpdateCall struct {
  43326. s *Service
  43327. project string
  43328. httpsHealthCheck string
  43329. httpshealthcheck *HttpsHealthCheck
  43330. urlParams_ gensupport.URLParams
  43331. ctx_ context.Context
  43332. header_ http.Header
  43333. }
  43334. // Update: Updates a HttpsHealthCheck resource in the specified project
  43335. // using the data included in the request.
  43336. func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall {
  43337. c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43338. c.project = project
  43339. c.httpsHealthCheck = httpsHealthCheck
  43340. c.httpshealthcheck = httpshealthcheck
  43341. return c
  43342. }
  43343. // RequestId sets the optional parameter "requestId": An optional
  43344. // request ID to identify requests. Specify a unique request ID so that
  43345. // if you must retry your request, the server will know to ignore the
  43346. // request if it has already been completed.
  43347. //
  43348. // For example, consider a situation where you make an initial request
  43349. // and the request times out. If you make the request again with the
  43350. // same request ID, the server can check if original operation with the
  43351. // same request ID was received, and if so, will ignore the second
  43352. // request. This prevents clients from accidentally creating duplicate
  43353. // commitments.
  43354. //
  43355. // The request ID must be a valid UUID with the exception that zero UUID
  43356. // is not supported (00000000-0000-0000-0000-000000000000).
  43357. func (c *HttpsHealthChecksUpdateCall) RequestId(requestId string) *HttpsHealthChecksUpdateCall {
  43358. c.urlParams_.Set("requestId", requestId)
  43359. return c
  43360. }
  43361. // Fields allows partial responses to be retrieved. See
  43362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43363. // for more information.
  43364. func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall {
  43365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43366. return c
  43367. }
  43368. // Context sets the context to be used in this call's Do method. Any
  43369. // pending HTTP request will be aborted if the provided context is
  43370. // canceled.
  43371. func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall {
  43372. c.ctx_ = ctx
  43373. return c
  43374. }
  43375. // Header returns an http.Header that can be modified by the caller to
  43376. // add HTTP headers to the request.
  43377. func (c *HttpsHealthChecksUpdateCall) Header() http.Header {
  43378. if c.header_ == nil {
  43379. c.header_ = make(http.Header)
  43380. }
  43381. return c.header_
  43382. }
  43383. func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) {
  43384. reqHeaders := make(http.Header)
  43385. for k, v := range c.header_ {
  43386. reqHeaders[k] = v
  43387. }
  43388. reqHeaders.Set("User-Agent", c.s.userAgent())
  43389. var body io.Reader = nil
  43390. body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck)
  43391. if err != nil {
  43392. return nil, err
  43393. }
  43394. reqHeaders.Set("Content-Type", "application/json")
  43395. c.urlParams_.Set("alt", alt)
  43396. c.urlParams_.Set("prettyPrint", "false")
  43397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}")
  43398. urls += "?" + c.urlParams_.Encode()
  43399. req, err := http.NewRequest("PUT", urls, body)
  43400. if err != nil {
  43401. return nil, err
  43402. }
  43403. req.Header = reqHeaders
  43404. googleapi.Expand(req.URL, map[string]string{
  43405. "project": c.project,
  43406. "httpsHealthCheck": c.httpsHealthCheck,
  43407. })
  43408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43409. }
  43410. // Do executes the "compute.httpsHealthChecks.update" call.
  43411. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43412. // status code is an error. Response headers are in either
  43413. // *Operation.ServerResponse.Header or (if a response was returned at
  43414. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43415. // to check whether the returned error was because
  43416. // http.StatusNotModified was returned.
  43417. func (c *HttpsHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43418. gensupport.SetOptions(c.urlParams_, opts...)
  43419. res, err := c.doRequest("json")
  43420. if res != nil && res.StatusCode == http.StatusNotModified {
  43421. if res.Body != nil {
  43422. res.Body.Close()
  43423. }
  43424. return nil, &googleapi.Error{
  43425. Code: res.StatusCode,
  43426. Header: res.Header,
  43427. }
  43428. }
  43429. if err != nil {
  43430. return nil, err
  43431. }
  43432. defer googleapi.CloseBody(res)
  43433. if err := googleapi.CheckResponse(res); err != nil {
  43434. return nil, err
  43435. }
  43436. ret := &Operation{
  43437. ServerResponse: googleapi.ServerResponse{
  43438. Header: res.Header,
  43439. HTTPStatusCode: res.StatusCode,
  43440. },
  43441. }
  43442. target := &ret
  43443. if err := gensupport.DecodeResponse(target, res); err != nil {
  43444. return nil, err
  43445. }
  43446. return ret, nil
  43447. // {
  43448. // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.",
  43449. // "httpMethod": "PUT",
  43450. // "id": "compute.httpsHealthChecks.update",
  43451. // "parameterOrder": [
  43452. // "project",
  43453. // "httpsHealthCheck"
  43454. // ],
  43455. // "parameters": {
  43456. // "httpsHealthCheck": {
  43457. // "description": "Name of the HttpsHealthCheck resource to update.",
  43458. // "location": "path",
  43459. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43460. // "required": true,
  43461. // "type": "string"
  43462. // },
  43463. // "project": {
  43464. // "description": "Project ID for this request.",
  43465. // "location": "path",
  43466. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43467. // "required": true,
  43468. // "type": "string"
  43469. // },
  43470. // "requestId": {
  43471. // "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).",
  43472. // "location": "query",
  43473. // "type": "string"
  43474. // }
  43475. // },
  43476. // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}",
  43477. // "request": {
  43478. // "$ref": "HttpsHealthCheck"
  43479. // },
  43480. // "response": {
  43481. // "$ref": "Operation"
  43482. // },
  43483. // "scopes": [
  43484. // "https://www.googleapis.com/auth/cloud-platform",
  43485. // "https://www.googleapis.com/auth/compute"
  43486. // ]
  43487. // }
  43488. }
  43489. // method id "compute.images.delete":
  43490. type ImagesDeleteCall struct {
  43491. s *Service
  43492. project string
  43493. image string
  43494. urlParams_ gensupport.URLParams
  43495. ctx_ context.Context
  43496. header_ http.Header
  43497. }
  43498. // Delete: Deletes the specified image.
  43499. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete
  43500. func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall {
  43501. c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43502. c.project = project
  43503. c.image = image
  43504. return c
  43505. }
  43506. // RequestId sets the optional parameter "requestId": An optional
  43507. // request ID to identify requests. Specify a unique request ID so that
  43508. // if you must retry your request, the server will know to ignore the
  43509. // request if it has already been completed.
  43510. //
  43511. // For example, consider a situation where you make an initial request
  43512. // and the request times out. If you make the request again with the
  43513. // same request ID, the server can check if original operation with the
  43514. // same request ID was received, and if so, will ignore the second
  43515. // request. This prevents clients from accidentally creating duplicate
  43516. // commitments.
  43517. //
  43518. // The request ID must be a valid UUID with the exception that zero UUID
  43519. // is not supported (00000000-0000-0000-0000-000000000000).
  43520. func (c *ImagesDeleteCall) RequestId(requestId string) *ImagesDeleteCall {
  43521. c.urlParams_.Set("requestId", requestId)
  43522. return c
  43523. }
  43524. // Fields allows partial responses to be retrieved. See
  43525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43526. // for more information.
  43527. func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall {
  43528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43529. return c
  43530. }
  43531. // Context sets the context to be used in this call's Do method. Any
  43532. // pending HTTP request will be aborted if the provided context is
  43533. // canceled.
  43534. func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall {
  43535. c.ctx_ = ctx
  43536. return c
  43537. }
  43538. // Header returns an http.Header that can be modified by the caller to
  43539. // add HTTP headers to the request.
  43540. func (c *ImagesDeleteCall) Header() http.Header {
  43541. if c.header_ == nil {
  43542. c.header_ = make(http.Header)
  43543. }
  43544. return c.header_
  43545. }
  43546. func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  43547. reqHeaders := make(http.Header)
  43548. for k, v := range c.header_ {
  43549. reqHeaders[k] = v
  43550. }
  43551. reqHeaders.Set("User-Agent", c.s.userAgent())
  43552. var body io.Reader = nil
  43553. c.urlParams_.Set("alt", alt)
  43554. c.urlParams_.Set("prettyPrint", "false")
  43555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  43556. urls += "?" + c.urlParams_.Encode()
  43557. req, err := http.NewRequest("DELETE", urls, body)
  43558. if err != nil {
  43559. return nil, err
  43560. }
  43561. req.Header = reqHeaders
  43562. googleapi.Expand(req.URL, map[string]string{
  43563. "project": c.project,
  43564. "image": c.image,
  43565. })
  43566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43567. }
  43568. // Do executes the "compute.images.delete" call.
  43569. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43570. // status code is an error. Response headers are in either
  43571. // *Operation.ServerResponse.Header or (if a response was returned at
  43572. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43573. // to check whether the returned error was because
  43574. // http.StatusNotModified was returned.
  43575. func (c *ImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43576. gensupport.SetOptions(c.urlParams_, opts...)
  43577. res, err := c.doRequest("json")
  43578. if res != nil && res.StatusCode == http.StatusNotModified {
  43579. if res.Body != nil {
  43580. res.Body.Close()
  43581. }
  43582. return nil, &googleapi.Error{
  43583. Code: res.StatusCode,
  43584. Header: res.Header,
  43585. }
  43586. }
  43587. if err != nil {
  43588. return nil, err
  43589. }
  43590. defer googleapi.CloseBody(res)
  43591. if err := googleapi.CheckResponse(res); err != nil {
  43592. return nil, err
  43593. }
  43594. ret := &Operation{
  43595. ServerResponse: googleapi.ServerResponse{
  43596. Header: res.Header,
  43597. HTTPStatusCode: res.StatusCode,
  43598. },
  43599. }
  43600. target := &ret
  43601. if err := gensupport.DecodeResponse(target, res); err != nil {
  43602. return nil, err
  43603. }
  43604. return ret, nil
  43605. // {
  43606. // "description": "Deletes the specified image.",
  43607. // "httpMethod": "DELETE",
  43608. // "id": "compute.images.delete",
  43609. // "parameterOrder": [
  43610. // "project",
  43611. // "image"
  43612. // ],
  43613. // "parameters": {
  43614. // "image": {
  43615. // "description": "Name of the image resource to delete.",
  43616. // "location": "path",
  43617. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43618. // "required": true,
  43619. // "type": "string"
  43620. // },
  43621. // "project": {
  43622. // "description": "Project ID for this request.",
  43623. // "location": "path",
  43624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43625. // "required": true,
  43626. // "type": "string"
  43627. // },
  43628. // "requestId": {
  43629. // "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).",
  43630. // "location": "query",
  43631. // "type": "string"
  43632. // }
  43633. // },
  43634. // "path": "{project}/global/images/{image}",
  43635. // "response": {
  43636. // "$ref": "Operation"
  43637. // },
  43638. // "scopes": [
  43639. // "https://www.googleapis.com/auth/cloud-platform",
  43640. // "https://www.googleapis.com/auth/compute"
  43641. // ]
  43642. // }
  43643. }
  43644. // method id "compute.images.deprecate":
  43645. type ImagesDeprecateCall struct {
  43646. s *Service
  43647. project string
  43648. image string
  43649. deprecationstatus *DeprecationStatus
  43650. urlParams_ gensupport.URLParams
  43651. ctx_ context.Context
  43652. header_ http.Header
  43653. }
  43654. // Deprecate: Sets the deprecation status of an image.
  43655. //
  43656. // If an empty request body is given, clears the deprecation status
  43657. // instead.
  43658. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate
  43659. func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall {
  43660. c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43661. c.project = project
  43662. c.image = image
  43663. c.deprecationstatus = deprecationstatus
  43664. return c
  43665. }
  43666. // RequestId sets the optional parameter "requestId": An optional
  43667. // request ID to identify requests. Specify a unique request ID so that
  43668. // if you must retry your request, the server will know to ignore the
  43669. // request if it has already been completed.
  43670. //
  43671. // For example, consider a situation where you make an initial request
  43672. // and the request times out. If you make the request again with the
  43673. // same request ID, the server can check if original operation with the
  43674. // same request ID was received, and if so, will ignore the second
  43675. // request. This prevents clients from accidentally creating duplicate
  43676. // commitments.
  43677. //
  43678. // The request ID must be a valid UUID with the exception that zero UUID
  43679. // is not supported (00000000-0000-0000-0000-000000000000).
  43680. func (c *ImagesDeprecateCall) RequestId(requestId string) *ImagesDeprecateCall {
  43681. c.urlParams_.Set("requestId", requestId)
  43682. return c
  43683. }
  43684. // Fields allows partial responses to be retrieved. See
  43685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43686. // for more information.
  43687. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall {
  43688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43689. return c
  43690. }
  43691. // Context sets the context to be used in this call's Do method. Any
  43692. // pending HTTP request will be aborted if the provided context is
  43693. // canceled.
  43694. func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall {
  43695. c.ctx_ = ctx
  43696. return c
  43697. }
  43698. // Header returns an http.Header that can be modified by the caller to
  43699. // add HTTP headers to the request.
  43700. func (c *ImagesDeprecateCall) Header() http.Header {
  43701. if c.header_ == nil {
  43702. c.header_ = make(http.Header)
  43703. }
  43704. return c.header_
  43705. }
  43706. func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) {
  43707. reqHeaders := make(http.Header)
  43708. for k, v := range c.header_ {
  43709. reqHeaders[k] = v
  43710. }
  43711. reqHeaders.Set("User-Agent", c.s.userAgent())
  43712. var body io.Reader = nil
  43713. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus)
  43714. if err != nil {
  43715. return nil, err
  43716. }
  43717. reqHeaders.Set("Content-Type", "application/json")
  43718. c.urlParams_.Set("alt", alt)
  43719. c.urlParams_.Set("prettyPrint", "false")
  43720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate")
  43721. urls += "?" + c.urlParams_.Encode()
  43722. req, err := http.NewRequest("POST", urls, body)
  43723. if err != nil {
  43724. return nil, err
  43725. }
  43726. req.Header = reqHeaders
  43727. googleapi.Expand(req.URL, map[string]string{
  43728. "project": c.project,
  43729. "image": c.image,
  43730. })
  43731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43732. }
  43733. // Do executes the "compute.images.deprecate" call.
  43734. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  43735. // status code is an error. Response headers are in either
  43736. // *Operation.ServerResponse.Header or (if a response was returned at
  43737. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43738. // to check whether the returned error was because
  43739. // http.StatusNotModified was returned.
  43740. func (c *ImagesDeprecateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  43741. gensupport.SetOptions(c.urlParams_, opts...)
  43742. res, err := c.doRequest("json")
  43743. if res != nil && res.StatusCode == http.StatusNotModified {
  43744. if res.Body != nil {
  43745. res.Body.Close()
  43746. }
  43747. return nil, &googleapi.Error{
  43748. Code: res.StatusCode,
  43749. Header: res.Header,
  43750. }
  43751. }
  43752. if err != nil {
  43753. return nil, err
  43754. }
  43755. defer googleapi.CloseBody(res)
  43756. if err := googleapi.CheckResponse(res); err != nil {
  43757. return nil, err
  43758. }
  43759. ret := &Operation{
  43760. ServerResponse: googleapi.ServerResponse{
  43761. Header: res.Header,
  43762. HTTPStatusCode: res.StatusCode,
  43763. },
  43764. }
  43765. target := &ret
  43766. if err := gensupport.DecodeResponse(target, res); err != nil {
  43767. return nil, err
  43768. }
  43769. return ret, nil
  43770. // {
  43771. // "description": "Sets the deprecation status of an image.\n\nIf an empty request body is given, clears the deprecation status instead.",
  43772. // "httpMethod": "POST",
  43773. // "id": "compute.images.deprecate",
  43774. // "parameterOrder": [
  43775. // "project",
  43776. // "image"
  43777. // ],
  43778. // "parameters": {
  43779. // "image": {
  43780. // "description": "Image name.",
  43781. // "location": "path",
  43782. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43783. // "required": true,
  43784. // "type": "string"
  43785. // },
  43786. // "project": {
  43787. // "description": "Project ID for this request.",
  43788. // "location": "path",
  43789. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43790. // "required": true,
  43791. // "type": "string"
  43792. // },
  43793. // "requestId": {
  43794. // "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).",
  43795. // "location": "query",
  43796. // "type": "string"
  43797. // }
  43798. // },
  43799. // "path": "{project}/global/images/{image}/deprecate",
  43800. // "request": {
  43801. // "$ref": "DeprecationStatus"
  43802. // },
  43803. // "response": {
  43804. // "$ref": "Operation"
  43805. // },
  43806. // "scopes": [
  43807. // "https://www.googleapis.com/auth/cloud-platform",
  43808. // "https://www.googleapis.com/auth/compute"
  43809. // ]
  43810. // }
  43811. }
  43812. // method id "compute.images.get":
  43813. type ImagesGetCall struct {
  43814. s *Service
  43815. project string
  43816. image string
  43817. urlParams_ gensupport.URLParams
  43818. ifNoneMatch_ string
  43819. ctx_ context.Context
  43820. header_ http.Header
  43821. }
  43822. // Get: Returns the specified image. Gets a list of available images by
  43823. // making a list() request.
  43824. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get
  43825. func (r *ImagesService) Get(project string, image string) *ImagesGetCall {
  43826. c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43827. c.project = project
  43828. c.image = image
  43829. return c
  43830. }
  43831. // Fields allows partial responses to be retrieved. See
  43832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43833. // for more information.
  43834. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall {
  43835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43836. return c
  43837. }
  43838. // IfNoneMatch sets the optional parameter which makes the operation
  43839. // fail if the object's ETag matches the given value. This is useful for
  43840. // getting updates only after the object has changed since the last
  43841. // request. Use googleapi.IsNotModified to check whether the response
  43842. // error from Do is the result of In-None-Match.
  43843. func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall {
  43844. c.ifNoneMatch_ = entityTag
  43845. return c
  43846. }
  43847. // Context sets the context to be used in this call's Do method. Any
  43848. // pending HTTP request will be aborted if the provided context is
  43849. // canceled.
  43850. func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall {
  43851. c.ctx_ = ctx
  43852. return c
  43853. }
  43854. // Header returns an http.Header that can be modified by the caller to
  43855. // add HTTP headers to the request.
  43856. func (c *ImagesGetCall) Header() http.Header {
  43857. if c.header_ == nil {
  43858. c.header_ = make(http.Header)
  43859. }
  43860. return c.header_
  43861. }
  43862. func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) {
  43863. reqHeaders := make(http.Header)
  43864. for k, v := range c.header_ {
  43865. reqHeaders[k] = v
  43866. }
  43867. reqHeaders.Set("User-Agent", c.s.userAgent())
  43868. if c.ifNoneMatch_ != "" {
  43869. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43870. }
  43871. var body io.Reader = nil
  43872. c.urlParams_.Set("alt", alt)
  43873. c.urlParams_.Set("prettyPrint", "false")
  43874. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}")
  43875. urls += "?" + c.urlParams_.Encode()
  43876. req, err := http.NewRequest("GET", urls, body)
  43877. if err != nil {
  43878. return nil, err
  43879. }
  43880. req.Header = reqHeaders
  43881. googleapi.Expand(req.URL, map[string]string{
  43882. "project": c.project,
  43883. "image": c.image,
  43884. })
  43885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43886. }
  43887. // Do executes the "compute.images.get" call.
  43888. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  43889. // code is an error. Response headers are in either
  43890. // *Image.ServerResponse.Header or (if a response was returned at all)
  43891. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  43892. // check whether the returned error was because http.StatusNotModified
  43893. // was returned.
  43894. func (c *ImagesGetCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  43895. gensupport.SetOptions(c.urlParams_, opts...)
  43896. res, err := c.doRequest("json")
  43897. if res != nil && res.StatusCode == http.StatusNotModified {
  43898. if res.Body != nil {
  43899. res.Body.Close()
  43900. }
  43901. return nil, &googleapi.Error{
  43902. Code: res.StatusCode,
  43903. Header: res.Header,
  43904. }
  43905. }
  43906. if err != nil {
  43907. return nil, err
  43908. }
  43909. defer googleapi.CloseBody(res)
  43910. if err := googleapi.CheckResponse(res); err != nil {
  43911. return nil, err
  43912. }
  43913. ret := &Image{
  43914. ServerResponse: googleapi.ServerResponse{
  43915. Header: res.Header,
  43916. HTTPStatusCode: res.StatusCode,
  43917. },
  43918. }
  43919. target := &ret
  43920. if err := gensupport.DecodeResponse(target, res); err != nil {
  43921. return nil, err
  43922. }
  43923. return ret, nil
  43924. // {
  43925. // "description": "Returns the specified image. Gets a list of available images by making a list() request.",
  43926. // "httpMethod": "GET",
  43927. // "id": "compute.images.get",
  43928. // "parameterOrder": [
  43929. // "project",
  43930. // "image"
  43931. // ],
  43932. // "parameters": {
  43933. // "image": {
  43934. // "description": "Name of the image resource to return.",
  43935. // "location": "path",
  43936. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  43937. // "required": true,
  43938. // "type": "string"
  43939. // },
  43940. // "project": {
  43941. // "description": "Project ID for this request.",
  43942. // "location": "path",
  43943. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  43944. // "required": true,
  43945. // "type": "string"
  43946. // }
  43947. // },
  43948. // "path": "{project}/global/images/{image}",
  43949. // "response": {
  43950. // "$ref": "Image"
  43951. // },
  43952. // "scopes": [
  43953. // "https://www.googleapis.com/auth/cloud-platform",
  43954. // "https://www.googleapis.com/auth/compute",
  43955. // "https://www.googleapis.com/auth/compute.readonly"
  43956. // ]
  43957. // }
  43958. }
  43959. // method id "compute.images.getFromFamily":
  43960. type ImagesGetFromFamilyCall struct {
  43961. s *Service
  43962. project string
  43963. family string
  43964. urlParams_ gensupport.URLParams
  43965. ifNoneMatch_ string
  43966. ctx_ context.Context
  43967. header_ http.Header
  43968. }
  43969. // GetFromFamily: Returns the latest image that is part of an image
  43970. // family and is not deprecated.
  43971. func (r *ImagesService) GetFromFamily(project string, family string) *ImagesGetFromFamilyCall {
  43972. c := &ImagesGetFromFamilyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43973. c.project = project
  43974. c.family = family
  43975. return c
  43976. }
  43977. // Fields allows partial responses to be retrieved. See
  43978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43979. // for more information.
  43980. func (c *ImagesGetFromFamilyCall) Fields(s ...googleapi.Field) *ImagesGetFromFamilyCall {
  43981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43982. return c
  43983. }
  43984. // IfNoneMatch sets the optional parameter which makes the operation
  43985. // fail if the object's ETag matches the given value. This is useful for
  43986. // getting updates only after the object has changed since the last
  43987. // request. Use googleapi.IsNotModified to check whether the response
  43988. // error from Do is the result of In-None-Match.
  43989. func (c *ImagesGetFromFamilyCall) IfNoneMatch(entityTag string) *ImagesGetFromFamilyCall {
  43990. c.ifNoneMatch_ = entityTag
  43991. return c
  43992. }
  43993. // Context sets the context to be used in this call's Do method. Any
  43994. // pending HTTP request will be aborted if the provided context is
  43995. // canceled.
  43996. func (c *ImagesGetFromFamilyCall) Context(ctx context.Context) *ImagesGetFromFamilyCall {
  43997. c.ctx_ = ctx
  43998. return c
  43999. }
  44000. // Header returns an http.Header that can be modified by the caller to
  44001. // add HTTP headers to the request.
  44002. func (c *ImagesGetFromFamilyCall) Header() http.Header {
  44003. if c.header_ == nil {
  44004. c.header_ = make(http.Header)
  44005. }
  44006. return c.header_
  44007. }
  44008. func (c *ImagesGetFromFamilyCall) doRequest(alt string) (*http.Response, error) {
  44009. reqHeaders := make(http.Header)
  44010. for k, v := range c.header_ {
  44011. reqHeaders[k] = v
  44012. }
  44013. reqHeaders.Set("User-Agent", c.s.userAgent())
  44014. if c.ifNoneMatch_ != "" {
  44015. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44016. }
  44017. var body io.Reader = nil
  44018. c.urlParams_.Set("alt", alt)
  44019. c.urlParams_.Set("prettyPrint", "false")
  44020. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/family/{family}")
  44021. urls += "?" + c.urlParams_.Encode()
  44022. req, err := http.NewRequest("GET", urls, body)
  44023. if err != nil {
  44024. return nil, err
  44025. }
  44026. req.Header = reqHeaders
  44027. googleapi.Expand(req.URL, map[string]string{
  44028. "project": c.project,
  44029. "family": c.family,
  44030. })
  44031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44032. }
  44033. // Do executes the "compute.images.getFromFamily" call.
  44034. // Exactly one of *Image or error will be non-nil. Any non-2xx status
  44035. // code is an error. Response headers are in either
  44036. // *Image.ServerResponse.Header or (if a response was returned at all)
  44037. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  44038. // check whether the returned error was because http.StatusNotModified
  44039. // was returned.
  44040. func (c *ImagesGetFromFamilyCall) Do(opts ...googleapi.CallOption) (*Image, error) {
  44041. gensupport.SetOptions(c.urlParams_, opts...)
  44042. res, err := c.doRequest("json")
  44043. if res != nil && res.StatusCode == http.StatusNotModified {
  44044. if res.Body != nil {
  44045. res.Body.Close()
  44046. }
  44047. return nil, &googleapi.Error{
  44048. Code: res.StatusCode,
  44049. Header: res.Header,
  44050. }
  44051. }
  44052. if err != nil {
  44053. return nil, err
  44054. }
  44055. defer googleapi.CloseBody(res)
  44056. if err := googleapi.CheckResponse(res); err != nil {
  44057. return nil, err
  44058. }
  44059. ret := &Image{
  44060. ServerResponse: googleapi.ServerResponse{
  44061. Header: res.Header,
  44062. HTTPStatusCode: res.StatusCode,
  44063. },
  44064. }
  44065. target := &ret
  44066. if err := gensupport.DecodeResponse(target, res); err != nil {
  44067. return nil, err
  44068. }
  44069. return ret, nil
  44070. // {
  44071. // "description": "Returns the latest image that is part of an image family and is not deprecated.",
  44072. // "httpMethod": "GET",
  44073. // "id": "compute.images.getFromFamily",
  44074. // "parameterOrder": [
  44075. // "project",
  44076. // "family"
  44077. // ],
  44078. // "parameters": {
  44079. // "family": {
  44080. // "description": "Name of the image family to search for.",
  44081. // "location": "path",
  44082. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44083. // "required": true,
  44084. // "type": "string"
  44085. // },
  44086. // "project": {
  44087. // "description": "Project ID for this request.",
  44088. // "location": "path",
  44089. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44090. // "required": true,
  44091. // "type": "string"
  44092. // }
  44093. // },
  44094. // "path": "{project}/global/images/family/{family}",
  44095. // "response": {
  44096. // "$ref": "Image"
  44097. // },
  44098. // "scopes": [
  44099. // "https://www.googleapis.com/auth/cloud-platform",
  44100. // "https://www.googleapis.com/auth/compute",
  44101. // "https://www.googleapis.com/auth/compute.readonly"
  44102. // ]
  44103. // }
  44104. }
  44105. // method id "compute.images.getIamPolicy":
  44106. type ImagesGetIamPolicyCall struct {
  44107. s *Service
  44108. project string
  44109. resource string
  44110. urlParams_ gensupport.URLParams
  44111. ifNoneMatch_ string
  44112. ctx_ context.Context
  44113. header_ http.Header
  44114. }
  44115. // GetIamPolicy: Gets the access control policy for a resource. May be
  44116. // empty if no such policy or resource exists.
  44117. func (r *ImagesService) GetIamPolicy(project string, resource string) *ImagesGetIamPolicyCall {
  44118. c := &ImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44119. c.project = project
  44120. c.resource = resource
  44121. return c
  44122. }
  44123. // Fields allows partial responses to be retrieved. See
  44124. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44125. // for more information.
  44126. func (c *ImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesGetIamPolicyCall {
  44127. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44128. return c
  44129. }
  44130. // IfNoneMatch sets the optional parameter which makes the operation
  44131. // fail if the object's ETag matches the given value. This is useful for
  44132. // getting updates only after the object has changed since the last
  44133. // request. Use googleapi.IsNotModified to check whether the response
  44134. // error from Do is the result of In-None-Match.
  44135. func (c *ImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *ImagesGetIamPolicyCall {
  44136. c.ifNoneMatch_ = entityTag
  44137. return c
  44138. }
  44139. // Context sets the context to be used in this call's Do method. Any
  44140. // pending HTTP request will be aborted if the provided context is
  44141. // canceled.
  44142. func (c *ImagesGetIamPolicyCall) Context(ctx context.Context) *ImagesGetIamPolicyCall {
  44143. c.ctx_ = ctx
  44144. return c
  44145. }
  44146. // Header returns an http.Header that can be modified by the caller to
  44147. // add HTTP headers to the request.
  44148. func (c *ImagesGetIamPolicyCall) Header() http.Header {
  44149. if c.header_ == nil {
  44150. c.header_ = make(http.Header)
  44151. }
  44152. return c.header_
  44153. }
  44154. func (c *ImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  44155. reqHeaders := make(http.Header)
  44156. for k, v := range c.header_ {
  44157. reqHeaders[k] = v
  44158. }
  44159. reqHeaders.Set("User-Agent", c.s.userAgent())
  44160. if c.ifNoneMatch_ != "" {
  44161. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44162. }
  44163. var body io.Reader = nil
  44164. c.urlParams_.Set("alt", alt)
  44165. c.urlParams_.Set("prettyPrint", "false")
  44166. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/getIamPolicy")
  44167. urls += "?" + c.urlParams_.Encode()
  44168. req, err := http.NewRequest("GET", urls, body)
  44169. if err != nil {
  44170. return nil, err
  44171. }
  44172. req.Header = reqHeaders
  44173. googleapi.Expand(req.URL, map[string]string{
  44174. "project": c.project,
  44175. "resource": c.resource,
  44176. })
  44177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44178. }
  44179. // Do executes the "compute.images.getIamPolicy" call.
  44180. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  44181. // code is an error. Response headers are in either
  44182. // *Policy.ServerResponse.Header or (if a response was returned at all)
  44183. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  44184. // check whether the returned error was because http.StatusNotModified
  44185. // was returned.
  44186. func (c *ImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  44187. gensupport.SetOptions(c.urlParams_, opts...)
  44188. res, err := c.doRequest("json")
  44189. if res != nil && res.StatusCode == http.StatusNotModified {
  44190. if res.Body != nil {
  44191. res.Body.Close()
  44192. }
  44193. return nil, &googleapi.Error{
  44194. Code: res.StatusCode,
  44195. Header: res.Header,
  44196. }
  44197. }
  44198. if err != nil {
  44199. return nil, err
  44200. }
  44201. defer googleapi.CloseBody(res)
  44202. if err := googleapi.CheckResponse(res); err != nil {
  44203. return nil, err
  44204. }
  44205. ret := &Policy{
  44206. ServerResponse: googleapi.ServerResponse{
  44207. Header: res.Header,
  44208. HTTPStatusCode: res.StatusCode,
  44209. },
  44210. }
  44211. target := &ret
  44212. if err := gensupport.DecodeResponse(target, res); err != nil {
  44213. return nil, err
  44214. }
  44215. return ret, nil
  44216. // {
  44217. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  44218. // "httpMethod": "GET",
  44219. // "id": "compute.images.getIamPolicy",
  44220. // "parameterOrder": [
  44221. // "project",
  44222. // "resource"
  44223. // ],
  44224. // "parameters": {
  44225. // "project": {
  44226. // "description": "Project ID for this request.",
  44227. // "location": "path",
  44228. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44229. // "required": true,
  44230. // "type": "string"
  44231. // },
  44232. // "resource": {
  44233. // "description": "Name or id of the resource for this request.",
  44234. // "location": "path",
  44235. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44236. // "required": true,
  44237. // "type": "string"
  44238. // }
  44239. // },
  44240. // "path": "{project}/global/images/{resource}/getIamPolicy",
  44241. // "response": {
  44242. // "$ref": "Policy"
  44243. // },
  44244. // "scopes": [
  44245. // "https://www.googleapis.com/auth/cloud-platform",
  44246. // "https://www.googleapis.com/auth/compute",
  44247. // "https://www.googleapis.com/auth/compute.readonly"
  44248. // ]
  44249. // }
  44250. }
  44251. // method id "compute.images.insert":
  44252. type ImagesInsertCall struct {
  44253. s *Service
  44254. project string
  44255. image *Image
  44256. urlParams_ gensupport.URLParams
  44257. ctx_ context.Context
  44258. header_ http.Header
  44259. }
  44260. // Insert: Creates an image in the specified project using the data
  44261. // included in the request.
  44262. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert
  44263. func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall {
  44264. c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44265. c.project = project
  44266. c.image = image
  44267. return c
  44268. }
  44269. // ForceCreate sets the optional parameter "forceCreate": Force image
  44270. // creation if true.
  44271. func (c *ImagesInsertCall) ForceCreate(forceCreate bool) *ImagesInsertCall {
  44272. c.urlParams_.Set("forceCreate", fmt.Sprint(forceCreate))
  44273. return c
  44274. }
  44275. // RequestId sets the optional parameter "requestId": An optional
  44276. // request ID to identify requests. Specify a unique request ID so that
  44277. // if you must retry your request, the server will know to ignore the
  44278. // request if it has already been completed.
  44279. //
  44280. // For example, consider a situation where you make an initial request
  44281. // and the request times out. If you make the request again with the
  44282. // same request ID, the server can check if original operation with the
  44283. // same request ID was received, and if so, will ignore the second
  44284. // request. This prevents clients from accidentally creating duplicate
  44285. // commitments.
  44286. //
  44287. // The request ID must be a valid UUID with the exception that zero UUID
  44288. // is not supported (00000000-0000-0000-0000-000000000000).
  44289. func (c *ImagesInsertCall) RequestId(requestId string) *ImagesInsertCall {
  44290. c.urlParams_.Set("requestId", requestId)
  44291. return c
  44292. }
  44293. // Fields allows partial responses to be retrieved. See
  44294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44295. // for more information.
  44296. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall {
  44297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44298. return c
  44299. }
  44300. // Context sets the context to be used in this call's Do method. Any
  44301. // pending HTTP request will be aborted if the provided context is
  44302. // canceled.
  44303. func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall {
  44304. c.ctx_ = ctx
  44305. return c
  44306. }
  44307. // Header returns an http.Header that can be modified by the caller to
  44308. // add HTTP headers to the request.
  44309. func (c *ImagesInsertCall) Header() http.Header {
  44310. if c.header_ == nil {
  44311. c.header_ = make(http.Header)
  44312. }
  44313. return c.header_
  44314. }
  44315. func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) {
  44316. reqHeaders := make(http.Header)
  44317. for k, v := range c.header_ {
  44318. reqHeaders[k] = v
  44319. }
  44320. reqHeaders.Set("User-Agent", c.s.userAgent())
  44321. var body io.Reader = nil
  44322. body, err := googleapi.WithoutDataWrapper.JSONReader(c.image)
  44323. if err != nil {
  44324. return nil, err
  44325. }
  44326. reqHeaders.Set("Content-Type", "application/json")
  44327. c.urlParams_.Set("alt", alt)
  44328. c.urlParams_.Set("prettyPrint", "false")
  44329. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  44330. urls += "?" + c.urlParams_.Encode()
  44331. req, err := http.NewRequest("POST", urls, body)
  44332. if err != nil {
  44333. return nil, err
  44334. }
  44335. req.Header = reqHeaders
  44336. googleapi.Expand(req.URL, map[string]string{
  44337. "project": c.project,
  44338. })
  44339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44340. }
  44341. // Do executes the "compute.images.insert" call.
  44342. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44343. // status code is an error. Response headers are in either
  44344. // *Operation.ServerResponse.Header or (if a response was returned at
  44345. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44346. // to check whether the returned error was because
  44347. // http.StatusNotModified was returned.
  44348. func (c *ImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44349. gensupport.SetOptions(c.urlParams_, opts...)
  44350. res, err := c.doRequest("json")
  44351. if res != nil && res.StatusCode == http.StatusNotModified {
  44352. if res.Body != nil {
  44353. res.Body.Close()
  44354. }
  44355. return nil, &googleapi.Error{
  44356. Code: res.StatusCode,
  44357. Header: res.Header,
  44358. }
  44359. }
  44360. if err != nil {
  44361. return nil, err
  44362. }
  44363. defer googleapi.CloseBody(res)
  44364. if err := googleapi.CheckResponse(res); err != nil {
  44365. return nil, err
  44366. }
  44367. ret := &Operation{
  44368. ServerResponse: googleapi.ServerResponse{
  44369. Header: res.Header,
  44370. HTTPStatusCode: res.StatusCode,
  44371. },
  44372. }
  44373. target := &ret
  44374. if err := gensupport.DecodeResponse(target, res); err != nil {
  44375. return nil, err
  44376. }
  44377. return ret, nil
  44378. // {
  44379. // "description": "Creates an image in the specified project using the data included in the request.",
  44380. // "httpMethod": "POST",
  44381. // "id": "compute.images.insert",
  44382. // "parameterOrder": [
  44383. // "project"
  44384. // ],
  44385. // "parameters": {
  44386. // "forceCreate": {
  44387. // "description": "Force image creation if true.",
  44388. // "location": "query",
  44389. // "type": "boolean"
  44390. // },
  44391. // "project": {
  44392. // "description": "Project ID for this request.",
  44393. // "location": "path",
  44394. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44395. // "required": true,
  44396. // "type": "string"
  44397. // },
  44398. // "requestId": {
  44399. // "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).",
  44400. // "location": "query",
  44401. // "type": "string"
  44402. // }
  44403. // },
  44404. // "path": "{project}/global/images",
  44405. // "request": {
  44406. // "$ref": "Image"
  44407. // },
  44408. // "response": {
  44409. // "$ref": "Operation"
  44410. // },
  44411. // "scopes": [
  44412. // "https://www.googleapis.com/auth/cloud-platform",
  44413. // "https://www.googleapis.com/auth/compute",
  44414. // "https://www.googleapis.com/auth/devstorage.full_control",
  44415. // "https://www.googleapis.com/auth/devstorage.read_only",
  44416. // "https://www.googleapis.com/auth/devstorage.read_write"
  44417. // ]
  44418. // }
  44419. }
  44420. // method id "compute.images.list":
  44421. type ImagesListCall struct {
  44422. s *Service
  44423. project string
  44424. urlParams_ gensupport.URLParams
  44425. ifNoneMatch_ string
  44426. ctx_ context.Context
  44427. header_ http.Header
  44428. }
  44429. // List: Retrieves the list of custom images available to the specified
  44430. // project. Custom images are images you create that belong to your
  44431. // project. This method does not get any images that belong to other
  44432. // projects, including publicly-available images, like Debian 8. If you
  44433. // want to get a list of publicly-available images, use this method to
  44434. // make a request to the respective image project, such as debian-cloud
  44435. // or windows-cloud.
  44436. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list
  44437. func (r *ImagesService) List(project string) *ImagesListCall {
  44438. c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44439. c.project = project
  44440. return c
  44441. }
  44442. // Filter sets the optional parameter "filter": A filter expression that
  44443. // filters resources listed in the response. The expression must specify
  44444. // the field name, a comparison operator, and the value that you want to
  44445. // use for filtering. The value must be a string, a number, or a
  44446. // boolean. The comparison operator must be either =, !=, >, or <.
  44447. //
  44448. // For example, if you are filtering Compute Engine instances, you can
  44449. // exclude instances named example-instance by specifying name !=
  44450. // example-instance.
  44451. //
  44452. // You can also filter nested fields. For example, you could specify
  44453. // scheduling.automaticRestart = false to include instances only if they
  44454. // are not scheduled for automatic restarts. You can use filtering on
  44455. // nested fields to filter based on resource labels.
  44456. //
  44457. // To filter on multiple expressions, provide each separate expression
  44458. // within parentheses. For example, (scheduling.automaticRestart = true)
  44459. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  44460. // AND expression. However, you can include AND and OR expressions
  44461. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  44462. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  44463. // true).
  44464. func (c *ImagesListCall) Filter(filter string) *ImagesListCall {
  44465. c.urlParams_.Set("filter", filter)
  44466. return c
  44467. }
  44468. // MaxResults sets the optional parameter "maxResults": The maximum
  44469. // number of results per page that should be returned. If the number of
  44470. // available results is larger than maxResults, Compute Engine returns a
  44471. // nextPageToken that can be used to get the next page of results in
  44472. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  44473. // (Default: 500)
  44474. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall {
  44475. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44476. return c
  44477. }
  44478. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  44479. // a certain order. By default, results are returned in alphanumerical
  44480. // order based on the resource name.
  44481. //
  44482. // You can also sort results in descending order based on the creation
  44483. // timestamp using orderBy="creationTimestamp desc". This sorts results
  44484. // based on the creationTimestamp field in reverse chronological order
  44485. // (newest result first). Use this to sort resources like operations so
  44486. // that the newest operation is returned first.
  44487. //
  44488. // Currently, only sorting by name or creationTimestamp desc is
  44489. // supported.
  44490. func (c *ImagesListCall) OrderBy(orderBy string) *ImagesListCall {
  44491. c.urlParams_.Set("orderBy", orderBy)
  44492. return c
  44493. }
  44494. // PageToken sets the optional parameter "pageToken": Specifies a page
  44495. // token to use. Set pageToken to the nextPageToken returned by a
  44496. // previous list request to get the next page of results.
  44497. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall {
  44498. c.urlParams_.Set("pageToken", pageToken)
  44499. return c
  44500. }
  44501. // Fields allows partial responses to be retrieved. See
  44502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44503. // for more information.
  44504. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall {
  44505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44506. return c
  44507. }
  44508. // IfNoneMatch sets the optional parameter which makes the operation
  44509. // fail if the object's ETag matches the given value. This is useful for
  44510. // getting updates only after the object has changed since the last
  44511. // request. Use googleapi.IsNotModified to check whether the response
  44512. // error from Do is the result of In-None-Match.
  44513. func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall {
  44514. c.ifNoneMatch_ = entityTag
  44515. return c
  44516. }
  44517. // Context sets the context to be used in this call's Do method. Any
  44518. // pending HTTP request will be aborted if the provided context is
  44519. // canceled.
  44520. func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall {
  44521. c.ctx_ = ctx
  44522. return c
  44523. }
  44524. // Header returns an http.Header that can be modified by the caller to
  44525. // add HTTP headers to the request.
  44526. func (c *ImagesListCall) Header() http.Header {
  44527. if c.header_ == nil {
  44528. c.header_ = make(http.Header)
  44529. }
  44530. return c.header_
  44531. }
  44532. func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) {
  44533. reqHeaders := make(http.Header)
  44534. for k, v := range c.header_ {
  44535. reqHeaders[k] = v
  44536. }
  44537. reqHeaders.Set("User-Agent", c.s.userAgent())
  44538. if c.ifNoneMatch_ != "" {
  44539. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44540. }
  44541. var body io.Reader = nil
  44542. c.urlParams_.Set("alt", alt)
  44543. c.urlParams_.Set("prettyPrint", "false")
  44544. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images")
  44545. urls += "?" + c.urlParams_.Encode()
  44546. req, err := http.NewRequest("GET", urls, body)
  44547. if err != nil {
  44548. return nil, err
  44549. }
  44550. req.Header = reqHeaders
  44551. googleapi.Expand(req.URL, map[string]string{
  44552. "project": c.project,
  44553. })
  44554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44555. }
  44556. // Do executes the "compute.images.list" call.
  44557. // Exactly one of *ImageList or error will be non-nil. Any non-2xx
  44558. // status code is an error. Response headers are in either
  44559. // *ImageList.ServerResponse.Header or (if a response was returned at
  44560. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44561. // to check whether the returned error was because
  44562. // http.StatusNotModified was returned.
  44563. func (c *ImagesListCall) Do(opts ...googleapi.CallOption) (*ImageList, error) {
  44564. gensupport.SetOptions(c.urlParams_, opts...)
  44565. res, err := c.doRequest("json")
  44566. if res != nil && res.StatusCode == http.StatusNotModified {
  44567. if res.Body != nil {
  44568. res.Body.Close()
  44569. }
  44570. return nil, &googleapi.Error{
  44571. Code: res.StatusCode,
  44572. Header: res.Header,
  44573. }
  44574. }
  44575. if err != nil {
  44576. return nil, err
  44577. }
  44578. defer googleapi.CloseBody(res)
  44579. if err := googleapi.CheckResponse(res); err != nil {
  44580. return nil, err
  44581. }
  44582. ret := &ImageList{
  44583. ServerResponse: googleapi.ServerResponse{
  44584. Header: res.Header,
  44585. HTTPStatusCode: res.StatusCode,
  44586. },
  44587. }
  44588. target := &ret
  44589. if err := gensupport.DecodeResponse(target, res); err != nil {
  44590. return nil, err
  44591. }
  44592. return ret, nil
  44593. // {
  44594. // "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.",
  44595. // "httpMethod": "GET",
  44596. // "id": "compute.images.list",
  44597. // "parameterOrder": [
  44598. // "project"
  44599. // ],
  44600. // "parameters": {
  44601. // "filter": {
  44602. // "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).",
  44603. // "location": "query",
  44604. // "type": "string"
  44605. // },
  44606. // "maxResults": {
  44607. // "default": "500",
  44608. // "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)",
  44609. // "format": "uint32",
  44610. // "location": "query",
  44611. // "minimum": "0",
  44612. // "type": "integer"
  44613. // },
  44614. // "orderBy": {
  44615. // "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.",
  44616. // "location": "query",
  44617. // "type": "string"
  44618. // },
  44619. // "pageToken": {
  44620. // "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.",
  44621. // "location": "query",
  44622. // "type": "string"
  44623. // },
  44624. // "project": {
  44625. // "description": "Project ID for this request.",
  44626. // "location": "path",
  44627. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44628. // "required": true,
  44629. // "type": "string"
  44630. // }
  44631. // },
  44632. // "path": "{project}/global/images",
  44633. // "response": {
  44634. // "$ref": "ImageList"
  44635. // },
  44636. // "scopes": [
  44637. // "https://www.googleapis.com/auth/cloud-platform",
  44638. // "https://www.googleapis.com/auth/compute",
  44639. // "https://www.googleapis.com/auth/compute.readonly"
  44640. // ]
  44641. // }
  44642. }
  44643. // Pages invokes f for each page of results.
  44644. // A non-nil error returned from f will halt the iteration.
  44645. // The provided context supersedes any context provided to the Context method.
  44646. func (c *ImagesListCall) Pages(ctx context.Context, f func(*ImageList) error) error {
  44647. c.ctx_ = ctx
  44648. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44649. for {
  44650. x, err := c.Do()
  44651. if err != nil {
  44652. return err
  44653. }
  44654. if err := f(x); err != nil {
  44655. return err
  44656. }
  44657. if x.NextPageToken == "" {
  44658. return nil
  44659. }
  44660. c.PageToken(x.NextPageToken)
  44661. }
  44662. }
  44663. // method id "compute.images.setIamPolicy":
  44664. type ImagesSetIamPolicyCall struct {
  44665. s *Service
  44666. project string
  44667. resource string
  44668. globalsetpolicyrequest *GlobalSetPolicyRequest
  44669. urlParams_ gensupport.URLParams
  44670. ctx_ context.Context
  44671. header_ http.Header
  44672. }
  44673. // SetIamPolicy: Sets the access control policy on the specified
  44674. // resource. Replaces any existing policy.
  44675. func (r *ImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *ImagesSetIamPolicyCall {
  44676. c := &ImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44677. c.project = project
  44678. c.resource = resource
  44679. c.globalsetpolicyrequest = globalsetpolicyrequest
  44680. return c
  44681. }
  44682. // Fields allows partial responses to be retrieved. See
  44683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44684. // for more information.
  44685. func (c *ImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *ImagesSetIamPolicyCall {
  44686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44687. return c
  44688. }
  44689. // Context sets the context to be used in this call's Do method. Any
  44690. // pending HTTP request will be aborted if the provided context is
  44691. // canceled.
  44692. func (c *ImagesSetIamPolicyCall) Context(ctx context.Context) *ImagesSetIamPolicyCall {
  44693. c.ctx_ = ctx
  44694. return c
  44695. }
  44696. // Header returns an http.Header that can be modified by the caller to
  44697. // add HTTP headers to the request.
  44698. func (c *ImagesSetIamPolicyCall) Header() http.Header {
  44699. if c.header_ == nil {
  44700. c.header_ = make(http.Header)
  44701. }
  44702. return c.header_
  44703. }
  44704. func (c *ImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  44705. reqHeaders := make(http.Header)
  44706. for k, v := range c.header_ {
  44707. reqHeaders[k] = v
  44708. }
  44709. reqHeaders.Set("User-Agent", c.s.userAgent())
  44710. var body io.Reader = nil
  44711. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  44712. if err != nil {
  44713. return nil, err
  44714. }
  44715. reqHeaders.Set("Content-Type", "application/json")
  44716. c.urlParams_.Set("alt", alt)
  44717. c.urlParams_.Set("prettyPrint", "false")
  44718. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setIamPolicy")
  44719. urls += "?" + c.urlParams_.Encode()
  44720. req, err := http.NewRequest("POST", urls, body)
  44721. if err != nil {
  44722. return nil, err
  44723. }
  44724. req.Header = reqHeaders
  44725. googleapi.Expand(req.URL, map[string]string{
  44726. "project": c.project,
  44727. "resource": c.resource,
  44728. })
  44729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44730. }
  44731. // Do executes the "compute.images.setIamPolicy" call.
  44732. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  44733. // code is an error. Response headers are in either
  44734. // *Policy.ServerResponse.Header or (if a response was returned at all)
  44735. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  44736. // check whether the returned error was because http.StatusNotModified
  44737. // was returned.
  44738. func (c *ImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  44739. gensupport.SetOptions(c.urlParams_, opts...)
  44740. res, err := c.doRequest("json")
  44741. if res != nil && res.StatusCode == http.StatusNotModified {
  44742. if res.Body != nil {
  44743. res.Body.Close()
  44744. }
  44745. return nil, &googleapi.Error{
  44746. Code: res.StatusCode,
  44747. Header: res.Header,
  44748. }
  44749. }
  44750. if err != nil {
  44751. return nil, err
  44752. }
  44753. defer googleapi.CloseBody(res)
  44754. if err := googleapi.CheckResponse(res); err != nil {
  44755. return nil, err
  44756. }
  44757. ret := &Policy{
  44758. ServerResponse: googleapi.ServerResponse{
  44759. Header: res.Header,
  44760. HTTPStatusCode: res.StatusCode,
  44761. },
  44762. }
  44763. target := &ret
  44764. if err := gensupport.DecodeResponse(target, res); err != nil {
  44765. return nil, err
  44766. }
  44767. return ret, nil
  44768. // {
  44769. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  44770. // "httpMethod": "POST",
  44771. // "id": "compute.images.setIamPolicy",
  44772. // "parameterOrder": [
  44773. // "project",
  44774. // "resource"
  44775. // ],
  44776. // "parameters": {
  44777. // "project": {
  44778. // "description": "Project ID for this request.",
  44779. // "location": "path",
  44780. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44781. // "required": true,
  44782. // "type": "string"
  44783. // },
  44784. // "resource": {
  44785. // "description": "Name or id of the resource for this request.",
  44786. // "location": "path",
  44787. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44788. // "required": true,
  44789. // "type": "string"
  44790. // }
  44791. // },
  44792. // "path": "{project}/global/images/{resource}/setIamPolicy",
  44793. // "request": {
  44794. // "$ref": "GlobalSetPolicyRequest"
  44795. // },
  44796. // "response": {
  44797. // "$ref": "Policy"
  44798. // },
  44799. // "scopes": [
  44800. // "https://www.googleapis.com/auth/cloud-platform",
  44801. // "https://www.googleapis.com/auth/compute"
  44802. // ]
  44803. // }
  44804. }
  44805. // method id "compute.images.setLabels":
  44806. type ImagesSetLabelsCall struct {
  44807. s *Service
  44808. project string
  44809. resource string
  44810. globalsetlabelsrequest *GlobalSetLabelsRequest
  44811. urlParams_ gensupport.URLParams
  44812. ctx_ context.Context
  44813. header_ http.Header
  44814. }
  44815. // SetLabels: Sets the labels on an image. To learn more about labels,
  44816. // read the Labeling Resources documentation.
  44817. func (r *ImagesService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *ImagesSetLabelsCall {
  44818. c := &ImagesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44819. c.project = project
  44820. c.resource = resource
  44821. c.globalsetlabelsrequest = globalsetlabelsrequest
  44822. return c
  44823. }
  44824. // Fields allows partial responses to be retrieved. See
  44825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44826. // for more information.
  44827. func (c *ImagesSetLabelsCall) Fields(s ...googleapi.Field) *ImagesSetLabelsCall {
  44828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44829. return c
  44830. }
  44831. // Context sets the context to be used in this call's Do method. Any
  44832. // pending HTTP request will be aborted if the provided context is
  44833. // canceled.
  44834. func (c *ImagesSetLabelsCall) Context(ctx context.Context) *ImagesSetLabelsCall {
  44835. c.ctx_ = ctx
  44836. return c
  44837. }
  44838. // Header returns an http.Header that can be modified by the caller to
  44839. // add HTTP headers to the request.
  44840. func (c *ImagesSetLabelsCall) Header() http.Header {
  44841. if c.header_ == nil {
  44842. c.header_ = make(http.Header)
  44843. }
  44844. return c.header_
  44845. }
  44846. func (c *ImagesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  44847. reqHeaders := make(http.Header)
  44848. for k, v := range c.header_ {
  44849. reqHeaders[k] = v
  44850. }
  44851. reqHeaders.Set("User-Agent", c.s.userAgent())
  44852. var body io.Reader = nil
  44853. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  44854. if err != nil {
  44855. return nil, err
  44856. }
  44857. reqHeaders.Set("Content-Type", "application/json")
  44858. c.urlParams_.Set("alt", alt)
  44859. c.urlParams_.Set("prettyPrint", "false")
  44860. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/setLabels")
  44861. urls += "?" + c.urlParams_.Encode()
  44862. req, err := http.NewRequest("POST", urls, body)
  44863. if err != nil {
  44864. return nil, err
  44865. }
  44866. req.Header = reqHeaders
  44867. googleapi.Expand(req.URL, map[string]string{
  44868. "project": c.project,
  44869. "resource": c.resource,
  44870. })
  44871. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44872. }
  44873. // Do executes the "compute.images.setLabels" call.
  44874. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  44875. // status code is an error. Response headers are in either
  44876. // *Operation.ServerResponse.Header or (if a response was returned at
  44877. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44878. // to check whether the returned error was because
  44879. // http.StatusNotModified was returned.
  44880. func (c *ImagesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  44881. gensupport.SetOptions(c.urlParams_, opts...)
  44882. res, err := c.doRequest("json")
  44883. if res != nil && res.StatusCode == http.StatusNotModified {
  44884. if res.Body != nil {
  44885. res.Body.Close()
  44886. }
  44887. return nil, &googleapi.Error{
  44888. Code: res.StatusCode,
  44889. Header: res.Header,
  44890. }
  44891. }
  44892. if err != nil {
  44893. return nil, err
  44894. }
  44895. defer googleapi.CloseBody(res)
  44896. if err := googleapi.CheckResponse(res); err != nil {
  44897. return nil, err
  44898. }
  44899. ret := &Operation{
  44900. ServerResponse: googleapi.ServerResponse{
  44901. Header: res.Header,
  44902. HTTPStatusCode: res.StatusCode,
  44903. },
  44904. }
  44905. target := &ret
  44906. if err := gensupport.DecodeResponse(target, res); err != nil {
  44907. return nil, err
  44908. }
  44909. return ret, nil
  44910. // {
  44911. // "description": "Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.",
  44912. // "httpMethod": "POST",
  44913. // "id": "compute.images.setLabels",
  44914. // "parameterOrder": [
  44915. // "project",
  44916. // "resource"
  44917. // ],
  44918. // "parameters": {
  44919. // "project": {
  44920. // "description": "Project ID for this request.",
  44921. // "location": "path",
  44922. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  44923. // "required": true,
  44924. // "type": "string"
  44925. // },
  44926. // "resource": {
  44927. // "description": "Name or id of the resource for this request.",
  44928. // "location": "path",
  44929. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  44930. // "required": true,
  44931. // "type": "string"
  44932. // }
  44933. // },
  44934. // "path": "{project}/global/images/{resource}/setLabels",
  44935. // "request": {
  44936. // "$ref": "GlobalSetLabelsRequest"
  44937. // },
  44938. // "response": {
  44939. // "$ref": "Operation"
  44940. // },
  44941. // "scopes": [
  44942. // "https://www.googleapis.com/auth/cloud-platform",
  44943. // "https://www.googleapis.com/auth/compute"
  44944. // ]
  44945. // }
  44946. }
  44947. // method id "compute.images.testIamPermissions":
  44948. type ImagesTestIamPermissionsCall struct {
  44949. s *Service
  44950. project string
  44951. resource string
  44952. testpermissionsrequest *TestPermissionsRequest
  44953. urlParams_ gensupport.URLParams
  44954. ctx_ context.Context
  44955. header_ http.Header
  44956. }
  44957. // TestIamPermissions: Returns permissions that a caller has on the
  44958. // specified resource.
  44959. func (r *ImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *ImagesTestIamPermissionsCall {
  44960. c := &ImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44961. c.project = project
  44962. c.resource = resource
  44963. c.testpermissionsrequest = testpermissionsrequest
  44964. return c
  44965. }
  44966. // Fields allows partial responses to be retrieved. See
  44967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44968. // for more information.
  44969. func (c *ImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ImagesTestIamPermissionsCall {
  44970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44971. return c
  44972. }
  44973. // Context sets the context to be used in this call's Do method. Any
  44974. // pending HTTP request will be aborted if the provided context is
  44975. // canceled.
  44976. func (c *ImagesTestIamPermissionsCall) Context(ctx context.Context) *ImagesTestIamPermissionsCall {
  44977. c.ctx_ = ctx
  44978. return c
  44979. }
  44980. // Header returns an http.Header that can be modified by the caller to
  44981. // add HTTP headers to the request.
  44982. func (c *ImagesTestIamPermissionsCall) Header() http.Header {
  44983. if c.header_ == nil {
  44984. c.header_ = make(http.Header)
  44985. }
  44986. return c.header_
  44987. }
  44988. func (c *ImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  44989. reqHeaders := make(http.Header)
  44990. for k, v := range c.header_ {
  44991. reqHeaders[k] = v
  44992. }
  44993. reqHeaders.Set("User-Agent", c.s.userAgent())
  44994. var body io.Reader = nil
  44995. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  44996. if err != nil {
  44997. return nil, err
  44998. }
  44999. reqHeaders.Set("Content-Type", "application/json")
  45000. c.urlParams_.Set("alt", alt)
  45001. c.urlParams_.Set("prettyPrint", "false")
  45002. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{resource}/testIamPermissions")
  45003. urls += "?" + c.urlParams_.Encode()
  45004. req, err := http.NewRequest("POST", urls, body)
  45005. if err != nil {
  45006. return nil, err
  45007. }
  45008. req.Header = reqHeaders
  45009. googleapi.Expand(req.URL, map[string]string{
  45010. "project": c.project,
  45011. "resource": c.resource,
  45012. })
  45013. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45014. }
  45015. // Do executes the "compute.images.testIamPermissions" call.
  45016. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  45017. // non-2xx status code is an error. Response headers are in either
  45018. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  45019. // returned at all) in error.(*googleapi.Error).Header. Use
  45020. // googleapi.IsNotModified to check whether the returned error was
  45021. // because http.StatusNotModified was returned.
  45022. func (c *ImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, 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 := &TestPermissionsResponse{
  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": "Returns permissions that a caller has on the specified resource.",
  45054. // "httpMethod": "POST",
  45055. // "id": "compute.images.testIamPermissions",
  45056. // "parameterOrder": [
  45057. // "project",
  45058. // "resource"
  45059. // ],
  45060. // "parameters": {
  45061. // "project": {
  45062. // "description": "Project ID for this request.",
  45063. // "location": "path",
  45064. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45065. // "required": true,
  45066. // "type": "string"
  45067. // },
  45068. // "resource": {
  45069. // "description": "Name or id of the resource for this request.",
  45070. // "location": "path",
  45071. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  45072. // "required": true,
  45073. // "type": "string"
  45074. // }
  45075. // },
  45076. // "path": "{project}/global/images/{resource}/testIamPermissions",
  45077. // "request": {
  45078. // "$ref": "TestPermissionsRequest"
  45079. // },
  45080. // "response": {
  45081. // "$ref": "TestPermissionsResponse"
  45082. // },
  45083. // "scopes": [
  45084. // "https://www.googleapis.com/auth/cloud-platform",
  45085. // "https://www.googleapis.com/auth/compute",
  45086. // "https://www.googleapis.com/auth/compute.readonly"
  45087. // ]
  45088. // }
  45089. }
  45090. // method id "compute.instanceGroupManagers.abandonInstances":
  45091. type InstanceGroupManagersAbandonInstancesCall struct {
  45092. s *Service
  45093. project string
  45094. zone string
  45095. instanceGroupManager string
  45096. instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest
  45097. urlParams_ gensupport.URLParams
  45098. ctx_ context.Context
  45099. header_ http.Header
  45100. }
  45101. // AbandonInstances: Flags the specified instances to be removed from
  45102. // the managed instance group. Abandoning an instance does not delete
  45103. // the instance, but it does remove the instance from any target pools
  45104. // that are applied by the managed instance group. This method reduces
  45105. // the targetSize of the managed instance group by the number of
  45106. // instances that you abandon. This operation is marked as DONE when the
  45107. // action is scheduled even if the instances have not yet been removed
  45108. // from the group. You must separately verify the status of the
  45109. // abandoning action with the listmanagedinstances method.
  45110. //
  45111. // If the group is part of a backend service that has enabled connection
  45112. // draining, it can take up to 60 seconds after the connection draining
  45113. // duration has elapsed before the VM instance is removed or
  45114. // deleted.
  45115. //
  45116. // You can specify a maximum of 1000 instances with this method per
  45117. // request.
  45118. func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall {
  45119. c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45120. c.project = project
  45121. c.zone = zone
  45122. c.instanceGroupManager = instanceGroupManager
  45123. c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest
  45124. return c
  45125. }
  45126. // RequestId sets the optional parameter "requestId": An optional
  45127. // request ID to identify requests. Specify a unique request ID so that
  45128. // if you must retry your request, the server will know to ignore the
  45129. // request if it has already been completed.
  45130. //
  45131. // For example, consider a situation where you make an initial request
  45132. // and the request times out. If you make the request again with the
  45133. // same request ID, the server can check if original operation with the
  45134. // same request ID was received, and if so, will ignore the second
  45135. // request. This prevents clients from accidentally creating duplicate
  45136. // commitments.
  45137. //
  45138. // The request ID must be a valid UUID with the exception that zero UUID
  45139. // is not supported (00000000-0000-0000-0000-000000000000).
  45140. func (c *InstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *InstanceGroupManagersAbandonInstancesCall {
  45141. c.urlParams_.Set("requestId", requestId)
  45142. return c
  45143. }
  45144. // Fields allows partial responses to be retrieved. See
  45145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45146. // for more information.
  45147. func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall {
  45148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45149. return c
  45150. }
  45151. // Context sets the context to be used in this call's Do method. Any
  45152. // pending HTTP request will be aborted if the provided context is
  45153. // canceled.
  45154. func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall {
  45155. c.ctx_ = ctx
  45156. return c
  45157. }
  45158. // Header returns an http.Header that can be modified by the caller to
  45159. // add HTTP headers to the request.
  45160. func (c *InstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  45161. if c.header_ == nil {
  45162. c.header_ = make(http.Header)
  45163. }
  45164. return c.header_
  45165. }
  45166. func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  45167. reqHeaders := make(http.Header)
  45168. for k, v := range c.header_ {
  45169. reqHeaders[k] = v
  45170. }
  45171. reqHeaders.Set("User-Agent", c.s.userAgent())
  45172. var body io.Reader = nil
  45173. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest)
  45174. if err != nil {
  45175. return nil, err
  45176. }
  45177. reqHeaders.Set("Content-Type", "application/json")
  45178. c.urlParams_.Set("alt", alt)
  45179. c.urlParams_.Set("prettyPrint", "false")
  45180. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  45181. urls += "?" + c.urlParams_.Encode()
  45182. req, err := http.NewRequest("POST", urls, body)
  45183. if err != nil {
  45184. return nil, err
  45185. }
  45186. req.Header = reqHeaders
  45187. googleapi.Expand(req.URL, map[string]string{
  45188. "project": c.project,
  45189. "zone": c.zone,
  45190. "instanceGroupManager": c.instanceGroupManager,
  45191. })
  45192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45193. }
  45194. // Do executes the "compute.instanceGroupManagers.abandonInstances" call.
  45195. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45196. // status code is an error. Response headers are in either
  45197. // *Operation.ServerResponse.Header or (if a response was returned at
  45198. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45199. // to check whether the returned error was because
  45200. // http.StatusNotModified was returned.
  45201. func (c *InstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45202. gensupport.SetOptions(c.urlParams_, opts...)
  45203. res, err := c.doRequest("json")
  45204. if res != nil && res.StatusCode == http.StatusNotModified {
  45205. if res.Body != nil {
  45206. res.Body.Close()
  45207. }
  45208. return nil, &googleapi.Error{
  45209. Code: res.StatusCode,
  45210. Header: res.Header,
  45211. }
  45212. }
  45213. if err != nil {
  45214. return nil, err
  45215. }
  45216. defer googleapi.CloseBody(res)
  45217. if err := googleapi.CheckResponse(res); err != nil {
  45218. return nil, err
  45219. }
  45220. ret := &Operation{
  45221. ServerResponse: googleapi.ServerResponse{
  45222. Header: res.Header,
  45223. HTTPStatusCode: res.StatusCode,
  45224. },
  45225. }
  45226. target := &ret
  45227. if err := gensupport.DecodeResponse(target, res); err != nil {
  45228. return nil, err
  45229. }
  45230. return ret, nil
  45231. // {
  45232. // "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.",
  45233. // "httpMethod": "POST",
  45234. // "id": "compute.instanceGroupManagers.abandonInstances",
  45235. // "parameterOrder": [
  45236. // "project",
  45237. // "zone",
  45238. // "instanceGroupManager"
  45239. // ],
  45240. // "parameters": {
  45241. // "instanceGroupManager": {
  45242. // "description": "The name of the managed instance group.",
  45243. // "location": "path",
  45244. // "required": true,
  45245. // "type": "string"
  45246. // },
  45247. // "project": {
  45248. // "description": "Project ID for this request.",
  45249. // "location": "path",
  45250. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45251. // "required": true,
  45252. // "type": "string"
  45253. // },
  45254. // "requestId": {
  45255. // "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).",
  45256. // "location": "query",
  45257. // "type": "string"
  45258. // },
  45259. // "zone": {
  45260. // "description": "The name of the zone where the managed instance group is located.",
  45261. // "location": "path",
  45262. // "required": true,
  45263. // "type": "string"
  45264. // }
  45265. // },
  45266. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  45267. // "request": {
  45268. // "$ref": "InstanceGroupManagersAbandonInstancesRequest"
  45269. // },
  45270. // "response": {
  45271. // "$ref": "Operation"
  45272. // },
  45273. // "scopes": [
  45274. // "https://www.googleapis.com/auth/cloud-platform",
  45275. // "https://www.googleapis.com/auth/compute"
  45276. // ]
  45277. // }
  45278. }
  45279. // method id "compute.instanceGroupManagers.aggregatedList":
  45280. type InstanceGroupManagersAggregatedListCall struct {
  45281. s *Service
  45282. project string
  45283. urlParams_ gensupport.URLParams
  45284. ifNoneMatch_ string
  45285. ctx_ context.Context
  45286. header_ http.Header
  45287. }
  45288. // AggregatedList: Retrieves the list of managed instance groups and
  45289. // groups them by zone.
  45290. func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall {
  45291. c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45292. c.project = project
  45293. return c
  45294. }
  45295. // Filter sets the optional parameter "filter": A filter expression that
  45296. // filters resources listed in the response. The expression must specify
  45297. // the field name, a comparison operator, and the value that you want to
  45298. // use for filtering. The value must be a string, a number, or a
  45299. // boolean. The comparison operator must be either =, !=, >, or <.
  45300. //
  45301. // For example, if you are filtering Compute Engine instances, you can
  45302. // exclude instances named example-instance by specifying name !=
  45303. // example-instance.
  45304. //
  45305. // You can also filter nested fields. For example, you could specify
  45306. // scheduling.automaticRestart = false to include instances only if they
  45307. // are not scheduled for automatic restarts. You can use filtering on
  45308. // nested fields to filter based on resource labels.
  45309. //
  45310. // To filter on multiple expressions, provide each separate expression
  45311. // within parentheses. For example, (scheduling.automaticRestart = true)
  45312. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  45313. // AND expression. However, you can include AND and OR expressions
  45314. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  45315. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  45316. // true).
  45317. func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall {
  45318. c.urlParams_.Set("filter", filter)
  45319. return c
  45320. }
  45321. // MaxResults sets the optional parameter "maxResults": The maximum
  45322. // number of results per page that should be returned. If the number of
  45323. // available results is larger than maxResults, Compute Engine returns a
  45324. // nextPageToken that can be used to get the next page of results in
  45325. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  45326. // (Default: 500)
  45327. func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall {
  45328. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45329. return c
  45330. }
  45331. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  45332. // a certain order. By default, results are returned in alphanumerical
  45333. // order based on the resource name.
  45334. //
  45335. // You can also sort results in descending order based on the creation
  45336. // timestamp using orderBy="creationTimestamp desc". This sorts results
  45337. // based on the creationTimestamp field in reverse chronological order
  45338. // (newest result first). Use this to sort resources like operations so
  45339. // that the newest operation is returned first.
  45340. //
  45341. // Currently, only sorting by name or creationTimestamp desc is
  45342. // supported.
  45343. func (c *InstanceGroupManagersAggregatedListCall) OrderBy(orderBy string) *InstanceGroupManagersAggregatedListCall {
  45344. c.urlParams_.Set("orderBy", orderBy)
  45345. return c
  45346. }
  45347. // PageToken sets the optional parameter "pageToken": Specifies a page
  45348. // token to use. Set pageToken to the nextPageToken returned by a
  45349. // previous list request to get the next page of results.
  45350. func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall {
  45351. c.urlParams_.Set("pageToken", pageToken)
  45352. return c
  45353. }
  45354. // Fields allows partial responses to be retrieved. See
  45355. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45356. // for more information.
  45357. func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall {
  45358. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45359. return c
  45360. }
  45361. // IfNoneMatch sets the optional parameter which makes the operation
  45362. // fail if the object's ETag matches the given value. This is useful for
  45363. // getting updates only after the object has changed since the last
  45364. // request. Use googleapi.IsNotModified to check whether the response
  45365. // error from Do is the result of In-None-Match.
  45366. func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall {
  45367. c.ifNoneMatch_ = entityTag
  45368. return c
  45369. }
  45370. // Context sets the context to be used in this call's Do method. Any
  45371. // pending HTTP request will be aborted if the provided context is
  45372. // canceled.
  45373. func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall {
  45374. c.ctx_ = ctx
  45375. return c
  45376. }
  45377. // Header returns an http.Header that can be modified by the caller to
  45378. // add HTTP headers to the request.
  45379. func (c *InstanceGroupManagersAggregatedListCall) Header() http.Header {
  45380. if c.header_ == nil {
  45381. c.header_ = make(http.Header)
  45382. }
  45383. return c.header_
  45384. }
  45385. func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  45386. reqHeaders := make(http.Header)
  45387. for k, v := range c.header_ {
  45388. reqHeaders[k] = v
  45389. }
  45390. reqHeaders.Set("User-Agent", c.s.userAgent())
  45391. if c.ifNoneMatch_ != "" {
  45392. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45393. }
  45394. var body io.Reader = nil
  45395. c.urlParams_.Set("alt", alt)
  45396. c.urlParams_.Set("prettyPrint", "false")
  45397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers")
  45398. urls += "?" + c.urlParams_.Encode()
  45399. req, err := http.NewRequest("GET", urls, body)
  45400. if err != nil {
  45401. return nil, err
  45402. }
  45403. req.Header = reqHeaders
  45404. googleapi.Expand(req.URL, map[string]string{
  45405. "project": c.project,
  45406. })
  45407. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45408. }
  45409. // Do executes the "compute.instanceGroupManagers.aggregatedList" call.
  45410. // Exactly one of *InstanceGroupManagerAggregatedList or error will be
  45411. // non-nil. Any non-2xx status code is an error. Response headers are in
  45412. // either *InstanceGroupManagerAggregatedList.ServerResponse.Header or
  45413. // (if a response was returned at all) in
  45414. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  45415. // whether the returned error was because http.StatusNotModified was
  45416. // returned.
  45417. func (c *InstanceGroupManagersAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerAggregatedList, error) {
  45418. gensupport.SetOptions(c.urlParams_, opts...)
  45419. res, err := c.doRequest("json")
  45420. if res != nil && res.StatusCode == http.StatusNotModified {
  45421. if res.Body != nil {
  45422. res.Body.Close()
  45423. }
  45424. return nil, &googleapi.Error{
  45425. Code: res.StatusCode,
  45426. Header: res.Header,
  45427. }
  45428. }
  45429. if err != nil {
  45430. return nil, err
  45431. }
  45432. defer googleapi.CloseBody(res)
  45433. if err := googleapi.CheckResponse(res); err != nil {
  45434. return nil, err
  45435. }
  45436. ret := &InstanceGroupManagerAggregatedList{
  45437. ServerResponse: googleapi.ServerResponse{
  45438. Header: res.Header,
  45439. HTTPStatusCode: res.StatusCode,
  45440. },
  45441. }
  45442. target := &ret
  45443. if err := gensupport.DecodeResponse(target, res); err != nil {
  45444. return nil, err
  45445. }
  45446. return ret, nil
  45447. // {
  45448. // "description": "Retrieves the list of managed instance groups and groups them by zone.",
  45449. // "httpMethod": "GET",
  45450. // "id": "compute.instanceGroupManagers.aggregatedList",
  45451. // "parameterOrder": [
  45452. // "project"
  45453. // ],
  45454. // "parameters": {
  45455. // "filter": {
  45456. // "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).",
  45457. // "location": "query",
  45458. // "type": "string"
  45459. // },
  45460. // "maxResults": {
  45461. // "default": "500",
  45462. // "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)",
  45463. // "format": "uint32",
  45464. // "location": "query",
  45465. // "minimum": "0",
  45466. // "type": "integer"
  45467. // },
  45468. // "orderBy": {
  45469. // "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.",
  45470. // "location": "query",
  45471. // "type": "string"
  45472. // },
  45473. // "pageToken": {
  45474. // "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.",
  45475. // "location": "query",
  45476. // "type": "string"
  45477. // },
  45478. // "project": {
  45479. // "description": "Project ID for this request.",
  45480. // "location": "path",
  45481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45482. // "required": true,
  45483. // "type": "string"
  45484. // }
  45485. // },
  45486. // "path": "{project}/aggregated/instanceGroupManagers",
  45487. // "response": {
  45488. // "$ref": "InstanceGroupManagerAggregatedList"
  45489. // },
  45490. // "scopes": [
  45491. // "https://www.googleapis.com/auth/cloud-platform",
  45492. // "https://www.googleapis.com/auth/compute",
  45493. // "https://www.googleapis.com/auth/compute.readonly"
  45494. // ]
  45495. // }
  45496. }
  45497. // Pages invokes f for each page of results.
  45498. // A non-nil error returned from f will halt the iteration.
  45499. // The provided context supersedes any context provided to the Context method.
  45500. func (c *InstanceGroupManagersAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerAggregatedList) error) error {
  45501. c.ctx_ = ctx
  45502. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45503. for {
  45504. x, err := c.Do()
  45505. if err != nil {
  45506. return err
  45507. }
  45508. if err := f(x); err != nil {
  45509. return err
  45510. }
  45511. if x.NextPageToken == "" {
  45512. return nil
  45513. }
  45514. c.PageToken(x.NextPageToken)
  45515. }
  45516. }
  45517. // method id "compute.instanceGroupManagers.delete":
  45518. type InstanceGroupManagersDeleteCall struct {
  45519. s *Service
  45520. project string
  45521. zone string
  45522. instanceGroupManager string
  45523. urlParams_ gensupport.URLParams
  45524. ctx_ context.Context
  45525. header_ http.Header
  45526. }
  45527. // Delete: Deletes the specified managed instance group and all of the
  45528. // instances in that group. Note that the instance group must not belong
  45529. // to a backend service. Read Deleting an instance group for more
  45530. // information.
  45531. func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall {
  45532. c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45533. c.project = project
  45534. c.zone = zone
  45535. c.instanceGroupManager = instanceGroupManager
  45536. return c
  45537. }
  45538. // RequestId sets the optional parameter "requestId": An optional
  45539. // request ID to identify requests. Specify a unique request ID so that
  45540. // if you must retry your request, the server will know to ignore the
  45541. // request if it has already been completed.
  45542. //
  45543. // For example, consider a situation where you make an initial request
  45544. // and the request times out. If you make the request again with the
  45545. // same request ID, the server can check if original operation with the
  45546. // same request ID was received, and if so, will ignore the second
  45547. // request. This prevents clients from accidentally creating duplicate
  45548. // commitments.
  45549. //
  45550. // The request ID must be a valid UUID with the exception that zero UUID
  45551. // is not supported (00000000-0000-0000-0000-000000000000).
  45552. func (c *InstanceGroupManagersDeleteCall) RequestId(requestId string) *InstanceGroupManagersDeleteCall {
  45553. c.urlParams_.Set("requestId", requestId)
  45554. return c
  45555. }
  45556. // Fields allows partial responses to be retrieved. See
  45557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45558. // for more information.
  45559. func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall {
  45560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45561. return c
  45562. }
  45563. // Context sets the context to be used in this call's Do method. Any
  45564. // pending HTTP request will be aborted if the provided context is
  45565. // canceled.
  45566. func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall {
  45567. c.ctx_ = ctx
  45568. return c
  45569. }
  45570. // Header returns an http.Header that can be modified by the caller to
  45571. // add HTTP headers to the request.
  45572. func (c *InstanceGroupManagersDeleteCall) Header() http.Header {
  45573. if c.header_ == nil {
  45574. c.header_ = make(http.Header)
  45575. }
  45576. return c.header_
  45577. }
  45578. func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  45579. reqHeaders := make(http.Header)
  45580. for k, v := range c.header_ {
  45581. reqHeaders[k] = v
  45582. }
  45583. reqHeaders.Set("User-Agent", c.s.userAgent())
  45584. var body io.Reader = nil
  45585. c.urlParams_.Set("alt", alt)
  45586. c.urlParams_.Set("prettyPrint", "false")
  45587. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  45588. urls += "?" + c.urlParams_.Encode()
  45589. req, err := http.NewRequest("DELETE", urls, body)
  45590. if err != nil {
  45591. return nil, err
  45592. }
  45593. req.Header = reqHeaders
  45594. googleapi.Expand(req.URL, map[string]string{
  45595. "project": c.project,
  45596. "zone": c.zone,
  45597. "instanceGroupManager": c.instanceGroupManager,
  45598. })
  45599. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45600. }
  45601. // Do executes the "compute.instanceGroupManagers.delete" call.
  45602. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45603. // status code is an error. Response headers are in either
  45604. // *Operation.ServerResponse.Header or (if a response was returned at
  45605. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45606. // to check whether the returned error was because
  45607. // http.StatusNotModified was returned.
  45608. func (c *InstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45609. gensupport.SetOptions(c.urlParams_, opts...)
  45610. res, err := c.doRequest("json")
  45611. if res != nil && res.StatusCode == http.StatusNotModified {
  45612. if res.Body != nil {
  45613. res.Body.Close()
  45614. }
  45615. return nil, &googleapi.Error{
  45616. Code: res.StatusCode,
  45617. Header: res.Header,
  45618. }
  45619. }
  45620. if err != nil {
  45621. return nil, err
  45622. }
  45623. defer googleapi.CloseBody(res)
  45624. if err := googleapi.CheckResponse(res); err != nil {
  45625. return nil, err
  45626. }
  45627. ret := &Operation{
  45628. ServerResponse: googleapi.ServerResponse{
  45629. Header: res.Header,
  45630. HTTPStatusCode: res.StatusCode,
  45631. },
  45632. }
  45633. target := &ret
  45634. if err := gensupport.DecodeResponse(target, res); err != nil {
  45635. return nil, err
  45636. }
  45637. return ret, nil
  45638. // {
  45639. // "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.",
  45640. // "httpMethod": "DELETE",
  45641. // "id": "compute.instanceGroupManagers.delete",
  45642. // "parameterOrder": [
  45643. // "project",
  45644. // "zone",
  45645. // "instanceGroupManager"
  45646. // ],
  45647. // "parameters": {
  45648. // "instanceGroupManager": {
  45649. // "description": "The name of the managed instance group to delete.",
  45650. // "location": "path",
  45651. // "required": true,
  45652. // "type": "string"
  45653. // },
  45654. // "project": {
  45655. // "description": "Project ID for this request.",
  45656. // "location": "path",
  45657. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45658. // "required": true,
  45659. // "type": "string"
  45660. // },
  45661. // "requestId": {
  45662. // "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).",
  45663. // "location": "query",
  45664. // "type": "string"
  45665. // },
  45666. // "zone": {
  45667. // "description": "The name of the zone where the managed instance group is located.",
  45668. // "location": "path",
  45669. // "required": true,
  45670. // "type": "string"
  45671. // }
  45672. // },
  45673. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  45674. // "response": {
  45675. // "$ref": "Operation"
  45676. // },
  45677. // "scopes": [
  45678. // "https://www.googleapis.com/auth/cloud-platform",
  45679. // "https://www.googleapis.com/auth/compute"
  45680. // ]
  45681. // }
  45682. }
  45683. // method id "compute.instanceGroupManagers.deleteInstances":
  45684. type InstanceGroupManagersDeleteInstancesCall struct {
  45685. s *Service
  45686. project string
  45687. zone string
  45688. instanceGroupManager string
  45689. instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest
  45690. urlParams_ gensupport.URLParams
  45691. ctx_ context.Context
  45692. header_ http.Header
  45693. }
  45694. // DeleteInstances: Flags the specified instances in the managed
  45695. // instance group for immediate deletion. The instances are also removed
  45696. // from any target pools of which they were a member. This method
  45697. // reduces the targetSize of the managed instance group by the number of
  45698. // instances that you delete. This operation is marked as DONE when the
  45699. // action is scheduled even if the instances are still being deleted.
  45700. // You must separately verify the status of the deleting action with the
  45701. // listmanagedinstances method.
  45702. //
  45703. // If the group is part of a backend service that has enabled connection
  45704. // draining, it can take up to 60 seconds after the connection draining
  45705. // duration has elapsed before the VM instance is removed or
  45706. // deleted.
  45707. //
  45708. // You can specify a maximum of 1000 instances with this method per
  45709. // request.
  45710. func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall {
  45711. c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45712. c.project = project
  45713. c.zone = zone
  45714. c.instanceGroupManager = instanceGroupManager
  45715. c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest
  45716. return c
  45717. }
  45718. // RequestId sets the optional parameter "requestId": An optional
  45719. // request ID to identify requests. Specify a unique request ID so that
  45720. // if you must retry your request, the server will know to ignore the
  45721. // request if it has already been completed.
  45722. //
  45723. // For example, consider a situation where you make an initial request
  45724. // and the request times out. If you make the request again with the
  45725. // same request ID, the server can check if original operation with the
  45726. // same request ID was received, and if so, will ignore the second
  45727. // request. This prevents clients from accidentally creating duplicate
  45728. // commitments.
  45729. //
  45730. // The request ID must be a valid UUID with the exception that zero UUID
  45731. // is not supported (00000000-0000-0000-0000-000000000000).
  45732. func (c *InstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *InstanceGroupManagersDeleteInstancesCall {
  45733. c.urlParams_.Set("requestId", requestId)
  45734. return c
  45735. }
  45736. // Fields allows partial responses to be retrieved. See
  45737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45738. // for more information.
  45739. func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall {
  45740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45741. return c
  45742. }
  45743. // Context sets the context to be used in this call's Do method. Any
  45744. // pending HTTP request will be aborted if the provided context is
  45745. // canceled.
  45746. func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall {
  45747. c.ctx_ = ctx
  45748. return c
  45749. }
  45750. // Header returns an http.Header that can be modified by the caller to
  45751. // add HTTP headers to the request.
  45752. func (c *InstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  45753. if c.header_ == nil {
  45754. c.header_ = make(http.Header)
  45755. }
  45756. return c.header_
  45757. }
  45758. func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  45759. reqHeaders := make(http.Header)
  45760. for k, v := range c.header_ {
  45761. reqHeaders[k] = v
  45762. }
  45763. reqHeaders.Set("User-Agent", c.s.userAgent())
  45764. var body io.Reader = nil
  45765. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest)
  45766. if err != nil {
  45767. return nil, err
  45768. }
  45769. reqHeaders.Set("Content-Type", "application/json")
  45770. c.urlParams_.Set("alt", alt)
  45771. c.urlParams_.Set("prettyPrint", "false")
  45772. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  45773. urls += "?" + c.urlParams_.Encode()
  45774. req, err := http.NewRequest("POST", urls, body)
  45775. if err != nil {
  45776. return nil, err
  45777. }
  45778. req.Header = reqHeaders
  45779. googleapi.Expand(req.URL, map[string]string{
  45780. "project": c.project,
  45781. "zone": c.zone,
  45782. "instanceGroupManager": c.instanceGroupManager,
  45783. })
  45784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45785. }
  45786. // Do executes the "compute.instanceGroupManagers.deleteInstances" call.
  45787. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  45788. // status code is an error. Response headers are in either
  45789. // *Operation.ServerResponse.Header or (if a response was returned at
  45790. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45791. // to check whether the returned error was because
  45792. // http.StatusNotModified was returned.
  45793. func (c *InstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  45794. gensupport.SetOptions(c.urlParams_, opts...)
  45795. res, err := c.doRequest("json")
  45796. if res != nil && res.StatusCode == http.StatusNotModified {
  45797. if res.Body != nil {
  45798. res.Body.Close()
  45799. }
  45800. return nil, &googleapi.Error{
  45801. Code: res.StatusCode,
  45802. Header: res.Header,
  45803. }
  45804. }
  45805. if err != nil {
  45806. return nil, err
  45807. }
  45808. defer googleapi.CloseBody(res)
  45809. if err := googleapi.CheckResponse(res); err != nil {
  45810. return nil, err
  45811. }
  45812. ret := &Operation{
  45813. ServerResponse: googleapi.ServerResponse{
  45814. Header: res.Header,
  45815. HTTPStatusCode: res.StatusCode,
  45816. },
  45817. }
  45818. target := &ret
  45819. if err := gensupport.DecodeResponse(target, res); err != nil {
  45820. return nil, err
  45821. }
  45822. return ret, nil
  45823. // {
  45824. // "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.",
  45825. // "httpMethod": "POST",
  45826. // "id": "compute.instanceGroupManagers.deleteInstances",
  45827. // "parameterOrder": [
  45828. // "project",
  45829. // "zone",
  45830. // "instanceGroupManager"
  45831. // ],
  45832. // "parameters": {
  45833. // "instanceGroupManager": {
  45834. // "description": "The name of the managed instance group.",
  45835. // "location": "path",
  45836. // "required": true,
  45837. // "type": "string"
  45838. // },
  45839. // "project": {
  45840. // "description": "Project ID for this request.",
  45841. // "location": "path",
  45842. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  45843. // "required": true,
  45844. // "type": "string"
  45845. // },
  45846. // "requestId": {
  45847. // "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).",
  45848. // "location": "query",
  45849. // "type": "string"
  45850. // },
  45851. // "zone": {
  45852. // "description": "The name of the zone where the managed instance group is located.",
  45853. // "location": "path",
  45854. // "required": true,
  45855. // "type": "string"
  45856. // }
  45857. // },
  45858. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  45859. // "request": {
  45860. // "$ref": "InstanceGroupManagersDeleteInstancesRequest"
  45861. // },
  45862. // "response": {
  45863. // "$ref": "Operation"
  45864. // },
  45865. // "scopes": [
  45866. // "https://www.googleapis.com/auth/cloud-platform",
  45867. // "https://www.googleapis.com/auth/compute"
  45868. // ]
  45869. // }
  45870. }
  45871. // method id "compute.instanceGroupManagers.get":
  45872. type InstanceGroupManagersGetCall struct {
  45873. s *Service
  45874. project string
  45875. zone string
  45876. instanceGroupManager string
  45877. urlParams_ gensupport.URLParams
  45878. ifNoneMatch_ string
  45879. ctx_ context.Context
  45880. header_ http.Header
  45881. }
  45882. // Get: Returns all of the details about the specified managed instance
  45883. // group. Gets a list of available managed instance groups by making a
  45884. // list() request.
  45885. func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall {
  45886. c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45887. c.project = project
  45888. c.zone = zone
  45889. c.instanceGroupManager = instanceGroupManager
  45890. return c
  45891. }
  45892. // Fields allows partial responses to be retrieved. See
  45893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45894. // for more information.
  45895. func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall {
  45896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45897. return c
  45898. }
  45899. // IfNoneMatch sets the optional parameter which makes the operation
  45900. // fail if the object's ETag matches the given value. This is useful for
  45901. // getting updates only after the object has changed since the last
  45902. // request. Use googleapi.IsNotModified to check whether the response
  45903. // error from Do is the result of In-None-Match.
  45904. func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall {
  45905. c.ifNoneMatch_ = entityTag
  45906. return c
  45907. }
  45908. // Context sets the context to be used in this call's Do method. Any
  45909. // pending HTTP request will be aborted if the provided context is
  45910. // canceled.
  45911. func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall {
  45912. c.ctx_ = ctx
  45913. return c
  45914. }
  45915. // Header returns an http.Header that can be modified by the caller to
  45916. // add HTTP headers to the request.
  45917. func (c *InstanceGroupManagersGetCall) Header() http.Header {
  45918. if c.header_ == nil {
  45919. c.header_ = make(http.Header)
  45920. }
  45921. return c.header_
  45922. }
  45923. func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  45924. reqHeaders := make(http.Header)
  45925. for k, v := range c.header_ {
  45926. reqHeaders[k] = v
  45927. }
  45928. reqHeaders.Set("User-Agent", c.s.userAgent())
  45929. if c.ifNoneMatch_ != "" {
  45930. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45931. }
  45932. var body io.Reader = nil
  45933. c.urlParams_.Set("alt", alt)
  45934. c.urlParams_.Set("prettyPrint", "false")
  45935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  45936. urls += "?" + c.urlParams_.Encode()
  45937. req, err := http.NewRequest("GET", urls, body)
  45938. if err != nil {
  45939. return nil, err
  45940. }
  45941. req.Header = reqHeaders
  45942. googleapi.Expand(req.URL, map[string]string{
  45943. "project": c.project,
  45944. "zone": c.zone,
  45945. "instanceGroupManager": c.instanceGroupManager,
  45946. })
  45947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45948. }
  45949. // Do executes the "compute.instanceGroupManagers.get" call.
  45950. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  45951. // non-2xx status code is an error. Response headers are in either
  45952. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  45953. // returned at all) in error.(*googleapi.Error).Header. Use
  45954. // googleapi.IsNotModified to check whether the returned error was
  45955. // because http.StatusNotModified was returned.
  45956. func (c *InstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  45957. gensupport.SetOptions(c.urlParams_, opts...)
  45958. res, err := c.doRequest("json")
  45959. if res != nil && res.StatusCode == http.StatusNotModified {
  45960. if res.Body != nil {
  45961. res.Body.Close()
  45962. }
  45963. return nil, &googleapi.Error{
  45964. Code: res.StatusCode,
  45965. Header: res.Header,
  45966. }
  45967. }
  45968. if err != nil {
  45969. return nil, err
  45970. }
  45971. defer googleapi.CloseBody(res)
  45972. if err := googleapi.CheckResponse(res); err != nil {
  45973. return nil, err
  45974. }
  45975. ret := &InstanceGroupManager{
  45976. ServerResponse: googleapi.ServerResponse{
  45977. Header: res.Header,
  45978. HTTPStatusCode: res.StatusCode,
  45979. },
  45980. }
  45981. target := &ret
  45982. if err := gensupport.DecodeResponse(target, res); err != nil {
  45983. return nil, err
  45984. }
  45985. return ret, nil
  45986. // {
  45987. // "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.",
  45988. // "httpMethod": "GET",
  45989. // "id": "compute.instanceGroupManagers.get",
  45990. // "parameterOrder": [
  45991. // "project",
  45992. // "zone",
  45993. // "instanceGroupManager"
  45994. // ],
  45995. // "parameters": {
  45996. // "instanceGroupManager": {
  45997. // "description": "The name of the managed instance group.",
  45998. // "location": "path",
  45999. // "required": true,
  46000. // "type": "string"
  46001. // },
  46002. // "project": {
  46003. // "description": "Project ID for this request.",
  46004. // "location": "path",
  46005. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46006. // "required": true,
  46007. // "type": "string"
  46008. // },
  46009. // "zone": {
  46010. // "description": "The name of the zone where the managed instance group is located.",
  46011. // "location": "path",
  46012. // "required": true,
  46013. // "type": "string"
  46014. // }
  46015. // },
  46016. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  46017. // "response": {
  46018. // "$ref": "InstanceGroupManager"
  46019. // },
  46020. // "scopes": [
  46021. // "https://www.googleapis.com/auth/cloud-platform",
  46022. // "https://www.googleapis.com/auth/compute",
  46023. // "https://www.googleapis.com/auth/compute.readonly"
  46024. // ]
  46025. // }
  46026. }
  46027. // method id "compute.instanceGroupManagers.insert":
  46028. type InstanceGroupManagersInsertCall struct {
  46029. s *Service
  46030. project string
  46031. zone string
  46032. instancegroupmanager *InstanceGroupManager
  46033. urlParams_ gensupport.URLParams
  46034. ctx_ context.Context
  46035. header_ http.Header
  46036. }
  46037. // Insert: Creates a managed instance group using the information that
  46038. // you specify in the request. After the group is created, instances in
  46039. // the group are created using the specified instance template. This
  46040. // operation is marked as DONE when the group is created even if the
  46041. // instances in the group have not yet been created. You must separately
  46042. // verify the status of the individual instances with the
  46043. // listmanagedinstances method.
  46044. //
  46045. // A managed instance group can have up to 1000 VM instances per group.
  46046. // Please contact Cloud Support if you need an increase in this limit.
  46047. func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall {
  46048. c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46049. c.project = project
  46050. c.zone = zone
  46051. c.instancegroupmanager = instancegroupmanager
  46052. return c
  46053. }
  46054. // RequestId sets the optional parameter "requestId": An optional
  46055. // request ID to identify requests. Specify a unique request ID so that
  46056. // if you must retry your request, the server will know to ignore the
  46057. // request if it has already been completed.
  46058. //
  46059. // For example, consider a situation where you make an initial request
  46060. // and the request times out. If you make the request again with the
  46061. // same request ID, the server can check if original operation with the
  46062. // same request ID was received, and if so, will ignore the second
  46063. // request. This prevents clients from accidentally creating duplicate
  46064. // commitments.
  46065. //
  46066. // The request ID must be a valid UUID with the exception that zero UUID
  46067. // is not supported (00000000-0000-0000-0000-000000000000).
  46068. func (c *InstanceGroupManagersInsertCall) RequestId(requestId string) *InstanceGroupManagersInsertCall {
  46069. c.urlParams_.Set("requestId", requestId)
  46070. return c
  46071. }
  46072. // Fields allows partial responses to be retrieved. See
  46073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46074. // for more information.
  46075. func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall {
  46076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46077. return c
  46078. }
  46079. // Context sets the context to be used in this call's Do method. Any
  46080. // pending HTTP request will be aborted if the provided context is
  46081. // canceled.
  46082. func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall {
  46083. c.ctx_ = ctx
  46084. return c
  46085. }
  46086. // Header returns an http.Header that can be modified by the caller to
  46087. // add HTTP headers to the request.
  46088. func (c *InstanceGroupManagersInsertCall) Header() http.Header {
  46089. if c.header_ == nil {
  46090. c.header_ = make(http.Header)
  46091. }
  46092. return c.header_
  46093. }
  46094. func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  46095. reqHeaders := make(http.Header)
  46096. for k, v := range c.header_ {
  46097. reqHeaders[k] = v
  46098. }
  46099. reqHeaders.Set("User-Agent", c.s.userAgent())
  46100. var body io.Reader = nil
  46101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  46102. if err != nil {
  46103. return nil, err
  46104. }
  46105. reqHeaders.Set("Content-Type", "application/json")
  46106. c.urlParams_.Set("alt", alt)
  46107. c.urlParams_.Set("prettyPrint", "false")
  46108. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  46109. urls += "?" + c.urlParams_.Encode()
  46110. req, err := http.NewRequest("POST", urls, body)
  46111. if err != nil {
  46112. return nil, err
  46113. }
  46114. req.Header = reqHeaders
  46115. googleapi.Expand(req.URL, map[string]string{
  46116. "project": c.project,
  46117. "zone": c.zone,
  46118. })
  46119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46120. }
  46121. // Do executes the "compute.instanceGroupManagers.insert" call.
  46122. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46123. // status code is an error. Response headers are in either
  46124. // *Operation.ServerResponse.Header or (if a response was returned at
  46125. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46126. // to check whether the returned error was because
  46127. // http.StatusNotModified was returned.
  46128. func (c *InstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46129. gensupport.SetOptions(c.urlParams_, opts...)
  46130. res, err := c.doRequest("json")
  46131. if res != nil && res.StatusCode == http.StatusNotModified {
  46132. if res.Body != nil {
  46133. res.Body.Close()
  46134. }
  46135. return nil, &googleapi.Error{
  46136. Code: res.StatusCode,
  46137. Header: res.Header,
  46138. }
  46139. }
  46140. if err != nil {
  46141. return nil, err
  46142. }
  46143. defer googleapi.CloseBody(res)
  46144. if err := googleapi.CheckResponse(res); err != nil {
  46145. return nil, err
  46146. }
  46147. ret := &Operation{
  46148. ServerResponse: googleapi.ServerResponse{
  46149. Header: res.Header,
  46150. HTTPStatusCode: res.StatusCode,
  46151. },
  46152. }
  46153. target := &ret
  46154. if err := gensupport.DecodeResponse(target, res); err != nil {
  46155. return nil, err
  46156. }
  46157. return ret, nil
  46158. // {
  46159. // "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.",
  46160. // "httpMethod": "POST",
  46161. // "id": "compute.instanceGroupManagers.insert",
  46162. // "parameterOrder": [
  46163. // "project",
  46164. // "zone"
  46165. // ],
  46166. // "parameters": {
  46167. // "project": {
  46168. // "description": "Project ID for this request.",
  46169. // "location": "path",
  46170. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46171. // "required": true,
  46172. // "type": "string"
  46173. // },
  46174. // "requestId": {
  46175. // "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).",
  46176. // "location": "query",
  46177. // "type": "string"
  46178. // },
  46179. // "zone": {
  46180. // "description": "The name of the zone where you want to create the managed instance group.",
  46181. // "location": "path",
  46182. // "required": true,
  46183. // "type": "string"
  46184. // }
  46185. // },
  46186. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  46187. // "request": {
  46188. // "$ref": "InstanceGroupManager"
  46189. // },
  46190. // "response": {
  46191. // "$ref": "Operation"
  46192. // },
  46193. // "scopes": [
  46194. // "https://www.googleapis.com/auth/cloud-platform",
  46195. // "https://www.googleapis.com/auth/compute"
  46196. // ]
  46197. // }
  46198. }
  46199. // method id "compute.instanceGroupManagers.list":
  46200. type InstanceGroupManagersListCall struct {
  46201. s *Service
  46202. project string
  46203. zone string
  46204. urlParams_ gensupport.URLParams
  46205. ifNoneMatch_ string
  46206. ctx_ context.Context
  46207. header_ http.Header
  46208. }
  46209. // List: Retrieves a list of managed instance groups that are contained
  46210. // within the specified project and zone.
  46211. func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall {
  46212. c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46213. c.project = project
  46214. c.zone = zone
  46215. return c
  46216. }
  46217. // Filter sets the optional parameter "filter": A filter expression that
  46218. // filters resources listed in the response. The expression must specify
  46219. // the field name, a comparison operator, and the value that you want to
  46220. // use for filtering. The value must be a string, a number, or a
  46221. // boolean. The comparison operator must be either =, !=, >, or <.
  46222. //
  46223. // For example, if you are filtering Compute Engine instances, you can
  46224. // exclude instances named example-instance by specifying name !=
  46225. // example-instance.
  46226. //
  46227. // You can also filter nested fields. For example, you could specify
  46228. // scheduling.automaticRestart = false to include instances only if they
  46229. // are not scheduled for automatic restarts. You can use filtering on
  46230. // nested fields to filter based on resource labels.
  46231. //
  46232. // To filter on multiple expressions, provide each separate expression
  46233. // within parentheses. For example, (scheduling.automaticRestart = true)
  46234. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46235. // AND expression. However, you can include AND and OR expressions
  46236. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46237. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46238. // true).
  46239. func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall {
  46240. c.urlParams_.Set("filter", filter)
  46241. return c
  46242. }
  46243. // MaxResults sets the optional parameter "maxResults": The maximum
  46244. // number of results per page that should be returned. If the number of
  46245. // available results is larger than maxResults, Compute Engine returns a
  46246. // nextPageToken that can be used to get the next page of results in
  46247. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46248. // (Default: 500)
  46249. func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall {
  46250. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46251. return c
  46252. }
  46253. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  46254. // a certain order. By default, results are returned in alphanumerical
  46255. // order based on the resource name.
  46256. //
  46257. // You can also sort results in descending order based on the creation
  46258. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46259. // based on the creationTimestamp field in reverse chronological order
  46260. // (newest result first). Use this to sort resources like operations so
  46261. // that the newest operation is returned first.
  46262. //
  46263. // Currently, only sorting by name or creationTimestamp desc is
  46264. // supported.
  46265. func (c *InstanceGroupManagersListCall) OrderBy(orderBy string) *InstanceGroupManagersListCall {
  46266. c.urlParams_.Set("orderBy", orderBy)
  46267. return c
  46268. }
  46269. // PageToken sets the optional parameter "pageToken": Specifies a page
  46270. // token to use. Set pageToken to the nextPageToken returned by a
  46271. // previous list request to get the next page of results.
  46272. func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall {
  46273. c.urlParams_.Set("pageToken", pageToken)
  46274. return c
  46275. }
  46276. // Fields allows partial responses to be retrieved. See
  46277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46278. // for more information.
  46279. func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall {
  46280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46281. return c
  46282. }
  46283. // IfNoneMatch sets the optional parameter which makes the operation
  46284. // fail if the object's ETag matches the given value. This is useful for
  46285. // getting updates only after the object has changed since the last
  46286. // request. Use googleapi.IsNotModified to check whether the response
  46287. // error from Do is the result of In-None-Match.
  46288. func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall {
  46289. c.ifNoneMatch_ = entityTag
  46290. return c
  46291. }
  46292. // Context sets the context to be used in this call's Do method. Any
  46293. // pending HTTP request will be aborted if the provided context is
  46294. // canceled.
  46295. func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall {
  46296. c.ctx_ = ctx
  46297. return c
  46298. }
  46299. // Header returns an http.Header that can be modified by the caller to
  46300. // add HTTP headers to the request.
  46301. func (c *InstanceGroupManagersListCall) Header() http.Header {
  46302. if c.header_ == nil {
  46303. c.header_ = make(http.Header)
  46304. }
  46305. return c.header_
  46306. }
  46307. func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  46308. reqHeaders := make(http.Header)
  46309. for k, v := range c.header_ {
  46310. reqHeaders[k] = v
  46311. }
  46312. reqHeaders.Set("User-Agent", c.s.userAgent())
  46313. if c.ifNoneMatch_ != "" {
  46314. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46315. }
  46316. var body io.Reader = nil
  46317. c.urlParams_.Set("alt", alt)
  46318. c.urlParams_.Set("prettyPrint", "false")
  46319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers")
  46320. urls += "?" + c.urlParams_.Encode()
  46321. req, err := http.NewRequest("GET", urls, body)
  46322. if err != nil {
  46323. return nil, err
  46324. }
  46325. req.Header = reqHeaders
  46326. googleapi.Expand(req.URL, map[string]string{
  46327. "project": c.project,
  46328. "zone": c.zone,
  46329. })
  46330. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46331. }
  46332. // Do executes the "compute.instanceGroupManagers.list" call.
  46333. // Exactly one of *InstanceGroupManagerList or error will be non-nil.
  46334. // Any non-2xx status code is an error. Response headers are in either
  46335. // *InstanceGroupManagerList.ServerResponse.Header or (if a response was
  46336. // returned at all) in error.(*googleapi.Error).Header. Use
  46337. // googleapi.IsNotModified to check whether the returned error was
  46338. // because http.StatusNotModified was returned.
  46339. func (c *InstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagerList, error) {
  46340. gensupport.SetOptions(c.urlParams_, opts...)
  46341. res, err := c.doRequest("json")
  46342. if res != nil && res.StatusCode == http.StatusNotModified {
  46343. if res.Body != nil {
  46344. res.Body.Close()
  46345. }
  46346. return nil, &googleapi.Error{
  46347. Code: res.StatusCode,
  46348. Header: res.Header,
  46349. }
  46350. }
  46351. if err != nil {
  46352. return nil, err
  46353. }
  46354. defer googleapi.CloseBody(res)
  46355. if err := googleapi.CheckResponse(res); err != nil {
  46356. return nil, err
  46357. }
  46358. ret := &InstanceGroupManagerList{
  46359. ServerResponse: googleapi.ServerResponse{
  46360. Header: res.Header,
  46361. HTTPStatusCode: res.StatusCode,
  46362. },
  46363. }
  46364. target := &ret
  46365. if err := gensupport.DecodeResponse(target, res); err != nil {
  46366. return nil, err
  46367. }
  46368. return ret, nil
  46369. // {
  46370. // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.",
  46371. // "httpMethod": "GET",
  46372. // "id": "compute.instanceGroupManagers.list",
  46373. // "parameterOrder": [
  46374. // "project",
  46375. // "zone"
  46376. // ],
  46377. // "parameters": {
  46378. // "filter": {
  46379. // "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).",
  46380. // "location": "query",
  46381. // "type": "string"
  46382. // },
  46383. // "maxResults": {
  46384. // "default": "500",
  46385. // "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)",
  46386. // "format": "uint32",
  46387. // "location": "query",
  46388. // "minimum": "0",
  46389. // "type": "integer"
  46390. // },
  46391. // "orderBy": {
  46392. // "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.",
  46393. // "location": "query",
  46394. // "type": "string"
  46395. // },
  46396. // "pageToken": {
  46397. // "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.",
  46398. // "location": "query",
  46399. // "type": "string"
  46400. // },
  46401. // "project": {
  46402. // "description": "Project ID for this request.",
  46403. // "location": "path",
  46404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46405. // "required": true,
  46406. // "type": "string"
  46407. // },
  46408. // "zone": {
  46409. // "description": "The name of the zone where the managed instance group is located.",
  46410. // "location": "path",
  46411. // "required": true,
  46412. // "type": "string"
  46413. // }
  46414. // },
  46415. // "path": "{project}/zones/{zone}/instanceGroupManagers",
  46416. // "response": {
  46417. // "$ref": "InstanceGroupManagerList"
  46418. // },
  46419. // "scopes": [
  46420. // "https://www.googleapis.com/auth/cloud-platform",
  46421. // "https://www.googleapis.com/auth/compute",
  46422. // "https://www.googleapis.com/auth/compute.readonly"
  46423. // ]
  46424. // }
  46425. }
  46426. // Pages invokes f for each page of results.
  46427. // A non-nil error returned from f will halt the iteration.
  46428. // The provided context supersedes any context provided to the Context method.
  46429. func (c *InstanceGroupManagersListCall) Pages(ctx context.Context, f func(*InstanceGroupManagerList) error) error {
  46430. c.ctx_ = ctx
  46431. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  46432. for {
  46433. x, err := c.Do()
  46434. if err != nil {
  46435. return err
  46436. }
  46437. if err := f(x); err != nil {
  46438. return err
  46439. }
  46440. if x.NextPageToken == "" {
  46441. return nil
  46442. }
  46443. c.PageToken(x.NextPageToken)
  46444. }
  46445. }
  46446. // method id "compute.instanceGroupManagers.listManagedInstances":
  46447. type InstanceGroupManagersListManagedInstancesCall struct {
  46448. s *Service
  46449. project string
  46450. zone string
  46451. instanceGroupManager string
  46452. urlParams_ gensupport.URLParams
  46453. ctx_ context.Context
  46454. header_ http.Header
  46455. }
  46456. // ListManagedInstances: Lists all of the instances in the managed
  46457. // instance group. Each instance in the list has a currentAction, which
  46458. // indicates the action that the managed instance group is performing on
  46459. // the instance. For example, if the group is still creating an
  46460. // instance, the currentAction is CREATING. If a previous action failed,
  46461. // the list displays the errors for that failed action.
  46462. func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall {
  46463. c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46464. c.project = project
  46465. c.zone = zone
  46466. c.instanceGroupManager = instanceGroupManager
  46467. return c
  46468. }
  46469. // Filter sets the optional parameter "filter": A filter expression that
  46470. // filters resources listed in the response. The expression must specify
  46471. // the field name, a comparison operator, and the value that you want to
  46472. // use for filtering. The value must be a string, a number, or a
  46473. // boolean. The comparison operator must be either =, !=, >, or <.
  46474. //
  46475. // For example, if you are filtering Compute Engine instances, you can
  46476. // exclude instances named example-instance by specifying name !=
  46477. // example-instance.
  46478. //
  46479. // You can also filter nested fields. For example, you could specify
  46480. // scheduling.automaticRestart = false to include instances only if they
  46481. // are not scheduled for automatic restarts. You can use filtering on
  46482. // nested fields to filter based on resource labels.
  46483. //
  46484. // To filter on multiple expressions, provide each separate expression
  46485. // within parentheses. For example, (scheduling.automaticRestart = true)
  46486. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  46487. // AND expression. However, you can include AND and OR expressions
  46488. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  46489. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  46490. // true).
  46491. func (c *InstanceGroupManagersListManagedInstancesCall) Filter(filter string) *InstanceGroupManagersListManagedInstancesCall {
  46492. c.urlParams_.Set("filter", filter)
  46493. return c
  46494. }
  46495. // MaxResults sets the optional parameter "maxResults": The maximum
  46496. // number of results per page that should be returned. If the number of
  46497. // available results is larger than maxResults, Compute Engine returns a
  46498. // nextPageToken that can be used to get the next page of results in
  46499. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  46500. // (Default: 500)
  46501. func (c *InstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *InstanceGroupManagersListManagedInstancesCall {
  46502. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  46503. return c
  46504. }
  46505. // OrderBy sets the optional parameter "order_by": Sorts list results by
  46506. // a certain order. By default, results are returned in alphanumerical
  46507. // order based on the resource name.
  46508. //
  46509. // You can also sort results in descending order based on the creation
  46510. // timestamp using orderBy="creationTimestamp desc". This sorts results
  46511. // based on the creationTimestamp field in reverse chronological order
  46512. // (newest result first). Use this to sort resources like operations so
  46513. // that the newest operation is returned first.
  46514. //
  46515. // Currently, only sorting by name or creationTimestamp desc is
  46516. // supported.
  46517. func (c *InstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *InstanceGroupManagersListManagedInstancesCall {
  46518. c.urlParams_.Set("order_by", orderBy)
  46519. return c
  46520. }
  46521. // PageToken sets the optional parameter "pageToken": Specifies a page
  46522. // token to use. Set pageToken to the nextPageToken returned by a
  46523. // previous list request to get the next page of results.
  46524. func (c *InstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *InstanceGroupManagersListManagedInstancesCall {
  46525. c.urlParams_.Set("pageToken", pageToken)
  46526. return c
  46527. }
  46528. // Fields allows partial responses to be retrieved. See
  46529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46530. // for more information.
  46531. func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall {
  46532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46533. return c
  46534. }
  46535. // Context sets the context to be used in this call's Do method. Any
  46536. // pending HTTP request will be aborted if the provided context is
  46537. // canceled.
  46538. func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall {
  46539. c.ctx_ = ctx
  46540. return c
  46541. }
  46542. // Header returns an http.Header that can be modified by the caller to
  46543. // add HTTP headers to the request.
  46544. func (c *InstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  46545. if c.header_ == nil {
  46546. c.header_ = make(http.Header)
  46547. }
  46548. return c.header_
  46549. }
  46550. func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  46551. reqHeaders := make(http.Header)
  46552. for k, v := range c.header_ {
  46553. reqHeaders[k] = v
  46554. }
  46555. reqHeaders.Set("User-Agent", c.s.userAgent())
  46556. var body io.Reader = nil
  46557. c.urlParams_.Set("alt", alt)
  46558. c.urlParams_.Set("prettyPrint", "false")
  46559. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  46560. urls += "?" + c.urlParams_.Encode()
  46561. req, err := http.NewRequest("POST", urls, body)
  46562. if err != nil {
  46563. return nil, err
  46564. }
  46565. req.Header = reqHeaders
  46566. googleapi.Expand(req.URL, map[string]string{
  46567. "project": c.project,
  46568. "zone": c.zone,
  46569. "instanceGroupManager": c.instanceGroupManager,
  46570. })
  46571. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46572. }
  46573. // Do executes the "compute.instanceGroupManagers.listManagedInstances" call.
  46574. // Exactly one of *InstanceGroupManagersListManagedInstancesResponse or
  46575. // error will be non-nil. Any non-2xx status code is an error. Response
  46576. // headers are in either
  46577. // *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head
  46578. // er or (if a response was returned at all) in
  46579. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  46580. // whether the returned error was because http.StatusNotModified was
  46581. // returned.
  46582. func (c *InstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManagersListManagedInstancesResponse, error) {
  46583. gensupport.SetOptions(c.urlParams_, opts...)
  46584. res, err := c.doRequest("json")
  46585. if res != nil && res.StatusCode == http.StatusNotModified {
  46586. if res.Body != nil {
  46587. res.Body.Close()
  46588. }
  46589. return nil, &googleapi.Error{
  46590. Code: res.StatusCode,
  46591. Header: res.Header,
  46592. }
  46593. }
  46594. if err != nil {
  46595. return nil, err
  46596. }
  46597. defer googleapi.CloseBody(res)
  46598. if err := googleapi.CheckResponse(res); err != nil {
  46599. return nil, err
  46600. }
  46601. ret := &InstanceGroupManagersListManagedInstancesResponse{
  46602. ServerResponse: googleapi.ServerResponse{
  46603. Header: res.Header,
  46604. HTTPStatusCode: res.StatusCode,
  46605. },
  46606. }
  46607. target := &ret
  46608. if err := gensupport.DecodeResponse(target, res); err != nil {
  46609. return nil, err
  46610. }
  46611. return ret, nil
  46612. // {
  46613. // "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.",
  46614. // "httpMethod": "POST",
  46615. // "id": "compute.instanceGroupManagers.listManagedInstances",
  46616. // "parameterOrder": [
  46617. // "project",
  46618. // "zone",
  46619. // "instanceGroupManager"
  46620. // ],
  46621. // "parameters": {
  46622. // "filter": {
  46623. // "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).",
  46624. // "location": "query",
  46625. // "type": "string"
  46626. // },
  46627. // "instanceGroupManager": {
  46628. // "description": "The name of the managed instance group.",
  46629. // "location": "path",
  46630. // "required": true,
  46631. // "type": "string"
  46632. // },
  46633. // "maxResults": {
  46634. // "default": "500",
  46635. // "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)",
  46636. // "format": "uint32",
  46637. // "location": "query",
  46638. // "minimum": "0",
  46639. // "type": "integer"
  46640. // },
  46641. // "order_by": {
  46642. // "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.",
  46643. // "location": "query",
  46644. // "type": "string"
  46645. // },
  46646. // "pageToken": {
  46647. // "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.",
  46648. // "location": "query",
  46649. // "type": "string"
  46650. // },
  46651. // "project": {
  46652. // "description": "Project ID for this request.",
  46653. // "location": "path",
  46654. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46655. // "required": true,
  46656. // "type": "string"
  46657. // },
  46658. // "zone": {
  46659. // "description": "The name of the zone where the managed instance group is located.",
  46660. // "location": "path",
  46661. // "required": true,
  46662. // "type": "string"
  46663. // }
  46664. // },
  46665. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  46666. // "response": {
  46667. // "$ref": "InstanceGroupManagersListManagedInstancesResponse"
  46668. // },
  46669. // "scopes": [
  46670. // "https://www.googleapis.com/auth/cloud-platform",
  46671. // "https://www.googleapis.com/auth/compute",
  46672. // "https://www.googleapis.com/auth/compute.readonly"
  46673. // ]
  46674. // }
  46675. }
  46676. // method id "compute.instanceGroupManagers.patch":
  46677. type InstanceGroupManagersPatchCall struct {
  46678. s *Service
  46679. project string
  46680. zone string
  46681. instanceGroupManager string
  46682. instancegroupmanager *InstanceGroupManager
  46683. urlParams_ gensupport.URLParams
  46684. ctx_ context.Context
  46685. header_ http.Header
  46686. }
  46687. // Patch: Updates a managed instance group using the information that
  46688. // you specify in the request. This operation is marked as DONE when the
  46689. // group is patched even if the instances in the group are still in the
  46690. // process of being patched. You must separately verify the status of
  46691. // the individual instances with the listManagedInstances method. This
  46692. // method supports PATCH semantics and uses the JSON merge patch format
  46693. // and processing rules.
  46694. func (r *InstanceGroupManagersService) Patch(project string, zone string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersPatchCall {
  46695. c := &InstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46696. c.project = project
  46697. c.zone = zone
  46698. c.instanceGroupManager = instanceGroupManager
  46699. c.instancegroupmanager = instancegroupmanager
  46700. return c
  46701. }
  46702. // RequestId sets the optional parameter "requestId": An optional
  46703. // request ID to identify requests. Specify a unique request ID so that
  46704. // if you must retry your request, the server will know to ignore the
  46705. // request if it has already been completed.
  46706. //
  46707. // For example, consider a situation where you make an initial request
  46708. // and the request times out. If you make the request again with the
  46709. // same request ID, the server can check if original operation with the
  46710. // same request ID was received, and if so, will ignore the second
  46711. // request. This prevents clients from accidentally creating duplicate
  46712. // commitments.
  46713. //
  46714. // The request ID must be a valid UUID with the exception that zero UUID
  46715. // is not supported (00000000-0000-0000-0000-000000000000).
  46716. func (c *InstanceGroupManagersPatchCall) RequestId(requestId string) *InstanceGroupManagersPatchCall {
  46717. c.urlParams_.Set("requestId", requestId)
  46718. return c
  46719. }
  46720. // Fields allows partial responses to be retrieved. See
  46721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46722. // for more information.
  46723. func (c *InstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *InstanceGroupManagersPatchCall {
  46724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46725. return c
  46726. }
  46727. // Context sets the context to be used in this call's Do method. Any
  46728. // pending HTTP request will be aborted if the provided context is
  46729. // canceled.
  46730. func (c *InstanceGroupManagersPatchCall) Context(ctx context.Context) *InstanceGroupManagersPatchCall {
  46731. c.ctx_ = ctx
  46732. return c
  46733. }
  46734. // Header returns an http.Header that can be modified by the caller to
  46735. // add HTTP headers to the request.
  46736. func (c *InstanceGroupManagersPatchCall) Header() http.Header {
  46737. if c.header_ == nil {
  46738. c.header_ = make(http.Header)
  46739. }
  46740. return c.header_
  46741. }
  46742. func (c *InstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  46743. reqHeaders := make(http.Header)
  46744. for k, v := range c.header_ {
  46745. reqHeaders[k] = v
  46746. }
  46747. reqHeaders.Set("User-Agent", c.s.userAgent())
  46748. var body io.Reader = nil
  46749. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  46750. if err != nil {
  46751. return nil, err
  46752. }
  46753. reqHeaders.Set("Content-Type", "application/json")
  46754. c.urlParams_.Set("alt", alt)
  46755. c.urlParams_.Set("prettyPrint", "false")
  46756. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}")
  46757. urls += "?" + c.urlParams_.Encode()
  46758. req, err := http.NewRequest("PATCH", urls, body)
  46759. if err != nil {
  46760. return nil, err
  46761. }
  46762. req.Header = reqHeaders
  46763. googleapi.Expand(req.URL, map[string]string{
  46764. "project": c.project,
  46765. "zone": c.zone,
  46766. "instanceGroupManager": c.instanceGroupManager,
  46767. })
  46768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46769. }
  46770. // Do executes the "compute.instanceGroupManagers.patch" call.
  46771. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46772. // status code is an error. Response headers are in either
  46773. // *Operation.ServerResponse.Header or (if a response was returned at
  46774. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46775. // to check whether the returned error was because
  46776. // http.StatusNotModified was returned.
  46777. func (c *InstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46778. gensupport.SetOptions(c.urlParams_, opts...)
  46779. res, err := c.doRequest("json")
  46780. if res != nil && res.StatusCode == http.StatusNotModified {
  46781. if res.Body != nil {
  46782. res.Body.Close()
  46783. }
  46784. return nil, &googleapi.Error{
  46785. Code: res.StatusCode,
  46786. Header: res.Header,
  46787. }
  46788. }
  46789. if err != nil {
  46790. return nil, err
  46791. }
  46792. defer googleapi.CloseBody(res)
  46793. if err := googleapi.CheckResponse(res); err != nil {
  46794. return nil, err
  46795. }
  46796. ret := &Operation{
  46797. ServerResponse: googleapi.ServerResponse{
  46798. Header: res.Header,
  46799. HTTPStatusCode: res.StatusCode,
  46800. },
  46801. }
  46802. target := &ret
  46803. if err := gensupport.DecodeResponse(target, res); err != nil {
  46804. return nil, err
  46805. }
  46806. return ret, nil
  46807. // {
  46808. // "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.",
  46809. // "httpMethod": "PATCH",
  46810. // "id": "compute.instanceGroupManagers.patch",
  46811. // "parameterOrder": [
  46812. // "project",
  46813. // "zone",
  46814. // "instanceGroupManager"
  46815. // ],
  46816. // "parameters": {
  46817. // "instanceGroupManager": {
  46818. // "description": "The name of the instance group manager.",
  46819. // "location": "path",
  46820. // "required": true,
  46821. // "type": "string"
  46822. // },
  46823. // "project": {
  46824. // "description": "Project ID for this request.",
  46825. // "location": "path",
  46826. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  46827. // "required": true,
  46828. // "type": "string"
  46829. // },
  46830. // "requestId": {
  46831. // "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).",
  46832. // "location": "query",
  46833. // "type": "string"
  46834. // },
  46835. // "zone": {
  46836. // "description": "The name of the zone where you want to create the managed instance group.",
  46837. // "location": "path",
  46838. // "required": true,
  46839. // "type": "string"
  46840. // }
  46841. // },
  46842. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}",
  46843. // "request": {
  46844. // "$ref": "InstanceGroupManager"
  46845. // },
  46846. // "response": {
  46847. // "$ref": "Operation"
  46848. // },
  46849. // "scopes": [
  46850. // "https://www.googleapis.com/auth/cloud-platform",
  46851. // "https://www.googleapis.com/auth/compute"
  46852. // ]
  46853. // }
  46854. }
  46855. // method id "compute.instanceGroupManagers.recreateInstances":
  46856. type InstanceGroupManagersRecreateInstancesCall struct {
  46857. s *Service
  46858. project string
  46859. zone string
  46860. instanceGroupManager string
  46861. instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest
  46862. urlParams_ gensupport.URLParams
  46863. ctx_ context.Context
  46864. header_ http.Header
  46865. }
  46866. // RecreateInstances: Flags the specified instances in the managed
  46867. // instance group to be immediately recreated. The instances are deleted
  46868. // and recreated using the current instance template for the managed
  46869. // instance group. This operation is marked as DONE when the flag is set
  46870. // even if the instances have not yet been recreated. You must
  46871. // separately verify the status of the recreating action with the
  46872. // listmanagedinstances method.
  46873. //
  46874. // If the group is part of a backend service that has enabled connection
  46875. // draining, it can take up to 60 seconds after the connection draining
  46876. // duration has elapsed before the VM instance is removed or
  46877. // deleted.
  46878. //
  46879. // You can specify a maximum of 1000 instances with this method per
  46880. // request.
  46881. func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall {
  46882. c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46883. c.project = project
  46884. c.zone = zone
  46885. c.instanceGroupManager = instanceGroupManager
  46886. c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest
  46887. return c
  46888. }
  46889. // RequestId sets the optional parameter "requestId": An optional
  46890. // request ID to identify requests. Specify a unique request ID so that
  46891. // if you must retry your request, the server will know to ignore the
  46892. // request if it has already been completed.
  46893. //
  46894. // For example, consider a situation where you make an initial request
  46895. // and the request times out. If you make the request again with the
  46896. // same request ID, the server can check if original operation with the
  46897. // same request ID was received, and if so, will ignore the second
  46898. // request. This prevents clients from accidentally creating duplicate
  46899. // commitments.
  46900. //
  46901. // The request ID must be a valid UUID with the exception that zero UUID
  46902. // is not supported (00000000-0000-0000-0000-000000000000).
  46903. func (c *InstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *InstanceGroupManagersRecreateInstancesCall {
  46904. c.urlParams_.Set("requestId", requestId)
  46905. return c
  46906. }
  46907. // Fields allows partial responses to be retrieved. See
  46908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46909. // for more information.
  46910. func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall {
  46911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46912. return c
  46913. }
  46914. // Context sets the context to be used in this call's Do method. Any
  46915. // pending HTTP request will be aborted if the provided context is
  46916. // canceled.
  46917. func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall {
  46918. c.ctx_ = ctx
  46919. return c
  46920. }
  46921. // Header returns an http.Header that can be modified by the caller to
  46922. // add HTTP headers to the request.
  46923. func (c *InstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  46924. if c.header_ == nil {
  46925. c.header_ = make(http.Header)
  46926. }
  46927. return c.header_
  46928. }
  46929. func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  46930. reqHeaders := make(http.Header)
  46931. for k, v := range c.header_ {
  46932. reqHeaders[k] = v
  46933. }
  46934. reqHeaders.Set("User-Agent", c.s.userAgent())
  46935. var body io.Reader = nil
  46936. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest)
  46937. if err != nil {
  46938. return nil, err
  46939. }
  46940. reqHeaders.Set("Content-Type", "application/json")
  46941. c.urlParams_.Set("alt", alt)
  46942. c.urlParams_.Set("prettyPrint", "false")
  46943. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  46944. urls += "?" + c.urlParams_.Encode()
  46945. req, err := http.NewRequest("POST", urls, body)
  46946. if err != nil {
  46947. return nil, err
  46948. }
  46949. req.Header = reqHeaders
  46950. googleapi.Expand(req.URL, map[string]string{
  46951. "project": c.project,
  46952. "zone": c.zone,
  46953. "instanceGroupManager": c.instanceGroupManager,
  46954. })
  46955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46956. }
  46957. // Do executes the "compute.instanceGroupManagers.recreateInstances" call.
  46958. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  46959. // status code is an error. Response headers are in either
  46960. // *Operation.ServerResponse.Header or (if a response was returned at
  46961. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  46962. // to check whether the returned error was because
  46963. // http.StatusNotModified was returned.
  46964. func (c *InstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  46965. gensupport.SetOptions(c.urlParams_, opts...)
  46966. res, err := c.doRequest("json")
  46967. if res != nil && res.StatusCode == http.StatusNotModified {
  46968. if res.Body != nil {
  46969. res.Body.Close()
  46970. }
  46971. return nil, &googleapi.Error{
  46972. Code: res.StatusCode,
  46973. Header: res.Header,
  46974. }
  46975. }
  46976. if err != nil {
  46977. return nil, err
  46978. }
  46979. defer googleapi.CloseBody(res)
  46980. if err := googleapi.CheckResponse(res); err != nil {
  46981. return nil, err
  46982. }
  46983. ret := &Operation{
  46984. ServerResponse: googleapi.ServerResponse{
  46985. Header: res.Header,
  46986. HTTPStatusCode: res.StatusCode,
  46987. },
  46988. }
  46989. target := &ret
  46990. if err := gensupport.DecodeResponse(target, res); err != nil {
  46991. return nil, err
  46992. }
  46993. return ret, nil
  46994. // {
  46995. // "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.",
  46996. // "httpMethod": "POST",
  46997. // "id": "compute.instanceGroupManagers.recreateInstances",
  46998. // "parameterOrder": [
  46999. // "project",
  47000. // "zone",
  47001. // "instanceGroupManager"
  47002. // ],
  47003. // "parameters": {
  47004. // "instanceGroupManager": {
  47005. // "description": "The name of the managed instance group.",
  47006. // "location": "path",
  47007. // "required": true,
  47008. // "type": "string"
  47009. // },
  47010. // "project": {
  47011. // "description": "Project ID for this request.",
  47012. // "location": "path",
  47013. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47014. // "required": true,
  47015. // "type": "string"
  47016. // },
  47017. // "requestId": {
  47018. // "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).",
  47019. // "location": "query",
  47020. // "type": "string"
  47021. // },
  47022. // "zone": {
  47023. // "description": "The name of the zone where the managed instance group is located.",
  47024. // "location": "path",
  47025. // "required": true,
  47026. // "type": "string"
  47027. // }
  47028. // },
  47029. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  47030. // "request": {
  47031. // "$ref": "InstanceGroupManagersRecreateInstancesRequest"
  47032. // },
  47033. // "response": {
  47034. // "$ref": "Operation"
  47035. // },
  47036. // "scopes": [
  47037. // "https://www.googleapis.com/auth/cloud-platform",
  47038. // "https://www.googleapis.com/auth/compute"
  47039. // ]
  47040. // }
  47041. }
  47042. // method id "compute.instanceGroupManagers.resize":
  47043. type InstanceGroupManagersResizeCall struct {
  47044. s *Service
  47045. project string
  47046. zone string
  47047. instanceGroupManager string
  47048. urlParams_ gensupport.URLParams
  47049. ctx_ context.Context
  47050. header_ http.Header
  47051. }
  47052. // Resize: Resizes the managed instance group. If you increase the size,
  47053. // the group creates new instances using the current instance template.
  47054. // If you decrease the size, the group deletes instances. The resize
  47055. // operation is marked DONE when the resize actions are scheduled even
  47056. // if the group has not yet added or deleted any instances. You must
  47057. // separately verify the status of the creating or deleting actions with
  47058. // the listmanagedinstances method.
  47059. //
  47060. // When resizing down, the instance group arbitrarily chooses the order
  47061. // in which VMs are deleted. The group takes into account some VM
  47062. // attributes when making the selection including:
  47063. //
  47064. // + The status of the VM instance. + The health of the VM instance. +
  47065. // The instance template version the VM is based on. + For regional
  47066. // managed instance groups, the location of the VM instance.
  47067. //
  47068. // This list is subject to change.
  47069. //
  47070. // If the group is part of a backend service that has enabled connection
  47071. // draining, it can take up to 60 seconds after the connection draining
  47072. // duration has elapsed before the VM instance is removed or deleted.
  47073. func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall {
  47074. c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47075. c.project = project
  47076. c.zone = zone
  47077. c.instanceGroupManager = instanceGroupManager
  47078. c.urlParams_.Set("size", fmt.Sprint(size))
  47079. return c
  47080. }
  47081. // RequestId sets the optional parameter "requestId": An optional
  47082. // request ID to identify requests. Specify a unique request ID so that
  47083. // if you must retry your request, the server will know to ignore the
  47084. // request if it has already been completed.
  47085. //
  47086. // For example, consider a situation where you make an initial request
  47087. // and the request times out. If you make the request again with the
  47088. // same request ID, the server can check if original operation with the
  47089. // same request ID was received, and if so, will ignore the second
  47090. // request. This prevents clients from accidentally creating duplicate
  47091. // commitments.
  47092. //
  47093. // The request ID must be a valid UUID with the exception that zero UUID
  47094. // is not supported (00000000-0000-0000-0000-000000000000).
  47095. func (c *InstanceGroupManagersResizeCall) RequestId(requestId string) *InstanceGroupManagersResizeCall {
  47096. c.urlParams_.Set("requestId", requestId)
  47097. return c
  47098. }
  47099. // Fields allows partial responses to be retrieved. See
  47100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47101. // for more information.
  47102. func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall {
  47103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47104. return c
  47105. }
  47106. // Context sets the context to be used in this call's Do method. Any
  47107. // pending HTTP request will be aborted if the provided context is
  47108. // canceled.
  47109. func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall {
  47110. c.ctx_ = ctx
  47111. return c
  47112. }
  47113. // Header returns an http.Header that can be modified by the caller to
  47114. // add HTTP headers to the request.
  47115. func (c *InstanceGroupManagersResizeCall) Header() http.Header {
  47116. if c.header_ == nil {
  47117. c.header_ = make(http.Header)
  47118. }
  47119. return c.header_
  47120. }
  47121. func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  47122. reqHeaders := make(http.Header)
  47123. for k, v := range c.header_ {
  47124. reqHeaders[k] = v
  47125. }
  47126. reqHeaders.Set("User-Agent", c.s.userAgent())
  47127. var body io.Reader = nil
  47128. c.urlParams_.Set("alt", alt)
  47129. c.urlParams_.Set("prettyPrint", "false")
  47130. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize")
  47131. urls += "?" + c.urlParams_.Encode()
  47132. req, err := http.NewRequest("POST", urls, body)
  47133. if err != nil {
  47134. return nil, err
  47135. }
  47136. req.Header = reqHeaders
  47137. googleapi.Expand(req.URL, map[string]string{
  47138. "project": c.project,
  47139. "zone": c.zone,
  47140. "instanceGroupManager": c.instanceGroupManager,
  47141. })
  47142. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47143. }
  47144. // Do executes the "compute.instanceGroupManagers.resize" call.
  47145. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47146. // status code is an error. Response headers are in either
  47147. // *Operation.ServerResponse.Header or (if a response was returned at
  47148. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47149. // to check whether the returned error was because
  47150. // http.StatusNotModified was returned.
  47151. func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47152. gensupport.SetOptions(c.urlParams_, opts...)
  47153. res, err := c.doRequest("json")
  47154. if res != nil && res.StatusCode == http.StatusNotModified {
  47155. if res.Body != nil {
  47156. res.Body.Close()
  47157. }
  47158. return nil, &googleapi.Error{
  47159. Code: res.StatusCode,
  47160. Header: res.Header,
  47161. }
  47162. }
  47163. if err != nil {
  47164. return nil, err
  47165. }
  47166. defer googleapi.CloseBody(res)
  47167. if err := googleapi.CheckResponse(res); err != nil {
  47168. return nil, err
  47169. }
  47170. ret := &Operation{
  47171. ServerResponse: googleapi.ServerResponse{
  47172. Header: res.Header,
  47173. HTTPStatusCode: res.StatusCode,
  47174. },
  47175. }
  47176. target := &ret
  47177. if err := gensupport.DecodeResponse(target, res); err != nil {
  47178. return nil, err
  47179. }
  47180. return ret, nil
  47181. // {
  47182. // "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.",
  47183. // "httpMethod": "POST",
  47184. // "id": "compute.instanceGroupManagers.resize",
  47185. // "parameterOrder": [
  47186. // "project",
  47187. // "zone",
  47188. // "instanceGroupManager",
  47189. // "size"
  47190. // ],
  47191. // "parameters": {
  47192. // "instanceGroupManager": {
  47193. // "description": "The name of the managed instance group.",
  47194. // "location": "path",
  47195. // "required": true,
  47196. // "type": "string"
  47197. // },
  47198. // "project": {
  47199. // "description": "Project ID for this request.",
  47200. // "location": "path",
  47201. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47202. // "required": true,
  47203. // "type": "string"
  47204. // },
  47205. // "requestId": {
  47206. // "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).",
  47207. // "location": "query",
  47208. // "type": "string"
  47209. // },
  47210. // "size": {
  47211. // "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.",
  47212. // "format": "int32",
  47213. // "location": "query",
  47214. // "required": true,
  47215. // "type": "integer"
  47216. // },
  47217. // "zone": {
  47218. // "description": "The name of the zone where the managed instance group is located.",
  47219. // "location": "path",
  47220. // "required": true,
  47221. // "type": "string"
  47222. // }
  47223. // },
  47224. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize",
  47225. // "response": {
  47226. // "$ref": "Operation"
  47227. // },
  47228. // "scopes": [
  47229. // "https://www.googleapis.com/auth/cloud-platform",
  47230. // "https://www.googleapis.com/auth/compute"
  47231. // ]
  47232. // }
  47233. }
  47234. // method id "compute.instanceGroupManagers.setInstanceTemplate":
  47235. type InstanceGroupManagersSetInstanceTemplateCall struct {
  47236. s *Service
  47237. project string
  47238. zone string
  47239. instanceGroupManager string
  47240. instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest
  47241. urlParams_ gensupport.URLParams
  47242. ctx_ context.Context
  47243. header_ http.Header
  47244. }
  47245. // SetInstanceTemplate: Specifies the instance template to use when
  47246. // creating new instances in this group. The templates for existing
  47247. // instances in the group do not change unless you recreate them.
  47248. func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall {
  47249. c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47250. c.project = project
  47251. c.zone = zone
  47252. c.instanceGroupManager = instanceGroupManager
  47253. c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest
  47254. return c
  47255. }
  47256. // RequestId sets the optional parameter "requestId": An optional
  47257. // request ID to identify requests. Specify a unique request ID so that
  47258. // if you must retry your request, the server will know to ignore the
  47259. // request if it has already been completed.
  47260. //
  47261. // For example, consider a situation where you make an initial request
  47262. // and the request times out. If you make the request again with the
  47263. // same request ID, the server can check if original operation with the
  47264. // same request ID was received, and if so, will ignore the second
  47265. // request. This prevents clients from accidentally creating duplicate
  47266. // commitments.
  47267. //
  47268. // The request ID must be a valid UUID with the exception that zero UUID
  47269. // is not supported (00000000-0000-0000-0000-000000000000).
  47270. func (c *InstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *InstanceGroupManagersSetInstanceTemplateCall {
  47271. c.urlParams_.Set("requestId", requestId)
  47272. return c
  47273. }
  47274. // Fields allows partial responses to be retrieved. See
  47275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47276. // for more information.
  47277. func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall {
  47278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47279. return c
  47280. }
  47281. // Context sets the context to be used in this call's Do method. Any
  47282. // pending HTTP request will be aborted if the provided context is
  47283. // canceled.
  47284. func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall {
  47285. c.ctx_ = ctx
  47286. return c
  47287. }
  47288. // Header returns an http.Header that can be modified by the caller to
  47289. // add HTTP headers to the request.
  47290. func (c *InstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  47291. if c.header_ == nil {
  47292. c.header_ = make(http.Header)
  47293. }
  47294. return c.header_
  47295. }
  47296. func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  47297. reqHeaders := make(http.Header)
  47298. for k, v := range c.header_ {
  47299. reqHeaders[k] = v
  47300. }
  47301. reqHeaders.Set("User-Agent", c.s.userAgent())
  47302. var body io.Reader = nil
  47303. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest)
  47304. if err != nil {
  47305. return nil, err
  47306. }
  47307. reqHeaders.Set("Content-Type", "application/json")
  47308. c.urlParams_.Set("alt", alt)
  47309. c.urlParams_.Set("prettyPrint", "false")
  47310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  47311. urls += "?" + c.urlParams_.Encode()
  47312. req, err := http.NewRequest("POST", urls, body)
  47313. if err != nil {
  47314. return nil, err
  47315. }
  47316. req.Header = reqHeaders
  47317. googleapi.Expand(req.URL, map[string]string{
  47318. "project": c.project,
  47319. "zone": c.zone,
  47320. "instanceGroupManager": c.instanceGroupManager,
  47321. })
  47322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47323. }
  47324. // Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call.
  47325. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47326. // status code is an error. Response headers are in either
  47327. // *Operation.ServerResponse.Header or (if a response was returned at
  47328. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47329. // to check whether the returned error was because
  47330. // http.StatusNotModified was returned.
  47331. func (c *InstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47332. gensupport.SetOptions(c.urlParams_, opts...)
  47333. res, err := c.doRequest("json")
  47334. if res != nil && res.StatusCode == http.StatusNotModified {
  47335. if res.Body != nil {
  47336. res.Body.Close()
  47337. }
  47338. return nil, &googleapi.Error{
  47339. Code: res.StatusCode,
  47340. Header: res.Header,
  47341. }
  47342. }
  47343. if err != nil {
  47344. return nil, err
  47345. }
  47346. defer googleapi.CloseBody(res)
  47347. if err := googleapi.CheckResponse(res); err != nil {
  47348. return nil, err
  47349. }
  47350. ret := &Operation{
  47351. ServerResponse: googleapi.ServerResponse{
  47352. Header: res.Header,
  47353. HTTPStatusCode: res.StatusCode,
  47354. },
  47355. }
  47356. target := &ret
  47357. if err := gensupport.DecodeResponse(target, res); err != nil {
  47358. return nil, err
  47359. }
  47360. return ret, nil
  47361. // {
  47362. // "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.",
  47363. // "httpMethod": "POST",
  47364. // "id": "compute.instanceGroupManagers.setInstanceTemplate",
  47365. // "parameterOrder": [
  47366. // "project",
  47367. // "zone",
  47368. // "instanceGroupManager"
  47369. // ],
  47370. // "parameters": {
  47371. // "instanceGroupManager": {
  47372. // "description": "The name of the managed instance group.",
  47373. // "location": "path",
  47374. // "required": true,
  47375. // "type": "string"
  47376. // },
  47377. // "project": {
  47378. // "description": "Project ID for this request.",
  47379. // "location": "path",
  47380. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47381. // "required": true,
  47382. // "type": "string"
  47383. // },
  47384. // "requestId": {
  47385. // "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).",
  47386. // "location": "query",
  47387. // "type": "string"
  47388. // },
  47389. // "zone": {
  47390. // "description": "The name of the zone where the managed instance group is located.",
  47391. // "location": "path",
  47392. // "required": true,
  47393. // "type": "string"
  47394. // }
  47395. // },
  47396. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  47397. // "request": {
  47398. // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest"
  47399. // },
  47400. // "response": {
  47401. // "$ref": "Operation"
  47402. // },
  47403. // "scopes": [
  47404. // "https://www.googleapis.com/auth/cloud-platform",
  47405. // "https://www.googleapis.com/auth/compute"
  47406. // ]
  47407. // }
  47408. }
  47409. // method id "compute.instanceGroupManagers.setTargetPools":
  47410. type InstanceGroupManagersSetTargetPoolsCall struct {
  47411. s *Service
  47412. project string
  47413. zone string
  47414. instanceGroupManager string
  47415. instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest
  47416. urlParams_ gensupport.URLParams
  47417. ctx_ context.Context
  47418. header_ http.Header
  47419. }
  47420. // SetTargetPools: Modifies the target pools to which all instances in
  47421. // this managed instance group are assigned. The target pools
  47422. // automatically apply to all of the instances in the managed instance
  47423. // group. This operation is marked DONE when you make the request even
  47424. // if the instances have not yet been added to their target pools. The
  47425. // change might take some time to apply to all of the instances in the
  47426. // group depending on the size of the group.
  47427. func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall {
  47428. c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47429. c.project = project
  47430. c.zone = zone
  47431. c.instanceGroupManager = instanceGroupManager
  47432. c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest
  47433. return c
  47434. }
  47435. // RequestId sets the optional parameter "requestId": An optional
  47436. // request ID to identify requests. Specify a unique request ID so that
  47437. // if you must retry your request, the server will know to ignore the
  47438. // request if it has already been completed.
  47439. //
  47440. // For example, consider a situation where you make an initial request
  47441. // and the request times out. If you make the request again with the
  47442. // same request ID, the server can check if original operation with the
  47443. // same request ID was received, and if so, will ignore the second
  47444. // request. This prevents clients from accidentally creating duplicate
  47445. // commitments.
  47446. //
  47447. // The request ID must be a valid UUID with the exception that zero UUID
  47448. // is not supported (00000000-0000-0000-0000-000000000000).
  47449. func (c *InstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *InstanceGroupManagersSetTargetPoolsCall {
  47450. c.urlParams_.Set("requestId", requestId)
  47451. return c
  47452. }
  47453. // Fields allows partial responses to be retrieved. See
  47454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47455. // for more information.
  47456. func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall {
  47457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47458. return c
  47459. }
  47460. // Context sets the context to be used in this call's Do method. Any
  47461. // pending HTTP request will be aborted if the provided context is
  47462. // canceled.
  47463. func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall {
  47464. c.ctx_ = ctx
  47465. return c
  47466. }
  47467. // Header returns an http.Header that can be modified by the caller to
  47468. // add HTTP headers to the request.
  47469. func (c *InstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  47470. if c.header_ == nil {
  47471. c.header_ = make(http.Header)
  47472. }
  47473. return c.header_
  47474. }
  47475. func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  47476. reqHeaders := make(http.Header)
  47477. for k, v := range c.header_ {
  47478. reqHeaders[k] = v
  47479. }
  47480. reqHeaders.Set("User-Agent", c.s.userAgent())
  47481. var body io.Reader = nil
  47482. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest)
  47483. if err != nil {
  47484. return nil, err
  47485. }
  47486. reqHeaders.Set("Content-Type", "application/json")
  47487. c.urlParams_.Set("alt", alt)
  47488. c.urlParams_.Set("prettyPrint", "false")
  47489. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  47490. urls += "?" + c.urlParams_.Encode()
  47491. req, err := http.NewRequest("POST", urls, body)
  47492. if err != nil {
  47493. return nil, err
  47494. }
  47495. req.Header = reqHeaders
  47496. googleapi.Expand(req.URL, map[string]string{
  47497. "project": c.project,
  47498. "zone": c.zone,
  47499. "instanceGroupManager": c.instanceGroupManager,
  47500. })
  47501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47502. }
  47503. // Do executes the "compute.instanceGroupManagers.setTargetPools" call.
  47504. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47505. // status code is an error. Response headers are in either
  47506. // *Operation.ServerResponse.Header or (if a response was returned at
  47507. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47508. // to check whether the returned error was because
  47509. // http.StatusNotModified was returned.
  47510. func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47511. gensupport.SetOptions(c.urlParams_, opts...)
  47512. res, err := c.doRequest("json")
  47513. if res != nil && res.StatusCode == http.StatusNotModified {
  47514. if res.Body != nil {
  47515. res.Body.Close()
  47516. }
  47517. return nil, &googleapi.Error{
  47518. Code: res.StatusCode,
  47519. Header: res.Header,
  47520. }
  47521. }
  47522. if err != nil {
  47523. return nil, err
  47524. }
  47525. defer googleapi.CloseBody(res)
  47526. if err := googleapi.CheckResponse(res); err != nil {
  47527. return nil, err
  47528. }
  47529. ret := &Operation{
  47530. ServerResponse: googleapi.ServerResponse{
  47531. Header: res.Header,
  47532. HTTPStatusCode: res.StatusCode,
  47533. },
  47534. }
  47535. target := &ret
  47536. if err := gensupport.DecodeResponse(target, res); err != nil {
  47537. return nil, err
  47538. }
  47539. return ret, nil
  47540. // {
  47541. // "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.",
  47542. // "httpMethod": "POST",
  47543. // "id": "compute.instanceGroupManagers.setTargetPools",
  47544. // "parameterOrder": [
  47545. // "project",
  47546. // "zone",
  47547. // "instanceGroupManager"
  47548. // ],
  47549. // "parameters": {
  47550. // "instanceGroupManager": {
  47551. // "description": "The name of the managed instance group.",
  47552. // "location": "path",
  47553. // "required": true,
  47554. // "type": "string"
  47555. // },
  47556. // "project": {
  47557. // "description": "Project ID for this request.",
  47558. // "location": "path",
  47559. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47560. // "required": true,
  47561. // "type": "string"
  47562. // },
  47563. // "requestId": {
  47564. // "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).",
  47565. // "location": "query",
  47566. // "type": "string"
  47567. // },
  47568. // "zone": {
  47569. // "description": "The name of the zone where the managed instance group is located.",
  47570. // "location": "path",
  47571. // "required": true,
  47572. // "type": "string"
  47573. // }
  47574. // },
  47575. // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  47576. // "request": {
  47577. // "$ref": "InstanceGroupManagersSetTargetPoolsRequest"
  47578. // },
  47579. // "response": {
  47580. // "$ref": "Operation"
  47581. // },
  47582. // "scopes": [
  47583. // "https://www.googleapis.com/auth/cloud-platform",
  47584. // "https://www.googleapis.com/auth/compute"
  47585. // ]
  47586. // }
  47587. }
  47588. // method id "compute.instanceGroups.addInstances":
  47589. type InstanceGroupsAddInstancesCall struct {
  47590. s *Service
  47591. project string
  47592. zone string
  47593. instanceGroup string
  47594. instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest
  47595. urlParams_ gensupport.URLParams
  47596. ctx_ context.Context
  47597. header_ http.Header
  47598. }
  47599. // AddInstances: Adds a list of instances to the specified instance
  47600. // group. All of the instances in the instance group must be in the same
  47601. // network/subnetwork. Read Adding instances for more information.
  47602. func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall {
  47603. c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47604. c.project = project
  47605. c.zone = zone
  47606. c.instanceGroup = instanceGroup
  47607. c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest
  47608. return c
  47609. }
  47610. // RequestId sets the optional parameter "requestId": An optional
  47611. // request ID to identify requests. Specify a unique request ID so that
  47612. // if you must retry your request, the server will know to ignore the
  47613. // request if it has already been completed.
  47614. //
  47615. // For example, consider a situation where you make an initial request
  47616. // and the request times out. If you make the request again with the
  47617. // same request ID, the server can check if original operation with the
  47618. // same request ID was received, and if so, will ignore the second
  47619. // request. This prevents clients from accidentally creating duplicate
  47620. // commitments.
  47621. //
  47622. // The request ID must be a valid UUID with the exception that zero UUID
  47623. // is not supported (00000000-0000-0000-0000-000000000000).
  47624. func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall {
  47625. c.urlParams_.Set("requestId", requestId)
  47626. return c
  47627. }
  47628. // Fields allows partial responses to be retrieved. See
  47629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47630. // for more information.
  47631. func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall {
  47632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47633. return c
  47634. }
  47635. // Context sets the context to be used in this call's Do method. Any
  47636. // pending HTTP request will be aborted if the provided context is
  47637. // canceled.
  47638. func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall {
  47639. c.ctx_ = ctx
  47640. return c
  47641. }
  47642. // Header returns an http.Header that can be modified by the caller to
  47643. // add HTTP headers to the request.
  47644. func (c *InstanceGroupsAddInstancesCall) Header() http.Header {
  47645. if c.header_ == nil {
  47646. c.header_ = make(http.Header)
  47647. }
  47648. return c.header_
  47649. }
  47650. func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) {
  47651. reqHeaders := make(http.Header)
  47652. for k, v := range c.header_ {
  47653. reqHeaders[k] = v
  47654. }
  47655. reqHeaders.Set("User-Agent", c.s.userAgent())
  47656. var body io.Reader = nil
  47657. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest)
  47658. if err != nil {
  47659. return nil, err
  47660. }
  47661. reqHeaders.Set("Content-Type", "application/json")
  47662. c.urlParams_.Set("alt", alt)
  47663. c.urlParams_.Set("prettyPrint", "false")
  47664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances")
  47665. urls += "?" + c.urlParams_.Encode()
  47666. req, err := http.NewRequest("POST", urls, body)
  47667. if err != nil {
  47668. return nil, err
  47669. }
  47670. req.Header = reqHeaders
  47671. googleapi.Expand(req.URL, map[string]string{
  47672. "project": c.project,
  47673. "zone": c.zone,
  47674. "instanceGroup": c.instanceGroup,
  47675. })
  47676. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47677. }
  47678. // Do executes the "compute.instanceGroups.addInstances" call.
  47679. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  47680. // status code is an error. Response headers are in either
  47681. // *Operation.ServerResponse.Header or (if a response was returned at
  47682. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  47683. // to check whether the returned error was because
  47684. // http.StatusNotModified was returned.
  47685. func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  47686. gensupport.SetOptions(c.urlParams_, opts...)
  47687. res, err := c.doRequest("json")
  47688. if res != nil && res.StatusCode == http.StatusNotModified {
  47689. if res.Body != nil {
  47690. res.Body.Close()
  47691. }
  47692. return nil, &googleapi.Error{
  47693. Code: res.StatusCode,
  47694. Header: res.Header,
  47695. }
  47696. }
  47697. if err != nil {
  47698. return nil, err
  47699. }
  47700. defer googleapi.CloseBody(res)
  47701. if err := googleapi.CheckResponse(res); err != nil {
  47702. return nil, err
  47703. }
  47704. ret := &Operation{
  47705. ServerResponse: googleapi.ServerResponse{
  47706. Header: res.Header,
  47707. HTTPStatusCode: res.StatusCode,
  47708. },
  47709. }
  47710. target := &ret
  47711. if err := gensupport.DecodeResponse(target, res); err != nil {
  47712. return nil, err
  47713. }
  47714. return ret, nil
  47715. // {
  47716. // "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.",
  47717. // "httpMethod": "POST",
  47718. // "id": "compute.instanceGroups.addInstances",
  47719. // "parameterOrder": [
  47720. // "project",
  47721. // "zone",
  47722. // "instanceGroup"
  47723. // ],
  47724. // "parameters": {
  47725. // "instanceGroup": {
  47726. // "description": "The name of the instance group where you are adding instances.",
  47727. // "location": "path",
  47728. // "required": true,
  47729. // "type": "string"
  47730. // },
  47731. // "project": {
  47732. // "description": "Project ID for this request.",
  47733. // "location": "path",
  47734. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47735. // "required": true,
  47736. // "type": "string"
  47737. // },
  47738. // "requestId": {
  47739. // "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).",
  47740. // "location": "query",
  47741. // "type": "string"
  47742. // },
  47743. // "zone": {
  47744. // "description": "The name of the zone where the instance group is located.",
  47745. // "location": "path",
  47746. // "required": true,
  47747. // "type": "string"
  47748. // }
  47749. // },
  47750. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances",
  47751. // "request": {
  47752. // "$ref": "InstanceGroupsAddInstancesRequest"
  47753. // },
  47754. // "response": {
  47755. // "$ref": "Operation"
  47756. // },
  47757. // "scopes": [
  47758. // "https://www.googleapis.com/auth/cloud-platform",
  47759. // "https://www.googleapis.com/auth/compute"
  47760. // ]
  47761. // }
  47762. }
  47763. // method id "compute.instanceGroups.aggregatedList":
  47764. type InstanceGroupsAggregatedListCall struct {
  47765. s *Service
  47766. project string
  47767. urlParams_ gensupport.URLParams
  47768. ifNoneMatch_ string
  47769. ctx_ context.Context
  47770. header_ http.Header
  47771. }
  47772. // AggregatedList: Retrieves the list of instance groups and sorts them
  47773. // by zone.
  47774. func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall {
  47775. c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  47776. c.project = project
  47777. return c
  47778. }
  47779. // Filter sets the optional parameter "filter": A filter expression that
  47780. // filters resources listed in the response. The expression must specify
  47781. // the field name, a comparison operator, and the value that you want to
  47782. // use for filtering. The value must be a string, a number, or a
  47783. // boolean. The comparison operator must be either =, !=, >, or <.
  47784. //
  47785. // For example, if you are filtering Compute Engine instances, you can
  47786. // exclude instances named example-instance by specifying name !=
  47787. // example-instance.
  47788. //
  47789. // You can also filter nested fields. For example, you could specify
  47790. // scheduling.automaticRestart = false to include instances only if they
  47791. // are not scheduled for automatic restarts. You can use filtering on
  47792. // nested fields to filter based on resource labels.
  47793. //
  47794. // To filter on multiple expressions, provide each separate expression
  47795. // within parentheses. For example, (scheduling.automaticRestart = true)
  47796. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  47797. // AND expression. However, you can include AND and OR expressions
  47798. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  47799. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  47800. // true).
  47801. func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall {
  47802. c.urlParams_.Set("filter", filter)
  47803. return c
  47804. }
  47805. // MaxResults sets the optional parameter "maxResults": The maximum
  47806. // number of results per page that should be returned. If the number of
  47807. // available results is larger than maxResults, Compute Engine returns a
  47808. // nextPageToken that can be used to get the next page of results in
  47809. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  47810. // (Default: 500)
  47811. func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall {
  47812. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  47813. return c
  47814. }
  47815. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  47816. // a certain order. By default, results are returned in alphanumerical
  47817. // order based on the resource name.
  47818. //
  47819. // You can also sort results in descending order based on the creation
  47820. // timestamp using orderBy="creationTimestamp desc". This sorts results
  47821. // based on the creationTimestamp field in reverse chronological order
  47822. // (newest result first). Use this to sort resources like operations so
  47823. // that the newest operation is returned first.
  47824. //
  47825. // Currently, only sorting by name or creationTimestamp desc is
  47826. // supported.
  47827. func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall {
  47828. c.urlParams_.Set("orderBy", orderBy)
  47829. return c
  47830. }
  47831. // PageToken sets the optional parameter "pageToken": Specifies a page
  47832. // token to use. Set pageToken to the nextPageToken returned by a
  47833. // previous list request to get the next page of results.
  47834. func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall {
  47835. c.urlParams_.Set("pageToken", pageToken)
  47836. return c
  47837. }
  47838. // Fields allows partial responses to be retrieved. See
  47839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  47840. // for more information.
  47841. func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall {
  47842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  47843. return c
  47844. }
  47845. // IfNoneMatch sets the optional parameter which makes the operation
  47846. // fail if the object's ETag matches the given value. This is useful for
  47847. // getting updates only after the object has changed since the last
  47848. // request. Use googleapi.IsNotModified to check whether the response
  47849. // error from Do is the result of In-None-Match.
  47850. func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall {
  47851. c.ifNoneMatch_ = entityTag
  47852. return c
  47853. }
  47854. // Context sets the context to be used in this call's Do method. Any
  47855. // pending HTTP request will be aborted if the provided context is
  47856. // canceled.
  47857. func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall {
  47858. c.ctx_ = ctx
  47859. return c
  47860. }
  47861. // Header returns an http.Header that can be modified by the caller to
  47862. // add HTTP headers to the request.
  47863. func (c *InstanceGroupsAggregatedListCall) Header() http.Header {
  47864. if c.header_ == nil {
  47865. c.header_ = make(http.Header)
  47866. }
  47867. return c.header_
  47868. }
  47869. func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  47870. reqHeaders := make(http.Header)
  47871. for k, v := range c.header_ {
  47872. reqHeaders[k] = v
  47873. }
  47874. reqHeaders.Set("User-Agent", c.s.userAgent())
  47875. if c.ifNoneMatch_ != "" {
  47876. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  47877. }
  47878. var body io.Reader = nil
  47879. c.urlParams_.Set("alt", alt)
  47880. c.urlParams_.Set("prettyPrint", "false")
  47881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups")
  47882. urls += "?" + c.urlParams_.Encode()
  47883. req, err := http.NewRequest("GET", urls, body)
  47884. if err != nil {
  47885. return nil, err
  47886. }
  47887. req.Header = reqHeaders
  47888. googleapi.Expand(req.URL, map[string]string{
  47889. "project": c.project,
  47890. })
  47891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  47892. }
  47893. // Do executes the "compute.instanceGroups.aggregatedList" call.
  47894. // Exactly one of *InstanceGroupAggregatedList or error will be non-nil.
  47895. // Any non-2xx status code is an error. Response headers are in either
  47896. // *InstanceGroupAggregatedList.ServerResponse.Header or (if a response
  47897. // was returned at all) in error.(*googleapi.Error).Header. Use
  47898. // googleapi.IsNotModified to check whether the returned error was
  47899. // because http.StatusNotModified was returned.
  47900. func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) {
  47901. gensupport.SetOptions(c.urlParams_, opts...)
  47902. res, err := c.doRequest("json")
  47903. if res != nil && res.StatusCode == http.StatusNotModified {
  47904. if res.Body != nil {
  47905. res.Body.Close()
  47906. }
  47907. return nil, &googleapi.Error{
  47908. Code: res.StatusCode,
  47909. Header: res.Header,
  47910. }
  47911. }
  47912. if err != nil {
  47913. return nil, err
  47914. }
  47915. defer googleapi.CloseBody(res)
  47916. if err := googleapi.CheckResponse(res); err != nil {
  47917. return nil, err
  47918. }
  47919. ret := &InstanceGroupAggregatedList{
  47920. ServerResponse: googleapi.ServerResponse{
  47921. Header: res.Header,
  47922. HTTPStatusCode: res.StatusCode,
  47923. },
  47924. }
  47925. target := &ret
  47926. if err := gensupport.DecodeResponse(target, res); err != nil {
  47927. return nil, err
  47928. }
  47929. return ret, nil
  47930. // {
  47931. // "description": "Retrieves the list of instance groups and sorts them by zone.",
  47932. // "httpMethod": "GET",
  47933. // "id": "compute.instanceGroups.aggregatedList",
  47934. // "parameterOrder": [
  47935. // "project"
  47936. // ],
  47937. // "parameters": {
  47938. // "filter": {
  47939. // "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).",
  47940. // "location": "query",
  47941. // "type": "string"
  47942. // },
  47943. // "maxResults": {
  47944. // "default": "500",
  47945. // "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)",
  47946. // "format": "uint32",
  47947. // "location": "query",
  47948. // "minimum": "0",
  47949. // "type": "integer"
  47950. // },
  47951. // "orderBy": {
  47952. // "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.",
  47953. // "location": "query",
  47954. // "type": "string"
  47955. // },
  47956. // "pageToken": {
  47957. // "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.",
  47958. // "location": "query",
  47959. // "type": "string"
  47960. // },
  47961. // "project": {
  47962. // "description": "Project ID for this request.",
  47963. // "location": "path",
  47964. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  47965. // "required": true,
  47966. // "type": "string"
  47967. // }
  47968. // },
  47969. // "path": "{project}/aggregated/instanceGroups",
  47970. // "response": {
  47971. // "$ref": "InstanceGroupAggregatedList"
  47972. // },
  47973. // "scopes": [
  47974. // "https://www.googleapis.com/auth/cloud-platform",
  47975. // "https://www.googleapis.com/auth/compute",
  47976. // "https://www.googleapis.com/auth/compute.readonly"
  47977. // ]
  47978. // }
  47979. }
  47980. // Pages invokes f for each page of results.
  47981. // A non-nil error returned from f will halt the iteration.
  47982. // The provided context supersedes any context provided to the Context method.
  47983. func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error {
  47984. c.ctx_ = ctx
  47985. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  47986. for {
  47987. x, err := c.Do()
  47988. if err != nil {
  47989. return err
  47990. }
  47991. if err := f(x); err != nil {
  47992. return err
  47993. }
  47994. if x.NextPageToken == "" {
  47995. return nil
  47996. }
  47997. c.PageToken(x.NextPageToken)
  47998. }
  47999. }
  48000. // method id "compute.instanceGroups.delete":
  48001. type InstanceGroupsDeleteCall struct {
  48002. s *Service
  48003. project string
  48004. zone string
  48005. instanceGroup string
  48006. urlParams_ gensupport.URLParams
  48007. ctx_ context.Context
  48008. header_ http.Header
  48009. }
  48010. // Delete: Deletes the specified instance group. The instances in the
  48011. // group are not deleted. Note that instance group must not belong to a
  48012. // backend service. Read Deleting an instance group for more
  48013. // information.
  48014. func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall {
  48015. c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48016. c.project = project
  48017. c.zone = zone
  48018. c.instanceGroup = instanceGroup
  48019. return c
  48020. }
  48021. // RequestId sets the optional parameter "requestId": An optional
  48022. // request ID to identify requests. Specify a unique request ID so that
  48023. // if you must retry your request, the server will know to ignore the
  48024. // request if it has already been completed.
  48025. //
  48026. // For example, consider a situation where you make an initial request
  48027. // and the request times out. If you make the request again with the
  48028. // same request ID, the server can check if original operation with the
  48029. // same request ID was received, and if so, will ignore the second
  48030. // request. This prevents clients from accidentally creating duplicate
  48031. // commitments.
  48032. //
  48033. // The request ID must be a valid UUID with the exception that zero UUID
  48034. // is not supported (00000000-0000-0000-0000-000000000000).
  48035. func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall {
  48036. c.urlParams_.Set("requestId", requestId)
  48037. return c
  48038. }
  48039. // Fields allows partial responses to be retrieved. See
  48040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48041. // for more information.
  48042. func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall {
  48043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48044. return c
  48045. }
  48046. // Context sets the context to be used in this call's Do method. Any
  48047. // pending HTTP request will be aborted if the provided context is
  48048. // canceled.
  48049. func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall {
  48050. c.ctx_ = ctx
  48051. return c
  48052. }
  48053. // Header returns an http.Header that can be modified by the caller to
  48054. // add HTTP headers to the request.
  48055. func (c *InstanceGroupsDeleteCall) Header() http.Header {
  48056. if c.header_ == nil {
  48057. c.header_ = make(http.Header)
  48058. }
  48059. return c.header_
  48060. }
  48061. func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  48062. reqHeaders := make(http.Header)
  48063. for k, v := range c.header_ {
  48064. reqHeaders[k] = v
  48065. }
  48066. reqHeaders.Set("User-Agent", c.s.userAgent())
  48067. var body io.Reader = nil
  48068. c.urlParams_.Set("alt", alt)
  48069. c.urlParams_.Set("prettyPrint", "false")
  48070. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  48071. urls += "?" + c.urlParams_.Encode()
  48072. req, err := http.NewRequest("DELETE", urls, body)
  48073. if err != nil {
  48074. return nil, err
  48075. }
  48076. req.Header = reqHeaders
  48077. googleapi.Expand(req.URL, map[string]string{
  48078. "project": c.project,
  48079. "zone": c.zone,
  48080. "instanceGroup": c.instanceGroup,
  48081. })
  48082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48083. }
  48084. // Do executes the "compute.instanceGroups.delete" call.
  48085. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48086. // status code is an error. Response headers are in either
  48087. // *Operation.ServerResponse.Header or (if a response was returned at
  48088. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48089. // to check whether the returned error was because
  48090. // http.StatusNotModified was returned.
  48091. func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48092. gensupport.SetOptions(c.urlParams_, opts...)
  48093. res, err := c.doRequest("json")
  48094. if res != nil && res.StatusCode == http.StatusNotModified {
  48095. if res.Body != nil {
  48096. res.Body.Close()
  48097. }
  48098. return nil, &googleapi.Error{
  48099. Code: res.StatusCode,
  48100. Header: res.Header,
  48101. }
  48102. }
  48103. if err != nil {
  48104. return nil, err
  48105. }
  48106. defer googleapi.CloseBody(res)
  48107. if err := googleapi.CheckResponse(res); err != nil {
  48108. return nil, err
  48109. }
  48110. ret := &Operation{
  48111. ServerResponse: googleapi.ServerResponse{
  48112. Header: res.Header,
  48113. HTTPStatusCode: res.StatusCode,
  48114. },
  48115. }
  48116. target := &ret
  48117. if err := gensupport.DecodeResponse(target, res); err != nil {
  48118. return nil, err
  48119. }
  48120. return ret, nil
  48121. // {
  48122. // "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.",
  48123. // "httpMethod": "DELETE",
  48124. // "id": "compute.instanceGroups.delete",
  48125. // "parameterOrder": [
  48126. // "project",
  48127. // "zone",
  48128. // "instanceGroup"
  48129. // ],
  48130. // "parameters": {
  48131. // "instanceGroup": {
  48132. // "description": "The name of the instance group to delete.",
  48133. // "location": "path",
  48134. // "required": true,
  48135. // "type": "string"
  48136. // },
  48137. // "project": {
  48138. // "description": "Project ID for this request.",
  48139. // "location": "path",
  48140. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48141. // "required": true,
  48142. // "type": "string"
  48143. // },
  48144. // "requestId": {
  48145. // "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).",
  48146. // "location": "query",
  48147. // "type": "string"
  48148. // },
  48149. // "zone": {
  48150. // "description": "The name of the zone where the instance group is located.",
  48151. // "location": "path",
  48152. // "required": true,
  48153. // "type": "string"
  48154. // }
  48155. // },
  48156. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  48157. // "response": {
  48158. // "$ref": "Operation"
  48159. // },
  48160. // "scopes": [
  48161. // "https://www.googleapis.com/auth/cloud-platform",
  48162. // "https://www.googleapis.com/auth/compute"
  48163. // ]
  48164. // }
  48165. }
  48166. // method id "compute.instanceGroups.get":
  48167. type InstanceGroupsGetCall struct {
  48168. s *Service
  48169. project string
  48170. zone string
  48171. instanceGroup string
  48172. urlParams_ gensupport.URLParams
  48173. ifNoneMatch_ string
  48174. ctx_ context.Context
  48175. header_ http.Header
  48176. }
  48177. // Get: Returns the specified instance group. Gets a list of available
  48178. // instance groups by making a list() request.
  48179. func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall {
  48180. c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48181. c.project = project
  48182. c.zone = zone
  48183. c.instanceGroup = instanceGroup
  48184. return c
  48185. }
  48186. // Fields allows partial responses to be retrieved. See
  48187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48188. // for more information.
  48189. func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall {
  48190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48191. return c
  48192. }
  48193. // IfNoneMatch sets the optional parameter which makes the operation
  48194. // fail if the object's ETag matches the given value. This is useful for
  48195. // getting updates only after the object has changed since the last
  48196. // request. Use googleapi.IsNotModified to check whether the response
  48197. // error from Do is the result of In-None-Match.
  48198. func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall {
  48199. c.ifNoneMatch_ = entityTag
  48200. return c
  48201. }
  48202. // Context sets the context to be used in this call's Do method. Any
  48203. // pending HTTP request will be aborted if the provided context is
  48204. // canceled.
  48205. func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall {
  48206. c.ctx_ = ctx
  48207. return c
  48208. }
  48209. // Header returns an http.Header that can be modified by the caller to
  48210. // add HTTP headers to the request.
  48211. func (c *InstanceGroupsGetCall) Header() http.Header {
  48212. if c.header_ == nil {
  48213. c.header_ = make(http.Header)
  48214. }
  48215. return c.header_
  48216. }
  48217. func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  48218. reqHeaders := make(http.Header)
  48219. for k, v := range c.header_ {
  48220. reqHeaders[k] = v
  48221. }
  48222. reqHeaders.Set("User-Agent", c.s.userAgent())
  48223. if c.ifNoneMatch_ != "" {
  48224. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48225. }
  48226. var body io.Reader = nil
  48227. c.urlParams_.Set("alt", alt)
  48228. c.urlParams_.Set("prettyPrint", "false")
  48229. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}")
  48230. urls += "?" + c.urlParams_.Encode()
  48231. req, err := http.NewRequest("GET", urls, body)
  48232. if err != nil {
  48233. return nil, err
  48234. }
  48235. req.Header = reqHeaders
  48236. googleapi.Expand(req.URL, map[string]string{
  48237. "project": c.project,
  48238. "zone": c.zone,
  48239. "instanceGroup": c.instanceGroup,
  48240. })
  48241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48242. }
  48243. // Do executes the "compute.instanceGroups.get" call.
  48244. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  48245. // status code is an error. Response headers are in either
  48246. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  48247. // at all) in error.(*googleapi.Error).Header. Use
  48248. // googleapi.IsNotModified to check whether the returned error was
  48249. // because http.StatusNotModified was returned.
  48250. func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  48251. gensupport.SetOptions(c.urlParams_, opts...)
  48252. res, err := c.doRequest("json")
  48253. if res != nil && res.StatusCode == http.StatusNotModified {
  48254. if res.Body != nil {
  48255. res.Body.Close()
  48256. }
  48257. return nil, &googleapi.Error{
  48258. Code: res.StatusCode,
  48259. Header: res.Header,
  48260. }
  48261. }
  48262. if err != nil {
  48263. return nil, err
  48264. }
  48265. defer googleapi.CloseBody(res)
  48266. if err := googleapi.CheckResponse(res); err != nil {
  48267. return nil, err
  48268. }
  48269. ret := &InstanceGroup{
  48270. ServerResponse: googleapi.ServerResponse{
  48271. Header: res.Header,
  48272. HTTPStatusCode: res.StatusCode,
  48273. },
  48274. }
  48275. target := &ret
  48276. if err := gensupport.DecodeResponse(target, res); err != nil {
  48277. return nil, err
  48278. }
  48279. return ret, nil
  48280. // {
  48281. // "description": "Returns the specified instance group. Gets a list of available instance groups by making a list() request.",
  48282. // "httpMethod": "GET",
  48283. // "id": "compute.instanceGroups.get",
  48284. // "parameterOrder": [
  48285. // "project",
  48286. // "zone",
  48287. // "instanceGroup"
  48288. // ],
  48289. // "parameters": {
  48290. // "instanceGroup": {
  48291. // "description": "The name of the instance group.",
  48292. // "location": "path",
  48293. // "required": true,
  48294. // "type": "string"
  48295. // },
  48296. // "project": {
  48297. // "description": "Project ID for this request.",
  48298. // "location": "path",
  48299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48300. // "required": true,
  48301. // "type": "string"
  48302. // },
  48303. // "zone": {
  48304. // "description": "The name of the zone where the instance group is located.",
  48305. // "location": "path",
  48306. // "required": true,
  48307. // "type": "string"
  48308. // }
  48309. // },
  48310. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}",
  48311. // "response": {
  48312. // "$ref": "InstanceGroup"
  48313. // },
  48314. // "scopes": [
  48315. // "https://www.googleapis.com/auth/cloud-platform",
  48316. // "https://www.googleapis.com/auth/compute",
  48317. // "https://www.googleapis.com/auth/compute.readonly"
  48318. // ]
  48319. // }
  48320. }
  48321. // method id "compute.instanceGroups.insert":
  48322. type InstanceGroupsInsertCall struct {
  48323. s *Service
  48324. project string
  48325. zone string
  48326. instancegroup *InstanceGroup
  48327. urlParams_ gensupport.URLParams
  48328. ctx_ context.Context
  48329. header_ http.Header
  48330. }
  48331. // Insert: Creates an instance group in the specified project using the
  48332. // parameters that are included in the request.
  48333. func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall {
  48334. c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48335. c.project = project
  48336. c.zone = zone
  48337. c.instancegroup = instancegroup
  48338. return c
  48339. }
  48340. // RequestId sets the optional parameter "requestId": An optional
  48341. // request ID to identify requests. Specify a unique request ID so that
  48342. // if you must retry your request, the server will know to ignore the
  48343. // request if it has already been completed.
  48344. //
  48345. // For example, consider a situation where you make an initial request
  48346. // and the request times out. If you make the request again with the
  48347. // same request ID, the server can check if original operation with the
  48348. // same request ID was received, and if so, will ignore the second
  48349. // request. This prevents clients from accidentally creating duplicate
  48350. // commitments.
  48351. //
  48352. // The request ID must be a valid UUID with the exception that zero UUID
  48353. // is not supported (00000000-0000-0000-0000-000000000000).
  48354. func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall {
  48355. c.urlParams_.Set("requestId", requestId)
  48356. return c
  48357. }
  48358. // Fields allows partial responses to be retrieved. See
  48359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48360. // for more information.
  48361. func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall {
  48362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48363. return c
  48364. }
  48365. // Context sets the context to be used in this call's Do method. Any
  48366. // pending HTTP request will be aborted if the provided context is
  48367. // canceled.
  48368. func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall {
  48369. c.ctx_ = ctx
  48370. return c
  48371. }
  48372. // Header returns an http.Header that can be modified by the caller to
  48373. // add HTTP headers to the request.
  48374. func (c *InstanceGroupsInsertCall) Header() http.Header {
  48375. if c.header_ == nil {
  48376. c.header_ = make(http.Header)
  48377. }
  48378. return c.header_
  48379. }
  48380. func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  48381. reqHeaders := make(http.Header)
  48382. for k, v := range c.header_ {
  48383. reqHeaders[k] = v
  48384. }
  48385. reqHeaders.Set("User-Agent", c.s.userAgent())
  48386. var body io.Reader = nil
  48387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup)
  48388. if err != nil {
  48389. return nil, err
  48390. }
  48391. reqHeaders.Set("Content-Type", "application/json")
  48392. c.urlParams_.Set("alt", alt)
  48393. c.urlParams_.Set("prettyPrint", "false")
  48394. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  48395. urls += "?" + c.urlParams_.Encode()
  48396. req, err := http.NewRequest("POST", urls, body)
  48397. if err != nil {
  48398. return nil, err
  48399. }
  48400. req.Header = reqHeaders
  48401. googleapi.Expand(req.URL, map[string]string{
  48402. "project": c.project,
  48403. "zone": c.zone,
  48404. })
  48405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48406. }
  48407. // Do executes the "compute.instanceGroups.insert" call.
  48408. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  48409. // status code is an error. Response headers are in either
  48410. // *Operation.ServerResponse.Header or (if a response was returned at
  48411. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  48412. // to check whether the returned error was because
  48413. // http.StatusNotModified was returned.
  48414. func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  48415. gensupport.SetOptions(c.urlParams_, opts...)
  48416. res, err := c.doRequest("json")
  48417. if res != nil && res.StatusCode == http.StatusNotModified {
  48418. if res.Body != nil {
  48419. res.Body.Close()
  48420. }
  48421. return nil, &googleapi.Error{
  48422. Code: res.StatusCode,
  48423. Header: res.Header,
  48424. }
  48425. }
  48426. if err != nil {
  48427. return nil, err
  48428. }
  48429. defer googleapi.CloseBody(res)
  48430. if err := googleapi.CheckResponse(res); err != nil {
  48431. return nil, err
  48432. }
  48433. ret := &Operation{
  48434. ServerResponse: googleapi.ServerResponse{
  48435. Header: res.Header,
  48436. HTTPStatusCode: res.StatusCode,
  48437. },
  48438. }
  48439. target := &ret
  48440. if err := gensupport.DecodeResponse(target, res); err != nil {
  48441. return nil, err
  48442. }
  48443. return ret, nil
  48444. // {
  48445. // "description": "Creates an instance group in the specified project using the parameters that are included in the request.",
  48446. // "httpMethod": "POST",
  48447. // "id": "compute.instanceGroups.insert",
  48448. // "parameterOrder": [
  48449. // "project",
  48450. // "zone"
  48451. // ],
  48452. // "parameters": {
  48453. // "project": {
  48454. // "description": "Project ID for this request.",
  48455. // "location": "path",
  48456. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48457. // "required": true,
  48458. // "type": "string"
  48459. // },
  48460. // "requestId": {
  48461. // "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).",
  48462. // "location": "query",
  48463. // "type": "string"
  48464. // },
  48465. // "zone": {
  48466. // "description": "The name of the zone where you want to create the instance group.",
  48467. // "location": "path",
  48468. // "required": true,
  48469. // "type": "string"
  48470. // }
  48471. // },
  48472. // "path": "{project}/zones/{zone}/instanceGroups",
  48473. // "request": {
  48474. // "$ref": "InstanceGroup"
  48475. // },
  48476. // "response": {
  48477. // "$ref": "Operation"
  48478. // },
  48479. // "scopes": [
  48480. // "https://www.googleapis.com/auth/cloud-platform",
  48481. // "https://www.googleapis.com/auth/compute"
  48482. // ]
  48483. // }
  48484. }
  48485. // method id "compute.instanceGroups.list":
  48486. type InstanceGroupsListCall struct {
  48487. s *Service
  48488. project string
  48489. zone string
  48490. urlParams_ gensupport.URLParams
  48491. ifNoneMatch_ string
  48492. ctx_ context.Context
  48493. header_ http.Header
  48494. }
  48495. // List: Retrieves the list of instance groups that are located in the
  48496. // specified project and zone.
  48497. func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall {
  48498. c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48499. c.project = project
  48500. c.zone = zone
  48501. return c
  48502. }
  48503. // Filter sets the optional parameter "filter": A filter expression that
  48504. // filters resources listed in the response. The expression must specify
  48505. // the field name, a comparison operator, and the value that you want to
  48506. // use for filtering. The value must be a string, a number, or a
  48507. // boolean. The comparison operator must be either =, !=, >, or <.
  48508. //
  48509. // For example, if you are filtering Compute Engine instances, you can
  48510. // exclude instances named example-instance by specifying name !=
  48511. // example-instance.
  48512. //
  48513. // You can also filter nested fields. For example, you could specify
  48514. // scheduling.automaticRestart = false to include instances only if they
  48515. // are not scheduled for automatic restarts. You can use filtering on
  48516. // nested fields to filter based on resource labels.
  48517. //
  48518. // To filter on multiple expressions, provide each separate expression
  48519. // within parentheses. For example, (scheduling.automaticRestart = true)
  48520. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48521. // AND expression. However, you can include AND and OR expressions
  48522. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48523. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48524. // true).
  48525. func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall {
  48526. c.urlParams_.Set("filter", filter)
  48527. return c
  48528. }
  48529. // MaxResults sets the optional parameter "maxResults": The maximum
  48530. // number of results per page that should be returned. If the number of
  48531. // available results is larger than maxResults, Compute Engine returns a
  48532. // nextPageToken that can be used to get the next page of results in
  48533. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48534. // (Default: 500)
  48535. func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall {
  48536. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48537. return c
  48538. }
  48539. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48540. // a certain order. By default, results are returned in alphanumerical
  48541. // order based on the resource name.
  48542. //
  48543. // You can also sort results in descending order based on the creation
  48544. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48545. // based on the creationTimestamp field in reverse chronological order
  48546. // (newest result first). Use this to sort resources like operations so
  48547. // that the newest operation is returned first.
  48548. //
  48549. // Currently, only sorting by name or creationTimestamp desc is
  48550. // supported.
  48551. func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall {
  48552. c.urlParams_.Set("orderBy", orderBy)
  48553. return c
  48554. }
  48555. // PageToken sets the optional parameter "pageToken": Specifies a page
  48556. // token to use. Set pageToken to the nextPageToken returned by a
  48557. // previous list request to get the next page of results.
  48558. func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall {
  48559. c.urlParams_.Set("pageToken", pageToken)
  48560. return c
  48561. }
  48562. // Fields allows partial responses to be retrieved. See
  48563. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48564. // for more information.
  48565. func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall {
  48566. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48567. return c
  48568. }
  48569. // IfNoneMatch sets the optional parameter which makes the operation
  48570. // fail if the object's ETag matches the given value. This is useful for
  48571. // getting updates only after the object has changed since the last
  48572. // request. Use googleapi.IsNotModified to check whether the response
  48573. // error from Do is the result of In-None-Match.
  48574. func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall {
  48575. c.ifNoneMatch_ = entityTag
  48576. return c
  48577. }
  48578. // Context sets the context to be used in this call's Do method. Any
  48579. // pending HTTP request will be aborted if the provided context is
  48580. // canceled.
  48581. func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall {
  48582. c.ctx_ = ctx
  48583. return c
  48584. }
  48585. // Header returns an http.Header that can be modified by the caller to
  48586. // add HTTP headers to the request.
  48587. func (c *InstanceGroupsListCall) Header() http.Header {
  48588. if c.header_ == nil {
  48589. c.header_ = make(http.Header)
  48590. }
  48591. return c.header_
  48592. }
  48593. func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  48594. reqHeaders := make(http.Header)
  48595. for k, v := range c.header_ {
  48596. reqHeaders[k] = v
  48597. }
  48598. reqHeaders.Set("User-Agent", c.s.userAgent())
  48599. if c.ifNoneMatch_ != "" {
  48600. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  48601. }
  48602. var body io.Reader = nil
  48603. c.urlParams_.Set("alt", alt)
  48604. c.urlParams_.Set("prettyPrint", "false")
  48605. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups")
  48606. urls += "?" + c.urlParams_.Encode()
  48607. req, err := http.NewRequest("GET", urls, body)
  48608. if err != nil {
  48609. return nil, err
  48610. }
  48611. req.Header = reqHeaders
  48612. googleapi.Expand(req.URL, map[string]string{
  48613. "project": c.project,
  48614. "zone": c.zone,
  48615. })
  48616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48617. }
  48618. // Do executes the "compute.instanceGroups.list" call.
  48619. // Exactly one of *InstanceGroupList or error will be non-nil. Any
  48620. // non-2xx status code is an error. Response headers are in either
  48621. // *InstanceGroupList.ServerResponse.Header or (if a response was
  48622. // returned at all) in error.(*googleapi.Error).Header. Use
  48623. // googleapi.IsNotModified to check whether the returned error was
  48624. // because http.StatusNotModified was returned.
  48625. func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) {
  48626. gensupport.SetOptions(c.urlParams_, opts...)
  48627. res, err := c.doRequest("json")
  48628. if res != nil && res.StatusCode == http.StatusNotModified {
  48629. if res.Body != nil {
  48630. res.Body.Close()
  48631. }
  48632. return nil, &googleapi.Error{
  48633. Code: res.StatusCode,
  48634. Header: res.Header,
  48635. }
  48636. }
  48637. if err != nil {
  48638. return nil, err
  48639. }
  48640. defer googleapi.CloseBody(res)
  48641. if err := googleapi.CheckResponse(res); err != nil {
  48642. return nil, err
  48643. }
  48644. ret := &InstanceGroupList{
  48645. ServerResponse: googleapi.ServerResponse{
  48646. Header: res.Header,
  48647. HTTPStatusCode: res.StatusCode,
  48648. },
  48649. }
  48650. target := &ret
  48651. if err := gensupport.DecodeResponse(target, res); err != nil {
  48652. return nil, err
  48653. }
  48654. return ret, nil
  48655. // {
  48656. // "description": "Retrieves the list of instance groups that are located in the specified project and zone.",
  48657. // "httpMethod": "GET",
  48658. // "id": "compute.instanceGroups.list",
  48659. // "parameterOrder": [
  48660. // "project",
  48661. // "zone"
  48662. // ],
  48663. // "parameters": {
  48664. // "filter": {
  48665. // "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).",
  48666. // "location": "query",
  48667. // "type": "string"
  48668. // },
  48669. // "maxResults": {
  48670. // "default": "500",
  48671. // "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)",
  48672. // "format": "uint32",
  48673. // "location": "query",
  48674. // "minimum": "0",
  48675. // "type": "integer"
  48676. // },
  48677. // "orderBy": {
  48678. // "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.",
  48679. // "location": "query",
  48680. // "type": "string"
  48681. // },
  48682. // "pageToken": {
  48683. // "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.",
  48684. // "location": "query",
  48685. // "type": "string"
  48686. // },
  48687. // "project": {
  48688. // "description": "Project ID for this request.",
  48689. // "location": "path",
  48690. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48691. // "required": true,
  48692. // "type": "string"
  48693. // },
  48694. // "zone": {
  48695. // "description": "The name of the zone where the instance group is located.",
  48696. // "location": "path",
  48697. // "required": true,
  48698. // "type": "string"
  48699. // }
  48700. // },
  48701. // "path": "{project}/zones/{zone}/instanceGroups",
  48702. // "response": {
  48703. // "$ref": "InstanceGroupList"
  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. // Pages invokes f for each page of results.
  48713. // A non-nil error returned from f will halt the iteration.
  48714. // The provided context supersedes any context provided to the Context method.
  48715. func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error {
  48716. c.ctx_ = ctx
  48717. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48718. for {
  48719. x, err := c.Do()
  48720. if err != nil {
  48721. return err
  48722. }
  48723. if err := f(x); err != nil {
  48724. return err
  48725. }
  48726. if x.NextPageToken == "" {
  48727. return nil
  48728. }
  48729. c.PageToken(x.NextPageToken)
  48730. }
  48731. }
  48732. // method id "compute.instanceGroups.listInstances":
  48733. type InstanceGroupsListInstancesCall struct {
  48734. s *Service
  48735. project string
  48736. zone string
  48737. instanceGroup string
  48738. instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest
  48739. urlParams_ gensupport.URLParams
  48740. ctx_ context.Context
  48741. header_ http.Header
  48742. }
  48743. // ListInstances: Lists the instances in the specified instance group.
  48744. func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall {
  48745. c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  48746. c.project = project
  48747. c.zone = zone
  48748. c.instanceGroup = instanceGroup
  48749. c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest
  48750. return c
  48751. }
  48752. // Filter sets the optional parameter "filter": A filter expression that
  48753. // filters resources listed in the response. The expression must specify
  48754. // the field name, a comparison operator, and the value that you want to
  48755. // use for filtering. The value must be a string, a number, or a
  48756. // boolean. The comparison operator must be either =, !=, >, or <.
  48757. //
  48758. // For example, if you are filtering Compute Engine instances, you can
  48759. // exclude instances named example-instance by specifying name !=
  48760. // example-instance.
  48761. //
  48762. // You can also filter nested fields. For example, you could specify
  48763. // scheduling.automaticRestart = false to include instances only if they
  48764. // are not scheduled for automatic restarts. You can use filtering on
  48765. // nested fields to filter based on resource labels.
  48766. //
  48767. // To filter on multiple expressions, provide each separate expression
  48768. // within parentheses. For example, (scheduling.automaticRestart = true)
  48769. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  48770. // AND expression. However, you can include AND and OR expressions
  48771. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  48772. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  48773. // true).
  48774. func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall {
  48775. c.urlParams_.Set("filter", filter)
  48776. return c
  48777. }
  48778. // MaxResults sets the optional parameter "maxResults": The maximum
  48779. // number of results per page that should be returned. If the number of
  48780. // available results is larger than maxResults, Compute Engine returns a
  48781. // nextPageToken that can be used to get the next page of results in
  48782. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  48783. // (Default: 500)
  48784. func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall {
  48785. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  48786. return c
  48787. }
  48788. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  48789. // a certain order. By default, results are returned in alphanumerical
  48790. // order based on the resource name.
  48791. //
  48792. // You can also sort results in descending order based on the creation
  48793. // timestamp using orderBy="creationTimestamp desc". This sorts results
  48794. // based on the creationTimestamp field in reverse chronological order
  48795. // (newest result first). Use this to sort resources like operations so
  48796. // that the newest operation is returned first.
  48797. //
  48798. // Currently, only sorting by name or creationTimestamp desc is
  48799. // supported.
  48800. func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall {
  48801. c.urlParams_.Set("orderBy", orderBy)
  48802. return c
  48803. }
  48804. // PageToken sets the optional parameter "pageToken": Specifies a page
  48805. // token to use. Set pageToken to the nextPageToken returned by a
  48806. // previous list request to get the next page of results.
  48807. func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall {
  48808. c.urlParams_.Set("pageToken", pageToken)
  48809. return c
  48810. }
  48811. // Fields allows partial responses to be retrieved. See
  48812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  48813. // for more information.
  48814. func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall {
  48815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  48816. return c
  48817. }
  48818. // Context sets the context to be used in this call's Do method. Any
  48819. // pending HTTP request will be aborted if the provided context is
  48820. // canceled.
  48821. func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall {
  48822. c.ctx_ = ctx
  48823. return c
  48824. }
  48825. // Header returns an http.Header that can be modified by the caller to
  48826. // add HTTP headers to the request.
  48827. func (c *InstanceGroupsListInstancesCall) Header() http.Header {
  48828. if c.header_ == nil {
  48829. c.header_ = make(http.Header)
  48830. }
  48831. return c.header_
  48832. }
  48833. func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  48834. reqHeaders := make(http.Header)
  48835. for k, v := range c.header_ {
  48836. reqHeaders[k] = v
  48837. }
  48838. reqHeaders.Set("User-Agent", c.s.userAgent())
  48839. var body io.Reader = nil
  48840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest)
  48841. if err != nil {
  48842. return nil, err
  48843. }
  48844. reqHeaders.Set("Content-Type", "application/json")
  48845. c.urlParams_.Set("alt", alt)
  48846. c.urlParams_.Set("prettyPrint", "false")
  48847. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances")
  48848. urls += "?" + c.urlParams_.Encode()
  48849. req, err := http.NewRequest("POST", urls, body)
  48850. if err != nil {
  48851. return nil, err
  48852. }
  48853. req.Header = reqHeaders
  48854. googleapi.Expand(req.URL, map[string]string{
  48855. "project": c.project,
  48856. "zone": c.zone,
  48857. "instanceGroup": c.instanceGroup,
  48858. })
  48859. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  48860. }
  48861. // Do executes the "compute.instanceGroups.listInstances" call.
  48862. // Exactly one of *InstanceGroupsListInstances or error will be non-nil.
  48863. // Any non-2xx status code is an error. Response headers are in either
  48864. // *InstanceGroupsListInstances.ServerResponse.Header or (if a response
  48865. // was returned at all) in error.(*googleapi.Error).Header. Use
  48866. // googleapi.IsNotModified to check whether the returned error was
  48867. // because http.StatusNotModified was returned.
  48868. func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) {
  48869. gensupport.SetOptions(c.urlParams_, opts...)
  48870. res, err := c.doRequest("json")
  48871. if res != nil && res.StatusCode == http.StatusNotModified {
  48872. if res.Body != nil {
  48873. res.Body.Close()
  48874. }
  48875. return nil, &googleapi.Error{
  48876. Code: res.StatusCode,
  48877. Header: res.Header,
  48878. }
  48879. }
  48880. if err != nil {
  48881. return nil, err
  48882. }
  48883. defer googleapi.CloseBody(res)
  48884. if err := googleapi.CheckResponse(res); err != nil {
  48885. return nil, err
  48886. }
  48887. ret := &InstanceGroupsListInstances{
  48888. ServerResponse: googleapi.ServerResponse{
  48889. Header: res.Header,
  48890. HTTPStatusCode: res.StatusCode,
  48891. },
  48892. }
  48893. target := &ret
  48894. if err := gensupport.DecodeResponse(target, res); err != nil {
  48895. return nil, err
  48896. }
  48897. return ret, nil
  48898. // {
  48899. // "description": "Lists the instances in the specified instance group.",
  48900. // "httpMethod": "POST",
  48901. // "id": "compute.instanceGroups.listInstances",
  48902. // "parameterOrder": [
  48903. // "project",
  48904. // "zone",
  48905. // "instanceGroup"
  48906. // ],
  48907. // "parameters": {
  48908. // "filter": {
  48909. // "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).",
  48910. // "location": "query",
  48911. // "type": "string"
  48912. // },
  48913. // "instanceGroup": {
  48914. // "description": "The name of the instance group from which you want to generate a list of included instances.",
  48915. // "location": "path",
  48916. // "required": true,
  48917. // "type": "string"
  48918. // },
  48919. // "maxResults": {
  48920. // "default": "500",
  48921. // "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)",
  48922. // "format": "uint32",
  48923. // "location": "query",
  48924. // "minimum": "0",
  48925. // "type": "integer"
  48926. // },
  48927. // "orderBy": {
  48928. // "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.",
  48929. // "location": "query",
  48930. // "type": "string"
  48931. // },
  48932. // "pageToken": {
  48933. // "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.",
  48934. // "location": "query",
  48935. // "type": "string"
  48936. // },
  48937. // "project": {
  48938. // "description": "Project ID for this request.",
  48939. // "location": "path",
  48940. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  48941. // "required": true,
  48942. // "type": "string"
  48943. // },
  48944. // "zone": {
  48945. // "description": "The name of the zone where the instance group is located.",
  48946. // "location": "path",
  48947. // "required": true,
  48948. // "type": "string"
  48949. // }
  48950. // },
  48951. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances",
  48952. // "request": {
  48953. // "$ref": "InstanceGroupsListInstancesRequest"
  48954. // },
  48955. // "response": {
  48956. // "$ref": "InstanceGroupsListInstances"
  48957. // },
  48958. // "scopes": [
  48959. // "https://www.googleapis.com/auth/cloud-platform",
  48960. // "https://www.googleapis.com/auth/compute",
  48961. // "https://www.googleapis.com/auth/compute.readonly"
  48962. // ]
  48963. // }
  48964. }
  48965. // Pages invokes f for each page of results.
  48966. // A non-nil error returned from f will halt the iteration.
  48967. // The provided context supersedes any context provided to the Context method.
  48968. func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error {
  48969. c.ctx_ = ctx
  48970. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  48971. for {
  48972. x, err := c.Do()
  48973. if err != nil {
  48974. return err
  48975. }
  48976. if err := f(x); err != nil {
  48977. return err
  48978. }
  48979. if x.NextPageToken == "" {
  48980. return nil
  48981. }
  48982. c.PageToken(x.NextPageToken)
  48983. }
  48984. }
  48985. // method id "compute.instanceGroups.removeInstances":
  48986. type InstanceGroupsRemoveInstancesCall struct {
  48987. s *Service
  48988. project string
  48989. zone string
  48990. instanceGroup string
  48991. instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest
  48992. urlParams_ gensupport.URLParams
  48993. ctx_ context.Context
  48994. header_ http.Header
  48995. }
  48996. // RemoveInstances: Removes one or more instances from the specified
  48997. // instance group, but does not delete those instances.
  48998. //
  48999. // If the group is part of a backend service that has enabled connection
  49000. // draining, it can take up to 60 seconds after the connection draining
  49001. // duration before the VM instance is removed or deleted.
  49002. func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall {
  49003. c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49004. c.project = project
  49005. c.zone = zone
  49006. c.instanceGroup = instanceGroup
  49007. c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest
  49008. return c
  49009. }
  49010. // RequestId sets the optional parameter "requestId": An optional
  49011. // request ID to identify requests. Specify a unique request ID so that
  49012. // if you must retry your request, the server will know to ignore the
  49013. // request if it has already been completed.
  49014. //
  49015. // For example, consider a situation where you make an initial request
  49016. // and the request times out. If you make the request again with the
  49017. // same request ID, the server can check if original operation with the
  49018. // same request ID was received, and if so, will ignore the second
  49019. // request. This prevents clients from accidentally creating duplicate
  49020. // commitments.
  49021. //
  49022. // The request ID must be a valid UUID with the exception that zero UUID
  49023. // is not supported (00000000-0000-0000-0000-000000000000).
  49024. func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall {
  49025. c.urlParams_.Set("requestId", requestId)
  49026. return c
  49027. }
  49028. // Fields allows partial responses to be retrieved. See
  49029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49030. // for more information.
  49031. func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall {
  49032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49033. return c
  49034. }
  49035. // Context sets the context to be used in this call's Do method. Any
  49036. // pending HTTP request will be aborted if the provided context is
  49037. // canceled.
  49038. func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall {
  49039. c.ctx_ = ctx
  49040. return c
  49041. }
  49042. // Header returns an http.Header that can be modified by the caller to
  49043. // add HTTP headers to the request.
  49044. func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header {
  49045. if c.header_ == nil {
  49046. c.header_ = make(http.Header)
  49047. }
  49048. return c.header_
  49049. }
  49050. func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) {
  49051. reqHeaders := make(http.Header)
  49052. for k, v := range c.header_ {
  49053. reqHeaders[k] = v
  49054. }
  49055. reqHeaders.Set("User-Agent", c.s.userAgent())
  49056. var body io.Reader = nil
  49057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest)
  49058. if err != nil {
  49059. return nil, err
  49060. }
  49061. reqHeaders.Set("Content-Type", "application/json")
  49062. c.urlParams_.Set("alt", alt)
  49063. c.urlParams_.Set("prettyPrint", "false")
  49064. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances")
  49065. urls += "?" + c.urlParams_.Encode()
  49066. req, err := http.NewRequest("POST", urls, body)
  49067. if err != nil {
  49068. return nil, err
  49069. }
  49070. req.Header = reqHeaders
  49071. googleapi.Expand(req.URL, map[string]string{
  49072. "project": c.project,
  49073. "zone": c.zone,
  49074. "instanceGroup": c.instanceGroup,
  49075. })
  49076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49077. }
  49078. // Do executes the "compute.instanceGroups.removeInstances" call.
  49079. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49080. // status code is an error. Response headers are in either
  49081. // *Operation.ServerResponse.Header or (if a response was returned at
  49082. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49083. // to check whether the returned error was because
  49084. // http.StatusNotModified was returned.
  49085. func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49086. gensupport.SetOptions(c.urlParams_, opts...)
  49087. res, err := c.doRequest("json")
  49088. if res != nil && res.StatusCode == http.StatusNotModified {
  49089. if res.Body != nil {
  49090. res.Body.Close()
  49091. }
  49092. return nil, &googleapi.Error{
  49093. Code: res.StatusCode,
  49094. Header: res.Header,
  49095. }
  49096. }
  49097. if err != nil {
  49098. return nil, err
  49099. }
  49100. defer googleapi.CloseBody(res)
  49101. if err := googleapi.CheckResponse(res); err != nil {
  49102. return nil, err
  49103. }
  49104. ret := &Operation{
  49105. ServerResponse: googleapi.ServerResponse{
  49106. Header: res.Header,
  49107. HTTPStatusCode: res.StatusCode,
  49108. },
  49109. }
  49110. target := &ret
  49111. if err := gensupport.DecodeResponse(target, res); err != nil {
  49112. return nil, err
  49113. }
  49114. return ret, nil
  49115. // {
  49116. // "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.",
  49117. // "httpMethod": "POST",
  49118. // "id": "compute.instanceGroups.removeInstances",
  49119. // "parameterOrder": [
  49120. // "project",
  49121. // "zone",
  49122. // "instanceGroup"
  49123. // ],
  49124. // "parameters": {
  49125. // "instanceGroup": {
  49126. // "description": "The name of the instance group where the specified instances will be removed.",
  49127. // "location": "path",
  49128. // "required": true,
  49129. // "type": "string"
  49130. // },
  49131. // "project": {
  49132. // "description": "Project ID for this request.",
  49133. // "location": "path",
  49134. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49135. // "required": true,
  49136. // "type": "string"
  49137. // },
  49138. // "requestId": {
  49139. // "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).",
  49140. // "location": "query",
  49141. // "type": "string"
  49142. // },
  49143. // "zone": {
  49144. // "description": "The name of the zone where the instance group is located.",
  49145. // "location": "path",
  49146. // "required": true,
  49147. // "type": "string"
  49148. // }
  49149. // },
  49150. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances",
  49151. // "request": {
  49152. // "$ref": "InstanceGroupsRemoveInstancesRequest"
  49153. // },
  49154. // "response": {
  49155. // "$ref": "Operation"
  49156. // },
  49157. // "scopes": [
  49158. // "https://www.googleapis.com/auth/cloud-platform",
  49159. // "https://www.googleapis.com/auth/compute"
  49160. // ]
  49161. // }
  49162. }
  49163. // method id "compute.instanceGroups.setNamedPorts":
  49164. type InstanceGroupsSetNamedPortsCall struct {
  49165. s *Service
  49166. project string
  49167. zone string
  49168. instanceGroup string
  49169. instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest
  49170. urlParams_ gensupport.URLParams
  49171. ctx_ context.Context
  49172. header_ http.Header
  49173. }
  49174. // SetNamedPorts: Sets the named ports for the specified instance group.
  49175. func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall {
  49176. c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49177. c.project = project
  49178. c.zone = zone
  49179. c.instanceGroup = instanceGroup
  49180. c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest
  49181. return c
  49182. }
  49183. // RequestId sets the optional parameter "requestId": An optional
  49184. // request ID to identify requests. Specify a unique request ID so that
  49185. // if you must retry your request, the server will know to ignore the
  49186. // request if it has already been completed.
  49187. //
  49188. // For example, consider a situation where you make an initial request
  49189. // and the request times out. If you make the request again with the
  49190. // same request ID, the server can check if original operation with the
  49191. // same request ID was received, and if so, will ignore the second
  49192. // request. This prevents clients from accidentally creating duplicate
  49193. // commitments.
  49194. //
  49195. // The request ID must be a valid UUID with the exception that zero UUID
  49196. // is not supported (00000000-0000-0000-0000-000000000000).
  49197. func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall {
  49198. c.urlParams_.Set("requestId", requestId)
  49199. return c
  49200. }
  49201. // Fields allows partial responses to be retrieved. See
  49202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49203. // for more information.
  49204. func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall {
  49205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49206. return c
  49207. }
  49208. // Context sets the context to be used in this call's Do method. Any
  49209. // pending HTTP request will be aborted if the provided context is
  49210. // canceled.
  49211. func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall {
  49212. c.ctx_ = ctx
  49213. return c
  49214. }
  49215. // Header returns an http.Header that can be modified by the caller to
  49216. // add HTTP headers to the request.
  49217. func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header {
  49218. if c.header_ == nil {
  49219. c.header_ = make(http.Header)
  49220. }
  49221. return c.header_
  49222. }
  49223. func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  49224. reqHeaders := make(http.Header)
  49225. for k, v := range c.header_ {
  49226. reqHeaders[k] = v
  49227. }
  49228. reqHeaders.Set("User-Agent", c.s.userAgent())
  49229. var body io.Reader = nil
  49230. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest)
  49231. if err != nil {
  49232. return nil, err
  49233. }
  49234. reqHeaders.Set("Content-Type", "application/json")
  49235. c.urlParams_.Set("alt", alt)
  49236. c.urlParams_.Set("prettyPrint", "false")
  49237. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts")
  49238. urls += "?" + c.urlParams_.Encode()
  49239. req, err := http.NewRequest("POST", urls, body)
  49240. if err != nil {
  49241. return nil, err
  49242. }
  49243. req.Header = reqHeaders
  49244. googleapi.Expand(req.URL, map[string]string{
  49245. "project": c.project,
  49246. "zone": c.zone,
  49247. "instanceGroup": c.instanceGroup,
  49248. })
  49249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49250. }
  49251. // Do executes the "compute.instanceGroups.setNamedPorts" call.
  49252. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49253. // status code is an error. Response headers are in either
  49254. // *Operation.ServerResponse.Header or (if a response was returned at
  49255. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49256. // to check whether the returned error was because
  49257. // http.StatusNotModified was returned.
  49258. func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49259. gensupport.SetOptions(c.urlParams_, opts...)
  49260. res, err := c.doRequest("json")
  49261. if res != nil && res.StatusCode == http.StatusNotModified {
  49262. if res.Body != nil {
  49263. res.Body.Close()
  49264. }
  49265. return nil, &googleapi.Error{
  49266. Code: res.StatusCode,
  49267. Header: res.Header,
  49268. }
  49269. }
  49270. if err != nil {
  49271. return nil, err
  49272. }
  49273. defer googleapi.CloseBody(res)
  49274. if err := googleapi.CheckResponse(res); err != nil {
  49275. return nil, err
  49276. }
  49277. ret := &Operation{
  49278. ServerResponse: googleapi.ServerResponse{
  49279. Header: res.Header,
  49280. HTTPStatusCode: res.StatusCode,
  49281. },
  49282. }
  49283. target := &ret
  49284. if err := gensupport.DecodeResponse(target, res); err != nil {
  49285. return nil, err
  49286. }
  49287. return ret, nil
  49288. // {
  49289. // "description": "Sets the named ports for the specified instance group.",
  49290. // "httpMethod": "POST",
  49291. // "id": "compute.instanceGroups.setNamedPorts",
  49292. // "parameterOrder": [
  49293. // "project",
  49294. // "zone",
  49295. // "instanceGroup"
  49296. // ],
  49297. // "parameters": {
  49298. // "instanceGroup": {
  49299. // "description": "The name of the instance group where the named ports are updated.",
  49300. // "location": "path",
  49301. // "required": true,
  49302. // "type": "string"
  49303. // },
  49304. // "project": {
  49305. // "description": "Project ID for this request.",
  49306. // "location": "path",
  49307. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49308. // "required": true,
  49309. // "type": "string"
  49310. // },
  49311. // "requestId": {
  49312. // "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).",
  49313. // "location": "query",
  49314. // "type": "string"
  49315. // },
  49316. // "zone": {
  49317. // "description": "The name of the zone where the instance group is located.",
  49318. // "location": "path",
  49319. // "required": true,
  49320. // "type": "string"
  49321. // }
  49322. // },
  49323. // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts",
  49324. // "request": {
  49325. // "$ref": "InstanceGroupsSetNamedPortsRequest"
  49326. // },
  49327. // "response": {
  49328. // "$ref": "Operation"
  49329. // },
  49330. // "scopes": [
  49331. // "https://www.googleapis.com/auth/cloud-platform",
  49332. // "https://www.googleapis.com/auth/compute"
  49333. // ]
  49334. // }
  49335. }
  49336. // method id "compute.instanceTemplates.delete":
  49337. type InstanceTemplatesDeleteCall struct {
  49338. s *Service
  49339. project string
  49340. instanceTemplate string
  49341. urlParams_ gensupport.URLParams
  49342. ctx_ context.Context
  49343. header_ http.Header
  49344. }
  49345. // Delete: Deletes the specified instance template. Deleting an instance
  49346. // template is permanent and cannot be undone. It is not possible to
  49347. // delete templates that are already in use by a managed instance group.
  49348. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete
  49349. func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall {
  49350. c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49351. c.project = project
  49352. c.instanceTemplate = instanceTemplate
  49353. return c
  49354. }
  49355. // RequestId sets the optional parameter "requestId": An optional
  49356. // request ID to identify requests. Specify a unique request ID so that
  49357. // if you must retry your request, the server will know to ignore the
  49358. // request if it has already been completed.
  49359. //
  49360. // For example, consider a situation where you make an initial request
  49361. // and the request times out. If you make the request again with the
  49362. // same request ID, the server can check if original operation with the
  49363. // same request ID was received, and if so, will ignore the second
  49364. // request. This prevents clients from accidentally creating duplicate
  49365. // commitments.
  49366. //
  49367. // The request ID must be a valid UUID with the exception that zero UUID
  49368. // is not supported (00000000-0000-0000-0000-000000000000).
  49369. func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall {
  49370. c.urlParams_.Set("requestId", requestId)
  49371. return c
  49372. }
  49373. // Fields allows partial responses to be retrieved. See
  49374. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49375. // for more information.
  49376. func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall {
  49377. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49378. return c
  49379. }
  49380. // Context sets the context to be used in this call's Do method. Any
  49381. // pending HTTP request will be aborted if the provided context is
  49382. // canceled.
  49383. func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall {
  49384. c.ctx_ = ctx
  49385. return c
  49386. }
  49387. // Header returns an http.Header that can be modified by the caller to
  49388. // add HTTP headers to the request.
  49389. func (c *InstanceTemplatesDeleteCall) Header() http.Header {
  49390. if c.header_ == nil {
  49391. c.header_ = make(http.Header)
  49392. }
  49393. return c.header_
  49394. }
  49395. func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  49396. reqHeaders := make(http.Header)
  49397. for k, v := range c.header_ {
  49398. reqHeaders[k] = v
  49399. }
  49400. reqHeaders.Set("User-Agent", c.s.userAgent())
  49401. var body io.Reader = nil
  49402. c.urlParams_.Set("alt", alt)
  49403. c.urlParams_.Set("prettyPrint", "false")
  49404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  49405. urls += "?" + c.urlParams_.Encode()
  49406. req, err := http.NewRequest("DELETE", urls, body)
  49407. if err != nil {
  49408. return nil, err
  49409. }
  49410. req.Header = reqHeaders
  49411. googleapi.Expand(req.URL, map[string]string{
  49412. "project": c.project,
  49413. "instanceTemplate": c.instanceTemplate,
  49414. })
  49415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49416. }
  49417. // Do executes the "compute.instanceTemplates.delete" call.
  49418. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49419. // status code is an error. Response headers are in either
  49420. // *Operation.ServerResponse.Header or (if a response was returned at
  49421. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49422. // to check whether the returned error was because
  49423. // http.StatusNotModified was returned.
  49424. func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49425. gensupport.SetOptions(c.urlParams_, opts...)
  49426. res, err := c.doRequest("json")
  49427. if res != nil && res.StatusCode == http.StatusNotModified {
  49428. if res.Body != nil {
  49429. res.Body.Close()
  49430. }
  49431. return nil, &googleapi.Error{
  49432. Code: res.StatusCode,
  49433. Header: res.Header,
  49434. }
  49435. }
  49436. if err != nil {
  49437. return nil, err
  49438. }
  49439. defer googleapi.CloseBody(res)
  49440. if err := googleapi.CheckResponse(res); err != nil {
  49441. return nil, err
  49442. }
  49443. ret := &Operation{
  49444. ServerResponse: googleapi.ServerResponse{
  49445. Header: res.Header,
  49446. HTTPStatusCode: res.StatusCode,
  49447. },
  49448. }
  49449. target := &ret
  49450. if err := gensupport.DecodeResponse(target, res); err != nil {
  49451. return nil, err
  49452. }
  49453. return ret, nil
  49454. // {
  49455. // "description": "Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group.",
  49456. // "httpMethod": "DELETE",
  49457. // "id": "compute.instanceTemplates.delete",
  49458. // "parameterOrder": [
  49459. // "project",
  49460. // "instanceTemplate"
  49461. // ],
  49462. // "parameters": {
  49463. // "instanceTemplate": {
  49464. // "description": "The name of the instance template to delete.",
  49465. // "location": "path",
  49466. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49467. // "required": true,
  49468. // "type": "string"
  49469. // },
  49470. // "project": {
  49471. // "description": "Project ID for this request.",
  49472. // "location": "path",
  49473. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49474. // "required": true,
  49475. // "type": "string"
  49476. // },
  49477. // "requestId": {
  49478. // "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).",
  49479. // "location": "query",
  49480. // "type": "string"
  49481. // }
  49482. // },
  49483. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  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.instanceTemplates.get":
  49494. type InstanceTemplatesGetCall struct {
  49495. s *Service
  49496. project string
  49497. instanceTemplate string
  49498. urlParams_ gensupport.URLParams
  49499. ifNoneMatch_ string
  49500. ctx_ context.Context
  49501. header_ http.Header
  49502. }
  49503. // Get: Returns the specified instance template. Gets a list of
  49504. // available instance templates by making a list() request.
  49505. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get
  49506. func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall {
  49507. c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49508. c.project = project
  49509. c.instanceTemplate = instanceTemplate
  49510. return c
  49511. }
  49512. // Fields allows partial responses to be retrieved. See
  49513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49514. // for more information.
  49515. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall {
  49516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49517. return c
  49518. }
  49519. // IfNoneMatch sets the optional parameter which makes the operation
  49520. // fail if the object's ETag matches the given value. This is useful for
  49521. // getting updates only after the object has changed since the last
  49522. // request. Use googleapi.IsNotModified to check whether the response
  49523. // error from Do is the result of In-None-Match.
  49524. func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall {
  49525. c.ifNoneMatch_ = entityTag
  49526. return c
  49527. }
  49528. // Context sets the context to be used in this call's Do method. Any
  49529. // pending HTTP request will be aborted if the provided context is
  49530. // canceled.
  49531. func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall {
  49532. c.ctx_ = ctx
  49533. return c
  49534. }
  49535. // Header returns an http.Header that can be modified by the caller to
  49536. // add HTTP headers to the request.
  49537. func (c *InstanceTemplatesGetCall) Header() http.Header {
  49538. if c.header_ == nil {
  49539. c.header_ = make(http.Header)
  49540. }
  49541. return c.header_
  49542. }
  49543. func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  49544. reqHeaders := make(http.Header)
  49545. for k, v := range c.header_ {
  49546. reqHeaders[k] = v
  49547. }
  49548. reqHeaders.Set("User-Agent", c.s.userAgent())
  49549. if c.ifNoneMatch_ != "" {
  49550. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49551. }
  49552. var body io.Reader = nil
  49553. c.urlParams_.Set("alt", alt)
  49554. c.urlParams_.Set("prettyPrint", "false")
  49555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}")
  49556. urls += "?" + c.urlParams_.Encode()
  49557. req, err := http.NewRequest("GET", urls, body)
  49558. if err != nil {
  49559. return nil, err
  49560. }
  49561. req.Header = reqHeaders
  49562. googleapi.Expand(req.URL, map[string]string{
  49563. "project": c.project,
  49564. "instanceTemplate": c.instanceTemplate,
  49565. })
  49566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49567. }
  49568. // Do executes the "compute.instanceTemplates.get" call.
  49569. // Exactly one of *InstanceTemplate or error will be non-nil. Any
  49570. // non-2xx status code is an error. Response headers are in either
  49571. // *InstanceTemplate.ServerResponse.Header or (if a response was
  49572. // returned at all) in error.(*googleapi.Error).Header. Use
  49573. // googleapi.IsNotModified to check whether the returned error was
  49574. // because http.StatusNotModified was returned.
  49575. func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) {
  49576. gensupport.SetOptions(c.urlParams_, opts...)
  49577. res, err := c.doRequest("json")
  49578. if res != nil && res.StatusCode == http.StatusNotModified {
  49579. if res.Body != nil {
  49580. res.Body.Close()
  49581. }
  49582. return nil, &googleapi.Error{
  49583. Code: res.StatusCode,
  49584. Header: res.Header,
  49585. }
  49586. }
  49587. if err != nil {
  49588. return nil, err
  49589. }
  49590. defer googleapi.CloseBody(res)
  49591. if err := googleapi.CheckResponse(res); err != nil {
  49592. return nil, err
  49593. }
  49594. ret := &InstanceTemplate{
  49595. ServerResponse: googleapi.ServerResponse{
  49596. Header: res.Header,
  49597. HTTPStatusCode: res.StatusCode,
  49598. },
  49599. }
  49600. target := &ret
  49601. if err := gensupport.DecodeResponse(target, res); err != nil {
  49602. return nil, err
  49603. }
  49604. return ret, nil
  49605. // {
  49606. // "description": "Returns the specified instance template. Gets a list of available instance templates by making a list() request.",
  49607. // "httpMethod": "GET",
  49608. // "id": "compute.instanceTemplates.get",
  49609. // "parameterOrder": [
  49610. // "project",
  49611. // "instanceTemplate"
  49612. // ],
  49613. // "parameters": {
  49614. // "instanceTemplate": {
  49615. // "description": "The name of the instance template.",
  49616. // "location": "path",
  49617. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49618. // "required": true,
  49619. // "type": "string"
  49620. // },
  49621. // "project": {
  49622. // "description": "Project ID for this request.",
  49623. // "location": "path",
  49624. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49625. // "required": true,
  49626. // "type": "string"
  49627. // }
  49628. // },
  49629. // "path": "{project}/global/instanceTemplates/{instanceTemplate}",
  49630. // "response": {
  49631. // "$ref": "InstanceTemplate"
  49632. // },
  49633. // "scopes": [
  49634. // "https://www.googleapis.com/auth/cloud-platform",
  49635. // "https://www.googleapis.com/auth/compute",
  49636. // "https://www.googleapis.com/auth/compute.readonly"
  49637. // ]
  49638. // }
  49639. }
  49640. // method id "compute.instanceTemplates.getIamPolicy":
  49641. type InstanceTemplatesGetIamPolicyCall struct {
  49642. s *Service
  49643. project string
  49644. resource string
  49645. urlParams_ gensupport.URLParams
  49646. ifNoneMatch_ string
  49647. ctx_ context.Context
  49648. header_ http.Header
  49649. }
  49650. // GetIamPolicy: Gets the access control policy for a resource. May be
  49651. // empty if no such policy or resource exists.
  49652. func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall {
  49653. c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49654. c.project = project
  49655. c.resource = resource
  49656. return c
  49657. }
  49658. // Fields allows partial responses to be retrieved. See
  49659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49660. // for more information.
  49661. func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall {
  49662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49663. return c
  49664. }
  49665. // IfNoneMatch sets the optional parameter which makes the operation
  49666. // fail if the object's ETag matches the given value. This is useful for
  49667. // getting updates only after the object has changed since the last
  49668. // request. Use googleapi.IsNotModified to check whether the response
  49669. // error from Do is the result of In-None-Match.
  49670. func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall {
  49671. c.ifNoneMatch_ = entityTag
  49672. return c
  49673. }
  49674. // Context sets the context to be used in this call's Do method. Any
  49675. // pending HTTP request will be aborted if the provided context is
  49676. // canceled.
  49677. func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall {
  49678. c.ctx_ = ctx
  49679. return c
  49680. }
  49681. // Header returns an http.Header that can be modified by the caller to
  49682. // add HTTP headers to the request.
  49683. func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header {
  49684. if c.header_ == nil {
  49685. c.header_ = make(http.Header)
  49686. }
  49687. return c.header_
  49688. }
  49689. func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  49690. reqHeaders := make(http.Header)
  49691. for k, v := range c.header_ {
  49692. reqHeaders[k] = v
  49693. }
  49694. reqHeaders.Set("User-Agent", c.s.userAgent())
  49695. if c.ifNoneMatch_ != "" {
  49696. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  49697. }
  49698. var body io.Reader = nil
  49699. c.urlParams_.Set("alt", alt)
  49700. c.urlParams_.Set("prettyPrint", "false")
  49701. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/getIamPolicy")
  49702. urls += "?" + c.urlParams_.Encode()
  49703. req, err := http.NewRequest("GET", urls, body)
  49704. if err != nil {
  49705. return nil, err
  49706. }
  49707. req.Header = reqHeaders
  49708. googleapi.Expand(req.URL, map[string]string{
  49709. "project": c.project,
  49710. "resource": c.resource,
  49711. })
  49712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49713. }
  49714. // Do executes the "compute.instanceTemplates.getIamPolicy" call.
  49715. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  49716. // code is an error. Response headers are in either
  49717. // *Policy.ServerResponse.Header or (if a response was returned at all)
  49718. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  49719. // check whether the returned error was because http.StatusNotModified
  49720. // was returned.
  49721. func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  49722. gensupport.SetOptions(c.urlParams_, opts...)
  49723. res, err := c.doRequest("json")
  49724. if res != nil && res.StatusCode == http.StatusNotModified {
  49725. if res.Body != nil {
  49726. res.Body.Close()
  49727. }
  49728. return nil, &googleapi.Error{
  49729. Code: res.StatusCode,
  49730. Header: res.Header,
  49731. }
  49732. }
  49733. if err != nil {
  49734. return nil, err
  49735. }
  49736. defer googleapi.CloseBody(res)
  49737. if err := googleapi.CheckResponse(res); err != nil {
  49738. return nil, err
  49739. }
  49740. ret := &Policy{
  49741. ServerResponse: googleapi.ServerResponse{
  49742. Header: res.Header,
  49743. HTTPStatusCode: res.StatusCode,
  49744. },
  49745. }
  49746. target := &ret
  49747. if err := gensupport.DecodeResponse(target, res); err != nil {
  49748. return nil, err
  49749. }
  49750. return ret, nil
  49751. // {
  49752. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  49753. // "httpMethod": "GET",
  49754. // "id": "compute.instanceTemplates.getIamPolicy",
  49755. // "parameterOrder": [
  49756. // "project",
  49757. // "resource"
  49758. // ],
  49759. // "parameters": {
  49760. // "project": {
  49761. // "description": "Project ID for this request.",
  49762. // "location": "path",
  49763. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49764. // "required": true,
  49765. // "type": "string"
  49766. // },
  49767. // "resource": {
  49768. // "description": "Name or id of the resource for this request.",
  49769. // "location": "path",
  49770. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  49771. // "required": true,
  49772. // "type": "string"
  49773. // }
  49774. // },
  49775. // "path": "{project}/global/instanceTemplates/{resource}/getIamPolicy",
  49776. // "response": {
  49777. // "$ref": "Policy"
  49778. // },
  49779. // "scopes": [
  49780. // "https://www.googleapis.com/auth/cloud-platform",
  49781. // "https://www.googleapis.com/auth/compute",
  49782. // "https://www.googleapis.com/auth/compute.readonly"
  49783. // ]
  49784. // }
  49785. }
  49786. // method id "compute.instanceTemplates.insert":
  49787. type InstanceTemplatesInsertCall struct {
  49788. s *Service
  49789. project string
  49790. instancetemplate *InstanceTemplate
  49791. urlParams_ gensupport.URLParams
  49792. ctx_ context.Context
  49793. header_ http.Header
  49794. }
  49795. // Insert: Creates an instance template in the specified project using
  49796. // the data that is included in the request. If you are creating a new
  49797. // template to update an existing instance group, your new instance
  49798. // template must use the same network or, if applicable, the same
  49799. // subnetwork as the original template.
  49800. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert
  49801. func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall {
  49802. c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49803. c.project = project
  49804. c.instancetemplate = instancetemplate
  49805. return c
  49806. }
  49807. // RequestId sets the optional parameter "requestId": An optional
  49808. // request ID to identify requests. Specify a unique request ID so that
  49809. // if you must retry your request, the server will know to ignore the
  49810. // request if it has already been completed.
  49811. //
  49812. // For example, consider a situation where you make an initial request
  49813. // and the request times out. If you make the request again with the
  49814. // same request ID, the server can check if original operation with the
  49815. // same request ID was received, and if so, will ignore the second
  49816. // request. This prevents clients from accidentally creating duplicate
  49817. // commitments.
  49818. //
  49819. // The request ID must be a valid UUID with the exception that zero UUID
  49820. // is not supported (00000000-0000-0000-0000-000000000000).
  49821. func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall {
  49822. c.urlParams_.Set("requestId", requestId)
  49823. return c
  49824. }
  49825. // Fields allows partial responses to be retrieved. See
  49826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  49827. // for more information.
  49828. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall {
  49829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  49830. return c
  49831. }
  49832. // Context sets the context to be used in this call's Do method. Any
  49833. // pending HTTP request will be aborted if the provided context is
  49834. // canceled.
  49835. func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall {
  49836. c.ctx_ = ctx
  49837. return c
  49838. }
  49839. // Header returns an http.Header that can be modified by the caller to
  49840. // add HTTP headers to the request.
  49841. func (c *InstanceTemplatesInsertCall) Header() http.Header {
  49842. if c.header_ == nil {
  49843. c.header_ = make(http.Header)
  49844. }
  49845. return c.header_
  49846. }
  49847. func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  49848. reqHeaders := make(http.Header)
  49849. for k, v := range c.header_ {
  49850. reqHeaders[k] = v
  49851. }
  49852. reqHeaders.Set("User-Agent", c.s.userAgent())
  49853. var body io.Reader = nil
  49854. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate)
  49855. if err != nil {
  49856. return nil, err
  49857. }
  49858. reqHeaders.Set("Content-Type", "application/json")
  49859. c.urlParams_.Set("alt", alt)
  49860. c.urlParams_.Set("prettyPrint", "false")
  49861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  49862. urls += "?" + c.urlParams_.Encode()
  49863. req, err := http.NewRequest("POST", urls, body)
  49864. if err != nil {
  49865. return nil, err
  49866. }
  49867. req.Header = reqHeaders
  49868. googleapi.Expand(req.URL, map[string]string{
  49869. "project": c.project,
  49870. })
  49871. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  49872. }
  49873. // Do executes the "compute.instanceTemplates.insert" call.
  49874. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  49875. // status code is an error. Response headers are in either
  49876. // *Operation.ServerResponse.Header or (if a response was returned at
  49877. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  49878. // to check whether the returned error was because
  49879. // http.StatusNotModified was returned.
  49880. func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  49881. gensupport.SetOptions(c.urlParams_, opts...)
  49882. res, err := c.doRequest("json")
  49883. if res != nil && res.StatusCode == http.StatusNotModified {
  49884. if res.Body != nil {
  49885. res.Body.Close()
  49886. }
  49887. return nil, &googleapi.Error{
  49888. Code: res.StatusCode,
  49889. Header: res.Header,
  49890. }
  49891. }
  49892. if err != nil {
  49893. return nil, err
  49894. }
  49895. defer googleapi.CloseBody(res)
  49896. if err := googleapi.CheckResponse(res); err != nil {
  49897. return nil, err
  49898. }
  49899. ret := &Operation{
  49900. ServerResponse: googleapi.ServerResponse{
  49901. Header: res.Header,
  49902. HTTPStatusCode: res.StatusCode,
  49903. },
  49904. }
  49905. target := &ret
  49906. if err := gensupport.DecodeResponse(target, res); err != nil {
  49907. return nil, err
  49908. }
  49909. return ret, nil
  49910. // {
  49911. // "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.",
  49912. // "httpMethod": "POST",
  49913. // "id": "compute.instanceTemplates.insert",
  49914. // "parameterOrder": [
  49915. // "project"
  49916. // ],
  49917. // "parameters": {
  49918. // "project": {
  49919. // "description": "Project ID for this request.",
  49920. // "location": "path",
  49921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  49922. // "required": true,
  49923. // "type": "string"
  49924. // },
  49925. // "requestId": {
  49926. // "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).",
  49927. // "location": "query",
  49928. // "type": "string"
  49929. // }
  49930. // },
  49931. // "path": "{project}/global/instanceTemplates",
  49932. // "request": {
  49933. // "$ref": "InstanceTemplate"
  49934. // },
  49935. // "response": {
  49936. // "$ref": "Operation"
  49937. // },
  49938. // "scopes": [
  49939. // "https://www.googleapis.com/auth/cloud-platform",
  49940. // "https://www.googleapis.com/auth/compute"
  49941. // ]
  49942. // }
  49943. }
  49944. // method id "compute.instanceTemplates.list":
  49945. type InstanceTemplatesListCall struct {
  49946. s *Service
  49947. project string
  49948. urlParams_ gensupport.URLParams
  49949. ifNoneMatch_ string
  49950. ctx_ context.Context
  49951. header_ http.Header
  49952. }
  49953. // List: Retrieves a list of instance templates that are contained
  49954. // within the specified project.
  49955. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list
  49956. func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall {
  49957. c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  49958. c.project = project
  49959. return c
  49960. }
  49961. // Filter sets the optional parameter "filter": A filter expression that
  49962. // filters resources listed in the response. The expression must specify
  49963. // the field name, a comparison operator, and the value that you want to
  49964. // use for filtering. The value must be a string, a number, or a
  49965. // boolean. The comparison operator must be either =, !=, >, or <.
  49966. //
  49967. // For example, if you are filtering Compute Engine instances, you can
  49968. // exclude instances named example-instance by specifying name !=
  49969. // example-instance.
  49970. //
  49971. // You can also filter nested fields. For example, you could specify
  49972. // scheduling.automaticRestart = false to include instances only if they
  49973. // are not scheduled for automatic restarts. You can use filtering on
  49974. // nested fields to filter based on resource labels.
  49975. //
  49976. // To filter on multiple expressions, provide each separate expression
  49977. // within parentheses. For example, (scheduling.automaticRestart = true)
  49978. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  49979. // AND expression. However, you can include AND and OR expressions
  49980. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  49981. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  49982. // true).
  49983. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall {
  49984. c.urlParams_.Set("filter", filter)
  49985. return c
  49986. }
  49987. // MaxResults sets the optional parameter "maxResults": The maximum
  49988. // number of results per page that should be returned. If the number of
  49989. // available results is larger than maxResults, Compute Engine returns a
  49990. // nextPageToken that can be used to get the next page of results in
  49991. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  49992. // (Default: 500)
  49993. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall {
  49994. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  49995. return c
  49996. }
  49997. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  49998. // a certain order. By default, results are returned in alphanumerical
  49999. // order based on the resource name.
  50000. //
  50001. // You can also sort results in descending order based on the creation
  50002. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50003. // based on the creationTimestamp field in reverse chronological order
  50004. // (newest result first). Use this to sort resources like operations so
  50005. // that the newest operation is returned first.
  50006. //
  50007. // Currently, only sorting by name or creationTimestamp desc is
  50008. // supported.
  50009. func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall {
  50010. c.urlParams_.Set("orderBy", orderBy)
  50011. return c
  50012. }
  50013. // PageToken sets the optional parameter "pageToken": Specifies a page
  50014. // token to use. Set pageToken to the nextPageToken returned by a
  50015. // previous list request to get the next page of results.
  50016. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall {
  50017. c.urlParams_.Set("pageToken", pageToken)
  50018. return c
  50019. }
  50020. // Fields allows partial responses to be retrieved. See
  50021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50022. // for more information.
  50023. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall {
  50024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50025. return c
  50026. }
  50027. // IfNoneMatch sets the optional parameter which makes the operation
  50028. // fail if the object's ETag matches the given value. This is useful for
  50029. // getting updates only after the object has changed since the last
  50030. // request. Use googleapi.IsNotModified to check whether the response
  50031. // error from Do is the result of In-None-Match.
  50032. func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall {
  50033. c.ifNoneMatch_ = entityTag
  50034. return c
  50035. }
  50036. // Context sets the context to be used in this call's Do method. Any
  50037. // pending HTTP request will be aborted if the provided context is
  50038. // canceled.
  50039. func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall {
  50040. c.ctx_ = ctx
  50041. return c
  50042. }
  50043. // Header returns an http.Header that can be modified by the caller to
  50044. // add HTTP headers to the request.
  50045. func (c *InstanceTemplatesListCall) Header() http.Header {
  50046. if c.header_ == nil {
  50047. c.header_ = make(http.Header)
  50048. }
  50049. return c.header_
  50050. }
  50051. func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  50052. reqHeaders := make(http.Header)
  50053. for k, v := range c.header_ {
  50054. reqHeaders[k] = v
  50055. }
  50056. reqHeaders.Set("User-Agent", c.s.userAgent())
  50057. if c.ifNoneMatch_ != "" {
  50058. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50059. }
  50060. var body io.Reader = nil
  50061. c.urlParams_.Set("alt", alt)
  50062. c.urlParams_.Set("prettyPrint", "false")
  50063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates")
  50064. urls += "?" + c.urlParams_.Encode()
  50065. req, err := http.NewRequest("GET", urls, body)
  50066. if err != nil {
  50067. return nil, err
  50068. }
  50069. req.Header = reqHeaders
  50070. googleapi.Expand(req.URL, map[string]string{
  50071. "project": c.project,
  50072. })
  50073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50074. }
  50075. // Do executes the "compute.instanceTemplates.list" call.
  50076. // Exactly one of *InstanceTemplateList or error will be non-nil. Any
  50077. // non-2xx status code is an error. Response headers are in either
  50078. // *InstanceTemplateList.ServerResponse.Header or (if a response was
  50079. // returned at all) in error.(*googleapi.Error).Header. Use
  50080. // googleapi.IsNotModified to check whether the returned error was
  50081. // because http.StatusNotModified was returned.
  50082. func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) {
  50083. gensupport.SetOptions(c.urlParams_, opts...)
  50084. res, err := c.doRequest("json")
  50085. if res != nil && res.StatusCode == http.StatusNotModified {
  50086. if res.Body != nil {
  50087. res.Body.Close()
  50088. }
  50089. return nil, &googleapi.Error{
  50090. Code: res.StatusCode,
  50091. Header: res.Header,
  50092. }
  50093. }
  50094. if err != nil {
  50095. return nil, err
  50096. }
  50097. defer googleapi.CloseBody(res)
  50098. if err := googleapi.CheckResponse(res); err != nil {
  50099. return nil, err
  50100. }
  50101. ret := &InstanceTemplateList{
  50102. ServerResponse: googleapi.ServerResponse{
  50103. Header: res.Header,
  50104. HTTPStatusCode: res.StatusCode,
  50105. },
  50106. }
  50107. target := &ret
  50108. if err := gensupport.DecodeResponse(target, res); err != nil {
  50109. return nil, err
  50110. }
  50111. return ret, nil
  50112. // {
  50113. // "description": "Retrieves a list of instance templates that are contained within the specified project.",
  50114. // "httpMethod": "GET",
  50115. // "id": "compute.instanceTemplates.list",
  50116. // "parameterOrder": [
  50117. // "project"
  50118. // ],
  50119. // "parameters": {
  50120. // "filter": {
  50121. // "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).",
  50122. // "location": "query",
  50123. // "type": "string"
  50124. // },
  50125. // "maxResults": {
  50126. // "default": "500",
  50127. // "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)",
  50128. // "format": "uint32",
  50129. // "location": "query",
  50130. // "minimum": "0",
  50131. // "type": "integer"
  50132. // },
  50133. // "orderBy": {
  50134. // "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.",
  50135. // "location": "query",
  50136. // "type": "string"
  50137. // },
  50138. // "pageToken": {
  50139. // "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.",
  50140. // "location": "query",
  50141. // "type": "string"
  50142. // },
  50143. // "project": {
  50144. // "description": "Project ID for this request.",
  50145. // "location": "path",
  50146. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50147. // "required": true,
  50148. // "type": "string"
  50149. // }
  50150. // },
  50151. // "path": "{project}/global/instanceTemplates",
  50152. // "response": {
  50153. // "$ref": "InstanceTemplateList"
  50154. // },
  50155. // "scopes": [
  50156. // "https://www.googleapis.com/auth/cloud-platform",
  50157. // "https://www.googleapis.com/auth/compute",
  50158. // "https://www.googleapis.com/auth/compute.readonly"
  50159. // ]
  50160. // }
  50161. }
  50162. // Pages invokes f for each page of results.
  50163. // A non-nil error returned from f will halt the iteration.
  50164. // The provided context supersedes any context provided to the Context method.
  50165. func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error {
  50166. c.ctx_ = ctx
  50167. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50168. for {
  50169. x, err := c.Do()
  50170. if err != nil {
  50171. return err
  50172. }
  50173. if err := f(x); err != nil {
  50174. return err
  50175. }
  50176. if x.NextPageToken == "" {
  50177. return nil
  50178. }
  50179. c.PageToken(x.NextPageToken)
  50180. }
  50181. }
  50182. // method id "compute.instanceTemplates.setIamPolicy":
  50183. type InstanceTemplatesSetIamPolicyCall struct {
  50184. s *Service
  50185. project string
  50186. resource string
  50187. globalsetpolicyrequest *GlobalSetPolicyRequest
  50188. urlParams_ gensupport.URLParams
  50189. ctx_ context.Context
  50190. header_ http.Header
  50191. }
  50192. // SetIamPolicy: Sets the access control policy on the specified
  50193. // resource. Replaces any existing policy.
  50194. func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall {
  50195. c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50196. c.project = project
  50197. c.resource = resource
  50198. c.globalsetpolicyrequest = globalsetpolicyrequest
  50199. return c
  50200. }
  50201. // Fields allows partial responses to be retrieved. See
  50202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50203. // for more information.
  50204. func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall {
  50205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50206. return c
  50207. }
  50208. // Context sets the context to be used in this call's Do method. Any
  50209. // pending HTTP request will be aborted if the provided context is
  50210. // canceled.
  50211. func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall {
  50212. c.ctx_ = ctx
  50213. return c
  50214. }
  50215. // Header returns an http.Header that can be modified by the caller to
  50216. // add HTTP headers to the request.
  50217. func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header {
  50218. if c.header_ == nil {
  50219. c.header_ = make(http.Header)
  50220. }
  50221. return c.header_
  50222. }
  50223. func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  50224. reqHeaders := make(http.Header)
  50225. for k, v := range c.header_ {
  50226. reqHeaders[k] = v
  50227. }
  50228. reqHeaders.Set("User-Agent", c.s.userAgent())
  50229. var body io.Reader = nil
  50230. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  50231. if err != nil {
  50232. return nil, err
  50233. }
  50234. reqHeaders.Set("Content-Type", "application/json")
  50235. c.urlParams_.Set("alt", alt)
  50236. c.urlParams_.Set("prettyPrint", "false")
  50237. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/setIamPolicy")
  50238. urls += "?" + c.urlParams_.Encode()
  50239. req, err := http.NewRequest("POST", urls, body)
  50240. if err != nil {
  50241. return nil, err
  50242. }
  50243. req.Header = reqHeaders
  50244. googleapi.Expand(req.URL, map[string]string{
  50245. "project": c.project,
  50246. "resource": c.resource,
  50247. })
  50248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50249. }
  50250. // Do executes the "compute.instanceTemplates.setIamPolicy" call.
  50251. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  50252. // code is an error. Response headers are in either
  50253. // *Policy.ServerResponse.Header or (if a response was returned at all)
  50254. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  50255. // check whether the returned error was because http.StatusNotModified
  50256. // was returned.
  50257. func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  50258. gensupport.SetOptions(c.urlParams_, opts...)
  50259. res, err := c.doRequest("json")
  50260. if res != nil && res.StatusCode == http.StatusNotModified {
  50261. if res.Body != nil {
  50262. res.Body.Close()
  50263. }
  50264. return nil, &googleapi.Error{
  50265. Code: res.StatusCode,
  50266. Header: res.Header,
  50267. }
  50268. }
  50269. if err != nil {
  50270. return nil, err
  50271. }
  50272. defer googleapi.CloseBody(res)
  50273. if err := googleapi.CheckResponse(res); err != nil {
  50274. return nil, err
  50275. }
  50276. ret := &Policy{
  50277. ServerResponse: googleapi.ServerResponse{
  50278. Header: res.Header,
  50279. HTTPStatusCode: res.StatusCode,
  50280. },
  50281. }
  50282. target := &ret
  50283. if err := gensupport.DecodeResponse(target, res); err != nil {
  50284. return nil, err
  50285. }
  50286. return ret, nil
  50287. // {
  50288. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  50289. // "httpMethod": "POST",
  50290. // "id": "compute.instanceTemplates.setIamPolicy",
  50291. // "parameterOrder": [
  50292. // "project",
  50293. // "resource"
  50294. // ],
  50295. // "parameters": {
  50296. // "project": {
  50297. // "description": "Project ID for this request.",
  50298. // "location": "path",
  50299. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50300. // "required": true,
  50301. // "type": "string"
  50302. // },
  50303. // "resource": {
  50304. // "description": "Name or id of the resource for this request.",
  50305. // "location": "path",
  50306. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50307. // "required": true,
  50308. // "type": "string"
  50309. // }
  50310. // },
  50311. // "path": "{project}/global/instanceTemplates/{resource}/setIamPolicy",
  50312. // "request": {
  50313. // "$ref": "GlobalSetPolicyRequest"
  50314. // },
  50315. // "response": {
  50316. // "$ref": "Policy"
  50317. // },
  50318. // "scopes": [
  50319. // "https://www.googleapis.com/auth/cloud-platform",
  50320. // "https://www.googleapis.com/auth/compute"
  50321. // ]
  50322. // }
  50323. }
  50324. // method id "compute.instanceTemplates.testIamPermissions":
  50325. type InstanceTemplatesTestIamPermissionsCall struct {
  50326. s *Service
  50327. project string
  50328. resource string
  50329. testpermissionsrequest *TestPermissionsRequest
  50330. urlParams_ gensupport.URLParams
  50331. ctx_ context.Context
  50332. header_ http.Header
  50333. }
  50334. // TestIamPermissions: Returns permissions that a caller has on the
  50335. // specified resource.
  50336. func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall {
  50337. c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50338. c.project = project
  50339. c.resource = resource
  50340. c.testpermissionsrequest = testpermissionsrequest
  50341. return c
  50342. }
  50343. // Fields allows partial responses to be retrieved. See
  50344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50345. // for more information.
  50346. func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall {
  50347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50348. return c
  50349. }
  50350. // Context sets the context to be used in this call's Do method. Any
  50351. // pending HTTP request will be aborted if the provided context is
  50352. // canceled.
  50353. func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall {
  50354. c.ctx_ = ctx
  50355. return c
  50356. }
  50357. // Header returns an http.Header that can be modified by the caller to
  50358. // add HTTP headers to the request.
  50359. func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header {
  50360. if c.header_ == nil {
  50361. c.header_ = make(http.Header)
  50362. }
  50363. return c.header_
  50364. }
  50365. func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  50366. reqHeaders := make(http.Header)
  50367. for k, v := range c.header_ {
  50368. reqHeaders[k] = v
  50369. }
  50370. reqHeaders.Set("User-Agent", c.s.userAgent())
  50371. var body io.Reader = nil
  50372. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  50373. if err != nil {
  50374. return nil, err
  50375. }
  50376. reqHeaders.Set("Content-Type", "application/json")
  50377. c.urlParams_.Set("alt", alt)
  50378. c.urlParams_.Set("prettyPrint", "false")
  50379. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{resource}/testIamPermissions")
  50380. urls += "?" + c.urlParams_.Encode()
  50381. req, err := http.NewRequest("POST", urls, body)
  50382. if err != nil {
  50383. return nil, err
  50384. }
  50385. req.Header = reqHeaders
  50386. googleapi.Expand(req.URL, map[string]string{
  50387. "project": c.project,
  50388. "resource": c.resource,
  50389. })
  50390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50391. }
  50392. // Do executes the "compute.instanceTemplates.testIamPermissions" call.
  50393. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  50394. // non-2xx status code is an error. Response headers are in either
  50395. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  50396. // returned at all) in error.(*googleapi.Error).Header. Use
  50397. // googleapi.IsNotModified to check whether the returned error was
  50398. // because http.StatusNotModified was returned.
  50399. func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  50400. gensupport.SetOptions(c.urlParams_, opts...)
  50401. res, err := c.doRequest("json")
  50402. if res != nil && res.StatusCode == http.StatusNotModified {
  50403. if res.Body != nil {
  50404. res.Body.Close()
  50405. }
  50406. return nil, &googleapi.Error{
  50407. Code: res.StatusCode,
  50408. Header: res.Header,
  50409. }
  50410. }
  50411. if err != nil {
  50412. return nil, err
  50413. }
  50414. defer googleapi.CloseBody(res)
  50415. if err := googleapi.CheckResponse(res); err != nil {
  50416. return nil, err
  50417. }
  50418. ret := &TestPermissionsResponse{
  50419. ServerResponse: googleapi.ServerResponse{
  50420. Header: res.Header,
  50421. HTTPStatusCode: res.StatusCode,
  50422. },
  50423. }
  50424. target := &ret
  50425. if err := gensupport.DecodeResponse(target, res); err != nil {
  50426. return nil, err
  50427. }
  50428. return ret, nil
  50429. // {
  50430. // "description": "Returns permissions that a caller has on the specified resource.",
  50431. // "httpMethod": "POST",
  50432. // "id": "compute.instanceTemplates.testIamPermissions",
  50433. // "parameterOrder": [
  50434. // "project",
  50435. // "resource"
  50436. // ],
  50437. // "parameters": {
  50438. // "project": {
  50439. // "description": "Project ID for this request.",
  50440. // "location": "path",
  50441. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50442. // "required": true,
  50443. // "type": "string"
  50444. // },
  50445. // "resource": {
  50446. // "description": "Name or id of the resource for this request.",
  50447. // "location": "path",
  50448. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50449. // "required": true,
  50450. // "type": "string"
  50451. // }
  50452. // },
  50453. // "path": "{project}/global/instanceTemplates/{resource}/testIamPermissions",
  50454. // "request": {
  50455. // "$ref": "TestPermissionsRequest"
  50456. // },
  50457. // "response": {
  50458. // "$ref": "TestPermissionsResponse"
  50459. // },
  50460. // "scopes": [
  50461. // "https://www.googleapis.com/auth/cloud-platform",
  50462. // "https://www.googleapis.com/auth/compute",
  50463. // "https://www.googleapis.com/auth/compute.readonly"
  50464. // ]
  50465. // }
  50466. }
  50467. // method id "compute.instances.addAccessConfig":
  50468. type InstancesAddAccessConfigCall struct {
  50469. s *Service
  50470. project string
  50471. zone string
  50472. instance string
  50473. accessconfig *AccessConfig
  50474. urlParams_ gensupport.URLParams
  50475. ctx_ context.Context
  50476. header_ http.Header
  50477. }
  50478. // AddAccessConfig: Adds an access config to an instance's network
  50479. // interface.
  50480. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig
  50481. func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall {
  50482. c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50483. c.project = project
  50484. c.zone = zone
  50485. c.instance = instance
  50486. c.urlParams_.Set("networkInterface", networkInterface)
  50487. c.accessconfig = accessconfig
  50488. return c
  50489. }
  50490. // RequestId sets the optional parameter "requestId": An optional
  50491. // request ID to identify requests. Specify a unique request ID so that
  50492. // if you must retry your request, the server will know to ignore the
  50493. // request if it has already been completed.
  50494. //
  50495. // For example, consider a situation where you make an initial request
  50496. // and the request times out. If you make the request again with the
  50497. // same request ID, the server can check if original operation with the
  50498. // same request ID was received, and if so, will ignore the second
  50499. // request. This prevents clients from accidentally creating duplicate
  50500. // commitments.
  50501. //
  50502. // The request ID must be a valid UUID with the exception that zero UUID
  50503. // is not supported (00000000-0000-0000-0000-000000000000).
  50504. func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall {
  50505. c.urlParams_.Set("requestId", requestId)
  50506. return c
  50507. }
  50508. // Fields allows partial responses to be retrieved. See
  50509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50510. // for more information.
  50511. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall {
  50512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50513. return c
  50514. }
  50515. // Context sets the context to be used in this call's Do method. Any
  50516. // pending HTTP request will be aborted if the provided context is
  50517. // canceled.
  50518. func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall {
  50519. c.ctx_ = ctx
  50520. return c
  50521. }
  50522. // Header returns an http.Header that can be modified by the caller to
  50523. // add HTTP headers to the request.
  50524. func (c *InstancesAddAccessConfigCall) Header() http.Header {
  50525. if c.header_ == nil {
  50526. c.header_ = make(http.Header)
  50527. }
  50528. return c.header_
  50529. }
  50530. func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  50531. reqHeaders := make(http.Header)
  50532. for k, v := range c.header_ {
  50533. reqHeaders[k] = v
  50534. }
  50535. reqHeaders.Set("User-Agent", c.s.userAgent())
  50536. var body io.Reader = nil
  50537. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  50538. if err != nil {
  50539. return nil, err
  50540. }
  50541. reqHeaders.Set("Content-Type", "application/json")
  50542. c.urlParams_.Set("alt", alt)
  50543. c.urlParams_.Set("prettyPrint", "false")
  50544. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig")
  50545. urls += "?" + c.urlParams_.Encode()
  50546. req, err := http.NewRequest("POST", urls, body)
  50547. if err != nil {
  50548. return nil, err
  50549. }
  50550. req.Header = reqHeaders
  50551. googleapi.Expand(req.URL, map[string]string{
  50552. "project": c.project,
  50553. "zone": c.zone,
  50554. "instance": c.instance,
  50555. })
  50556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50557. }
  50558. // Do executes the "compute.instances.addAccessConfig" call.
  50559. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50560. // status code is an error. Response headers are in either
  50561. // *Operation.ServerResponse.Header or (if a response was returned at
  50562. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50563. // to check whether the returned error was because
  50564. // http.StatusNotModified was returned.
  50565. func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50566. gensupport.SetOptions(c.urlParams_, opts...)
  50567. res, err := c.doRequest("json")
  50568. if res != nil && res.StatusCode == http.StatusNotModified {
  50569. if res.Body != nil {
  50570. res.Body.Close()
  50571. }
  50572. return nil, &googleapi.Error{
  50573. Code: res.StatusCode,
  50574. Header: res.Header,
  50575. }
  50576. }
  50577. if err != nil {
  50578. return nil, err
  50579. }
  50580. defer googleapi.CloseBody(res)
  50581. if err := googleapi.CheckResponse(res); err != nil {
  50582. return nil, err
  50583. }
  50584. ret := &Operation{
  50585. ServerResponse: googleapi.ServerResponse{
  50586. Header: res.Header,
  50587. HTTPStatusCode: res.StatusCode,
  50588. },
  50589. }
  50590. target := &ret
  50591. if err := gensupport.DecodeResponse(target, res); err != nil {
  50592. return nil, err
  50593. }
  50594. return ret, nil
  50595. // {
  50596. // "description": "Adds an access config to an instance's network interface.",
  50597. // "httpMethod": "POST",
  50598. // "id": "compute.instances.addAccessConfig",
  50599. // "parameterOrder": [
  50600. // "project",
  50601. // "zone",
  50602. // "instance",
  50603. // "networkInterface"
  50604. // ],
  50605. // "parameters": {
  50606. // "instance": {
  50607. // "description": "The instance name for this request.",
  50608. // "location": "path",
  50609. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  50610. // "required": true,
  50611. // "type": "string"
  50612. // },
  50613. // "networkInterface": {
  50614. // "description": "The name of the network interface to add to this instance.",
  50615. // "location": "query",
  50616. // "required": true,
  50617. // "type": "string"
  50618. // },
  50619. // "project": {
  50620. // "description": "Project ID for this request.",
  50621. // "location": "path",
  50622. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50623. // "required": true,
  50624. // "type": "string"
  50625. // },
  50626. // "requestId": {
  50627. // "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).",
  50628. // "location": "query",
  50629. // "type": "string"
  50630. // },
  50631. // "zone": {
  50632. // "description": "The name of the zone for this request.",
  50633. // "location": "path",
  50634. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  50635. // "required": true,
  50636. // "type": "string"
  50637. // }
  50638. // },
  50639. // "path": "{project}/zones/{zone}/instances/{instance}/addAccessConfig",
  50640. // "request": {
  50641. // "$ref": "AccessConfig"
  50642. // },
  50643. // "response": {
  50644. // "$ref": "Operation"
  50645. // },
  50646. // "scopes": [
  50647. // "https://www.googleapis.com/auth/cloud-platform",
  50648. // "https://www.googleapis.com/auth/compute"
  50649. // ]
  50650. // }
  50651. }
  50652. // method id "compute.instances.aggregatedList":
  50653. type InstancesAggregatedListCall struct {
  50654. s *Service
  50655. project string
  50656. urlParams_ gensupport.URLParams
  50657. ifNoneMatch_ string
  50658. ctx_ context.Context
  50659. header_ http.Header
  50660. }
  50661. // AggregatedList: Retrieves aggregated list of all of the instances in
  50662. // your project across all regions and zones.
  50663. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList
  50664. func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall {
  50665. c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50666. c.project = project
  50667. return c
  50668. }
  50669. // Filter sets the optional parameter "filter": A filter expression that
  50670. // filters resources listed in the response. The expression must specify
  50671. // the field name, a comparison operator, and the value that you want to
  50672. // use for filtering. The value must be a string, a number, or a
  50673. // boolean. The comparison operator must be either =, !=, >, or <.
  50674. //
  50675. // For example, if you are filtering Compute Engine instances, you can
  50676. // exclude instances named example-instance by specifying name !=
  50677. // example-instance.
  50678. //
  50679. // You can also filter nested fields. For example, you could specify
  50680. // scheduling.automaticRestart = false to include instances only if they
  50681. // are not scheduled for automatic restarts. You can use filtering on
  50682. // nested fields to filter based on resource labels.
  50683. //
  50684. // To filter on multiple expressions, provide each separate expression
  50685. // within parentheses. For example, (scheduling.automaticRestart = true)
  50686. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  50687. // AND expression. However, you can include AND and OR expressions
  50688. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  50689. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  50690. // true).
  50691. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall {
  50692. c.urlParams_.Set("filter", filter)
  50693. return c
  50694. }
  50695. // MaxResults sets the optional parameter "maxResults": The maximum
  50696. // number of results per page that should be returned. If the number of
  50697. // available results is larger than maxResults, Compute Engine returns a
  50698. // nextPageToken that can be used to get the next page of results in
  50699. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  50700. // (Default: 500)
  50701. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall {
  50702. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  50703. return c
  50704. }
  50705. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  50706. // a certain order. By default, results are returned in alphanumerical
  50707. // order based on the resource name.
  50708. //
  50709. // You can also sort results in descending order based on the creation
  50710. // timestamp using orderBy="creationTimestamp desc". This sorts results
  50711. // based on the creationTimestamp field in reverse chronological order
  50712. // (newest result first). Use this to sort resources like operations so
  50713. // that the newest operation is returned first.
  50714. //
  50715. // Currently, only sorting by name or creationTimestamp desc is
  50716. // supported.
  50717. func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall {
  50718. c.urlParams_.Set("orderBy", orderBy)
  50719. return c
  50720. }
  50721. // PageToken sets the optional parameter "pageToken": Specifies a page
  50722. // token to use. Set pageToken to the nextPageToken returned by a
  50723. // previous list request to get the next page of results.
  50724. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall {
  50725. c.urlParams_.Set("pageToken", pageToken)
  50726. return c
  50727. }
  50728. // Fields allows partial responses to be retrieved. See
  50729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50730. // for more information.
  50731. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall {
  50732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50733. return c
  50734. }
  50735. // IfNoneMatch sets the optional parameter which makes the operation
  50736. // fail if the object's ETag matches the given value. This is useful for
  50737. // getting updates only after the object has changed since the last
  50738. // request. Use googleapi.IsNotModified to check whether the response
  50739. // error from Do is the result of In-None-Match.
  50740. func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall {
  50741. c.ifNoneMatch_ = entityTag
  50742. return c
  50743. }
  50744. // Context sets the context to be used in this call's Do method. Any
  50745. // pending HTTP request will be aborted if the provided context is
  50746. // canceled.
  50747. func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall {
  50748. c.ctx_ = ctx
  50749. return c
  50750. }
  50751. // Header returns an http.Header that can be modified by the caller to
  50752. // add HTTP headers to the request.
  50753. func (c *InstancesAggregatedListCall) Header() http.Header {
  50754. if c.header_ == nil {
  50755. c.header_ = make(http.Header)
  50756. }
  50757. return c.header_
  50758. }
  50759. func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  50760. reqHeaders := make(http.Header)
  50761. for k, v := range c.header_ {
  50762. reqHeaders[k] = v
  50763. }
  50764. reqHeaders.Set("User-Agent", c.s.userAgent())
  50765. if c.ifNoneMatch_ != "" {
  50766. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  50767. }
  50768. var body io.Reader = nil
  50769. c.urlParams_.Set("alt", alt)
  50770. c.urlParams_.Set("prettyPrint", "false")
  50771. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances")
  50772. urls += "?" + c.urlParams_.Encode()
  50773. req, err := http.NewRequest("GET", urls, body)
  50774. if err != nil {
  50775. return nil, err
  50776. }
  50777. req.Header = reqHeaders
  50778. googleapi.Expand(req.URL, map[string]string{
  50779. "project": c.project,
  50780. })
  50781. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50782. }
  50783. // Do executes the "compute.instances.aggregatedList" call.
  50784. // Exactly one of *InstanceAggregatedList or error will be non-nil. Any
  50785. // non-2xx status code is an error. Response headers are in either
  50786. // *InstanceAggregatedList.ServerResponse.Header or (if a response was
  50787. // returned at all) in error.(*googleapi.Error).Header. Use
  50788. // googleapi.IsNotModified to check whether the returned error was
  50789. // because http.StatusNotModified was returned.
  50790. func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) {
  50791. gensupport.SetOptions(c.urlParams_, opts...)
  50792. res, err := c.doRequest("json")
  50793. if res != nil && res.StatusCode == http.StatusNotModified {
  50794. if res.Body != nil {
  50795. res.Body.Close()
  50796. }
  50797. return nil, &googleapi.Error{
  50798. Code: res.StatusCode,
  50799. Header: res.Header,
  50800. }
  50801. }
  50802. if err != nil {
  50803. return nil, err
  50804. }
  50805. defer googleapi.CloseBody(res)
  50806. if err := googleapi.CheckResponse(res); err != nil {
  50807. return nil, err
  50808. }
  50809. ret := &InstanceAggregatedList{
  50810. ServerResponse: googleapi.ServerResponse{
  50811. Header: res.Header,
  50812. HTTPStatusCode: res.StatusCode,
  50813. },
  50814. }
  50815. target := &ret
  50816. if err := gensupport.DecodeResponse(target, res); err != nil {
  50817. return nil, err
  50818. }
  50819. return ret, nil
  50820. // {
  50821. // "description": "Retrieves aggregated list of all of the instances in your project across all regions and zones.",
  50822. // "httpMethod": "GET",
  50823. // "id": "compute.instances.aggregatedList",
  50824. // "parameterOrder": [
  50825. // "project"
  50826. // ],
  50827. // "parameters": {
  50828. // "filter": {
  50829. // "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).",
  50830. // "location": "query",
  50831. // "type": "string"
  50832. // },
  50833. // "maxResults": {
  50834. // "default": "500",
  50835. // "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)",
  50836. // "format": "uint32",
  50837. // "location": "query",
  50838. // "minimum": "0",
  50839. // "type": "integer"
  50840. // },
  50841. // "orderBy": {
  50842. // "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.",
  50843. // "location": "query",
  50844. // "type": "string"
  50845. // },
  50846. // "pageToken": {
  50847. // "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.",
  50848. // "location": "query",
  50849. // "type": "string"
  50850. // },
  50851. // "project": {
  50852. // "description": "Project ID for this request.",
  50853. // "location": "path",
  50854. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  50855. // "required": true,
  50856. // "type": "string"
  50857. // }
  50858. // },
  50859. // "path": "{project}/aggregated/instances",
  50860. // "response": {
  50861. // "$ref": "InstanceAggregatedList"
  50862. // },
  50863. // "scopes": [
  50864. // "https://www.googleapis.com/auth/cloud-platform",
  50865. // "https://www.googleapis.com/auth/compute",
  50866. // "https://www.googleapis.com/auth/compute.readonly"
  50867. // ]
  50868. // }
  50869. }
  50870. // Pages invokes f for each page of results.
  50871. // A non-nil error returned from f will halt the iteration.
  50872. // The provided context supersedes any context provided to the Context method.
  50873. func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error {
  50874. c.ctx_ = ctx
  50875. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  50876. for {
  50877. x, err := c.Do()
  50878. if err != nil {
  50879. return err
  50880. }
  50881. if err := f(x); err != nil {
  50882. return err
  50883. }
  50884. if x.NextPageToken == "" {
  50885. return nil
  50886. }
  50887. c.PageToken(x.NextPageToken)
  50888. }
  50889. }
  50890. // method id "compute.instances.attachDisk":
  50891. type InstancesAttachDiskCall struct {
  50892. s *Service
  50893. project string
  50894. zone string
  50895. instance string
  50896. attacheddisk *AttachedDisk
  50897. urlParams_ gensupport.URLParams
  50898. ctx_ context.Context
  50899. header_ http.Header
  50900. }
  50901. // AttachDisk: Attaches an existing Disk resource to an instance. You
  50902. // must first create the disk before you can attach it. It is not
  50903. // possible to create and attach a disk at the same time. For more
  50904. // information, read Adding a persistent disk to your instance.
  50905. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk
  50906. func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall {
  50907. c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  50908. c.project = project
  50909. c.zone = zone
  50910. c.instance = instance
  50911. c.attacheddisk = attacheddisk
  50912. return c
  50913. }
  50914. // ForceAttach sets the optional parameter "forceAttach": Whether to
  50915. // force attach the disk even if it's currently attached to another
  50916. // instance.
  50917. func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall {
  50918. c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach))
  50919. return c
  50920. }
  50921. // RequestId sets the optional parameter "requestId": An optional
  50922. // request ID to identify requests. Specify a unique request ID so that
  50923. // if you must retry your request, the server will know to ignore the
  50924. // request if it has already been completed.
  50925. //
  50926. // For example, consider a situation where you make an initial request
  50927. // and the request times out. If you make the request again with the
  50928. // same request ID, the server can check if original operation with the
  50929. // same request ID was received, and if so, will ignore the second
  50930. // request. This prevents clients from accidentally creating duplicate
  50931. // commitments.
  50932. //
  50933. // The request ID must be a valid UUID with the exception that zero UUID
  50934. // is not supported (00000000-0000-0000-0000-000000000000).
  50935. func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall {
  50936. c.urlParams_.Set("requestId", requestId)
  50937. return c
  50938. }
  50939. // Fields allows partial responses to be retrieved. See
  50940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  50941. // for more information.
  50942. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall {
  50943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  50944. return c
  50945. }
  50946. // Context sets the context to be used in this call's Do method. Any
  50947. // pending HTTP request will be aborted if the provided context is
  50948. // canceled.
  50949. func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall {
  50950. c.ctx_ = ctx
  50951. return c
  50952. }
  50953. // Header returns an http.Header that can be modified by the caller to
  50954. // add HTTP headers to the request.
  50955. func (c *InstancesAttachDiskCall) Header() http.Header {
  50956. if c.header_ == nil {
  50957. c.header_ = make(http.Header)
  50958. }
  50959. return c.header_
  50960. }
  50961. func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) {
  50962. reqHeaders := make(http.Header)
  50963. for k, v := range c.header_ {
  50964. reqHeaders[k] = v
  50965. }
  50966. reqHeaders.Set("User-Agent", c.s.userAgent())
  50967. var body io.Reader = nil
  50968. body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk)
  50969. if err != nil {
  50970. return nil, err
  50971. }
  50972. reqHeaders.Set("Content-Type", "application/json")
  50973. c.urlParams_.Set("alt", alt)
  50974. c.urlParams_.Set("prettyPrint", "false")
  50975. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk")
  50976. urls += "?" + c.urlParams_.Encode()
  50977. req, err := http.NewRequest("POST", urls, body)
  50978. if err != nil {
  50979. return nil, err
  50980. }
  50981. req.Header = reqHeaders
  50982. googleapi.Expand(req.URL, map[string]string{
  50983. "project": c.project,
  50984. "zone": c.zone,
  50985. "instance": c.instance,
  50986. })
  50987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  50988. }
  50989. // Do executes the "compute.instances.attachDisk" call.
  50990. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  50991. // status code is an error. Response headers are in either
  50992. // *Operation.ServerResponse.Header or (if a response was returned at
  50993. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  50994. // to check whether the returned error was because
  50995. // http.StatusNotModified was returned.
  50996. func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  50997. gensupport.SetOptions(c.urlParams_, opts...)
  50998. res, err := c.doRequest("json")
  50999. if res != nil && res.StatusCode == http.StatusNotModified {
  51000. if res.Body != nil {
  51001. res.Body.Close()
  51002. }
  51003. return nil, &googleapi.Error{
  51004. Code: res.StatusCode,
  51005. Header: res.Header,
  51006. }
  51007. }
  51008. if err != nil {
  51009. return nil, err
  51010. }
  51011. defer googleapi.CloseBody(res)
  51012. if err := googleapi.CheckResponse(res); err != nil {
  51013. return nil, err
  51014. }
  51015. ret := &Operation{
  51016. ServerResponse: googleapi.ServerResponse{
  51017. Header: res.Header,
  51018. HTTPStatusCode: res.StatusCode,
  51019. },
  51020. }
  51021. target := &ret
  51022. if err := gensupport.DecodeResponse(target, res); err != nil {
  51023. return nil, err
  51024. }
  51025. return ret, nil
  51026. // {
  51027. // "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.",
  51028. // "httpMethod": "POST",
  51029. // "id": "compute.instances.attachDisk",
  51030. // "parameterOrder": [
  51031. // "project",
  51032. // "zone",
  51033. // "instance"
  51034. // ],
  51035. // "parameters": {
  51036. // "forceAttach": {
  51037. // "description": "Whether to force attach the disk even if it's currently attached to another instance.",
  51038. // "location": "query",
  51039. // "type": "boolean"
  51040. // },
  51041. // "instance": {
  51042. // "description": "The instance name for this request.",
  51043. // "location": "path",
  51044. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51045. // "required": true,
  51046. // "type": "string"
  51047. // },
  51048. // "project": {
  51049. // "description": "Project ID for this request.",
  51050. // "location": "path",
  51051. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51052. // "required": true,
  51053. // "type": "string"
  51054. // },
  51055. // "requestId": {
  51056. // "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).",
  51057. // "location": "query",
  51058. // "type": "string"
  51059. // },
  51060. // "zone": {
  51061. // "description": "The name of the zone for this request.",
  51062. // "location": "path",
  51063. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51064. // "required": true,
  51065. // "type": "string"
  51066. // }
  51067. // },
  51068. // "path": "{project}/zones/{zone}/instances/{instance}/attachDisk",
  51069. // "request": {
  51070. // "$ref": "AttachedDisk"
  51071. // },
  51072. // "response": {
  51073. // "$ref": "Operation"
  51074. // },
  51075. // "scopes": [
  51076. // "https://www.googleapis.com/auth/cloud-platform",
  51077. // "https://www.googleapis.com/auth/compute"
  51078. // ]
  51079. // }
  51080. }
  51081. // method id "compute.instances.delete":
  51082. type InstancesDeleteCall struct {
  51083. s *Service
  51084. project string
  51085. zone string
  51086. instance string
  51087. urlParams_ gensupport.URLParams
  51088. ctx_ context.Context
  51089. header_ http.Header
  51090. }
  51091. // Delete: Deletes the specified Instance resource. For more
  51092. // information, see Stopping or Deleting an Instance.
  51093. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete
  51094. func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall {
  51095. c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51096. c.project = project
  51097. c.zone = zone
  51098. c.instance = instance
  51099. return c
  51100. }
  51101. // RequestId sets the optional parameter "requestId": An optional
  51102. // request ID to identify requests. Specify a unique request ID so that
  51103. // if you must retry your request, the server will know to ignore the
  51104. // request if it has already been completed.
  51105. //
  51106. // For example, consider a situation where you make an initial request
  51107. // and the request times out. If you make the request again with the
  51108. // same request ID, the server can check if original operation with the
  51109. // same request ID was received, and if so, will ignore the second
  51110. // request. This prevents clients from accidentally creating duplicate
  51111. // commitments.
  51112. //
  51113. // The request ID must be a valid UUID with the exception that zero UUID
  51114. // is not supported (00000000-0000-0000-0000-000000000000).
  51115. func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall {
  51116. c.urlParams_.Set("requestId", requestId)
  51117. return c
  51118. }
  51119. // Fields allows partial responses to be retrieved. See
  51120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51121. // for more information.
  51122. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall {
  51123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51124. return c
  51125. }
  51126. // Context sets the context to be used in this call's Do method. Any
  51127. // pending HTTP request will be aborted if the provided context is
  51128. // canceled.
  51129. func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall {
  51130. c.ctx_ = ctx
  51131. return c
  51132. }
  51133. // Header returns an http.Header that can be modified by the caller to
  51134. // add HTTP headers to the request.
  51135. func (c *InstancesDeleteCall) Header() http.Header {
  51136. if c.header_ == nil {
  51137. c.header_ = make(http.Header)
  51138. }
  51139. return c.header_
  51140. }
  51141. func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  51142. reqHeaders := make(http.Header)
  51143. for k, v := range c.header_ {
  51144. reqHeaders[k] = v
  51145. }
  51146. reqHeaders.Set("User-Agent", c.s.userAgent())
  51147. var body io.Reader = nil
  51148. c.urlParams_.Set("alt", alt)
  51149. c.urlParams_.Set("prettyPrint", "false")
  51150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  51151. urls += "?" + c.urlParams_.Encode()
  51152. req, err := http.NewRequest("DELETE", urls, body)
  51153. if err != nil {
  51154. return nil, err
  51155. }
  51156. req.Header = reqHeaders
  51157. googleapi.Expand(req.URL, map[string]string{
  51158. "project": c.project,
  51159. "zone": c.zone,
  51160. "instance": c.instance,
  51161. })
  51162. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51163. }
  51164. // Do executes the "compute.instances.delete" call.
  51165. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51166. // status code is an error. Response headers are in either
  51167. // *Operation.ServerResponse.Header or (if a response was returned at
  51168. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51169. // to check whether the returned error was because
  51170. // http.StatusNotModified was returned.
  51171. func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51172. gensupport.SetOptions(c.urlParams_, opts...)
  51173. res, err := c.doRequest("json")
  51174. if res != nil && res.StatusCode == http.StatusNotModified {
  51175. if res.Body != nil {
  51176. res.Body.Close()
  51177. }
  51178. return nil, &googleapi.Error{
  51179. Code: res.StatusCode,
  51180. Header: res.Header,
  51181. }
  51182. }
  51183. if err != nil {
  51184. return nil, err
  51185. }
  51186. defer googleapi.CloseBody(res)
  51187. if err := googleapi.CheckResponse(res); err != nil {
  51188. return nil, err
  51189. }
  51190. ret := &Operation{
  51191. ServerResponse: googleapi.ServerResponse{
  51192. Header: res.Header,
  51193. HTTPStatusCode: res.StatusCode,
  51194. },
  51195. }
  51196. target := &ret
  51197. if err := gensupport.DecodeResponse(target, res); err != nil {
  51198. return nil, err
  51199. }
  51200. return ret, nil
  51201. // {
  51202. // "description": "Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.",
  51203. // "httpMethod": "DELETE",
  51204. // "id": "compute.instances.delete",
  51205. // "parameterOrder": [
  51206. // "project",
  51207. // "zone",
  51208. // "instance"
  51209. // ],
  51210. // "parameters": {
  51211. // "instance": {
  51212. // "description": "Name of the instance resource to delete.",
  51213. // "location": "path",
  51214. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51215. // "required": true,
  51216. // "type": "string"
  51217. // },
  51218. // "project": {
  51219. // "description": "Project ID for this request.",
  51220. // "location": "path",
  51221. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51222. // "required": true,
  51223. // "type": "string"
  51224. // },
  51225. // "requestId": {
  51226. // "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).",
  51227. // "location": "query",
  51228. // "type": "string"
  51229. // },
  51230. // "zone": {
  51231. // "description": "The name of the zone for this request.",
  51232. // "location": "path",
  51233. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51234. // "required": true,
  51235. // "type": "string"
  51236. // }
  51237. // },
  51238. // "path": "{project}/zones/{zone}/instances/{instance}",
  51239. // "response": {
  51240. // "$ref": "Operation"
  51241. // },
  51242. // "scopes": [
  51243. // "https://www.googleapis.com/auth/cloud-platform",
  51244. // "https://www.googleapis.com/auth/compute"
  51245. // ]
  51246. // }
  51247. }
  51248. // method id "compute.instances.deleteAccessConfig":
  51249. type InstancesDeleteAccessConfigCall struct {
  51250. s *Service
  51251. project string
  51252. zone string
  51253. instance string
  51254. urlParams_ gensupport.URLParams
  51255. ctx_ context.Context
  51256. header_ http.Header
  51257. }
  51258. // DeleteAccessConfig: Deletes an access config from an instance's
  51259. // network interface.
  51260. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig
  51261. func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall {
  51262. c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51263. c.project = project
  51264. c.zone = zone
  51265. c.instance = instance
  51266. c.urlParams_.Set("accessConfig", accessConfig)
  51267. c.urlParams_.Set("networkInterface", networkInterface)
  51268. return c
  51269. }
  51270. // RequestId sets the optional parameter "requestId": An optional
  51271. // request ID to identify requests. Specify a unique request ID so that
  51272. // if you must retry your request, the server will know to ignore the
  51273. // request if it has already been completed.
  51274. //
  51275. // For example, consider a situation where you make an initial request
  51276. // and the request times out. If you make the request again with the
  51277. // same request ID, the server can check if original operation with the
  51278. // same request ID was received, and if so, will ignore the second
  51279. // request. This prevents clients from accidentally creating duplicate
  51280. // commitments.
  51281. //
  51282. // The request ID must be a valid UUID with the exception that zero UUID
  51283. // is not supported (00000000-0000-0000-0000-000000000000).
  51284. func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall {
  51285. c.urlParams_.Set("requestId", requestId)
  51286. return c
  51287. }
  51288. // Fields allows partial responses to be retrieved. See
  51289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51290. // for more information.
  51291. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall {
  51292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51293. return c
  51294. }
  51295. // Context sets the context to be used in this call's Do method. Any
  51296. // pending HTTP request will be aborted if the provided context is
  51297. // canceled.
  51298. func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall {
  51299. c.ctx_ = ctx
  51300. return c
  51301. }
  51302. // Header returns an http.Header that can be modified by the caller to
  51303. // add HTTP headers to the request.
  51304. func (c *InstancesDeleteAccessConfigCall) Header() http.Header {
  51305. if c.header_ == nil {
  51306. c.header_ = make(http.Header)
  51307. }
  51308. return c.header_
  51309. }
  51310. func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  51311. reqHeaders := make(http.Header)
  51312. for k, v := range c.header_ {
  51313. reqHeaders[k] = v
  51314. }
  51315. reqHeaders.Set("User-Agent", c.s.userAgent())
  51316. var body io.Reader = nil
  51317. c.urlParams_.Set("alt", alt)
  51318. c.urlParams_.Set("prettyPrint", "false")
  51319. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig")
  51320. urls += "?" + c.urlParams_.Encode()
  51321. req, err := http.NewRequest("POST", urls, body)
  51322. if err != nil {
  51323. return nil, err
  51324. }
  51325. req.Header = reqHeaders
  51326. googleapi.Expand(req.URL, map[string]string{
  51327. "project": c.project,
  51328. "zone": c.zone,
  51329. "instance": c.instance,
  51330. })
  51331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51332. }
  51333. // Do executes the "compute.instances.deleteAccessConfig" call.
  51334. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51335. // status code is an error. Response headers are in either
  51336. // *Operation.ServerResponse.Header or (if a response was returned at
  51337. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51338. // to check whether the returned error was because
  51339. // http.StatusNotModified was returned.
  51340. func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51341. gensupport.SetOptions(c.urlParams_, opts...)
  51342. res, err := c.doRequest("json")
  51343. if res != nil && res.StatusCode == http.StatusNotModified {
  51344. if res.Body != nil {
  51345. res.Body.Close()
  51346. }
  51347. return nil, &googleapi.Error{
  51348. Code: res.StatusCode,
  51349. Header: res.Header,
  51350. }
  51351. }
  51352. if err != nil {
  51353. return nil, err
  51354. }
  51355. defer googleapi.CloseBody(res)
  51356. if err := googleapi.CheckResponse(res); err != nil {
  51357. return nil, err
  51358. }
  51359. ret := &Operation{
  51360. ServerResponse: googleapi.ServerResponse{
  51361. Header: res.Header,
  51362. HTTPStatusCode: res.StatusCode,
  51363. },
  51364. }
  51365. target := &ret
  51366. if err := gensupport.DecodeResponse(target, res); err != nil {
  51367. return nil, err
  51368. }
  51369. return ret, nil
  51370. // {
  51371. // "description": "Deletes an access config from an instance's network interface.",
  51372. // "httpMethod": "POST",
  51373. // "id": "compute.instances.deleteAccessConfig",
  51374. // "parameterOrder": [
  51375. // "project",
  51376. // "zone",
  51377. // "instance",
  51378. // "accessConfig",
  51379. // "networkInterface"
  51380. // ],
  51381. // "parameters": {
  51382. // "accessConfig": {
  51383. // "description": "The name of the access config to delete.",
  51384. // "location": "query",
  51385. // "required": true,
  51386. // "type": "string"
  51387. // },
  51388. // "instance": {
  51389. // "description": "The instance name for this request.",
  51390. // "location": "path",
  51391. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51392. // "required": true,
  51393. // "type": "string"
  51394. // },
  51395. // "networkInterface": {
  51396. // "description": "The name of the network interface.",
  51397. // "location": "query",
  51398. // "required": true,
  51399. // "type": "string"
  51400. // },
  51401. // "project": {
  51402. // "description": "Project ID for this request.",
  51403. // "location": "path",
  51404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51405. // "required": true,
  51406. // "type": "string"
  51407. // },
  51408. // "requestId": {
  51409. // "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).",
  51410. // "location": "query",
  51411. // "type": "string"
  51412. // },
  51413. // "zone": {
  51414. // "description": "The name of the zone for this request.",
  51415. // "location": "path",
  51416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51417. // "required": true,
  51418. // "type": "string"
  51419. // }
  51420. // },
  51421. // "path": "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig",
  51422. // "response": {
  51423. // "$ref": "Operation"
  51424. // },
  51425. // "scopes": [
  51426. // "https://www.googleapis.com/auth/cloud-platform",
  51427. // "https://www.googleapis.com/auth/compute"
  51428. // ]
  51429. // }
  51430. }
  51431. // method id "compute.instances.detachDisk":
  51432. type InstancesDetachDiskCall struct {
  51433. s *Service
  51434. project string
  51435. zone string
  51436. instance string
  51437. urlParams_ gensupport.URLParams
  51438. ctx_ context.Context
  51439. header_ http.Header
  51440. }
  51441. // DetachDisk: Detaches a disk from an instance.
  51442. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk
  51443. func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall {
  51444. c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51445. c.project = project
  51446. c.zone = zone
  51447. c.instance = instance
  51448. c.urlParams_.Set("deviceName", deviceName)
  51449. return c
  51450. }
  51451. // RequestId sets the optional parameter "requestId": An optional
  51452. // request ID to identify requests. Specify a unique request ID so that
  51453. // if you must retry your request, the server will know to ignore the
  51454. // request if it has already been completed.
  51455. //
  51456. // For example, consider a situation where you make an initial request
  51457. // and the request times out. If you make the request again with the
  51458. // same request ID, the server can check if original operation with the
  51459. // same request ID was received, and if so, will ignore the second
  51460. // request. This prevents clients from accidentally creating duplicate
  51461. // commitments.
  51462. //
  51463. // The request ID must be a valid UUID with the exception that zero UUID
  51464. // is not supported (00000000-0000-0000-0000-000000000000).
  51465. func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall {
  51466. c.urlParams_.Set("requestId", requestId)
  51467. return c
  51468. }
  51469. // Fields allows partial responses to be retrieved. See
  51470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51471. // for more information.
  51472. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall {
  51473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51474. return c
  51475. }
  51476. // Context sets the context to be used in this call's Do method. Any
  51477. // pending HTTP request will be aborted if the provided context is
  51478. // canceled.
  51479. func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall {
  51480. c.ctx_ = ctx
  51481. return c
  51482. }
  51483. // Header returns an http.Header that can be modified by the caller to
  51484. // add HTTP headers to the request.
  51485. func (c *InstancesDetachDiskCall) Header() http.Header {
  51486. if c.header_ == nil {
  51487. c.header_ = make(http.Header)
  51488. }
  51489. return c.header_
  51490. }
  51491. func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) {
  51492. reqHeaders := make(http.Header)
  51493. for k, v := range c.header_ {
  51494. reqHeaders[k] = v
  51495. }
  51496. reqHeaders.Set("User-Agent", c.s.userAgent())
  51497. var body io.Reader = nil
  51498. c.urlParams_.Set("alt", alt)
  51499. c.urlParams_.Set("prettyPrint", "false")
  51500. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk")
  51501. urls += "?" + c.urlParams_.Encode()
  51502. req, err := http.NewRequest("POST", urls, body)
  51503. if err != nil {
  51504. return nil, err
  51505. }
  51506. req.Header = reqHeaders
  51507. googleapi.Expand(req.URL, map[string]string{
  51508. "project": c.project,
  51509. "zone": c.zone,
  51510. "instance": c.instance,
  51511. })
  51512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51513. }
  51514. // Do executes the "compute.instances.detachDisk" call.
  51515. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  51516. // status code is an error. Response headers are in either
  51517. // *Operation.ServerResponse.Header or (if a response was returned at
  51518. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51519. // to check whether the returned error was because
  51520. // http.StatusNotModified was returned.
  51521. func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  51522. gensupport.SetOptions(c.urlParams_, opts...)
  51523. res, err := c.doRequest("json")
  51524. if res != nil && res.StatusCode == http.StatusNotModified {
  51525. if res.Body != nil {
  51526. res.Body.Close()
  51527. }
  51528. return nil, &googleapi.Error{
  51529. Code: res.StatusCode,
  51530. Header: res.Header,
  51531. }
  51532. }
  51533. if err != nil {
  51534. return nil, err
  51535. }
  51536. defer googleapi.CloseBody(res)
  51537. if err := googleapi.CheckResponse(res); err != nil {
  51538. return nil, err
  51539. }
  51540. ret := &Operation{
  51541. ServerResponse: googleapi.ServerResponse{
  51542. Header: res.Header,
  51543. HTTPStatusCode: res.StatusCode,
  51544. },
  51545. }
  51546. target := &ret
  51547. if err := gensupport.DecodeResponse(target, res); err != nil {
  51548. return nil, err
  51549. }
  51550. return ret, nil
  51551. // {
  51552. // "description": "Detaches a disk from an instance.",
  51553. // "httpMethod": "POST",
  51554. // "id": "compute.instances.detachDisk",
  51555. // "parameterOrder": [
  51556. // "project",
  51557. // "zone",
  51558. // "instance",
  51559. // "deviceName"
  51560. // ],
  51561. // "parameters": {
  51562. // "deviceName": {
  51563. // "description": "The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names.",
  51564. // "location": "query",
  51565. // "required": true,
  51566. // "type": "string"
  51567. // },
  51568. // "instance": {
  51569. // "description": "Instance name for this request.",
  51570. // "location": "path",
  51571. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51572. // "required": true,
  51573. // "type": "string"
  51574. // },
  51575. // "project": {
  51576. // "description": "Project ID for this request.",
  51577. // "location": "path",
  51578. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51579. // "required": true,
  51580. // "type": "string"
  51581. // },
  51582. // "requestId": {
  51583. // "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).",
  51584. // "location": "query",
  51585. // "type": "string"
  51586. // },
  51587. // "zone": {
  51588. // "description": "The name of the zone for this request.",
  51589. // "location": "path",
  51590. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51591. // "required": true,
  51592. // "type": "string"
  51593. // }
  51594. // },
  51595. // "path": "{project}/zones/{zone}/instances/{instance}/detachDisk",
  51596. // "response": {
  51597. // "$ref": "Operation"
  51598. // },
  51599. // "scopes": [
  51600. // "https://www.googleapis.com/auth/cloud-platform",
  51601. // "https://www.googleapis.com/auth/compute"
  51602. // ]
  51603. // }
  51604. }
  51605. // method id "compute.instances.get":
  51606. type InstancesGetCall struct {
  51607. s *Service
  51608. project string
  51609. zone string
  51610. instance string
  51611. urlParams_ gensupport.URLParams
  51612. ifNoneMatch_ string
  51613. ctx_ context.Context
  51614. header_ http.Header
  51615. }
  51616. // Get: Returns the specified Instance resource. Gets a list of
  51617. // available instances by making a list() request.
  51618. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get
  51619. func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall {
  51620. c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51621. c.project = project
  51622. c.zone = zone
  51623. c.instance = instance
  51624. return c
  51625. }
  51626. // Fields allows partial responses to be retrieved. See
  51627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51628. // for more information.
  51629. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall {
  51630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51631. return c
  51632. }
  51633. // IfNoneMatch sets the optional parameter which makes the operation
  51634. // fail if the object's ETag matches the given value. This is useful for
  51635. // getting updates only after the object has changed since the last
  51636. // request. Use googleapi.IsNotModified to check whether the response
  51637. // error from Do is the result of In-None-Match.
  51638. func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall {
  51639. c.ifNoneMatch_ = entityTag
  51640. return c
  51641. }
  51642. // Context sets the context to be used in this call's Do method. Any
  51643. // pending HTTP request will be aborted if the provided context is
  51644. // canceled.
  51645. func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall {
  51646. c.ctx_ = ctx
  51647. return c
  51648. }
  51649. // Header returns an http.Header that can be modified by the caller to
  51650. // add HTTP headers to the request.
  51651. func (c *InstancesGetCall) Header() http.Header {
  51652. if c.header_ == nil {
  51653. c.header_ = make(http.Header)
  51654. }
  51655. return c.header_
  51656. }
  51657. func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) {
  51658. reqHeaders := make(http.Header)
  51659. for k, v := range c.header_ {
  51660. reqHeaders[k] = v
  51661. }
  51662. reqHeaders.Set("User-Agent", c.s.userAgent())
  51663. if c.ifNoneMatch_ != "" {
  51664. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51665. }
  51666. var body io.Reader = nil
  51667. c.urlParams_.Set("alt", alt)
  51668. c.urlParams_.Set("prettyPrint", "false")
  51669. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}")
  51670. urls += "?" + c.urlParams_.Encode()
  51671. req, err := http.NewRequest("GET", urls, body)
  51672. if err != nil {
  51673. return nil, err
  51674. }
  51675. req.Header = reqHeaders
  51676. googleapi.Expand(req.URL, map[string]string{
  51677. "project": c.project,
  51678. "zone": c.zone,
  51679. "instance": c.instance,
  51680. })
  51681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51682. }
  51683. // Do executes the "compute.instances.get" call.
  51684. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  51685. // code is an error. Response headers are in either
  51686. // *Instance.ServerResponse.Header or (if a response was returned at
  51687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  51688. // to check whether the returned error was because
  51689. // http.StatusNotModified was returned.
  51690. func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  51691. gensupport.SetOptions(c.urlParams_, opts...)
  51692. res, err := c.doRequest("json")
  51693. if res != nil && res.StatusCode == http.StatusNotModified {
  51694. if res.Body != nil {
  51695. res.Body.Close()
  51696. }
  51697. return nil, &googleapi.Error{
  51698. Code: res.StatusCode,
  51699. Header: res.Header,
  51700. }
  51701. }
  51702. if err != nil {
  51703. return nil, err
  51704. }
  51705. defer googleapi.CloseBody(res)
  51706. if err := googleapi.CheckResponse(res); err != nil {
  51707. return nil, err
  51708. }
  51709. ret := &Instance{
  51710. ServerResponse: googleapi.ServerResponse{
  51711. Header: res.Header,
  51712. HTTPStatusCode: res.StatusCode,
  51713. },
  51714. }
  51715. target := &ret
  51716. if err := gensupport.DecodeResponse(target, res); err != nil {
  51717. return nil, err
  51718. }
  51719. return ret, nil
  51720. // {
  51721. // "description": "Returns the specified Instance resource. Gets a list of available instances by making a list() request.",
  51722. // "httpMethod": "GET",
  51723. // "id": "compute.instances.get",
  51724. // "parameterOrder": [
  51725. // "project",
  51726. // "zone",
  51727. // "instance"
  51728. // ],
  51729. // "parameters": {
  51730. // "instance": {
  51731. // "description": "Name of the instance resource to return.",
  51732. // "location": "path",
  51733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51734. // "required": true,
  51735. // "type": "string"
  51736. // },
  51737. // "project": {
  51738. // "description": "Project ID for this request.",
  51739. // "location": "path",
  51740. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51741. // "required": true,
  51742. // "type": "string"
  51743. // },
  51744. // "zone": {
  51745. // "description": "The name of the zone for this request.",
  51746. // "location": "path",
  51747. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51748. // "required": true,
  51749. // "type": "string"
  51750. // }
  51751. // },
  51752. // "path": "{project}/zones/{zone}/instances/{instance}",
  51753. // "response": {
  51754. // "$ref": "Instance"
  51755. // },
  51756. // "scopes": [
  51757. // "https://www.googleapis.com/auth/cloud-platform",
  51758. // "https://www.googleapis.com/auth/compute",
  51759. // "https://www.googleapis.com/auth/compute.readonly"
  51760. // ]
  51761. // }
  51762. }
  51763. // method id "compute.instances.getIamPolicy":
  51764. type InstancesGetIamPolicyCall struct {
  51765. s *Service
  51766. project string
  51767. zone string
  51768. resource string
  51769. urlParams_ gensupport.URLParams
  51770. ifNoneMatch_ string
  51771. ctx_ context.Context
  51772. header_ http.Header
  51773. }
  51774. // GetIamPolicy: Gets the access control policy for a resource. May be
  51775. // empty if no such policy or resource exists.
  51776. func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall {
  51777. c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51778. c.project = project
  51779. c.zone = zone
  51780. c.resource = resource
  51781. return c
  51782. }
  51783. // Fields allows partial responses to be retrieved. See
  51784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51785. // for more information.
  51786. func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall {
  51787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51788. return c
  51789. }
  51790. // IfNoneMatch sets the optional parameter which makes the operation
  51791. // fail if the object's ETag matches the given value. This is useful for
  51792. // getting updates only after the object has changed since the last
  51793. // request. Use googleapi.IsNotModified to check whether the response
  51794. // error from Do is the result of In-None-Match.
  51795. func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall {
  51796. c.ifNoneMatch_ = entityTag
  51797. return c
  51798. }
  51799. // Context sets the context to be used in this call's Do method. Any
  51800. // pending HTTP request will be aborted if the provided context is
  51801. // canceled.
  51802. func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall {
  51803. c.ctx_ = ctx
  51804. return c
  51805. }
  51806. // Header returns an http.Header that can be modified by the caller to
  51807. // add HTTP headers to the request.
  51808. func (c *InstancesGetIamPolicyCall) Header() http.Header {
  51809. if c.header_ == nil {
  51810. c.header_ = make(http.Header)
  51811. }
  51812. return c.header_
  51813. }
  51814. func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  51815. reqHeaders := make(http.Header)
  51816. for k, v := range c.header_ {
  51817. reqHeaders[k] = v
  51818. }
  51819. reqHeaders.Set("User-Agent", c.s.userAgent())
  51820. if c.ifNoneMatch_ != "" {
  51821. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51822. }
  51823. var body io.Reader = nil
  51824. c.urlParams_.Set("alt", alt)
  51825. c.urlParams_.Set("prettyPrint", "false")
  51826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/getIamPolicy")
  51827. urls += "?" + c.urlParams_.Encode()
  51828. req, err := http.NewRequest("GET", urls, body)
  51829. if err != nil {
  51830. return nil, err
  51831. }
  51832. req.Header = reqHeaders
  51833. googleapi.Expand(req.URL, map[string]string{
  51834. "project": c.project,
  51835. "zone": c.zone,
  51836. "resource": c.resource,
  51837. })
  51838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  51839. }
  51840. // Do executes the "compute.instances.getIamPolicy" call.
  51841. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  51842. // code is an error. Response headers are in either
  51843. // *Policy.ServerResponse.Header or (if a response was returned at all)
  51844. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  51845. // check whether the returned error was because http.StatusNotModified
  51846. // was returned.
  51847. func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  51848. gensupport.SetOptions(c.urlParams_, opts...)
  51849. res, err := c.doRequest("json")
  51850. if res != nil && res.StatusCode == http.StatusNotModified {
  51851. if res.Body != nil {
  51852. res.Body.Close()
  51853. }
  51854. return nil, &googleapi.Error{
  51855. Code: res.StatusCode,
  51856. Header: res.Header,
  51857. }
  51858. }
  51859. if err != nil {
  51860. return nil, err
  51861. }
  51862. defer googleapi.CloseBody(res)
  51863. if err := googleapi.CheckResponse(res); err != nil {
  51864. return nil, err
  51865. }
  51866. ret := &Policy{
  51867. ServerResponse: googleapi.ServerResponse{
  51868. Header: res.Header,
  51869. HTTPStatusCode: res.StatusCode,
  51870. },
  51871. }
  51872. target := &ret
  51873. if err := gensupport.DecodeResponse(target, res); err != nil {
  51874. return nil, err
  51875. }
  51876. return ret, nil
  51877. // {
  51878. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  51879. // "httpMethod": "GET",
  51880. // "id": "compute.instances.getIamPolicy",
  51881. // "parameterOrder": [
  51882. // "project",
  51883. // "zone",
  51884. // "resource"
  51885. // ],
  51886. // "parameters": {
  51887. // "project": {
  51888. // "description": "Project ID for this request.",
  51889. // "location": "path",
  51890. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  51891. // "required": true,
  51892. // "type": "string"
  51893. // },
  51894. // "resource": {
  51895. // "description": "Name or id of the resource for this request.",
  51896. // "location": "path",
  51897. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  51898. // "required": true,
  51899. // "type": "string"
  51900. // },
  51901. // "zone": {
  51902. // "description": "The name of the zone for this request.",
  51903. // "location": "path",
  51904. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  51905. // "required": true,
  51906. // "type": "string"
  51907. // }
  51908. // },
  51909. // "path": "{project}/zones/{zone}/instances/{resource}/getIamPolicy",
  51910. // "response": {
  51911. // "$ref": "Policy"
  51912. // },
  51913. // "scopes": [
  51914. // "https://www.googleapis.com/auth/cloud-platform",
  51915. // "https://www.googleapis.com/auth/compute",
  51916. // "https://www.googleapis.com/auth/compute.readonly"
  51917. // ]
  51918. // }
  51919. }
  51920. // method id "compute.instances.getSerialPortOutput":
  51921. type InstancesGetSerialPortOutputCall struct {
  51922. s *Service
  51923. project string
  51924. zone string
  51925. instance string
  51926. urlParams_ gensupport.URLParams
  51927. ifNoneMatch_ string
  51928. ctx_ context.Context
  51929. header_ http.Header
  51930. }
  51931. // GetSerialPortOutput: Returns the last 1 MB of serial port output from
  51932. // the specified instance.
  51933. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput
  51934. func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall {
  51935. c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  51936. c.project = project
  51937. c.zone = zone
  51938. c.instance = instance
  51939. return c
  51940. }
  51941. // Port sets the optional parameter "port": Specifies which COM or
  51942. // serial port to retrieve data from.
  51943. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall {
  51944. c.urlParams_.Set("port", fmt.Sprint(port))
  51945. return c
  51946. }
  51947. // Start sets the optional parameter "start": Returns output starting
  51948. // from a specific byte position. Use this to page through output when
  51949. // the output is too large to return in a single request. For the
  51950. // initial request, leave this field unspecified. For subsequent calls,
  51951. // this field should be set to the next value returned in the previous
  51952. // call.
  51953. func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall {
  51954. c.urlParams_.Set("start", fmt.Sprint(start))
  51955. return c
  51956. }
  51957. // Fields allows partial responses to be retrieved. See
  51958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  51959. // for more information.
  51960. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall {
  51961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  51962. return c
  51963. }
  51964. // IfNoneMatch sets the optional parameter which makes the operation
  51965. // fail if the object's ETag matches the given value. This is useful for
  51966. // getting updates only after the object has changed since the last
  51967. // request. Use googleapi.IsNotModified to check whether the response
  51968. // error from Do is the result of In-None-Match.
  51969. func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall {
  51970. c.ifNoneMatch_ = entityTag
  51971. return c
  51972. }
  51973. // Context sets the context to be used in this call's Do method. Any
  51974. // pending HTTP request will be aborted if the provided context is
  51975. // canceled.
  51976. func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall {
  51977. c.ctx_ = ctx
  51978. return c
  51979. }
  51980. // Header returns an http.Header that can be modified by the caller to
  51981. // add HTTP headers to the request.
  51982. func (c *InstancesGetSerialPortOutputCall) Header() http.Header {
  51983. if c.header_ == nil {
  51984. c.header_ = make(http.Header)
  51985. }
  51986. return c.header_
  51987. }
  51988. func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) {
  51989. reqHeaders := make(http.Header)
  51990. for k, v := range c.header_ {
  51991. reqHeaders[k] = v
  51992. }
  51993. reqHeaders.Set("User-Agent", c.s.userAgent())
  51994. if c.ifNoneMatch_ != "" {
  51995. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  51996. }
  51997. var body io.Reader = nil
  51998. c.urlParams_.Set("alt", alt)
  51999. c.urlParams_.Set("prettyPrint", "false")
  52000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort")
  52001. urls += "?" + c.urlParams_.Encode()
  52002. req, err := http.NewRequest("GET", urls, body)
  52003. if err != nil {
  52004. return nil, err
  52005. }
  52006. req.Header = reqHeaders
  52007. googleapi.Expand(req.URL, map[string]string{
  52008. "project": c.project,
  52009. "zone": c.zone,
  52010. "instance": c.instance,
  52011. })
  52012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52013. }
  52014. // Do executes the "compute.instances.getSerialPortOutput" call.
  52015. // Exactly one of *SerialPortOutput or error will be non-nil. Any
  52016. // non-2xx status code is an error. Response headers are in either
  52017. // *SerialPortOutput.ServerResponse.Header or (if a response was
  52018. // returned at all) in error.(*googleapi.Error).Header. Use
  52019. // googleapi.IsNotModified to check whether the returned error was
  52020. // because http.StatusNotModified was returned.
  52021. func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) {
  52022. gensupport.SetOptions(c.urlParams_, opts...)
  52023. res, err := c.doRequest("json")
  52024. if res != nil && res.StatusCode == http.StatusNotModified {
  52025. if res.Body != nil {
  52026. res.Body.Close()
  52027. }
  52028. return nil, &googleapi.Error{
  52029. Code: res.StatusCode,
  52030. Header: res.Header,
  52031. }
  52032. }
  52033. if err != nil {
  52034. return nil, err
  52035. }
  52036. defer googleapi.CloseBody(res)
  52037. if err := googleapi.CheckResponse(res); err != nil {
  52038. return nil, err
  52039. }
  52040. ret := &SerialPortOutput{
  52041. ServerResponse: googleapi.ServerResponse{
  52042. Header: res.Header,
  52043. HTTPStatusCode: res.StatusCode,
  52044. },
  52045. }
  52046. target := &ret
  52047. if err := gensupport.DecodeResponse(target, res); err != nil {
  52048. return nil, err
  52049. }
  52050. return ret, nil
  52051. // {
  52052. // "description": "Returns the last 1 MB of serial port output from the specified instance.",
  52053. // "httpMethod": "GET",
  52054. // "id": "compute.instances.getSerialPortOutput",
  52055. // "parameterOrder": [
  52056. // "project",
  52057. // "zone",
  52058. // "instance"
  52059. // ],
  52060. // "parameters": {
  52061. // "instance": {
  52062. // "description": "Name of the instance scoping this request.",
  52063. // "location": "path",
  52064. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52065. // "required": true,
  52066. // "type": "string"
  52067. // },
  52068. // "port": {
  52069. // "default": "1",
  52070. // "description": "Specifies which COM or serial port to retrieve data from.",
  52071. // "format": "int32",
  52072. // "location": "query",
  52073. // "maximum": "4",
  52074. // "minimum": "1",
  52075. // "type": "integer"
  52076. // },
  52077. // "project": {
  52078. // "description": "Project ID for this request.",
  52079. // "location": "path",
  52080. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52081. // "required": true,
  52082. // "type": "string"
  52083. // },
  52084. // "start": {
  52085. // "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.",
  52086. // "format": "int64",
  52087. // "location": "query",
  52088. // "type": "string"
  52089. // },
  52090. // "zone": {
  52091. // "description": "The name of the zone for this request.",
  52092. // "location": "path",
  52093. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52094. // "required": true,
  52095. // "type": "string"
  52096. // }
  52097. // },
  52098. // "path": "{project}/zones/{zone}/instances/{instance}/serialPort",
  52099. // "response": {
  52100. // "$ref": "SerialPortOutput"
  52101. // },
  52102. // "scopes": [
  52103. // "https://www.googleapis.com/auth/cloud-platform",
  52104. // "https://www.googleapis.com/auth/compute",
  52105. // "https://www.googleapis.com/auth/compute.readonly"
  52106. // ]
  52107. // }
  52108. }
  52109. // method id "compute.instances.getShieldedInstanceIdentity":
  52110. type InstancesGetShieldedInstanceIdentityCall struct {
  52111. s *Service
  52112. project string
  52113. zone string
  52114. instance string
  52115. urlParams_ gensupport.URLParams
  52116. ifNoneMatch_ string
  52117. ctx_ context.Context
  52118. header_ http.Header
  52119. }
  52120. // GetShieldedInstanceIdentity: Returns the Shielded Instance Identity
  52121. // of an instance
  52122. func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone string, instance string) *InstancesGetShieldedInstanceIdentityCall {
  52123. c := &InstancesGetShieldedInstanceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52124. c.project = project
  52125. c.zone = zone
  52126. c.instance = instance
  52127. return c
  52128. }
  52129. // Fields allows partial responses to be retrieved. See
  52130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52131. // for more information.
  52132. func (c *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedInstanceIdentityCall {
  52133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52134. return c
  52135. }
  52136. // IfNoneMatch sets the optional parameter which makes the operation
  52137. // fail if the object's ETag matches the given value. This is useful for
  52138. // getting updates only after the object has changed since the last
  52139. // request. Use googleapi.IsNotModified to check whether the response
  52140. // error from Do is the result of In-None-Match.
  52141. func (c *InstancesGetShieldedInstanceIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedInstanceIdentityCall {
  52142. c.ifNoneMatch_ = entityTag
  52143. return c
  52144. }
  52145. // Context sets the context to be used in this call's Do method. Any
  52146. // pending HTTP request will be aborted if the provided context is
  52147. // canceled.
  52148. func (c *InstancesGetShieldedInstanceIdentityCall) Context(ctx context.Context) *InstancesGetShieldedInstanceIdentityCall {
  52149. c.ctx_ = ctx
  52150. return c
  52151. }
  52152. // Header returns an http.Header that can be modified by the caller to
  52153. // add HTTP headers to the request.
  52154. func (c *InstancesGetShieldedInstanceIdentityCall) Header() http.Header {
  52155. if c.header_ == nil {
  52156. c.header_ = make(http.Header)
  52157. }
  52158. return c.header_
  52159. }
  52160. func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http.Response, error) {
  52161. reqHeaders := make(http.Header)
  52162. for k, v := range c.header_ {
  52163. reqHeaders[k] = v
  52164. }
  52165. reqHeaders.Set("User-Agent", c.s.userAgent())
  52166. if c.ifNoneMatch_ != "" {
  52167. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52168. }
  52169. var body io.Reader = nil
  52170. c.urlParams_.Set("alt", alt)
  52171. c.urlParams_.Set("prettyPrint", "false")
  52172. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity")
  52173. urls += "?" + c.urlParams_.Encode()
  52174. req, err := http.NewRequest("GET", urls, body)
  52175. if err != nil {
  52176. return nil, err
  52177. }
  52178. req.Header = reqHeaders
  52179. googleapi.Expand(req.URL, map[string]string{
  52180. "project": c.project,
  52181. "zone": c.zone,
  52182. "instance": c.instance,
  52183. })
  52184. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52185. }
  52186. // Do executes the "compute.instances.getShieldedInstanceIdentity" call.
  52187. // Exactly one of *ShieldedInstanceIdentity or error will be non-nil.
  52188. // Any non-2xx status code is an error. Response headers are in either
  52189. // *ShieldedInstanceIdentity.ServerResponse.Header or (if a response was
  52190. // returned at all) in error.(*googleapi.Error).Header. Use
  52191. // googleapi.IsNotModified to check whether the returned error was
  52192. // because http.StatusNotModified was returned.
  52193. func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedInstanceIdentity, error) {
  52194. gensupport.SetOptions(c.urlParams_, opts...)
  52195. res, err := c.doRequest("json")
  52196. if res != nil && res.StatusCode == http.StatusNotModified {
  52197. if res.Body != nil {
  52198. res.Body.Close()
  52199. }
  52200. return nil, &googleapi.Error{
  52201. Code: res.StatusCode,
  52202. Header: res.Header,
  52203. }
  52204. }
  52205. if err != nil {
  52206. return nil, err
  52207. }
  52208. defer googleapi.CloseBody(res)
  52209. if err := googleapi.CheckResponse(res); err != nil {
  52210. return nil, err
  52211. }
  52212. ret := &ShieldedInstanceIdentity{
  52213. ServerResponse: googleapi.ServerResponse{
  52214. Header: res.Header,
  52215. HTTPStatusCode: res.StatusCode,
  52216. },
  52217. }
  52218. target := &ret
  52219. if err := gensupport.DecodeResponse(target, res); err != nil {
  52220. return nil, err
  52221. }
  52222. return ret, nil
  52223. // {
  52224. // "description": "Returns the Shielded Instance Identity of an instance",
  52225. // "httpMethod": "GET",
  52226. // "id": "compute.instances.getShieldedInstanceIdentity",
  52227. // "parameterOrder": [
  52228. // "project",
  52229. // "zone",
  52230. // "instance"
  52231. // ],
  52232. // "parameters": {
  52233. // "instance": {
  52234. // "description": "Name or id of the instance scoping this request.",
  52235. // "location": "path",
  52236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52237. // "required": true,
  52238. // "type": "string"
  52239. // },
  52240. // "project": {
  52241. // "description": "Project ID for this request.",
  52242. // "location": "path",
  52243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52244. // "required": true,
  52245. // "type": "string"
  52246. // },
  52247. // "zone": {
  52248. // "description": "The name of the zone for this request.",
  52249. // "location": "path",
  52250. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52251. // "required": true,
  52252. // "type": "string"
  52253. // }
  52254. // },
  52255. // "path": "{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity",
  52256. // "response": {
  52257. // "$ref": "ShieldedInstanceIdentity"
  52258. // },
  52259. // "scopes": [
  52260. // "https://www.googleapis.com/auth/cloud-platform",
  52261. // "https://www.googleapis.com/auth/compute",
  52262. // "https://www.googleapis.com/auth/compute.readonly"
  52263. // ]
  52264. // }
  52265. }
  52266. // method id "compute.instances.insert":
  52267. type InstancesInsertCall struct {
  52268. s *Service
  52269. project string
  52270. zone string
  52271. instance *Instance
  52272. urlParams_ gensupport.URLParams
  52273. ctx_ context.Context
  52274. header_ http.Header
  52275. }
  52276. // Insert: Creates an instance resource in the specified project using
  52277. // the data included in the request.
  52278. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert
  52279. func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall {
  52280. c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52281. c.project = project
  52282. c.zone = zone
  52283. c.instance = instance
  52284. return c
  52285. }
  52286. // RequestId sets the optional parameter "requestId": An optional
  52287. // request ID to identify requests. Specify a unique request ID so that
  52288. // if you must retry your request, the server will know to ignore the
  52289. // request if it has already been completed.
  52290. //
  52291. // For example, consider a situation where you make an initial request
  52292. // and the request times out. If you make the request again with the
  52293. // same request ID, the server can check if original operation with the
  52294. // same request ID was received, and if so, will ignore the second
  52295. // request. This prevents clients from accidentally creating duplicate
  52296. // commitments.
  52297. //
  52298. // The request ID must be a valid UUID with the exception that zero UUID
  52299. // is not supported (00000000-0000-0000-0000-000000000000).
  52300. func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall {
  52301. c.urlParams_.Set("requestId", requestId)
  52302. return c
  52303. }
  52304. // SourceInstanceTemplate sets the optional parameter
  52305. // "sourceInstanceTemplate": Specifies instance template to create the
  52306. // instance.
  52307. //
  52308. // This field is optional. It can be a full or partial URL. For example,
  52309. // the following are all valid URLs to an instance template:
  52310. // -
  52311. // https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
  52312. // - projects/project/global/instanceTemplates/instanceTemplate
  52313. // - global/instanceTemplates/instanceTemplate
  52314. func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall {
  52315. c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate)
  52316. return c
  52317. }
  52318. // Fields allows partial responses to be retrieved. See
  52319. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52320. // for more information.
  52321. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall {
  52322. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52323. return c
  52324. }
  52325. // Context sets the context to be used in this call's Do method. Any
  52326. // pending HTTP request will be aborted if the provided context is
  52327. // canceled.
  52328. func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall {
  52329. c.ctx_ = ctx
  52330. return c
  52331. }
  52332. // Header returns an http.Header that can be modified by the caller to
  52333. // add HTTP headers to the request.
  52334. func (c *InstancesInsertCall) Header() http.Header {
  52335. if c.header_ == nil {
  52336. c.header_ = make(http.Header)
  52337. }
  52338. return c.header_
  52339. }
  52340. func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  52341. reqHeaders := make(http.Header)
  52342. for k, v := range c.header_ {
  52343. reqHeaders[k] = v
  52344. }
  52345. reqHeaders.Set("User-Agent", c.s.userAgent())
  52346. var body io.Reader = nil
  52347. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  52348. if err != nil {
  52349. return nil, err
  52350. }
  52351. reqHeaders.Set("Content-Type", "application/json")
  52352. c.urlParams_.Set("alt", alt)
  52353. c.urlParams_.Set("prettyPrint", "false")
  52354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  52355. urls += "?" + c.urlParams_.Encode()
  52356. req, err := http.NewRequest("POST", urls, body)
  52357. if err != nil {
  52358. return nil, err
  52359. }
  52360. req.Header = reqHeaders
  52361. googleapi.Expand(req.URL, map[string]string{
  52362. "project": c.project,
  52363. "zone": c.zone,
  52364. })
  52365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52366. }
  52367. // Do executes the "compute.instances.insert" call.
  52368. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  52369. // status code is an error. Response headers are in either
  52370. // *Operation.ServerResponse.Header or (if a response was returned at
  52371. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52372. // to check whether the returned error was because
  52373. // http.StatusNotModified was returned.
  52374. func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  52375. gensupport.SetOptions(c.urlParams_, opts...)
  52376. res, err := c.doRequest("json")
  52377. if res != nil && res.StatusCode == http.StatusNotModified {
  52378. if res.Body != nil {
  52379. res.Body.Close()
  52380. }
  52381. return nil, &googleapi.Error{
  52382. Code: res.StatusCode,
  52383. Header: res.Header,
  52384. }
  52385. }
  52386. if err != nil {
  52387. return nil, err
  52388. }
  52389. defer googleapi.CloseBody(res)
  52390. if err := googleapi.CheckResponse(res); err != nil {
  52391. return nil, err
  52392. }
  52393. ret := &Operation{
  52394. ServerResponse: googleapi.ServerResponse{
  52395. Header: res.Header,
  52396. HTTPStatusCode: res.StatusCode,
  52397. },
  52398. }
  52399. target := &ret
  52400. if err := gensupport.DecodeResponse(target, res); err != nil {
  52401. return nil, err
  52402. }
  52403. return ret, nil
  52404. // {
  52405. // "description": "Creates an instance resource in the specified project using the data included in the request.",
  52406. // "httpMethod": "POST",
  52407. // "id": "compute.instances.insert",
  52408. // "parameterOrder": [
  52409. // "project",
  52410. // "zone"
  52411. // ],
  52412. // "parameters": {
  52413. // "project": {
  52414. // "description": "Project ID for this request.",
  52415. // "location": "path",
  52416. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52417. // "required": true,
  52418. // "type": "string"
  52419. // },
  52420. // "requestId": {
  52421. // "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).",
  52422. // "location": "query",
  52423. // "type": "string"
  52424. // },
  52425. // "sourceInstanceTemplate": {
  52426. // "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",
  52427. // "location": "query",
  52428. // "type": "string"
  52429. // },
  52430. // "zone": {
  52431. // "description": "The name of the zone for this request.",
  52432. // "location": "path",
  52433. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52434. // "required": true,
  52435. // "type": "string"
  52436. // }
  52437. // },
  52438. // "path": "{project}/zones/{zone}/instances",
  52439. // "request": {
  52440. // "$ref": "Instance"
  52441. // },
  52442. // "response": {
  52443. // "$ref": "Operation"
  52444. // },
  52445. // "scopes": [
  52446. // "https://www.googleapis.com/auth/cloud-platform",
  52447. // "https://www.googleapis.com/auth/compute"
  52448. // ]
  52449. // }
  52450. }
  52451. // method id "compute.instances.list":
  52452. type InstancesListCall struct {
  52453. s *Service
  52454. project string
  52455. zone string
  52456. urlParams_ gensupport.URLParams
  52457. ifNoneMatch_ string
  52458. ctx_ context.Context
  52459. header_ http.Header
  52460. }
  52461. // List: Retrieves the list of instances contained within the specified
  52462. // zone.
  52463. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list
  52464. func (r *InstancesService) List(project string, zone string) *InstancesListCall {
  52465. c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52466. c.project = project
  52467. c.zone = zone
  52468. return c
  52469. }
  52470. // Filter sets the optional parameter "filter": A filter expression that
  52471. // filters resources listed in the response. The expression must specify
  52472. // the field name, a comparison operator, and the value that you want to
  52473. // use for filtering. The value must be a string, a number, or a
  52474. // boolean. The comparison operator must be either =, !=, >, or <.
  52475. //
  52476. // For example, if you are filtering Compute Engine instances, you can
  52477. // exclude instances named example-instance by specifying name !=
  52478. // example-instance.
  52479. //
  52480. // You can also filter nested fields. For example, you could specify
  52481. // scheduling.automaticRestart = false to include instances only if they
  52482. // are not scheduled for automatic restarts. You can use filtering on
  52483. // nested fields to filter based on resource labels.
  52484. //
  52485. // To filter on multiple expressions, provide each separate expression
  52486. // within parentheses. For example, (scheduling.automaticRestart = true)
  52487. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52488. // AND expression. However, you can include AND and OR expressions
  52489. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52490. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52491. // true).
  52492. func (c *InstancesListCall) Filter(filter string) *InstancesListCall {
  52493. c.urlParams_.Set("filter", filter)
  52494. return c
  52495. }
  52496. // MaxResults sets the optional parameter "maxResults": The maximum
  52497. // number of results per page that should be returned. If the number of
  52498. // available results is larger than maxResults, Compute Engine returns a
  52499. // nextPageToken that can be used to get the next page of results in
  52500. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52501. // (Default: 500)
  52502. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall {
  52503. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52504. return c
  52505. }
  52506. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52507. // a certain order. By default, results are returned in alphanumerical
  52508. // order based on the resource name.
  52509. //
  52510. // You can also sort results in descending order based on the creation
  52511. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52512. // based on the creationTimestamp field in reverse chronological order
  52513. // (newest result first). Use this to sort resources like operations so
  52514. // that the newest operation is returned first.
  52515. //
  52516. // Currently, only sorting by name or creationTimestamp desc is
  52517. // supported.
  52518. func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall {
  52519. c.urlParams_.Set("orderBy", orderBy)
  52520. return c
  52521. }
  52522. // PageToken sets the optional parameter "pageToken": Specifies a page
  52523. // token to use. Set pageToken to the nextPageToken returned by a
  52524. // previous list request to get the next page of results.
  52525. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall {
  52526. c.urlParams_.Set("pageToken", pageToken)
  52527. return c
  52528. }
  52529. // Fields allows partial responses to be retrieved. See
  52530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52531. // for more information.
  52532. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall {
  52533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52534. return c
  52535. }
  52536. // IfNoneMatch sets the optional parameter which makes the operation
  52537. // fail if the object's ETag matches the given value. This is useful for
  52538. // getting updates only after the object has changed since the last
  52539. // request. Use googleapi.IsNotModified to check whether the response
  52540. // error from Do is the result of In-None-Match.
  52541. func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall {
  52542. c.ifNoneMatch_ = entityTag
  52543. return c
  52544. }
  52545. // Context sets the context to be used in this call's Do method. Any
  52546. // pending HTTP request will be aborted if the provided context is
  52547. // canceled.
  52548. func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall {
  52549. c.ctx_ = ctx
  52550. return c
  52551. }
  52552. // Header returns an http.Header that can be modified by the caller to
  52553. // add HTTP headers to the request.
  52554. func (c *InstancesListCall) Header() http.Header {
  52555. if c.header_ == nil {
  52556. c.header_ = make(http.Header)
  52557. }
  52558. return c.header_
  52559. }
  52560. func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) {
  52561. reqHeaders := make(http.Header)
  52562. for k, v := range c.header_ {
  52563. reqHeaders[k] = v
  52564. }
  52565. reqHeaders.Set("User-Agent", c.s.userAgent())
  52566. if c.ifNoneMatch_ != "" {
  52567. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52568. }
  52569. var body io.Reader = nil
  52570. c.urlParams_.Set("alt", alt)
  52571. c.urlParams_.Set("prettyPrint", "false")
  52572. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances")
  52573. urls += "?" + c.urlParams_.Encode()
  52574. req, err := http.NewRequest("GET", urls, body)
  52575. if err != nil {
  52576. return nil, err
  52577. }
  52578. req.Header = reqHeaders
  52579. googleapi.Expand(req.URL, map[string]string{
  52580. "project": c.project,
  52581. "zone": c.zone,
  52582. })
  52583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52584. }
  52585. // Do executes the "compute.instances.list" call.
  52586. // Exactly one of *InstanceList or error will be non-nil. Any non-2xx
  52587. // status code is an error. Response headers are in either
  52588. // *InstanceList.ServerResponse.Header or (if a response was returned at
  52589. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  52590. // to check whether the returned error was because
  52591. // http.StatusNotModified was returned.
  52592. func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) {
  52593. gensupport.SetOptions(c.urlParams_, opts...)
  52594. res, err := c.doRequest("json")
  52595. if res != nil && res.StatusCode == http.StatusNotModified {
  52596. if res.Body != nil {
  52597. res.Body.Close()
  52598. }
  52599. return nil, &googleapi.Error{
  52600. Code: res.StatusCode,
  52601. Header: res.Header,
  52602. }
  52603. }
  52604. if err != nil {
  52605. return nil, err
  52606. }
  52607. defer googleapi.CloseBody(res)
  52608. if err := googleapi.CheckResponse(res); err != nil {
  52609. return nil, err
  52610. }
  52611. ret := &InstanceList{
  52612. ServerResponse: googleapi.ServerResponse{
  52613. Header: res.Header,
  52614. HTTPStatusCode: res.StatusCode,
  52615. },
  52616. }
  52617. target := &ret
  52618. if err := gensupport.DecodeResponse(target, res); err != nil {
  52619. return nil, err
  52620. }
  52621. return ret, nil
  52622. // {
  52623. // "description": "Retrieves the list of instances contained within the specified zone.",
  52624. // "httpMethod": "GET",
  52625. // "id": "compute.instances.list",
  52626. // "parameterOrder": [
  52627. // "project",
  52628. // "zone"
  52629. // ],
  52630. // "parameters": {
  52631. // "filter": {
  52632. // "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).",
  52633. // "location": "query",
  52634. // "type": "string"
  52635. // },
  52636. // "maxResults": {
  52637. // "default": "500",
  52638. // "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)",
  52639. // "format": "uint32",
  52640. // "location": "query",
  52641. // "minimum": "0",
  52642. // "type": "integer"
  52643. // },
  52644. // "orderBy": {
  52645. // "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.",
  52646. // "location": "query",
  52647. // "type": "string"
  52648. // },
  52649. // "pageToken": {
  52650. // "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.",
  52651. // "location": "query",
  52652. // "type": "string"
  52653. // },
  52654. // "project": {
  52655. // "description": "Project ID for this request.",
  52656. // "location": "path",
  52657. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52658. // "required": true,
  52659. // "type": "string"
  52660. // },
  52661. // "zone": {
  52662. // "description": "The name of the zone for this request.",
  52663. // "location": "path",
  52664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52665. // "required": true,
  52666. // "type": "string"
  52667. // }
  52668. // },
  52669. // "path": "{project}/zones/{zone}/instances",
  52670. // "response": {
  52671. // "$ref": "InstanceList"
  52672. // },
  52673. // "scopes": [
  52674. // "https://www.googleapis.com/auth/cloud-platform",
  52675. // "https://www.googleapis.com/auth/compute",
  52676. // "https://www.googleapis.com/auth/compute.readonly"
  52677. // ]
  52678. // }
  52679. }
  52680. // Pages invokes f for each page of results.
  52681. // A non-nil error returned from f will halt the iteration.
  52682. // The provided context supersedes any context provided to the Context method.
  52683. func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error {
  52684. c.ctx_ = ctx
  52685. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52686. for {
  52687. x, err := c.Do()
  52688. if err != nil {
  52689. return err
  52690. }
  52691. if err := f(x); err != nil {
  52692. return err
  52693. }
  52694. if x.NextPageToken == "" {
  52695. return nil
  52696. }
  52697. c.PageToken(x.NextPageToken)
  52698. }
  52699. }
  52700. // method id "compute.instances.listReferrers":
  52701. type InstancesListReferrersCall struct {
  52702. s *Service
  52703. project string
  52704. zone string
  52705. instance string
  52706. urlParams_ gensupport.URLParams
  52707. ifNoneMatch_ string
  52708. ctx_ context.Context
  52709. header_ http.Header
  52710. }
  52711. // ListReferrers: Retrieves the list of referrers to instances contained
  52712. // within the specified zone. For more information, read Viewing
  52713. // Referrers to VM Instances.
  52714. func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall {
  52715. c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52716. c.project = project
  52717. c.zone = zone
  52718. c.instance = instance
  52719. return c
  52720. }
  52721. // Filter sets the optional parameter "filter": A filter expression that
  52722. // filters resources listed in the response. The expression must specify
  52723. // the field name, a comparison operator, and the value that you want to
  52724. // use for filtering. The value must be a string, a number, or a
  52725. // boolean. The comparison operator must be either =, !=, >, or <.
  52726. //
  52727. // For example, if you are filtering Compute Engine instances, you can
  52728. // exclude instances named example-instance by specifying name !=
  52729. // example-instance.
  52730. //
  52731. // You can also filter nested fields. For example, you could specify
  52732. // scheduling.automaticRestart = false to include instances only if they
  52733. // are not scheduled for automatic restarts. You can use filtering on
  52734. // nested fields to filter based on resource labels.
  52735. //
  52736. // To filter on multiple expressions, provide each separate expression
  52737. // within parentheses. For example, (scheduling.automaticRestart = true)
  52738. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  52739. // AND expression. However, you can include AND and OR expressions
  52740. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  52741. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  52742. // true).
  52743. func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall {
  52744. c.urlParams_.Set("filter", filter)
  52745. return c
  52746. }
  52747. // MaxResults sets the optional parameter "maxResults": The maximum
  52748. // number of results per page that should be returned. If the number of
  52749. // available results is larger than maxResults, Compute Engine returns a
  52750. // nextPageToken that can be used to get the next page of results in
  52751. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  52752. // (Default: 500)
  52753. func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall {
  52754. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  52755. return c
  52756. }
  52757. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  52758. // a certain order. By default, results are returned in alphanumerical
  52759. // order based on the resource name.
  52760. //
  52761. // You can also sort results in descending order based on the creation
  52762. // timestamp using orderBy="creationTimestamp desc". This sorts results
  52763. // based on the creationTimestamp field in reverse chronological order
  52764. // (newest result first). Use this to sort resources like operations so
  52765. // that the newest operation is returned first.
  52766. //
  52767. // Currently, only sorting by name or creationTimestamp desc is
  52768. // supported.
  52769. func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall {
  52770. c.urlParams_.Set("orderBy", orderBy)
  52771. return c
  52772. }
  52773. // PageToken sets the optional parameter "pageToken": Specifies a page
  52774. // token to use. Set pageToken to the nextPageToken returned by a
  52775. // previous list request to get the next page of results.
  52776. func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall {
  52777. c.urlParams_.Set("pageToken", pageToken)
  52778. return c
  52779. }
  52780. // Fields allows partial responses to be retrieved. See
  52781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  52782. // for more information.
  52783. func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall {
  52784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  52785. return c
  52786. }
  52787. // IfNoneMatch sets the optional parameter which makes the operation
  52788. // fail if the object's ETag matches the given value. This is useful for
  52789. // getting updates only after the object has changed since the last
  52790. // request. Use googleapi.IsNotModified to check whether the response
  52791. // error from Do is the result of In-None-Match.
  52792. func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall {
  52793. c.ifNoneMatch_ = entityTag
  52794. return c
  52795. }
  52796. // Context sets the context to be used in this call's Do method. Any
  52797. // pending HTTP request will be aborted if the provided context is
  52798. // canceled.
  52799. func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall {
  52800. c.ctx_ = ctx
  52801. return c
  52802. }
  52803. // Header returns an http.Header that can be modified by the caller to
  52804. // add HTTP headers to the request.
  52805. func (c *InstancesListReferrersCall) Header() http.Header {
  52806. if c.header_ == nil {
  52807. c.header_ = make(http.Header)
  52808. }
  52809. return c.header_
  52810. }
  52811. func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) {
  52812. reqHeaders := make(http.Header)
  52813. for k, v := range c.header_ {
  52814. reqHeaders[k] = v
  52815. }
  52816. reqHeaders.Set("User-Agent", c.s.userAgent())
  52817. if c.ifNoneMatch_ != "" {
  52818. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  52819. }
  52820. var body io.Reader = nil
  52821. c.urlParams_.Set("alt", alt)
  52822. c.urlParams_.Set("prettyPrint", "false")
  52823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/referrers")
  52824. urls += "?" + c.urlParams_.Encode()
  52825. req, err := http.NewRequest("GET", urls, body)
  52826. if err != nil {
  52827. return nil, err
  52828. }
  52829. req.Header = reqHeaders
  52830. googleapi.Expand(req.URL, map[string]string{
  52831. "project": c.project,
  52832. "zone": c.zone,
  52833. "instance": c.instance,
  52834. })
  52835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  52836. }
  52837. // Do executes the "compute.instances.listReferrers" call.
  52838. // Exactly one of *InstanceListReferrers or error will be non-nil. Any
  52839. // non-2xx status code is an error. Response headers are in either
  52840. // *InstanceListReferrers.ServerResponse.Header or (if a response was
  52841. // returned at all) in error.(*googleapi.Error).Header. Use
  52842. // googleapi.IsNotModified to check whether the returned error was
  52843. // because http.StatusNotModified was returned.
  52844. func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) {
  52845. gensupport.SetOptions(c.urlParams_, opts...)
  52846. res, err := c.doRequest("json")
  52847. if res != nil && res.StatusCode == http.StatusNotModified {
  52848. if res.Body != nil {
  52849. res.Body.Close()
  52850. }
  52851. return nil, &googleapi.Error{
  52852. Code: res.StatusCode,
  52853. Header: res.Header,
  52854. }
  52855. }
  52856. if err != nil {
  52857. return nil, err
  52858. }
  52859. defer googleapi.CloseBody(res)
  52860. if err := googleapi.CheckResponse(res); err != nil {
  52861. return nil, err
  52862. }
  52863. ret := &InstanceListReferrers{
  52864. ServerResponse: googleapi.ServerResponse{
  52865. Header: res.Header,
  52866. HTTPStatusCode: res.StatusCode,
  52867. },
  52868. }
  52869. target := &ret
  52870. if err := gensupport.DecodeResponse(target, res); err != nil {
  52871. return nil, err
  52872. }
  52873. return ret, nil
  52874. // {
  52875. // "description": "Retrieves the list of referrers to instances contained within the specified zone. For more information, read Viewing Referrers to VM Instances.",
  52876. // "httpMethod": "GET",
  52877. // "id": "compute.instances.listReferrers",
  52878. // "parameterOrder": [
  52879. // "project",
  52880. // "zone",
  52881. // "instance"
  52882. // ],
  52883. // "parameters": {
  52884. // "filter": {
  52885. // "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).",
  52886. // "location": "query",
  52887. // "type": "string"
  52888. // },
  52889. // "instance": {
  52890. // "description": "Name of the target instance scoping this request, or '-' if the request should span over all instances in the container.",
  52891. // "location": "path",
  52892. // "pattern": "-|[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  52893. // "required": true,
  52894. // "type": "string"
  52895. // },
  52896. // "maxResults": {
  52897. // "default": "500",
  52898. // "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)",
  52899. // "format": "uint32",
  52900. // "location": "query",
  52901. // "minimum": "0",
  52902. // "type": "integer"
  52903. // },
  52904. // "orderBy": {
  52905. // "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.",
  52906. // "location": "query",
  52907. // "type": "string"
  52908. // },
  52909. // "pageToken": {
  52910. // "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.",
  52911. // "location": "query",
  52912. // "type": "string"
  52913. // },
  52914. // "project": {
  52915. // "description": "Project ID for this request.",
  52916. // "location": "path",
  52917. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  52918. // "required": true,
  52919. // "type": "string"
  52920. // },
  52921. // "zone": {
  52922. // "description": "The name of the zone for this request.",
  52923. // "location": "path",
  52924. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  52925. // "required": true,
  52926. // "type": "string"
  52927. // }
  52928. // },
  52929. // "path": "{project}/zones/{zone}/instances/{instance}/referrers",
  52930. // "response": {
  52931. // "$ref": "InstanceListReferrers"
  52932. // },
  52933. // "scopes": [
  52934. // "https://www.googleapis.com/auth/cloud-platform",
  52935. // "https://www.googleapis.com/auth/compute",
  52936. // "https://www.googleapis.com/auth/compute.readonly"
  52937. // ]
  52938. // }
  52939. }
  52940. // Pages invokes f for each page of results.
  52941. // A non-nil error returned from f will halt the iteration.
  52942. // The provided context supersedes any context provided to the Context method.
  52943. func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error {
  52944. c.ctx_ = ctx
  52945. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  52946. for {
  52947. x, err := c.Do()
  52948. if err != nil {
  52949. return err
  52950. }
  52951. if err := f(x); err != nil {
  52952. return err
  52953. }
  52954. if x.NextPageToken == "" {
  52955. return nil
  52956. }
  52957. c.PageToken(x.NextPageToken)
  52958. }
  52959. }
  52960. // method id "compute.instances.reset":
  52961. type InstancesResetCall struct {
  52962. s *Service
  52963. project string
  52964. zone string
  52965. instance string
  52966. urlParams_ gensupport.URLParams
  52967. ctx_ context.Context
  52968. header_ http.Header
  52969. }
  52970. // Reset: Performs a reset on the instance. This is a hard reset the VM
  52971. // does not do a graceful shutdown. For more information, see Resetting
  52972. // an instance.
  52973. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset
  52974. func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall {
  52975. c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  52976. c.project = project
  52977. c.zone = zone
  52978. c.instance = instance
  52979. return c
  52980. }
  52981. // RequestId sets the optional parameter "requestId": An optional
  52982. // request ID to identify requests. Specify a unique request ID so that
  52983. // if you must retry your request, the server will know to ignore the
  52984. // request if it has already been completed.
  52985. //
  52986. // For example, consider a situation where you make an initial request
  52987. // and the request times out. If you make the request again with the
  52988. // same request ID, the server can check if original operation with the
  52989. // same request ID was received, and if so, will ignore the second
  52990. // request. This prevents clients from accidentally creating duplicate
  52991. // commitments.
  52992. //
  52993. // The request ID must be a valid UUID with the exception that zero UUID
  52994. // is not supported (00000000-0000-0000-0000-000000000000).
  52995. func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall {
  52996. c.urlParams_.Set("requestId", requestId)
  52997. return c
  52998. }
  52999. // Fields allows partial responses to be retrieved. See
  53000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53001. // for more information.
  53002. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall {
  53003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53004. return c
  53005. }
  53006. // Context sets the context to be used in this call's Do method. Any
  53007. // pending HTTP request will be aborted if the provided context is
  53008. // canceled.
  53009. func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall {
  53010. c.ctx_ = ctx
  53011. return c
  53012. }
  53013. // Header returns an http.Header that can be modified by the caller to
  53014. // add HTTP headers to the request.
  53015. func (c *InstancesResetCall) Header() http.Header {
  53016. if c.header_ == nil {
  53017. c.header_ = make(http.Header)
  53018. }
  53019. return c.header_
  53020. }
  53021. func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) {
  53022. reqHeaders := make(http.Header)
  53023. for k, v := range c.header_ {
  53024. reqHeaders[k] = v
  53025. }
  53026. reqHeaders.Set("User-Agent", c.s.userAgent())
  53027. var body io.Reader = nil
  53028. c.urlParams_.Set("alt", alt)
  53029. c.urlParams_.Set("prettyPrint", "false")
  53030. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset")
  53031. urls += "?" + c.urlParams_.Encode()
  53032. req, err := http.NewRequest("POST", urls, body)
  53033. if err != nil {
  53034. return nil, err
  53035. }
  53036. req.Header = reqHeaders
  53037. googleapi.Expand(req.URL, map[string]string{
  53038. "project": c.project,
  53039. "zone": c.zone,
  53040. "instance": c.instance,
  53041. })
  53042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53043. }
  53044. // Do executes the "compute.instances.reset" call.
  53045. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53046. // status code is an error. Response headers are in either
  53047. // *Operation.ServerResponse.Header or (if a response was returned at
  53048. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53049. // to check whether the returned error was because
  53050. // http.StatusNotModified was returned.
  53051. func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53052. gensupport.SetOptions(c.urlParams_, opts...)
  53053. res, err := c.doRequest("json")
  53054. if res != nil && res.StatusCode == http.StatusNotModified {
  53055. if res.Body != nil {
  53056. res.Body.Close()
  53057. }
  53058. return nil, &googleapi.Error{
  53059. Code: res.StatusCode,
  53060. Header: res.Header,
  53061. }
  53062. }
  53063. if err != nil {
  53064. return nil, err
  53065. }
  53066. defer googleapi.CloseBody(res)
  53067. if err := googleapi.CheckResponse(res); err != nil {
  53068. return nil, err
  53069. }
  53070. ret := &Operation{
  53071. ServerResponse: googleapi.ServerResponse{
  53072. Header: res.Header,
  53073. HTTPStatusCode: res.StatusCode,
  53074. },
  53075. }
  53076. target := &ret
  53077. if err := gensupport.DecodeResponse(target, res); err != nil {
  53078. return nil, err
  53079. }
  53080. return ret, nil
  53081. // {
  53082. // "description": "Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance.",
  53083. // "httpMethod": "POST",
  53084. // "id": "compute.instances.reset",
  53085. // "parameterOrder": [
  53086. // "project",
  53087. // "zone",
  53088. // "instance"
  53089. // ],
  53090. // "parameters": {
  53091. // "instance": {
  53092. // "description": "Name of the instance scoping this request.",
  53093. // "location": "path",
  53094. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53095. // "required": true,
  53096. // "type": "string"
  53097. // },
  53098. // "project": {
  53099. // "description": "Project ID for this request.",
  53100. // "location": "path",
  53101. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53102. // "required": true,
  53103. // "type": "string"
  53104. // },
  53105. // "requestId": {
  53106. // "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).",
  53107. // "location": "query",
  53108. // "type": "string"
  53109. // },
  53110. // "zone": {
  53111. // "description": "The name of the zone for this request.",
  53112. // "location": "path",
  53113. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53114. // "required": true,
  53115. // "type": "string"
  53116. // }
  53117. // },
  53118. // "path": "{project}/zones/{zone}/instances/{instance}/reset",
  53119. // "response": {
  53120. // "$ref": "Operation"
  53121. // },
  53122. // "scopes": [
  53123. // "https://www.googleapis.com/auth/cloud-platform",
  53124. // "https://www.googleapis.com/auth/compute"
  53125. // ]
  53126. // }
  53127. }
  53128. // method id "compute.instances.setDeletionProtection":
  53129. type InstancesSetDeletionProtectionCall struct {
  53130. s *Service
  53131. project string
  53132. zone string
  53133. resource string
  53134. urlParams_ gensupport.URLParams
  53135. ctx_ context.Context
  53136. header_ http.Header
  53137. }
  53138. // SetDeletionProtection: Sets deletion protection on the instance.
  53139. func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall {
  53140. c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53141. c.project = project
  53142. c.zone = zone
  53143. c.resource = resource
  53144. return c
  53145. }
  53146. // DeletionProtection sets the optional parameter "deletionProtection":
  53147. // Whether the resource should be protected against deletion.
  53148. func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall {
  53149. c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection))
  53150. return c
  53151. }
  53152. // RequestId sets the optional parameter "requestId": An optional
  53153. // request ID to identify requests. Specify a unique request ID so that
  53154. // if you must retry your request, the server will know to ignore the
  53155. // request if it has already been completed.
  53156. //
  53157. // For example, consider a situation where you make an initial request
  53158. // and the request times out. If you make the request again with the
  53159. // same request ID, the server can check if original operation with the
  53160. // same request ID was received, and if so, will ignore the second
  53161. // request. This prevents clients from accidentally creating duplicate
  53162. // commitments.
  53163. //
  53164. // The request ID must be a valid UUID with the exception that zero UUID
  53165. // is not supported (00000000-0000-0000-0000-000000000000).
  53166. func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall {
  53167. c.urlParams_.Set("requestId", requestId)
  53168. return c
  53169. }
  53170. // Fields allows partial responses to be retrieved. See
  53171. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53172. // for more information.
  53173. func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall {
  53174. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53175. return c
  53176. }
  53177. // Context sets the context to be used in this call's Do method. Any
  53178. // pending HTTP request will be aborted if the provided context is
  53179. // canceled.
  53180. func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall {
  53181. c.ctx_ = ctx
  53182. return c
  53183. }
  53184. // Header returns an http.Header that can be modified by the caller to
  53185. // add HTTP headers to the request.
  53186. func (c *InstancesSetDeletionProtectionCall) Header() http.Header {
  53187. if c.header_ == nil {
  53188. c.header_ = make(http.Header)
  53189. }
  53190. return c.header_
  53191. }
  53192. func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) {
  53193. reqHeaders := make(http.Header)
  53194. for k, v := range c.header_ {
  53195. reqHeaders[k] = v
  53196. }
  53197. reqHeaders.Set("User-Agent", c.s.userAgent())
  53198. var body io.Reader = nil
  53199. c.urlParams_.Set("alt", alt)
  53200. c.urlParams_.Set("prettyPrint", "false")
  53201. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setDeletionProtection")
  53202. urls += "?" + c.urlParams_.Encode()
  53203. req, err := http.NewRequest("POST", urls, body)
  53204. if err != nil {
  53205. return nil, err
  53206. }
  53207. req.Header = reqHeaders
  53208. googleapi.Expand(req.URL, map[string]string{
  53209. "project": c.project,
  53210. "zone": c.zone,
  53211. "resource": c.resource,
  53212. })
  53213. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53214. }
  53215. // Do executes the "compute.instances.setDeletionProtection" call.
  53216. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53217. // status code is an error. Response headers are in either
  53218. // *Operation.ServerResponse.Header or (if a response was returned at
  53219. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53220. // to check whether the returned error was because
  53221. // http.StatusNotModified was returned.
  53222. func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53223. gensupport.SetOptions(c.urlParams_, opts...)
  53224. res, err := c.doRequest("json")
  53225. if res != nil && res.StatusCode == http.StatusNotModified {
  53226. if res.Body != nil {
  53227. res.Body.Close()
  53228. }
  53229. return nil, &googleapi.Error{
  53230. Code: res.StatusCode,
  53231. Header: res.Header,
  53232. }
  53233. }
  53234. if err != nil {
  53235. return nil, err
  53236. }
  53237. defer googleapi.CloseBody(res)
  53238. if err := googleapi.CheckResponse(res); err != nil {
  53239. return nil, err
  53240. }
  53241. ret := &Operation{
  53242. ServerResponse: googleapi.ServerResponse{
  53243. Header: res.Header,
  53244. HTTPStatusCode: res.StatusCode,
  53245. },
  53246. }
  53247. target := &ret
  53248. if err := gensupport.DecodeResponse(target, res); err != nil {
  53249. return nil, err
  53250. }
  53251. return ret, nil
  53252. // {
  53253. // "description": "Sets deletion protection on the instance.",
  53254. // "httpMethod": "POST",
  53255. // "id": "compute.instances.setDeletionProtection",
  53256. // "parameterOrder": [
  53257. // "project",
  53258. // "zone",
  53259. // "resource"
  53260. // ],
  53261. // "parameters": {
  53262. // "deletionProtection": {
  53263. // "default": "true",
  53264. // "description": "Whether the resource should be protected against deletion.",
  53265. // "location": "query",
  53266. // "type": "boolean"
  53267. // },
  53268. // "project": {
  53269. // "description": "Project ID for this request.",
  53270. // "location": "path",
  53271. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53272. // "required": true,
  53273. // "type": "string"
  53274. // },
  53275. // "requestId": {
  53276. // "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).",
  53277. // "location": "query",
  53278. // "type": "string"
  53279. // },
  53280. // "resource": {
  53281. // "description": "Name or id of the resource for this request.",
  53282. // "location": "path",
  53283. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53284. // "required": true,
  53285. // "type": "string"
  53286. // },
  53287. // "zone": {
  53288. // "description": "The name of the zone for this request.",
  53289. // "location": "path",
  53290. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53291. // "required": true,
  53292. // "type": "string"
  53293. // }
  53294. // },
  53295. // "path": "{project}/zones/{zone}/instances/{resource}/setDeletionProtection",
  53296. // "response": {
  53297. // "$ref": "Operation"
  53298. // },
  53299. // "scopes": [
  53300. // "https://www.googleapis.com/auth/cloud-platform",
  53301. // "https://www.googleapis.com/auth/compute"
  53302. // ]
  53303. // }
  53304. }
  53305. // method id "compute.instances.setDiskAutoDelete":
  53306. type InstancesSetDiskAutoDeleteCall struct {
  53307. s *Service
  53308. project string
  53309. zone string
  53310. instance string
  53311. urlParams_ gensupport.URLParams
  53312. ctx_ context.Context
  53313. header_ http.Header
  53314. }
  53315. // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to
  53316. // an instance.
  53317. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete
  53318. func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall {
  53319. c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53320. c.project = project
  53321. c.zone = zone
  53322. c.instance = instance
  53323. c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete))
  53324. c.urlParams_.Set("deviceName", deviceName)
  53325. return c
  53326. }
  53327. // RequestId sets the optional parameter "requestId": An optional
  53328. // request ID to identify requests. Specify a unique request ID so that
  53329. // if you must retry your request, the server will know to ignore the
  53330. // request if it has already been completed.
  53331. //
  53332. // For example, consider a situation where you make an initial request
  53333. // and the request times out. If you make the request again with the
  53334. // same request ID, the server can check if original operation with the
  53335. // same request ID was received, and if so, will ignore the second
  53336. // request. This prevents clients from accidentally creating duplicate
  53337. // commitments.
  53338. //
  53339. // The request ID must be a valid UUID with the exception that zero UUID
  53340. // is not supported (00000000-0000-0000-0000-000000000000).
  53341. func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall {
  53342. c.urlParams_.Set("requestId", requestId)
  53343. return c
  53344. }
  53345. // Fields allows partial responses to be retrieved. See
  53346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53347. // for more information.
  53348. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall {
  53349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53350. return c
  53351. }
  53352. // Context sets the context to be used in this call's Do method. Any
  53353. // pending HTTP request will be aborted if the provided context is
  53354. // canceled.
  53355. func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall {
  53356. c.ctx_ = ctx
  53357. return c
  53358. }
  53359. // Header returns an http.Header that can be modified by the caller to
  53360. // add HTTP headers to the request.
  53361. func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header {
  53362. if c.header_ == nil {
  53363. c.header_ = make(http.Header)
  53364. }
  53365. return c.header_
  53366. }
  53367. func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) {
  53368. reqHeaders := make(http.Header)
  53369. for k, v := range c.header_ {
  53370. reqHeaders[k] = v
  53371. }
  53372. reqHeaders.Set("User-Agent", c.s.userAgent())
  53373. var body io.Reader = nil
  53374. c.urlParams_.Set("alt", alt)
  53375. c.urlParams_.Set("prettyPrint", "false")
  53376. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete")
  53377. urls += "?" + c.urlParams_.Encode()
  53378. req, err := http.NewRequest("POST", urls, body)
  53379. if err != nil {
  53380. return nil, err
  53381. }
  53382. req.Header = reqHeaders
  53383. googleapi.Expand(req.URL, map[string]string{
  53384. "project": c.project,
  53385. "zone": c.zone,
  53386. "instance": c.instance,
  53387. })
  53388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53389. }
  53390. // Do executes the "compute.instances.setDiskAutoDelete" call.
  53391. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53392. // status code is an error. Response headers are in either
  53393. // *Operation.ServerResponse.Header or (if a response was returned at
  53394. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53395. // to check whether the returned error was because
  53396. // http.StatusNotModified was returned.
  53397. func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53398. gensupport.SetOptions(c.urlParams_, opts...)
  53399. res, err := c.doRequest("json")
  53400. if res != nil && res.StatusCode == http.StatusNotModified {
  53401. if res.Body != nil {
  53402. res.Body.Close()
  53403. }
  53404. return nil, &googleapi.Error{
  53405. Code: res.StatusCode,
  53406. Header: res.Header,
  53407. }
  53408. }
  53409. if err != nil {
  53410. return nil, err
  53411. }
  53412. defer googleapi.CloseBody(res)
  53413. if err := googleapi.CheckResponse(res); err != nil {
  53414. return nil, err
  53415. }
  53416. ret := &Operation{
  53417. ServerResponse: googleapi.ServerResponse{
  53418. Header: res.Header,
  53419. HTTPStatusCode: res.StatusCode,
  53420. },
  53421. }
  53422. target := &ret
  53423. if err := gensupport.DecodeResponse(target, res); err != nil {
  53424. return nil, err
  53425. }
  53426. return ret, nil
  53427. // {
  53428. // "description": "Sets the auto-delete flag for a disk attached to an instance.",
  53429. // "httpMethod": "POST",
  53430. // "id": "compute.instances.setDiskAutoDelete",
  53431. // "parameterOrder": [
  53432. // "project",
  53433. // "zone",
  53434. // "instance",
  53435. // "autoDelete",
  53436. // "deviceName"
  53437. // ],
  53438. // "parameters": {
  53439. // "autoDelete": {
  53440. // "description": "Whether to auto-delete the disk when the instance is deleted.",
  53441. // "location": "query",
  53442. // "required": true,
  53443. // "type": "boolean"
  53444. // },
  53445. // "deviceName": {
  53446. // "description": "The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names.",
  53447. // "location": "query",
  53448. // "pattern": "\\w[\\w.-]{0,254}",
  53449. // "required": true,
  53450. // "type": "string"
  53451. // },
  53452. // "instance": {
  53453. // "description": "The instance name for this request.",
  53454. // "location": "path",
  53455. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53456. // "required": true,
  53457. // "type": "string"
  53458. // },
  53459. // "project": {
  53460. // "description": "Project ID for this request.",
  53461. // "location": "path",
  53462. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53463. // "required": true,
  53464. // "type": "string"
  53465. // },
  53466. // "requestId": {
  53467. // "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).",
  53468. // "location": "query",
  53469. // "type": "string"
  53470. // },
  53471. // "zone": {
  53472. // "description": "The name of the zone for this request.",
  53473. // "location": "path",
  53474. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53475. // "required": true,
  53476. // "type": "string"
  53477. // }
  53478. // },
  53479. // "path": "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete",
  53480. // "response": {
  53481. // "$ref": "Operation"
  53482. // },
  53483. // "scopes": [
  53484. // "https://www.googleapis.com/auth/cloud-platform",
  53485. // "https://www.googleapis.com/auth/compute"
  53486. // ]
  53487. // }
  53488. }
  53489. // method id "compute.instances.setIamPolicy":
  53490. type InstancesSetIamPolicyCall struct {
  53491. s *Service
  53492. project string
  53493. zone string
  53494. resource string
  53495. zonesetpolicyrequest *ZoneSetPolicyRequest
  53496. urlParams_ gensupport.URLParams
  53497. ctx_ context.Context
  53498. header_ http.Header
  53499. }
  53500. // SetIamPolicy: Sets the access control policy on the specified
  53501. // resource. Replaces any existing policy.
  53502. func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall {
  53503. c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53504. c.project = project
  53505. c.zone = zone
  53506. c.resource = resource
  53507. c.zonesetpolicyrequest = zonesetpolicyrequest
  53508. return c
  53509. }
  53510. // Fields allows partial responses to be retrieved. See
  53511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53512. // for more information.
  53513. func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall {
  53514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53515. return c
  53516. }
  53517. // Context sets the context to be used in this call's Do method. Any
  53518. // pending HTTP request will be aborted if the provided context is
  53519. // canceled.
  53520. func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall {
  53521. c.ctx_ = ctx
  53522. return c
  53523. }
  53524. // Header returns an http.Header that can be modified by the caller to
  53525. // add HTTP headers to the request.
  53526. func (c *InstancesSetIamPolicyCall) Header() http.Header {
  53527. if c.header_ == nil {
  53528. c.header_ = make(http.Header)
  53529. }
  53530. return c.header_
  53531. }
  53532. func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  53533. reqHeaders := make(http.Header)
  53534. for k, v := range c.header_ {
  53535. reqHeaders[k] = v
  53536. }
  53537. reqHeaders.Set("User-Agent", c.s.userAgent())
  53538. var body io.Reader = nil
  53539. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  53540. if err != nil {
  53541. return nil, err
  53542. }
  53543. reqHeaders.Set("Content-Type", "application/json")
  53544. c.urlParams_.Set("alt", alt)
  53545. c.urlParams_.Set("prettyPrint", "false")
  53546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/setIamPolicy")
  53547. urls += "?" + c.urlParams_.Encode()
  53548. req, err := http.NewRequest("POST", urls, body)
  53549. if err != nil {
  53550. return nil, err
  53551. }
  53552. req.Header = reqHeaders
  53553. googleapi.Expand(req.URL, map[string]string{
  53554. "project": c.project,
  53555. "zone": c.zone,
  53556. "resource": c.resource,
  53557. })
  53558. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53559. }
  53560. // Do executes the "compute.instances.setIamPolicy" call.
  53561. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  53562. // code is an error. Response headers are in either
  53563. // *Policy.ServerResponse.Header or (if a response was returned at all)
  53564. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  53565. // check whether the returned error was because http.StatusNotModified
  53566. // was returned.
  53567. func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  53568. gensupport.SetOptions(c.urlParams_, opts...)
  53569. res, err := c.doRequest("json")
  53570. if res != nil && res.StatusCode == http.StatusNotModified {
  53571. if res.Body != nil {
  53572. res.Body.Close()
  53573. }
  53574. return nil, &googleapi.Error{
  53575. Code: res.StatusCode,
  53576. Header: res.Header,
  53577. }
  53578. }
  53579. if err != nil {
  53580. return nil, err
  53581. }
  53582. defer googleapi.CloseBody(res)
  53583. if err := googleapi.CheckResponse(res); err != nil {
  53584. return nil, err
  53585. }
  53586. ret := &Policy{
  53587. ServerResponse: googleapi.ServerResponse{
  53588. Header: res.Header,
  53589. HTTPStatusCode: res.StatusCode,
  53590. },
  53591. }
  53592. target := &ret
  53593. if err := gensupport.DecodeResponse(target, res); err != nil {
  53594. return nil, err
  53595. }
  53596. return ret, nil
  53597. // {
  53598. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  53599. // "httpMethod": "POST",
  53600. // "id": "compute.instances.setIamPolicy",
  53601. // "parameterOrder": [
  53602. // "project",
  53603. // "zone",
  53604. // "resource"
  53605. // ],
  53606. // "parameters": {
  53607. // "project": {
  53608. // "description": "Project ID for this request.",
  53609. // "location": "path",
  53610. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53611. // "required": true,
  53612. // "type": "string"
  53613. // },
  53614. // "resource": {
  53615. // "description": "Name or id of the resource for this request.",
  53616. // "location": "path",
  53617. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53618. // "required": true,
  53619. // "type": "string"
  53620. // },
  53621. // "zone": {
  53622. // "description": "The name of the zone for this request.",
  53623. // "location": "path",
  53624. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53625. // "required": true,
  53626. // "type": "string"
  53627. // }
  53628. // },
  53629. // "path": "{project}/zones/{zone}/instances/{resource}/setIamPolicy",
  53630. // "request": {
  53631. // "$ref": "ZoneSetPolicyRequest"
  53632. // },
  53633. // "response": {
  53634. // "$ref": "Policy"
  53635. // },
  53636. // "scopes": [
  53637. // "https://www.googleapis.com/auth/cloud-platform",
  53638. // "https://www.googleapis.com/auth/compute"
  53639. // ]
  53640. // }
  53641. }
  53642. // method id "compute.instances.setLabels":
  53643. type InstancesSetLabelsCall struct {
  53644. s *Service
  53645. project string
  53646. zone string
  53647. instance string
  53648. instancessetlabelsrequest *InstancesSetLabelsRequest
  53649. urlParams_ gensupport.URLParams
  53650. ctx_ context.Context
  53651. header_ http.Header
  53652. }
  53653. // SetLabels: Sets labels on an instance. To learn more about labels,
  53654. // read the Labeling Resources documentation.
  53655. func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall {
  53656. c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53657. c.project = project
  53658. c.zone = zone
  53659. c.instance = instance
  53660. c.instancessetlabelsrequest = instancessetlabelsrequest
  53661. return c
  53662. }
  53663. // RequestId sets the optional parameter "requestId": An optional
  53664. // request ID to identify requests. Specify a unique request ID so that
  53665. // if you must retry your request, the server will know to ignore the
  53666. // request if it has already been completed.
  53667. //
  53668. // For example, consider a situation where you make an initial request
  53669. // and the request times out. If you make the request again with the
  53670. // same request ID, the server can check if original operation with the
  53671. // same request ID was received, and if so, will ignore the second
  53672. // request. This prevents clients from accidentally creating duplicate
  53673. // commitments.
  53674. //
  53675. // The request ID must be a valid UUID with the exception that zero UUID
  53676. // is not supported (00000000-0000-0000-0000-000000000000).
  53677. func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall {
  53678. c.urlParams_.Set("requestId", requestId)
  53679. return c
  53680. }
  53681. // Fields allows partial responses to be retrieved. See
  53682. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53683. // for more information.
  53684. func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall {
  53685. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53686. return c
  53687. }
  53688. // Context sets the context to be used in this call's Do method. Any
  53689. // pending HTTP request will be aborted if the provided context is
  53690. // canceled.
  53691. func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall {
  53692. c.ctx_ = ctx
  53693. return c
  53694. }
  53695. // Header returns an http.Header that can be modified by the caller to
  53696. // add HTTP headers to the request.
  53697. func (c *InstancesSetLabelsCall) Header() http.Header {
  53698. if c.header_ == nil {
  53699. c.header_ = make(http.Header)
  53700. }
  53701. return c.header_
  53702. }
  53703. func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  53704. reqHeaders := make(http.Header)
  53705. for k, v := range c.header_ {
  53706. reqHeaders[k] = v
  53707. }
  53708. reqHeaders.Set("User-Agent", c.s.userAgent())
  53709. var body io.Reader = nil
  53710. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest)
  53711. if err != nil {
  53712. return nil, err
  53713. }
  53714. reqHeaders.Set("Content-Type", "application/json")
  53715. c.urlParams_.Set("alt", alt)
  53716. c.urlParams_.Set("prettyPrint", "false")
  53717. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setLabels")
  53718. urls += "?" + c.urlParams_.Encode()
  53719. req, err := http.NewRequest("POST", urls, body)
  53720. if err != nil {
  53721. return nil, err
  53722. }
  53723. req.Header = reqHeaders
  53724. googleapi.Expand(req.URL, map[string]string{
  53725. "project": c.project,
  53726. "zone": c.zone,
  53727. "instance": c.instance,
  53728. })
  53729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53730. }
  53731. // Do executes the "compute.instances.setLabels" call.
  53732. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53733. // status code is an error. Response headers are in either
  53734. // *Operation.ServerResponse.Header or (if a response was returned at
  53735. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53736. // to check whether the returned error was because
  53737. // http.StatusNotModified was returned.
  53738. func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53739. gensupport.SetOptions(c.urlParams_, opts...)
  53740. res, err := c.doRequest("json")
  53741. if res != nil && res.StatusCode == http.StatusNotModified {
  53742. if res.Body != nil {
  53743. res.Body.Close()
  53744. }
  53745. return nil, &googleapi.Error{
  53746. Code: res.StatusCode,
  53747. Header: res.Header,
  53748. }
  53749. }
  53750. if err != nil {
  53751. return nil, err
  53752. }
  53753. defer googleapi.CloseBody(res)
  53754. if err := googleapi.CheckResponse(res); err != nil {
  53755. return nil, err
  53756. }
  53757. ret := &Operation{
  53758. ServerResponse: googleapi.ServerResponse{
  53759. Header: res.Header,
  53760. HTTPStatusCode: res.StatusCode,
  53761. },
  53762. }
  53763. target := &ret
  53764. if err := gensupport.DecodeResponse(target, res); err != nil {
  53765. return nil, err
  53766. }
  53767. return ret, nil
  53768. // {
  53769. // "description": "Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation.",
  53770. // "httpMethod": "POST",
  53771. // "id": "compute.instances.setLabels",
  53772. // "parameterOrder": [
  53773. // "project",
  53774. // "zone",
  53775. // "instance"
  53776. // ],
  53777. // "parameters": {
  53778. // "instance": {
  53779. // "description": "Name of the instance scoping this request.",
  53780. // "location": "path",
  53781. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53782. // "required": true,
  53783. // "type": "string"
  53784. // },
  53785. // "project": {
  53786. // "description": "Project ID for this request.",
  53787. // "location": "path",
  53788. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53789. // "required": true,
  53790. // "type": "string"
  53791. // },
  53792. // "requestId": {
  53793. // "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).",
  53794. // "location": "query",
  53795. // "type": "string"
  53796. // },
  53797. // "zone": {
  53798. // "description": "The name of the zone for this request.",
  53799. // "location": "path",
  53800. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53801. // "required": true,
  53802. // "type": "string"
  53803. // }
  53804. // },
  53805. // "path": "{project}/zones/{zone}/instances/{instance}/setLabels",
  53806. // "request": {
  53807. // "$ref": "InstancesSetLabelsRequest"
  53808. // },
  53809. // "response": {
  53810. // "$ref": "Operation"
  53811. // },
  53812. // "scopes": [
  53813. // "https://www.googleapis.com/auth/cloud-platform",
  53814. // "https://www.googleapis.com/auth/compute"
  53815. // ]
  53816. // }
  53817. }
  53818. // method id "compute.instances.setMachineResources":
  53819. type InstancesSetMachineResourcesCall struct {
  53820. s *Service
  53821. project string
  53822. zone string
  53823. instance string
  53824. instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest
  53825. urlParams_ gensupport.URLParams
  53826. ctx_ context.Context
  53827. header_ http.Header
  53828. }
  53829. // SetMachineResources: Changes the number and/or type of accelerator
  53830. // for a stopped instance to the values specified in the request.
  53831. func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall {
  53832. c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  53833. c.project = project
  53834. c.zone = zone
  53835. c.instance = instance
  53836. c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest
  53837. return c
  53838. }
  53839. // RequestId sets the optional parameter "requestId": An optional
  53840. // request ID to identify requests. Specify a unique request ID so that
  53841. // if you must retry your request, the server will know to ignore the
  53842. // request if it has already been completed.
  53843. //
  53844. // For example, consider a situation where you make an initial request
  53845. // and the request times out. If you make the request again with the
  53846. // same request ID, the server can check if original operation with the
  53847. // same request ID was received, and if so, will ignore the second
  53848. // request. This prevents clients from accidentally creating duplicate
  53849. // commitments.
  53850. //
  53851. // The request ID must be a valid UUID with the exception that zero UUID
  53852. // is not supported (00000000-0000-0000-0000-000000000000).
  53853. func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall {
  53854. c.urlParams_.Set("requestId", requestId)
  53855. return c
  53856. }
  53857. // Fields allows partial responses to be retrieved. See
  53858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  53859. // for more information.
  53860. func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall {
  53861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  53862. return c
  53863. }
  53864. // Context sets the context to be used in this call's Do method. Any
  53865. // pending HTTP request will be aborted if the provided context is
  53866. // canceled.
  53867. func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall {
  53868. c.ctx_ = ctx
  53869. return c
  53870. }
  53871. // Header returns an http.Header that can be modified by the caller to
  53872. // add HTTP headers to the request.
  53873. func (c *InstancesSetMachineResourcesCall) Header() http.Header {
  53874. if c.header_ == nil {
  53875. c.header_ = make(http.Header)
  53876. }
  53877. return c.header_
  53878. }
  53879. func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) {
  53880. reqHeaders := make(http.Header)
  53881. for k, v := range c.header_ {
  53882. reqHeaders[k] = v
  53883. }
  53884. reqHeaders.Set("User-Agent", c.s.userAgent())
  53885. var body io.Reader = nil
  53886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest)
  53887. if err != nil {
  53888. return nil, err
  53889. }
  53890. reqHeaders.Set("Content-Type", "application/json")
  53891. c.urlParams_.Set("alt", alt)
  53892. c.urlParams_.Set("prettyPrint", "false")
  53893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineResources")
  53894. urls += "?" + c.urlParams_.Encode()
  53895. req, err := http.NewRequest("POST", urls, body)
  53896. if err != nil {
  53897. return nil, err
  53898. }
  53899. req.Header = reqHeaders
  53900. googleapi.Expand(req.URL, map[string]string{
  53901. "project": c.project,
  53902. "zone": c.zone,
  53903. "instance": c.instance,
  53904. })
  53905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  53906. }
  53907. // Do executes the "compute.instances.setMachineResources" call.
  53908. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  53909. // status code is an error. Response headers are in either
  53910. // *Operation.ServerResponse.Header or (if a response was returned at
  53911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  53912. // to check whether the returned error was because
  53913. // http.StatusNotModified was returned.
  53914. func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  53915. gensupport.SetOptions(c.urlParams_, opts...)
  53916. res, err := c.doRequest("json")
  53917. if res != nil && res.StatusCode == http.StatusNotModified {
  53918. if res.Body != nil {
  53919. res.Body.Close()
  53920. }
  53921. return nil, &googleapi.Error{
  53922. Code: res.StatusCode,
  53923. Header: res.Header,
  53924. }
  53925. }
  53926. if err != nil {
  53927. return nil, err
  53928. }
  53929. defer googleapi.CloseBody(res)
  53930. if err := googleapi.CheckResponse(res); err != nil {
  53931. return nil, err
  53932. }
  53933. ret := &Operation{
  53934. ServerResponse: googleapi.ServerResponse{
  53935. Header: res.Header,
  53936. HTTPStatusCode: res.StatusCode,
  53937. },
  53938. }
  53939. target := &ret
  53940. if err := gensupport.DecodeResponse(target, res); err != nil {
  53941. return nil, err
  53942. }
  53943. return ret, nil
  53944. // {
  53945. // "description": "Changes the number and/or type of accelerator for a stopped instance to the values specified in the request.",
  53946. // "httpMethod": "POST",
  53947. // "id": "compute.instances.setMachineResources",
  53948. // "parameterOrder": [
  53949. // "project",
  53950. // "zone",
  53951. // "instance"
  53952. // ],
  53953. // "parameters": {
  53954. // "instance": {
  53955. // "description": "Name of the instance scoping this request.",
  53956. // "location": "path",
  53957. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  53958. // "required": true,
  53959. // "type": "string"
  53960. // },
  53961. // "project": {
  53962. // "description": "Project ID for this request.",
  53963. // "location": "path",
  53964. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  53965. // "required": true,
  53966. // "type": "string"
  53967. // },
  53968. // "requestId": {
  53969. // "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).",
  53970. // "location": "query",
  53971. // "type": "string"
  53972. // },
  53973. // "zone": {
  53974. // "description": "The name of the zone for this request.",
  53975. // "location": "path",
  53976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  53977. // "required": true,
  53978. // "type": "string"
  53979. // }
  53980. // },
  53981. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineResources",
  53982. // "request": {
  53983. // "$ref": "InstancesSetMachineResourcesRequest"
  53984. // },
  53985. // "response": {
  53986. // "$ref": "Operation"
  53987. // },
  53988. // "scopes": [
  53989. // "https://www.googleapis.com/auth/cloud-platform",
  53990. // "https://www.googleapis.com/auth/compute"
  53991. // ]
  53992. // }
  53993. }
  53994. // method id "compute.instances.setMachineType":
  53995. type InstancesSetMachineTypeCall struct {
  53996. s *Service
  53997. project string
  53998. zone string
  53999. instance string
  54000. instancessetmachinetyperequest *InstancesSetMachineTypeRequest
  54001. urlParams_ gensupport.URLParams
  54002. ctx_ context.Context
  54003. header_ http.Header
  54004. }
  54005. // SetMachineType: Changes the machine type for a stopped instance to
  54006. // the machine type specified in the request.
  54007. func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall {
  54008. c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54009. c.project = project
  54010. c.zone = zone
  54011. c.instance = instance
  54012. c.instancessetmachinetyperequest = instancessetmachinetyperequest
  54013. return c
  54014. }
  54015. // RequestId sets the optional parameter "requestId": An optional
  54016. // request ID to identify requests. Specify a unique request ID so that
  54017. // if you must retry your request, the server will know to ignore the
  54018. // request if it has already been completed.
  54019. //
  54020. // For example, consider a situation where you make an initial request
  54021. // and the request times out. If you make the request again with the
  54022. // same request ID, the server can check if original operation with the
  54023. // same request ID was received, and if so, will ignore the second
  54024. // request. This prevents clients from accidentally creating duplicate
  54025. // commitments.
  54026. //
  54027. // The request ID must be a valid UUID with the exception that zero UUID
  54028. // is not supported (00000000-0000-0000-0000-000000000000).
  54029. func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall {
  54030. c.urlParams_.Set("requestId", requestId)
  54031. return c
  54032. }
  54033. // Fields allows partial responses to be retrieved. See
  54034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54035. // for more information.
  54036. func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall {
  54037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54038. return c
  54039. }
  54040. // Context sets the context to be used in this call's Do method. Any
  54041. // pending HTTP request will be aborted if the provided context is
  54042. // canceled.
  54043. func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall {
  54044. c.ctx_ = ctx
  54045. return c
  54046. }
  54047. // Header returns an http.Header that can be modified by the caller to
  54048. // add HTTP headers to the request.
  54049. func (c *InstancesSetMachineTypeCall) Header() http.Header {
  54050. if c.header_ == nil {
  54051. c.header_ = make(http.Header)
  54052. }
  54053. return c.header_
  54054. }
  54055. func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
  54056. reqHeaders := make(http.Header)
  54057. for k, v := range c.header_ {
  54058. reqHeaders[k] = v
  54059. }
  54060. reqHeaders.Set("User-Agent", c.s.userAgent())
  54061. var body io.Reader = nil
  54062. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest)
  54063. if err != nil {
  54064. return nil, err
  54065. }
  54066. reqHeaders.Set("Content-Type", "application/json")
  54067. c.urlParams_.Set("alt", alt)
  54068. c.urlParams_.Set("prettyPrint", "false")
  54069. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMachineType")
  54070. urls += "?" + c.urlParams_.Encode()
  54071. req, err := http.NewRequest("POST", urls, body)
  54072. if err != nil {
  54073. return nil, err
  54074. }
  54075. req.Header = reqHeaders
  54076. googleapi.Expand(req.URL, map[string]string{
  54077. "project": c.project,
  54078. "zone": c.zone,
  54079. "instance": c.instance,
  54080. })
  54081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54082. }
  54083. // Do executes the "compute.instances.setMachineType" call.
  54084. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54085. // status code is an error. Response headers are in either
  54086. // *Operation.ServerResponse.Header or (if a response was returned at
  54087. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54088. // to check whether the returned error was because
  54089. // http.StatusNotModified was returned.
  54090. func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54091. gensupport.SetOptions(c.urlParams_, opts...)
  54092. res, err := c.doRequest("json")
  54093. if res != nil && res.StatusCode == http.StatusNotModified {
  54094. if res.Body != nil {
  54095. res.Body.Close()
  54096. }
  54097. return nil, &googleapi.Error{
  54098. Code: res.StatusCode,
  54099. Header: res.Header,
  54100. }
  54101. }
  54102. if err != nil {
  54103. return nil, err
  54104. }
  54105. defer googleapi.CloseBody(res)
  54106. if err := googleapi.CheckResponse(res); err != nil {
  54107. return nil, err
  54108. }
  54109. ret := &Operation{
  54110. ServerResponse: googleapi.ServerResponse{
  54111. Header: res.Header,
  54112. HTTPStatusCode: res.StatusCode,
  54113. },
  54114. }
  54115. target := &ret
  54116. if err := gensupport.DecodeResponse(target, res); err != nil {
  54117. return nil, err
  54118. }
  54119. return ret, nil
  54120. // {
  54121. // "description": "Changes the machine type for a stopped instance to the machine type specified in the request.",
  54122. // "httpMethod": "POST",
  54123. // "id": "compute.instances.setMachineType",
  54124. // "parameterOrder": [
  54125. // "project",
  54126. // "zone",
  54127. // "instance"
  54128. // ],
  54129. // "parameters": {
  54130. // "instance": {
  54131. // "description": "Name of the instance scoping this request.",
  54132. // "location": "path",
  54133. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54134. // "required": true,
  54135. // "type": "string"
  54136. // },
  54137. // "project": {
  54138. // "description": "Project ID for this request.",
  54139. // "location": "path",
  54140. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54141. // "required": true,
  54142. // "type": "string"
  54143. // },
  54144. // "requestId": {
  54145. // "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).",
  54146. // "location": "query",
  54147. // "type": "string"
  54148. // },
  54149. // "zone": {
  54150. // "description": "The name of the zone for this request.",
  54151. // "location": "path",
  54152. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54153. // "required": true,
  54154. // "type": "string"
  54155. // }
  54156. // },
  54157. // "path": "{project}/zones/{zone}/instances/{instance}/setMachineType",
  54158. // "request": {
  54159. // "$ref": "InstancesSetMachineTypeRequest"
  54160. // },
  54161. // "response": {
  54162. // "$ref": "Operation"
  54163. // },
  54164. // "scopes": [
  54165. // "https://www.googleapis.com/auth/cloud-platform",
  54166. // "https://www.googleapis.com/auth/compute"
  54167. // ]
  54168. // }
  54169. }
  54170. // method id "compute.instances.setMetadata":
  54171. type InstancesSetMetadataCall struct {
  54172. s *Service
  54173. project string
  54174. zone string
  54175. instance string
  54176. metadata *Metadata
  54177. urlParams_ gensupport.URLParams
  54178. ctx_ context.Context
  54179. header_ http.Header
  54180. }
  54181. // SetMetadata: Sets metadata for the specified instance to the data
  54182. // included in the request.
  54183. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata
  54184. func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall {
  54185. c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54186. c.project = project
  54187. c.zone = zone
  54188. c.instance = instance
  54189. c.metadata = metadata
  54190. return c
  54191. }
  54192. // RequestId sets the optional parameter "requestId": An optional
  54193. // request ID to identify requests. Specify a unique request ID so that
  54194. // if you must retry your request, the server will know to ignore the
  54195. // request if it has already been completed.
  54196. //
  54197. // For example, consider a situation where you make an initial request
  54198. // and the request times out. If you make the request again with the
  54199. // same request ID, the server can check if original operation with the
  54200. // same request ID was received, and if so, will ignore the second
  54201. // request. This prevents clients from accidentally creating duplicate
  54202. // commitments.
  54203. //
  54204. // The request ID must be a valid UUID with the exception that zero UUID
  54205. // is not supported (00000000-0000-0000-0000-000000000000).
  54206. func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall {
  54207. c.urlParams_.Set("requestId", requestId)
  54208. return c
  54209. }
  54210. // Fields allows partial responses to be retrieved. See
  54211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54212. // for more information.
  54213. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall {
  54214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54215. return c
  54216. }
  54217. // Context sets the context to be used in this call's Do method. Any
  54218. // pending HTTP request will be aborted if the provided context is
  54219. // canceled.
  54220. func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall {
  54221. c.ctx_ = ctx
  54222. return c
  54223. }
  54224. // Header returns an http.Header that can be modified by the caller to
  54225. // add HTTP headers to the request.
  54226. func (c *InstancesSetMetadataCall) Header() http.Header {
  54227. if c.header_ == nil {
  54228. c.header_ = make(http.Header)
  54229. }
  54230. return c.header_
  54231. }
  54232. func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) {
  54233. reqHeaders := make(http.Header)
  54234. for k, v := range c.header_ {
  54235. reqHeaders[k] = v
  54236. }
  54237. reqHeaders.Set("User-Agent", c.s.userAgent())
  54238. var body io.Reader = nil
  54239. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  54240. if err != nil {
  54241. return nil, err
  54242. }
  54243. reqHeaders.Set("Content-Type", "application/json")
  54244. c.urlParams_.Set("alt", alt)
  54245. c.urlParams_.Set("prettyPrint", "false")
  54246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata")
  54247. urls += "?" + c.urlParams_.Encode()
  54248. req, err := http.NewRequest("POST", urls, body)
  54249. if err != nil {
  54250. return nil, err
  54251. }
  54252. req.Header = reqHeaders
  54253. googleapi.Expand(req.URL, map[string]string{
  54254. "project": c.project,
  54255. "zone": c.zone,
  54256. "instance": c.instance,
  54257. })
  54258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54259. }
  54260. // Do executes the "compute.instances.setMetadata" call.
  54261. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54262. // status code is an error. Response headers are in either
  54263. // *Operation.ServerResponse.Header or (if a response was returned at
  54264. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54265. // to check whether the returned error was because
  54266. // http.StatusNotModified was returned.
  54267. func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54268. gensupport.SetOptions(c.urlParams_, opts...)
  54269. res, err := c.doRequest("json")
  54270. if res != nil && res.StatusCode == http.StatusNotModified {
  54271. if res.Body != nil {
  54272. res.Body.Close()
  54273. }
  54274. return nil, &googleapi.Error{
  54275. Code: res.StatusCode,
  54276. Header: res.Header,
  54277. }
  54278. }
  54279. if err != nil {
  54280. return nil, err
  54281. }
  54282. defer googleapi.CloseBody(res)
  54283. if err := googleapi.CheckResponse(res); err != nil {
  54284. return nil, err
  54285. }
  54286. ret := &Operation{
  54287. ServerResponse: googleapi.ServerResponse{
  54288. Header: res.Header,
  54289. HTTPStatusCode: res.StatusCode,
  54290. },
  54291. }
  54292. target := &ret
  54293. if err := gensupport.DecodeResponse(target, res); err != nil {
  54294. return nil, err
  54295. }
  54296. return ret, nil
  54297. // {
  54298. // "description": "Sets metadata for the specified instance to the data included in the request.",
  54299. // "httpMethod": "POST",
  54300. // "id": "compute.instances.setMetadata",
  54301. // "parameterOrder": [
  54302. // "project",
  54303. // "zone",
  54304. // "instance"
  54305. // ],
  54306. // "parameters": {
  54307. // "instance": {
  54308. // "description": "Name of the instance scoping this request.",
  54309. // "location": "path",
  54310. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54311. // "required": true,
  54312. // "type": "string"
  54313. // },
  54314. // "project": {
  54315. // "description": "Project ID for this request.",
  54316. // "location": "path",
  54317. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54318. // "required": true,
  54319. // "type": "string"
  54320. // },
  54321. // "requestId": {
  54322. // "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).",
  54323. // "location": "query",
  54324. // "type": "string"
  54325. // },
  54326. // "zone": {
  54327. // "description": "The name of the zone for this request.",
  54328. // "location": "path",
  54329. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54330. // "required": true,
  54331. // "type": "string"
  54332. // }
  54333. // },
  54334. // "path": "{project}/zones/{zone}/instances/{instance}/setMetadata",
  54335. // "request": {
  54336. // "$ref": "Metadata"
  54337. // },
  54338. // "response": {
  54339. // "$ref": "Operation"
  54340. // },
  54341. // "scopes": [
  54342. // "https://www.googleapis.com/auth/cloud-platform",
  54343. // "https://www.googleapis.com/auth/compute"
  54344. // ]
  54345. // }
  54346. }
  54347. // method id "compute.instances.setMinCpuPlatform":
  54348. type InstancesSetMinCpuPlatformCall struct {
  54349. s *Service
  54350. project string
  54351. zone string
  54352. instance string
  54353. instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest
  54354. urlParams_ gensupport.URLParams
  54355. ctx_ context.Context
  54356. header_ http.Header
  54357. }
  54358. // SetMinCpuPlatform: Changes the minimum CPU platform that this
  54359. // instance should use. This method can only be called on a stopped
  54360. // instance. For more information, read Specifying a Minimum CPU
  54361. // Platform.
  54362. func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall {
  54363. c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54364. c.project = project
  54365. c.zone = zone
  54366. c.instance = instance
  54367. c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest
  54368. return c
  54369. }
  54370. // RequestId sets the optional parameter "requestId": An optional
  54371. // request ID to identify requests. Specify a unique request ID so that
  54372. // if you must retry your request, the server will know to ignore the
  54373. // request if it has already been completed.
  54374. //
  54375. // For example, consider a situation where you make an initial request
  54376. // and the request times out. If you make the request again with the
  54377. // same request ID, the server can check if original operation with the
  54378. // same request ID was received, and if so, will ignore the second
  54379. // request. This prevents clients from accidentally creating duplicate
  54380. // commitments.
  54381. //
  54382. // The request ID must be a valid UUID with the exception that zero UUID
  54383. // is not supported (00000000-0000-0000-0000-000000000000).
  54384. func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall {
  54385. c.urlParams_.Set("requestId", requestId)
  54386. return c
  54387. }
  54388. // Fields allows partial responses to be retrieved. See
  54389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54390. // for more information.
  54391. func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall {
  54392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54393. return c
  54394. }
  54395. // Context sets the context to be used in this call's Do method. Any
  54396. // pending HTTP request will be aborted if the provided context is
  54397. // canceled.
  54398. func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall {
  54399. c.ctx_ = ctx
  54400. return c
  54401. }
  54402. // Header returns an http.Header that can be modified by the caller to
  54403. // add HTTP headers to the request.
  54404. func (c *InstancesSetMinCpuPlatformCall) Header() http.Header {
  54405. if c.header_ == nil {
  54406. c.header_ = make(http.Header)
  54407. }
  54408. return c.header_
  54409. }
  54410. func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) {
  54411. reqHeaders := make(http.Header)
  54412. for k, v := range c.header_ {
  54413. reqHeaders[k] = v
  54414. }
  54415. reqHeaders.Set("User-Agent", c.s.userAgent())
  54416. var body io.Reader = nil
  54417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest)
  54418. if err != nil {
  54419. return nil, err
  54420. }
  54421. reqHeaders.Set("Content-Type", "application/json")
  54422. c.urlParams_.Set("alt", alt)
  54423. c.urlParams_.Set("prettyPrint", "false")
  54424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform")
  54425. urls += "?" + c.urlParams_.Encode()
  54426. req, err := http.NewRequest("POST", urls, body)
  54427. if err != nil {
  54428. return nil, err
  54429. }
  54430. req.Header = reqHeaders
  54431. googleapi.Expand(req.URL, map[string]string{
  54432. "project": c.project,
  54433. "zone": c.zone,
  54434. "instance": c.instance,
  54435. })
  54436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54437. }
  54438. // Do executes the "compute.instances.setMinCpuPlatform" call.
  54439. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54440. // status code is an error. Response headers are in either
  54441. // *Operation.ServerResponse.Header or (if a response was returned at
  54442. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54443. // to check whether the returned error was because
  54444. // http.StatusNotModified was returned.
  54445. func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54446. gensupport.SetOptions(c.urlParams_, opts...)
  54447. res, err := c.doRequest("json")
  54448. if res != nil && res.StatusCode == http.StatusNotModified {
  54449. if res.Body != nil {
  54450. res.Body.Close()
  54451. }
  54452. return nil, &googleapi.Error{
  54453. Code: res.StatusCode,
  54454. Header: res.Header,
  54455. }
  54456. }
  54457. if err != nil {
  54458. return nil, err
  54459. }
  54460. defer googleapi.CloseBody(res)
  54461. if err := googleapi.CheckResponse(res); err != nil {
  54462. return nil, err
  54463. }
  54464. ret := &Operation{
  54465. ServerResponse: googleapi.ServerResponse{
  54466. Header: res.Header,
  54467. HTTPStatusCode: res.StatusCode,
  54468. },
  54469. }
  54470. target := &ret
  54471. if err := gensupport.DecodeResponse(target, res); err != nil {
  54472. return nil, err
  54473. }
  54474. return ret, nil
  54475. // {
  54476. // "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.",
  54477. // "httpMethod": "POST",
  54478. // "id": "compute.instances.setMinCpuPlatform",
  54479. // "parameterOrder": [
  54480. // "project",
  54481. // "zone",
  54482. // "instance"
  54483. // ],
  54484. // "parameters": {
  54485. // "instance": {
  54486. // "description": "Name of the instance scoping this request.",
  54487. // "location": "path",
  54488. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54489. // "required": true,
  54490. // "type": "string"
  54491. // },
  54492. // "project": {
  54493. // "description": "Project ID for this request.",
  54494. // "location": "path",
  54495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54496. // "required": true,
  54497. // "type": "string"
  54498. // },
  54499. // "requestId": {
  54500. // "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).",
  54501. // "location": "query",
  54502. // "type": "string"
  54503. // },
  54504. // "zone": {
  54505. // "description": "The name of the zone for this request.",
  54506. // "location": "path",
  54507. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54508. // "required": true,
  54509. // "type": "string"
  54510. // }
  54511. // },
  54512. // "path": "{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform",
  54513. // "request": {
  54514. // "$ref": "InstancesSetMinCpuPlatformRequest"
  54515. // },
  54516. // "response": {
  54517. // "$ref": "Operation"
  54518. // },
  54519. // "scopes": [
  54520. // "https://www.googleapis.com/auth/cloud-platform",
  54521. // "https://www.googleapis.com/auth/compute"
  54522. // ]
  54523. // }
  54524. }
  54525. // method id "compute.instances.setScheduling":
  54526. type InstancesSetSchedulingCall struct {
  54527. s *Service
  54528. project string
  54529. zone string
  54530. instance string
  54531. scheduling *Scheduling
  54532. urlParams_ gensupport.URLParams
  54533. ctx_ context.Context
  54534. header_ http.Header
  54535. }
  54536. // SetScheduling: Sets an instance's scheduling options.
  54537. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling
  54538. func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall {
  54539. c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54540. c.project = project
  54541. c.zone = zone
  54542. c.instance = instance
  54543. c.scheduling = scheduling
  54544. return c
  54545. }
  54546. // RequestId sets the optional parameter "requestId": An optional
  54547. // request ID to identify requests. Specify a unique request ID so that
  54548. // if you must retry your request, the server will know to ignore the
  54549. // request if it has already been completed.
  54550. //
  54551. // For example, consider a situation where you make an initial request
  54552. // and the request times out. If you make the request again with the
  54553. // same request ID, the server can check if original operation with the
  54554. // same request ID was received, and if so, will ignore the second
  54555. // request. This prevents clients from accidentally creating duplicate
  54556. // commitments.
  54557. //
  54558. // The request ID must be a valid UUID with the exception that zero UUID
  54559. // is not supported (00000000-0000-0000-0000-000000000000).
  54560. func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall {
  54561. c.urlParams_.Set("requestId", requestId)
  54562. return c
  54563. }
  54564. // Fields allows partial responses to be retrieved. See
  54565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54566. // for more information.
  54567. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall {
  54568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54569. return c
  54570. }
  54571. // Context sets the context to be used in this call's Do method. Any
  54572. // pending HTTP request will be aborted if the provided context is
  54573. // canceled.
  54574. func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall {
  54575. c.ctx_ = ctx
  54576. return c
  54577. }
  54578. // Header returns an http.Header that can be modified by the caller to
  54579. // add HTTP headers to the request.
  54580. func (c *InstancesSetSchedulingCall) Header() http.Header {
  54581. if c.header_ == nil {
  54582. c.header_ = make(http.Header)
  54583. }
  54584. return c.header_
  54585. }
  54586. func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) {
  54587. reqHeaders := make(http.Header)
  54588. for k, v := range c.header_ {
  54589. reqHeaders[k] = v
  54590. }
  54591. reqHeaders.Set("User-Agent", c.s.userAgent())
  54592. var body io.Reader = nil
  54593. body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling)
  54594. if err != nil {
  54595. return nil, err
  54596. }
  54597. reqHeaders.Set("Content-Type", "application/json")
  54598. c.urlParams_.Set("alt", alt)
  54599. c.urlParams_.Set("prettyPrint", "false")
  54600. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling")
  54601. urls += "?" + c.urlParams_.Encode()
  54602. req, err := http.NewRequest("POST", urls, body)
  54603. if err != nil {
  54604. return nil, err
  54605. }
  54606. req.Header = reqHeaders
  54607. googleapi.Expand(req.URL, map[string]string{
  54608. "project": c.project,
  54609. "zone": c.zone,
  54610. "instance": c.instance,
  54611. })
  54612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54613. }
  54614. // Do executes the "compute.instances.setScheduling" call.
  54615. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54616. // status code is an error. Response headers are in either
  54617. // *Operation.ServerResponse.Header or (if a response was returned at
  54618. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54619. // to check whether the returned error was because
  54620. // http.StatusNotModified was returned.
  54621. func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54622. gensupport.SetOptions(c.urlParams_, opts...)
  54623. res, err := c.doRequest("json")
  54624. if res != nil && res.StatusCode == http.StatusNotModified {
  54625. if res.Body != nil {
  54626. res.Body.Close()
  54627. }
  54628. return nil, &googleapi.Error{
  54629. Code: res.StatusCode,
  54630. Header: res.Header,
  54631. }
  54632. }
  54633. if err != nil {
  54634. return nil, err
  54635. }
  54636. defer googleapi.CloseBody(res)
  54637. if err := googleapi.CheckResponse(res); err != nil {
  54638. return nil, err
  54639. }
  54640. ret := &Operation{
  54641. ServerResponse: googleapi.ServerResponse{
  54642. Header: res.Header,
  54643. HTTPStatusCode: res.StatusCode,
  54644. },
  54645. }
  54646. target := &ret
  54647. if err := gensupport.DecodeResponse(target, res); err != nil {
  54648. return nil, err
  54649. }
  54650. return ret, nil
  54651. // {
  54652. // "description": "Sets an instance's scheduling options.",
  54653. // "httpMethod": "POST",
  54654. // "id": "compute.instances.setScheduling",
  54655. // "parameterOrder": [
  54656. // "project",
  54657. // "zone",
  54658. // "instance"
  54659. // ],
  54660. // "parameters": {
  54661. // "instance": {
  54662. // "description": "Instance name for this request.",
  54663. // "location": "path",
  54664. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54665. // "required": true,
  54666. // "type": "string"
  54667. // },
  54668. // "project": {
  54669. // "description": "Project ID for this request.",
  54670. // "location": "path",
  54671. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54672. // "required": true,
  54673. // "type": "string"
  54674. // },
  54675. // "requestId": {
  54676. // "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).",
  54677. // "location": "query",
  54678. // "type": "string"
  54679. // },
  54680. // "zone": {
  54681. // "description": "The name of the zone for this request.",
  54682. // "location": "path",
  54683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54684. // "required": true,
  54685. // "type": "string"
  54686. // }
  54687. // },
  54688. // "path": "{project}/zones/{zone}/instances/{instance}/setScheduling",
  54689. // "request": {
  54690. // "$ref": "Scheduling"
  54691. // },
  54692. // "response": {
  54693. // "$ref": "Operation"
  54694. // },
  54695. // "scopes": [
  54696. // "https://www.googleapis.com/auth/cloud-platform",
  54697. // "https://www.googleapis.com/auth/compute"
  54698. // ]
  54699. // }
  54700. }
  54701. // method id "compute.instances.setServiceAccount":
  54702. type InstancesSetServiceAccountCall struct {
  54703. s *Service
  54704. project string
  54705. zone string
  54706. instance string
  54707. instancessetserviceaccountrequest *InstancesSetServiceAccountRequest
  54708. urlParams_ gensupport.URLParams
  54709. ctx_ context.Context
  54710. header_ http.Header
  54711. }
  54712. // SetServiceAccount: Sets the service account on the instance. For more
  54713. // information, read Changing the service account and access scopes for
  54714. // an instance.
  54715. func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall {
  54716. c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54717. c.project = project
  54718. c.zone = zone
  54719. c.instance = instance
  54720. c.instancessetserviceaccountrequest = instancessetserviceaccountrequest
  54721. return c
  54722. }
  54723. // RequestId sets the optional parameter "requestId": An optional
  54724. // request ID to identify requests. Specify a unique request ID so that
  54725. // if you must retry your request, the server will know to ignore the
  54726. // request if it has already been completed.
  54727. //
  54728. // For example, consider a situation where you make an initial request
  54729. // and the request times out. If you make the request again with the
  54730. // same request ID, the server can check if original operation with the
  54731. // same request ID was received, and if so, will ignore the second
  54732. // request. This prevents clients from accidentally creating duplicate
  54733. // commitments.
  54734. //
  54735. // The request ID must be a valid UUID with the exception that zero UUID
  54736. // is not supported (00000000-0000-0000-0000-000000000000).
  54737. func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall {
  54738. c.urlParams_.Set("requestId", requestId)
  54739. return c
  54740. }
  54741. // Fields allows partial responses to be retrieved. See
  54742. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54743. // for more information.
  54744. func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall {
  54745. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54746. return c
  54747. }
  54748. // Context sets the context to be used in this call's Do method. Any
  54749. // pending HTTP request will be aborted if the provided context is
  54750. // canceled.
  54751. func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall {
  54752. c.ctx_ = ctx
  54753. return c
  54754. }
  54755. // Header returns an http.Header that can be modified by the caller to
  54756. // add HTTP headers to the request.
  54757. func (c *InstancesSetServiceAccountCall) Header() http.Header {
  54758. if c.header_ == nil {
  54759. c.header_ = make(http.Header)
  54760. }
  54761. return c.header_
  54762. }
  54763. func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) {
  54764. reqHeaders := make(http.Header)
  54765. for k, v := range c.header_ {
  54766. reqHeaders[k] = v
  54767. }
  54768. reqHeaders.Set("User-Agent", c.s.userAgent())
  54769. var body io.Reader = nil
  54770. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest)
  54771. if err != nil {
  54772. return nil, err
  54773. }
  54774. reqHeaders.Set("Content-Type", "application/json")
  54775. c.urlParams_.Set("alt", alt)
  54776. c.urlParams_.Set("prettyPrint", "false")
  54777. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setServiceAccount")
  54778. urls += "?" + c.urlParams_.Encode()
  54779. req, err := http.NewRequest("POST", urls, body)
  54780. if err != nil {
  54781. return nil, err
  54782. }
  54783. req.Header = reqHeaders
  54784. googleapi.Expand(req.URL, map[string]string{
  54785. "project": c.project,
  54786. "zone": c.zone,
  54787. "instance": c.instance,
  54788. })
  54789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54790. }
  54791. // Do executes the "compute.instances.setServiceAccount" call.
  54792. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  54793. // status code is an error. Response headers are in either
  54794. // *Operation.ServerResponse.Header or (if a response was returned at
  54795. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  54796. // to check whether the returned error was because
  54797. // http.StatusNotModified was returned.
  54798. func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  54799. gensupport.SetOptions(c.urlParams_, opts...)
  54800. res, err := c.doRequest("json")
  54801. if res != nil && res.StatusCode == http.StatusNotModified {
  54802. if res.Body != nil {
  54803. res.Body.Close()
  54804. }
  54805. return nil, &googleapi.Error{
  54806. Code: res.StatusCode,
  54807. Header: res.Header,
  54808. }
  54809. }
  54810. if err != nil {
  54811. return nil, err
  54812. }
  54813. defer googleapi.CloseBody(res)
  54814. if err := googleapi.CheckResponse(res); err != nil {
  54815. return nil, err
  54816. }
  54817. ret := &Operation{
  54818. ServerResponse: googleapi.ServerResponse{
  54819. Header: res.Header,
  54820. HTTPStatusCode: res.StatusCode,
  54821. },
  54822. }
  54823. target := &ret
  54824. if err := gensupport.DecodeResponse(target, res); err != nil {
  54825. return nil, err
  54826. }
  54827. return ret, nil
  54828. // {
  54829. // "description": "Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.",
  54830. // "httpMethod": "POST",
  54831. // "id": "compute.instances.setServiceAccount",
  54832. // "parameterOrder": [
  54833. // "project",
  54834. // "zone",
  54835. // "instance"
  54836. // ],
  54837. // "parameters": {
  54838. // "instance": {
  54839. // "description": "Name of the instance resource to start.",
  54840. // "location": "path",
  54841. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  54842. // "required": true,
  54843. // "type": "string"
  54844. // },
  54845. // "project": {
  54846. // "description": "Project ID for this request.",
  54847. // "location": "path",
  54848. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  54849. // "required": true,
  54850. // "type": "string"
  54851. // },
  54852. // "requestId": {
  54853. // "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).",
  54854. // "location": "query",
  54855. // "type": "string"
  54856. // },
  54857. // "zone": {
  54858. // "description": "The name of the zone for this request.",
  54859. // "location": "path",
  54860. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  54861. // "required": true,
  54862. // "type": "string"
  54863. // }
  54864. // },
  54865. // "path": "{project}/zones/{zone}/instances/{instance}/setServiceAccount",
  54866. // "request": {
  54867. // "$ref": "InstancesSetServiceAccountRequest"
  54868. // },
  54869. // "response": {
  54870. // "$ref": "Operation"
  54871. // },
  54872. // "scopes": [
  54873. // "https://www.googleapis.com/auth/cloud-platform",
  54874. // "https://www.googleapis.com/auth/compute"
  54875. // ]
  54876. // }
  54877. }
  54878. // method id "compute.instances.setShieldedInstanceIntegrityPolicy":
  54879. type InstancesSetShieldedInstanceIntegrityPolicyCall struct {
  54880. s *Service
  54881. project string
  54882. zone string
  54883. instance string
  54884. shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy
  54885. urlParams_ gensupport.URLParams
  54886. ctx_ context.Context
  54887. header_ http.Header
  54888. }
  54889. // SetShieldedInstanceIntegrityPolicy: Sets the Shielded Instance
  54890. // integrity policy for an instance. You can only use this method on a
  54891. // running instance. This method supports PATCH semantics and uses the
  54892. // JSON merge patch format and processing rules.
  54893. func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zone string, instance string, shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  54894. c := &InstancesSetShieldedInstanceIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  54895. c.project = project
  54896. c.zone = zone
  54897. c.instance = instance
  54898. c.shieldedinstanceintegritypolicy = shieldedinstanceintegritypolicy
  54899. return c
  54900. }
  54901. // RequestId sets the optional parameter "requestId": An optional
  54902. // request ID to identify requests. Specify a unique request ID so that
  54903. // if you must retry your request, the server will know to ignore the
  54904. // request if it has already been completed.
  54905. //
  54906. // For example, consider a situation where you make an initial request
  54907. // and the request times out. If you make the request again with the
  54908. // same request ID, the server can check if original operation with the
  54909. // same request ID was received, and if so, will ignore the second
  54910. // request. This prevents clients from accidentally creating duplicate
  54911. // commitments.
  54912. //
  54913. // The request ID must be a valid UUID with the exception that zero UUID
  54914. // is not supported (00000000-0000-0000-0000-000000000000).
  54915. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  54916. c.urlParams_.Set("requestId", requestId)
  54917. return c
  54918. }
  54919. // Fields allows partial responses to be retrieved. See
  54920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  54921. // for more information.
  54922. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  54923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  54924. return c
  54925. }
  54926. // Context sets the context to be used in this call's Do method. Any
  54927. // pending HTTP request will be aborted if the provided context is
  54928. // canceled.
  54929. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedInstanceIntegrityPolicyCall {
  54930. c.ctx_ = ctx
  54931. return c
  54932. }
  54933. // Header returns an http.Header that can be modified by the caller to
  54934. // add HTTP headers to the request.
  54935. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header {
  54936. if c.header_ == nil {
  54937. c.header_ = make(http.Header)
  54938. }
  54939. return c.header_
  54940. }
  54941. func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) {
  54942. reqHeaders := make(http.Header)
  54943. for k, v := range c.header_ {
  54944. reqHeaders[k] = v
  54945. }
  54946. reqHeaders.Set("User-Agent", c.s.userAgent())
  54947. var body io.Reader = nil
  54948. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy)
  54949. if err != nil {
  54950. return nil, err
  54951. }
  54952. reqHeaders.Set("Content-Type", "application/json")
  54953. c.urlParams_.Set("alt", alt)
  54954. c.urlParams_.Set("prettyPrint", "false")
  54955. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy")
  54956. urls += "?" + c.urlParams_.Encode()
  54957. req, err := http.NewRequest("PATCH", urls, body)
  54958. if err != nil {
  54959. return nil, err
  54960. }
  54961. req.Header = reqHeaders
  54962. googleapi.Expand(req.URL, map[string]string{
  54963. "project": c.project,
  54964. "zone": c.zone,
  54965. "instance": c.instance,
  54966. })
  54967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  54968. }
  54969. // Do executes the "compute.instances.setShieldedInstanceIntegrityPolicy" 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 *InstancesSetShieldedInstanceIntegrityPolicyCall) 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": "Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  55008. // "httpMethod": "PATCH",
  55009. // "id": "compute.instances.setShieldedInstanceIntegrityPolicy",
  55010. // "parameterOrder": [
  55011. // "project",
  55012. // "zone",
  55013. // "instance"
  55014. // ],
  55015. // "parameters": {
  55016. // "instance": {
  55017. // "description": "Name or id of the instance scoping this request.",
  55018. // "location": "path",
  55019. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55020. // "required": true,
  55021. // "type": "string"
  55022. // },
  55023. // "project": {
  55024. // "description": "Project ID for this request.",
  55025. // "location": "path",
  55026. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55027. // "required": true,
  55028. // "type": "string"
  55029. // },
  55030. // "requestId": {
  55031. // "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).",
  55032. // "location": "query",
  55033. // "type": "string"
  55034. // },
  55035. // "zone": {
  55036. // "description": "The name of the zone for this request.",
  55037. // "location": "path",
  55038. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55039. // "required": true,
  55040. // "type": "string"
  55041. // }
  55042. // },
  55043. // "path": "{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy",
  55044. // "request": {
  55045. // "$ref": "ShieldedInstanceIntegrityPolicy"
  55046. // },
  55047. // "response": {
  55048. // "$ref": "Operation"
  55049. // },
  55050. // "scopes": [
  55051. // "https://www.googleapis.com/auth/cloud-platform",
  55052. // "https://www.googleapis.com/auth/compute"
  55053. // ]
  55054. // }
  55055. }
  55056. // method id "compute.instances.setTags":
  55057. type InstancesSetTagsCall struct {
  55058. s *Service
  55059. project string
  55060. zone string
  55061. instance string
  55062. tags *Tags
  55063. urlParams_ gensupport.URLParams
  55064. ctx_ context.Context
  55065. header_ http.Header
  55066. }
  55067. // SetTags: Sets network tags for the specified instance to the data
  55068. // included in the request.
  55069. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags
  55070. func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall {
  55071. c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55072. c.project = project
  55073. c.zone = zone
  55074. c.instance = instance
  55075. c.tags = tags
  55076. return c
  55077. }
  55078. // RequestId sets the optional parameter "requestId": An optional
  55079. // request ID to identify requests. Specify a unique request ID so that
  55080. // if you must retry your request, the server will know to ignore the
  55081. // request if it has already been completed.
  55082. //
  55083. // For example, consider a situation where you make an initial request
  55084. // and the request times out. If you make the request again with the
  55085. // same request ID, the server can check if original operation with the
  55086. // same request ID was received, and if so, will ignore the second
  55087. // request. This prevents clients from accidentally creating duplicate
  55088. // commitments.
  55089. //
  55090. // The request ID must be a valid UUID with the exception that zero UUID
  55091. // is not supported (00000000-0000-0000-0000-000000000000).
  55092. func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall {
  55093. c.urlParams_.Set("requestId", requestId)
  55094. return c
  55095. }
  55096. // Fields allows partial responses to be retrieved. See
  55097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55098. // for more information.
  55099. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall {
  55100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55101. return c
  55102. }
  55103. // Context sets the context to be used in this call's Do method. Any
  55104. // pending HTTP request will be aborted if the provided context is
  55105. // canceled.
  55106. func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall {
  55107. c.ctx_ = ctx
  55108. return c
  55109. }
  55110. // Header returns an http.Header that can be modified by the caller to
  55111. // add HTTP headers to the request.
  55112. func (c *InstancesSetTagsCall) Header() http.Header {
  55113. if c.header_ == nil {
  55114. c.header_ = make(http.Header)
  55115. }
  55116. return c.header_
  55117. }
  55118. func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) {
  55119. reqHeaders := make(http.Header)
  55120. for k, v := range c.header_ {
  55121. reqHeaders[k] = v
  55122. }
  55123. reqHeaders.Set("User-Agent", c.s.userAgent())
  55124. var body io.Reader = nil
  55125. body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags)
  55126. if err != nil {
  55127. return nil, err
  55128. }
  55129. reqHeaders.Set("Content-Type", "application/json")
  55130. c.urlParams_.Set("alt", alt)
  55131. c.urlParams_.Set("prettyPrint", "false")
  55132. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags")
  55133. urls += "?" + c.urlParams_.Encode()
  55134. req, err := http.NewRequest("POST", urls, body)
  55135. if err != nil {
  55136. return nil, err
  55137. }
  55138. req.Header = reqHeaders
  55139. googleapi.Expand(req.URL, map[string]string{
  55140. "project": c.project,
  55141. "zone": c.zone,
  55142. "instance": c.instance,
  55143. })
  55144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55145. }
  55146. // Do executes the "compute.instances.setTags" call.
  55147. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55148. // status code is an error. Response headers are in either
  55149. // *Operation.ServerResponse.Header or (if a response was returned at
  55150. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55151. // to check whether the returned error was because
  55152. // http.StatusNotModified was returned.
  55153. func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55154. gensupport.SetOptions(c.urlParams_, opts...)
  55155. res, err := c.doRequest("json")
  55156. if res != nil && res.StatusCode == http.StatusNotModified {
  55157. if res.Body != nil {
  55158. res.Body.Close()
  55159. }
  55160. return nil, &googleapi.Error{
  55161. Code: res.StatusCode,
  55162. Header: res.Header,
  55163. }
  55164. }
  55165. if err != nil {
  55166. return nil, err
  55167. }
  55168. defer googleapi.CloseBody(res)
  55169. if err := googleapi.CheckResponse(res); err != nil {
  55170. return nil, err
  55171. }
  55172. ret := &Operation{
  55173. ServerResponse: googleapi.ServerResponse{
  55174. Header: res.Header,
  55175. HTTPStatusCode: res.StatusCode,
  55176. },
  55177. }
  55178. target := &ret
  55179. if err := gensupport.DecodeResponse(target, res); err != nil {
  55180. return nil, err
  55181. }
  55182. return ret, nil
  55183. // {
  55184. // "description": "Sets network tags for the specified instance to the data included in the request.",
  55185. // "httpMethod": "POST",
  55186. // "id": "compute.instances.setTags",
  55187. // "parameterOrder": [
  55188. // "project",
  55189. // "zone",
  55190. // "instance"
  55191. // ],
  55192. // "parameters": {
  55193. // "instance": {
  55194. // "description": "Name of the instance scoping this request.",
  55195. // "location": "path",
  55196. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55197. // "required": true,
  55198. // "type": "string"
  55199. // },
  55200. // "project": {
  55201. // "description": "Project ID for this request.",
  55202. // "location": "path",
  55203. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55204. // "required": true,
  55205. // "type": "string"
  55206. // },
  55207. // "requestId": {
  55208. // "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).",
  55209. // "location": "query",
  55210. // "type": "string"
  55211. // },
  55212. // "zone": {
  55213. // "description": "The name of the zone for this request.",
  55214. // "location": "path",
  55215. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55216. // "required": true,
  55217. // "type": "string"
  55218. // }
  55219. // },
  55220. // "path": "{project}/zones/{zone}/instances/{instance}/setTags",
  55221. // "request": {
  55222. // "$ref": "Tags"
  55223. // },
  55224. // "response": {
  55225. // "$ref": "Operation"
  55226. // },
  55227. // "scopes": [
  55228. // "https://www.googleapis.com/auth/cloud-platform",
  55229. // "https://www.googleapis.com/auth/compute"
  55230. // ]
  55231. // }
  55232. }
  55233. // method id "compute.instances.simulateMaintenanceEvent":
  55234. type InstancesSimulateMaintenanceEventCall struct {
  55235. s *Service
  55236. project string
  55237. zone string
  55238. instance string
  55239. urlParams_ gensupport.URLParams
  55240. ctx_ context.Context
  55241. header_ http.Header
  55242. }
  55243. // SimulateMaintenanceEvent: Simulates a maintenance event on the
  55244. // instance.
  55245. func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall {
  55246. c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55247. c.project = project
  55248. c.zone = zone
  55249. c.instance = instance
  55250. return c
  55251. }
  55252. // Fields allows partial responses to be retrieved. See
  55253. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55254. // for more information.
  55255. func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall {
  55256. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55257. return c
  55258. }
  55259. // Context sets the context to be used in this call's Do method. Any
  55260. // pending HTTP request will be aborted if the provided context is
  55261. // canceled.
  55262. func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall {
  55263. c.ctx_ = ctx
  55264. return c
  55265. }
  55266. // Header returns an http.Header that can be modified by the caller to
  55267. // add HTTP headers to the request.
  55268. func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header {
  55269. if c.header_ == nil {
  55270. c.header_ = make(http.Header)
  55271. }
  55272. return c.header_
  55273. }
  55274. func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  55275. reqHeaders := make(http.Header)
  55276. for k, v := range c.header_ {
  55277. reqHeaders[k] = v
  55278. }
  55279. reqHeaders.Set("User-Agent", c.s.userAgent())
  55280. var body io.Reader = nil
  55281. c.urlParams_.Set("alt", alt)
  55282. c.urlParams_.Set("prettyPrint", "false")
  55283. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent")
  55284. urls += "?" + c.urlParams_.Encode()
  55285. req, err := http.NewRequest("POST", urls, body)
  55286. if err != nil {
  55287. return nil, err
  55288. }
  55289. req.Header = reqHeaders
  55290. googleapi.Expand(req.URL, map[string]string{
  55291. "project": c.project,
  55292. "zone": c.zone,
  55293. "instance": c.instance,
  55294. })
  55295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55296. }
  55297. // Do executes the "compute.instances.simulateMaintenanceEvent" call.
  55298. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55299. // status code is an error. Response headers are in either
  55300. // *Operation.ServerResponse.Header or (if a response was returned at
  55301. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55302. // to check whether the returned error was because
  55303. // http.StatusNotModified was returned.
  55304. func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55305. gensupport.SetOptions(c.urlParams_, opts...)
  55306. res, err := c.doRequest("json")
  55307. if res != nil && res.StatusCode == http.StatusNotModified {
  55308. if res.Body != nil {
  55309. res.Body.Close()
  55310. }
  55311. return nil, &googleapi.Error{
  55312. Code: res.StatusCode,
  55313. Header: res.Header,
  55314. }
  55315. }
  55316. if err != nil {
  55317. return nil, err
  55318. }
  55319. defer googleapi.CloseBody(res)
  55320. if err := googleapi.CheckResponse(res); err != nil {
  55321. return nil, err
  55322. }
  55323. ret := &Operation{
  55324. ServerResponse: googleapi.ServerResponse{
  55325. Header: res.Header,
  55326. HTTPStatusCode: res.StatusCode,
  55327. },
  55328. }
  55329. target := &ret
  55330. if err := gensupport.DecodeResponse(target, res); err != nil {
  55331. return nil, err
  55332. }
  55333. return ret, nil
  55334. // {
  55335. // "description": "Simulates a maintenance event on the instance.",
  55336. // "httpMethod": "POST",
  55337. // "id": "compute.instances.simulateMaintenanceEvent",
  55338. // "parameterOrder": [
  55339. // "project",
  55340. // "zone",
  55341. // "instance"
  55342. // ],
  55343. // "parameters": {
  55344. // "instance": {
  55345. // "description": "Name of the instance scoping this request.",
  55346. // "location": "path",
  55347. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55348. // "required": true,
  55349. // "type": "string"
  55350. // },
  55351. // "project": {
  55352. // "description": "Project ID for this request.",
  55353. // "location": "path",
  55354. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55355. // "required": true,
  55356. // "type": "string"
  55357. // },
  55358. // "zone": {
  55359. // "description": "The name of the zone for this request.",
  55360. // "location": "path",
  55361. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55362. // "required": true,
  55363. // "type": "string"
  55364. // }
  55365. // },
  55366. // "path": "{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent",
  55367. // "response": {
  55368. // "$ref": "Operation"
  55369. // },
  55370. // "scopes": [
  55371. // "https://www.googleapis.com/auth/cloud-platform",
  55372. // "https://www.googleapis.com/auth/compute"
  55373. // ]
  55374. // }
  55375. }
  55376. // method id "compute.instances.start":
  55377. type InstancesStartCall struct {
  55378. s *Service
  55379. project string
  55380. zone string
  55381. instance string
  55382. urlParams_ gensupport.URLParams
  55383. ctx_ context.Context
  55384. header_ http.Header
  55385. }
  55386. // Start: Starts an instance that was stopped using the instances().stop
  55387. // method. For more information, see Restart an instance.
  55388. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start
  55389. func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall {
  55390. c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55391. c.project = project
  55392. c.zone = zone
  55393. c.instance = instance
  55394. return c
  55395. }
  55396. // RequestId sets the optional parameter "requestId": An optional
  55397. // request ID to identify requests. Specify a unique request ID so that
  55398. // if you must retry your request, the server will know to ignore the
  55399. // request if it has already been completed.
  55400. //
  55401. // For example, consider a situation where you make an initial request
  55402. // and the request times out. If you make the request again with the
  55403. // same request ID, the server can check if original operation with the
  55404. // same request ID was received, and if so, will ignore the second
  55405. // request. This prevents clients from accidentally creating duplicate
  55406. // commitments.
  55407. //
  55408. // The request ID must be a valid UUID with the exception that zero UUID
  55409. // is not supported (00000000-0000-0000-0000-000000000000).
  55410. func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall {
  55411. c.urlParams_.Set("requestId", requestId)
  55412. return c
  55413. }
  55414. // Fields allows partial responses to be retrieved. See
  55415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55416. // for more information.
  55417. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall {
  55418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55419. return c
  55420. }
  55421. // Context sets the context to be used in this call's Do method. Any
  55422. // pending HTTP request will be aborted if the provided context is
  55423. // canceled.
  55424. func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall {
  55425. c.ctx_ = ctx
  55426. return c
  55427. }
  55428. // Header returns an http.Header that can be modified by the caller to
  55429. // add HTTP headers to the request.
  55430. func (c *InstancesStartCall) Header() http.Header {
  55431. if c.header_ == nil {
  55432. c.header_ = make(http.Header)
  55433. }
  55434. return c.header_
  55435. }
  55436. func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) {
  55437. reqHeaders := make(http.Header)
  55438. for k, v := range c.header_ {
  55439. reqHeaders[k] = v
  55440. }
  55441. reqHeaders.Set("User-Agent", c.s.userAgent())
  55442. var body io.Reader = nil
  55443. c.urlParams_.Set("alt", alt)
  55444. c.urlParams_.Set("prettyPrint", "false")
  55445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start")
  55446. urls += "?" + c.urlParams_.Encode()
  55447. req, err := http.NewRequest("POST", urls, body)
  55448. if err != nil {
  55449. return nil, err
  55450. }
  55451. req.Header = reqHeaders
  55452. googleapi.Expand(req.URL, map[string]string{
  55453. "project": c.project,
  55454. "zone": c.zone,
  55455. "instance": c.instance,
  55456. })
  55457. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55458. }
  55459. // Do executes the "compute.instances.start" call.
  55460. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55461. // status code is an error. Response headers are in either
  55462. // *Operation.ServerResponse.Header or (if a response was returned at
  55463. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55464. // to check whether the returned error was because
  55465. // http.StatusNotModified was returned.
  55466. func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55467. gensupport.SetOptions(c.urlParams_, opts...)
  55468. res, err := c.doRequest("json")
  55469. if res != nil && res.StatusCode == http.StatusNotModified {
  55470. if res.Body != nil {
  55471. res.Body.Close()
  55472. }
  55473. return nil, &googleapi.Error{
  55474. Code: res.StatusCode,
  55475. Header: res.Header,
  55476. }
  55477. }
  55478. if err != nil {
  55479. return nil, err
  55480. }
  55481. defer googleapi.CloseBody(res)
  55482. if err := googleapi.CheckResponse(res); err != nil {
  55483. return nil, err
  55484. }
  55485. ret := &Operation{
  55486. ServerResponse: googleapi.ServerResponse{
  55487. Header: res.Header,
  55488. HTTPStatusCode: res.StatusCode,
  55489. },
  55490. }
  55491. target := &ret
  55492. if err := gensupport.DecodeResponse(target, res); err != nil {
  55493. return nil, err
  55494. }
  55495. return ret, nil
  55496. // {
  55497. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  55498. // "httpMethod": "POST",
  55499. // "id": "compute.instances.start",
  55500. // "parameterOrder": [
  55501. // "project",
  55502. // "zone",
  55503. // "instance"
  55504. // ],
  55505. // "parameters": {
  55506. // "instance": {
  55507. // "description": "Name of the instance resource to start.",
  55508. // "location": "path",
  55509. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55510. // "required": true,
  55511. // "type": "string"
  55512. // },
  55513. // "project": {
  55514. // "description": "Project ID for this request.",
  55515. // "location": "path",
  55516. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55517. // "required": true,
  55518. // "type": "string"
  55519. // },
  55520. // "requestId": {
  55521. // "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).",
  55522. // "location": "query",
  55523. // "type": "string"
  55524. // },
  55525. // "zone": {
  55526. // "description": "The name of the zone for this request.",
  55527. // "location": "path",
  55528. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55529. // "required": true,
  55530. // "type": "string"
  55531. // }
  55532. // },
  55533. // "path": "{project}/zones/{zone}/instances/{instance}/start",
  55534. // "response": {
  55535. // "$ref": "Operation"
  55536. // },
  55537. // "scopes": [
  55538. // "https://www.googleapis.com/auth/cloud-platform",
  55539. // "https://www.googleapis.com/auth/compute"
  55540. // ]
  55541. // }
  55542. }
  55543. // method id "compute.instances.startWithEncryptionKey":
  55544. type InstancesStartWithEncryptionKeyCall struct {
  55545. s *Service
  55546. project string
  55547. zone string
  55548. instance string
  55549. instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest
  55550. urlParams_ gensupport.URLParams
  55551. ctx_ context.Context
  55552. header_ http.Header
  55553. }
  55554. // StartWithEncryptionKey: Starts an instance that was stopped using the
  55555. // instances().stop method. For more information, see Restart an
  55556. // instance.
  55557. func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall {
  55558. c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55559. c.project = project
  55560. c.zone = zone
  55561. c.instance = instance
  55562. c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest
  55563. return c
  55564. }
  55565. // RequestId sets the optional parameter "requestId": An optional
  55566. // request ID to identify requests. Specify a unique request ID so that
  55567. // if you must retry your request, the server will know to ignore the
  55568. // request if it has already been completed.
  55569. //
  55570. // For example, consider a situation where you make an initial request
  55571. // and the request times out. If you make the request again with the
  55572. // same request ID, the server can check if original operation with the
  55573. // same request ID was received, and if so, will ignore the second
  55574. // request. This prevents clients from accidentally creating duplicate
  55575. // commitments.
  55576. //
  55577. // The request ID must be a valid UUID with the exception that zero UUID
  55578. // is not supported (00000000-0000-0000-0000-000000000000).
  55579. func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall {
  55580. c.urlParams_.Set("requestId", requestId)
  55581. return c
  55582. }
  55583. // Fields allows partial responses to be retrieved. See
  55584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55585. // for more information.
  55586. func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall {
  55587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55588. return c
  55589. }
  55590. // Context sets the context to be used in this call's Do method. Any
  55591. // pending HTTP request will be aborted if the provided context is
  55592. // canceled.
  55593. func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall {
  55594. c.ctx_ = ctx
  55595. return c
  55596. }
  55597. // Header returns an http.Header that can be modified by the caller to
  55598. // add HTTP headers to the request.
  55599. func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header {
  55600. if c.header_ == nil {
  55601. c.header_ = make(http.Header)
  55602. }
  55603. return c.header_
  55604. }
  55605. func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) {
  55606. reqHeaders := make(http.Header)
  55607. for k, v := range c.header_ {
  55608. reqHeaders[k] = v
  55609. }
  55610. reqHeaders.Set("User-Agent", c.s.userAgent())
  55611. var body io.Reader = nil
  55612. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest)
  55613. if err != nil {
  55614. return nil, err
  55615. }
  55616. reqHeaders.Set("Content-Type", "application/json")
  55617. c.urlParams_.Set("alt", alt)
  55618. c.urlParams_.Set("prettyPrint", "false")
  55619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey")
  55620. urls += "?" + c.urlParams_.Encode()
  55621. req, err := http.NewRequest("POST", urls, body)
  55622. if err != nil {
  55623. return nil, err
  55624. }
  55625. req.Header = reqHeaders
  55626. googleapi.Expand(req.URL, map[string]string{
  55627. "project": c.project,
  55628. "zone": c.zone,
  55629. "instance": c.instance,
  55630. })
  55631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55632. }
  55633. // Do executes the "compute.instances.startWithEncryptionKey" call.
  55634. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55635. // status code is an error. Response headers are in either
  55636. // *Operation.ServerResponse.Header or (if a response was returned at
  55637. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55638. // to check whether the returned error was because
  55639. // http.StatusNotModified was returned.
  55640. func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55641. gensupport.SetOptions(c.urlParams_, opts...)
  55642. res, err := c.doRequest("json")
  55643. if res != nil && res.StatusCode == http.StatusNotModified {
  55644. if res.Body != nil {
  55645. res.Body.Close()
  55646. }
  55647. return nil, &googleapi.Error{
  55648. Code: res.StatusCode,
  55649. Header: res.Header,
  55650. }
  55651. }
  55652. if err != nil {
  55653. return nil, err
  55654. }
  55655. defer googleapi.CloseBody(res)
  55656. if err := googleapi.CheckResponse(res); err != nil {
  55657. return nil, err
  55658. }
  55659. ret := &Operation{
  55660. ServerResponse: googleapi.ServerResponse{
  55661. Header: res.Header,
  55662. HTTPStatusCode: res.StatusCode,
  55663. },
  55664. }
  55665. target := &ret
  55666. if err := gensupport.DecodeResponse(target, res); err != nil {
  55667. return nil, err
  55668. }
  55669. return ret, nil
  55670. // {
  55671. // "description": "Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance.",
  55672. // "httpMethod": "POST",
  55673. // "id": "compute.instances.startWithEncryptionKey",
  55674. // "parameterOrder": [
  55675. // "project",
  55676. // "zone",
  55677. // "instance"
  55678. // ],
  55679. // "parameters": {
  55680. // "instance": {
  55681. // "description": "Name of the instance resource to start.",
  55682. // "location": "path",
  55683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55684. // "required": true,
  55685. // "type": "string"
  55686. // },
  55687. // "project": {
  55688. // "description": "Project ID for this request.",
  55689. // "location": "path",
  55690. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55691. // "required": true,
  55692. // "type": "string"
  55693. // },
  55694. // "requestId": {
  55695. // "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).",
  55696. // "location": "query",
  55697. // "type": "string"
  55698. // },
  55699. // "zone": {
  55700. // "description": "The name of the zone for this request.",
  55701. // "location": "path",
  55702. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55703. // "required": true,
  55704. // "type": "string"
  55705. // }
  55706. // },
  55707. // "path": "{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey",
  55708. // "request": {
  55709. // "$ref": "InstancesStartWithEncryptionKeyRequest"
  55710. // },
  55711. // "response": {
  55712. // "$ref": "Operation"
  55713. // },
  55714. // "scopes": [
  55715. // "https://www.googleapis.com/auth/cloud-platform",
  55716. // "https://www.googleapis.com/auth/compute"
  55717. // ]
  55718. // }
  55719. }
  55720. // method id "compute.instances.stop":
  55721. type InstancesStopCall struct {
  55722. s *Service
  55723. project string
  55724. zone string
  55725. instance string
  55726. urlParams_ gensupport.URLParams
  55727. ctx_ context.Context
  55728. header_ http.Header
  55729. }
  55730. // Stop: Stops a running instance, shutting it down cleanly, and allows
  55731. // you to restart the instance at a later time. Stopped instances do not
  55732. // incur VM usage charges while they are stopped. However, resources
  55733. // that the VM is using, such as persistent disks and static IP
  55734. // addresses, will continue to be charged until they are deleted. For
  55735. // more information, see Stopping an instance.
  55736. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop
  55737. func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall {
  55738. c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55739. c.project = project
  55740. c.zone = zone
  55741. c.instance = instance
  55742. return c
  55743. }
  55744. // RequestId sets the optional parameter "requestId": An optional
  55745. // request ID to identify requests. Specify a unique request ID so that
  55746. // if you must retry your request, the server will know to ignore the
  55747. // request if it has already been completed.
  55748. //
  55749. // For example, consider a situation where you make an initial request
  55750. // and the request times out. If you make the request again with the
  55751. // same request ID, the server can check if original operation with the
  55752. // same request ID was received, and if so, will ignore the second
  55753. // request. This prevents clients from accidentally creating duplicate
  55754. // commitments.
  55755. //
  55756. // The request ID must be a valid UUID with the exception that zero UUID
  55757. // is not supported (00000000-0000-0000-0000-000000000000).
  55758. func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall {
  55759. c.urlParams_.Set("requestId", requestId)
  55760. return c
  55761. }
  55762. // Fields allows partial responses to be retrieved. See
  55763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55764. // for more information.
  55765. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall {
  55766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55767. return c
  55768. }
  55769. // Context sets the context to be used in this call's Do method. Any
  55770. // pending HTTP request will be aborted if the provided context is
  55771. // canceled.
  55772. func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall {
  55773. c.ctx_ = ctx
  55774. return c
  55775. }
  55776. // Header returns an http.Header that can be modified by the caller to
  55777. // add HTTP headers to the request.
  55778. func (c *InstancesStopCall) Header() http.Header {
  55779. if c.header_ == nil {
  55780. c.header_ = make(http.Header)
  55781. }
  55782. return c.header_
  55783. }
  55784. func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) {
  55785. reqHeaders := make(http.Header)
  55786. for k, v := range c.header_ {
  55787. reqHeaders[k] = v
  55788. }
  55789. reqHeaders.Set("User-Agent", c.s.userAgent())
  55790. var body io.Reader = nil
  55791. c.urlParams_.Set("alt", alt)
  55792. c.urlParams_.Set("prettyPrint", "false")
  55793. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop")
  55794. urls += "?" + c.urlParams_.Encode()
  55795. req, err := http.NewRequest("POST", urls, body)
  55796. if err != nil {
  55797. return nil, err
  55798. }
  55799. req.Header = reqHeaders
  55800. googleapi.Expand(req.URL, map[string]string{
  55801. "project": c.project,
  55802. "zone": c.zone,
  55803. "instance": c.instance,
  55804. })
  55805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55806. }
  55807. // Do executes the "compute.instances.stop" call.
  55808. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  55809. // status code is an error. Response headers are in either
  55810. // *Operation.ServerResponse.Header or (if a response was returned at
  55811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  55812. // to check whether the returned error was because
  55813. // http.StatusNotModified was returned.
  55814. func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  55815. gensupport.SetOptions(c.urlParams_, opts...)
  55816. res, err := c.doRequest("json")
  55817. if res != nil && res.StatusCode == http.StatusNotModified {
  55818. if res.Body != nil {
  55819. res.Body.Close()
  55820. }
  55821. return nil, &googleapi.Error{
  55822. Code: res.StatusCode,
  55823. Header: res.Header,
  55824. }
  55825. }
  55826. if err != nil {
  55827. return nil, err
  55828. }
  55829. defer googleapi.CloseBody(res)
  55830. if err := googleapi.CheckResponse(res); err != nil {
  55831. return nil, err
  55832. }
  55833. ret := &Operation{
  55834. ServerResponse: googleapi.ServerResponse{
  55835. Header: res.Header,
  55836. HTTPStatusCode: res.StatusCode,
  55837. },
  55838. }
  55839. target := &ret
  55840. if err := gensupport.DecodeResponse(target, res); err != nil {
  55841. return nil, err
  55842. }
  55843. return ret, nil
  55844. // {
  55845. // "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.",
  55846. // "httpMethod": "POST",
  55847. // "id": "compute.instances.stop",
  55848. // "parameterOrder": [
  55849. // "project",
  55850. // "zone",
  55851. // "instance"
  55852. // ],
  55853. // "parameters": {
  55854. // "instance": {
  55855. // "description": "Name of the instance resource to stop.",
  55856. // "location": "path",
  55857. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  55858. // "required": true,
  55859. // "type": "string"
  55860. // },
  55861. // "project": {
  55862. // "description": "Project ID for this request.",
  55863. // "location": "path",
  55864. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  55865. // "required": true,
  55866. // "type": "string"
  55867. // },
  55868. // "requestId": {
  55869. // "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).",
  55870. // "location": "query",
  55871. // "type": "string"
  55872. // },
  55873. // "zone": {
  55874. // "description": "The name of the zone for this request.",
  55875. // "location": "path",
  55876. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  55877. // "required": true,
  55878. // "type": "string"
  55879. // }
  55880. // },
  55881. // "path": "{project}/zones/{zone}/instances/{instance}/stop",
  55882. // "response": {
  55883. // "$ref": "Operation"
  55884. // },
  55885. // "scopes": [
  55886. // "https://www.googleapis.com/auth/cloud-platform",
  55887. // "https://www.googleapis.com/auth/compute"
  55888. // ]
  55889. // }
  55890. }
  55891. // method id "compute.instances.testIamPermissions":
  55892. type InstancesTestIamPermissionsCall struct {
  55893. s *Service
  55894. project string
  55895. zone string
  55896. resource string
  55897. testpermissionsrequest *TestPermissionsRequest
  55898. urlParams_ gensupport.URLParams
  55899. ctx_ context.Context
  55900. header_ http.Header
  55901. }
  55902. // TestIamPermissions: Returns permissions that a caller has on the
  55903. // specified resource.
  55904. func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall {
  55905. c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  55906. c.project = project
  55907. c.zone = zone
  55908. c.resource = resource
  55909. c.testpermissionsrequest = testpermissionsrequest
  55910. return c
  55911. }
  55912. // Fields allows partial responses to be retrieved. See
  55913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  55914. // for more information.
  55915. func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall {
  55916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  55917. return c
  55918. }
  55919. // Context sets the context to be used in this call's Do method. Any
  55920. // pending HTTP request will be aborted if the provided context is
  55921. // canceled.
  55922. func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall {
  55923. c.ctx_ = ctx
  55924. return c
  55925. }
  55926. // Header returns an http.Header that can be modified by the caller to
  55927. // add HTTP headers to the request.
  55928. func (c *InstancesTestIamPermissionsCall) Header() http.Header {
  55929. if c.header_ == nil {
  55930. c.header_ = make(http.Header)
  55931. }
  55932. return c.header_
  55933. }
  55934. func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  55935. reqHeaders := make(http.Header)
  55936. for k, v := range c.header_ {
  55937. reqHeaders[k] = v
  55938. }
  55939. reqHeaders.Set("User-Agent", c.s.userAgent())
  55940. var body io.Reader = nil
  55941. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  55942. if err != nil {
  55943. return nil, err
  55944. }
  55945. reqHeaders.Set("Content-Type", "application/json")
  55946. c.urlParams_.Set("alt", alt)
  55947. c.urlParams_.Set("prettyPrint", "false")
  55948. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{resource}/testIamPermissions")
  55949. urls += "?" + c.urlParams_.Encode()
  55950. req, err := http.NewRequest("POST", urls, body)
  55951. if err != nil {
  55952. return nil, err
  55953. }
  55954. req.Header = reqHeaders
  55955. googleapi.Expand(req.URL, map[string]string{
  55956. "project": c.project,
  55957. "zone": c.zone,
  55958. "resource": c.resource,
  55959. })
  55960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  55961. }
  55962. // Do executes the "compute.instances.testIamPermissions" call.
  55963. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  55964. // non-2xx status code is an error. Response headers are in either
  55965. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  55966. // returned at all) in error.(*googleapi.Error).Header. Use
  55967. // googleapi.IsNotModified to check whether the returned error was
  55968. // because http.StatusNotModified was returned.
  55969. func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  55970. gensupport.SetOptions(c.urlParams_, opts...)
  55971. res, err := c.doRequest("json")
  55972. if res != nil && res.StatusCode == http.StatusNotModified {
  55973. if res.Body != nil {
  55974. res.Body.Close()
  55975. }
  55976. return nil, &googleapi.Error{
  55977. Code: res.StatusCode,
  55978. Header: res.Header,
  55979. }
  55980. }
  55981. if err != nil {
  55982. return nil, err
  55983. }
  55984. defer googleapi.CloseBody(res)
  55985. if err := googleapi.CheckResponse(res); err != nil {
  55986. return nil, err
  55987. }
  55988. ret := &TestPermissionsResponse{
  55989. ServerResponse: googleapi.ServerResponse{
  55990. Header: res.Header,
  55991. HTTPStatusCode: res.StatusCode,
  55992. },
  55993. }
  55994. target := &ret
  55995. if err := gensupport.DecodeResponse(target, res); err != nil {
  55996. return nil, err
  55997. }
  55998. return ret, nil
  55999. // {
  56000. // "description": "Returns permissions that a caller has on the specified resource.",
  56001. // "httpMethod": "POST",
  56002. // "id": "compute.instances.testIamPermissions",
  56003. // "parameterOrder": [
  56004. // "project",
  56005. // "zone",
  56006. // "resource"
  56007. // ],
  56008. // "parameters": {
  56009. // "project": {
  56010. // "description": "Project ID for this request.",
  56011. // "location": "path",
  56012. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56013. // "required": true,
  56014. // "type": "string"
  56015. // },
  56016. // "resource": {
  56017. // "description": "Name or id of the resource for this request.",
  56018. // "location": "path",
  56019. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56020. // "required": true,
  56021. // "type": "string"
  56022. // },
  56023. // "zone": {
  56024. // "description": "The name of the zone for this request.",
  56025. // "location": "path",
  56026. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56027. // "required": true,
  56028. // "type": "string"
  56029. // }
  56030. // },
  56031. // "path": "{project}/zones/{zone}/instances/{resource}/testIamPermissions",
  56032. // "request": {
  56033. // "$ref": "TestPermissionsRequest"
  56034. // },
  56035. // "response": {
  56036. // "$ref": "TestPermissionsResponse"
  56037. // },
  56038. // "scopes": [
  56039. // "https://www.googleapis.com/auth/cloud-platform",
  56040. // "https://www.googleapis.com/auth/compute",
  56041. // "https://www.googleapis.com/auth/compute.readonly"
  56042. // ]
  56043. // }
  56044. }
  56045. // method id "compute.instances.updateAccessConfig":
  56046. type InstancesUpdateAccessConfigCall struct {
  56047. s *Service
  56048. project string
  56049. zone string
  56050. instance string
  56051. accessconfig *AccessConfig
  56052. urlParams_ gensupport.URLParams
  56053. ctx_ context.Context
  56054. header_ http.Header
  56055. }
  56056. // UpdateAccessConfig: Updates the specified access config from an
  56057. // instance's network interface with the data included in the request.
  56058. // This method supports PATCH semantics and uses the JSON merge patch
  56059. // format and processing rules.
  56060. func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall {
  56061. c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56062. c.project = project
  56063. c.zone = zone
  56064. c.instance = instance
  56065. c.urlParams_.Set("networkInterface", networkInterface)
  56066. c.accessconfig = accessconfig
  56067. return c
  56068. }
  56069. // RequestId sets the optional parameter "requestId": An optional
  56070. // request ID to identify requests. Specify a unique request ID so that
  56071. // if you must retry your request, the server will know to ignore the
  56072. // request if it has already been completed.
  56073. //
  56074. // For example, consider a situation where you make an initial request
  56075. // and the request times out. If you make the request again with the
  56076. // same request ID, the server can check if original operation with the
  56077. // same request ID was received, and if so, will ignore the second
  56078. // request. This prevents clients from accidentally creating duplicate
  56079. // commitments.
  56080. //
  56081. // The request ID must be a valid UUID with the exception that zero UUID
  56082. // is not supported (00000000-0000-0000-0000-000000000000).
  56083. func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall {
  56084. c.urlParams_.Set("requestId", requestId)
  56085. return c
  56086. }
  56087. // Fields allows partial responses to be retrieved. See
  56088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56089. // for more information.
  56090. func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall {
  56091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56092. return c
  56093. }
  56094. // Context sets the context to be used in this call's Do method. Any
  56095. // pending HTTP request will be aborted if the provided context is
  56096. // canceled.
  56097. func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall {
  56098. c.ctx_ = ctx
  56099. return c
  56100. }
  56101. // Header returns an http.Header that can be modified by the caller to
  56102. // add HTTP headers to the request.
  56103. func (c *InstancesUpdateAccessConfigCall) Header() http.Header {
  56104. if c.header_ == nil {
  56105. c.header_ = make(http.Header)
  56106. }
  56107. return c.header_
  56108. }
  56109. func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) {
  56110. reqHeaders := make(http.Header)
  56111. for k, v := range c.header_ {
  56112. reqHeaders[k] = v
  56113. }
  56114. reqHeaders.Set("User-Agent", c.s.userAgent())
  56115. var body io.Reader = nil
  56116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig)
  56117. if err != nil {
  56118. return nil, err
  56119. }
  56120. reqHeaders.Set("Content-Type", "application/json")
  56121. c.urlParams_.Set("alt", alt)
  56122. c.urlParams_.Set("prettyPrint", "false")
  56123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateAccessConfig")
  56124. urls += "?" + c.urlParams_.Encode()
  56125. req, err := http.NewRequest("POST", urls, body)
  56126. if err != nil {
  56127. return nil, err
  56128. }
  56129. req.Header = reqHeaders
  56130. googleapi.Expand(req.URL, map[string]string{
  56131. "project": c.project,
  56132. "zone": c.zone,
  56133. "instance": c.instance,
  56134. })
  56135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56136. }
  56137. // Do executes the "compute.instances.updateAccessConfig" call.
  56138. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56139. // status code is an error. Response headers are in either
  56140. // *Operation.ServerResponse.Header or (if a response was returned at
  56141. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56142. // to check whether the returned error was because
  56143. // http.StatusNotModified was returned.
  56144. func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56145. gensupport.SetOptions(c.urlParams_, opts...)
  56146. res, err := c.doRequest("json")
  56147. if res != nil && res.StatusCode == http.StatusNotModified {
  56148. if res.Body != nil {
  56149. res.Body.Close()
  56150. }
  56151. return nil, &googleapi.Error{
  56152. Code: res.StatusCode,
  56153. Header: res.Header,
  56154. }
  56155. }
  56156. if err != nil {
  56157. return nil, err
  56158. }
  56159. defer googleapi.CloseBody(res)
  56160. if err := googleapi.CheckResponse(res); err != nil {
  56161. return nil, err
  56162. }
  56163. ret := &Operation{
  56164. ServerResponse: googleapi.ServerResponse{
  56165. Header: res.Header,
  56166. HTTPStatusCode: res.StatusCode,
  56167. },
  56168. }
  56169. target := &ret
  56170. if err := gensupport.DecodeResponse(target, res); err != nil {
  56171. return nil, err
  56172. }
  56173. return ret, nil
  56174. // {
  56175. // "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.",
  56176. // "httpMethod": "POST",
  56177. // "id": "compute.instances.updateAccessConfig",
  56178. // "parameterOrder": [
  56179. // "project",
  56180. // "zone",
  56181. // "instance",
  56182. // "networkInterface"
  56183. // ],
  56184. // "parameters": {
  56185. // "instance": {
  56186. // "description": "The instance name for this request.",
  56187. // "location": "path",
  56188. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56189. // "required": true,
  56190. // "type": "string"
  56191. // },
  56192. // "networkInterface": {
  56193. // "description": "The name of the network interface where the access config is attached.",
  56194. // "location": "query",
  56195. // "required": true,
  56196. // "type": "string"
  56197. // },
  56198. // "project": {
  56199. // "description": "Project ID for this request.",
  56200. // "location": "path",
  56201. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56202. // "required": true,
  56203. // "type": "string"
  56204. // },
  56205. // "requestId": {
  56206. // "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).",
  56207. // "location": "query",
  56208. // "type": "string"
  56209. // },
  56210. // "zone": {
  56211. // "description": "The name of the zone for this request.",
  56212. // "location": "path",
  56213. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56214. // "required": true,
  56215. // "type": "string"
  56216. // }
  56217. // },
  56218. // "path": "{project}/zones/{zone}/instances/{instance}/updateAccessConfig",
  56219. // "request": {
  56220. // "$ref": "AccessConfig"
  56221. // },
  56222. // "response": {
  56223. // "$ref": "Operation"
  56224. // },
  56225. // "scopes": [
  56226. // "https://www.googleapis.com/auth/cloud-platform",
  56227. // "https://www.googleapis.com/auth/compute"
  56228. // ]
  56229. // }
  56230. }
  56231. // method id "compute.instances.updateNetworkInterface":
  56232. type InstancesUpdateNetworkInterfaceCall struct {
  56233. s *Service
  56234. project string
  56235. zone string
  56236. instance string
  56237. networkinterface *NetworkInterface
  56238. urlParams_ gensupport.URLParams
  56239. ctx_ context.Context
  56240. header_ http.Header
  56241. }
  56242. // UpdateNetworkInterface: Updates an instance's network interface. This
  56243. // method follows PATCH semantics.
  56244. func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall {
  56245. c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56246. c.project = project
  56247. c.zone = zone
  56248. c.instance = instance
  56249. c.urlParams_.Set("networkInterface", networkInterface)
  56250. c.networkinterface = networkinterface
  56251. return c
  56252. }
  56253. // RequestId sets the optional parameter "requestId": An optional
  56254. // request ID to identify requests. Specify a unique request ID so that
  56255. // if you must retry your request, the server will know to ignore the
  56256. // request if it has already been completed.
  56257. //
  56258. // For example, consider a situation where you make an initial request
  56259. // and the request times out. If you make the request again with the
  56260. // same request ID, the server can check if original operation with the
  56261. // same request ID was received, and if so, will ignore the second
  56262. // request. This prevents clients from accidentally creating duplicate
  56263. // commitments.
  56264. //
  56265. // The request ID must be a valid UUID with the exception that zero UUID
  56266. // is not supported (00000000-0000-0000-0000-000000000000).
  56267. func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall {
  56268. c.urlParams_.Set("requestId", requestId)
  56269. return c
  56270. }
  56271. // Fields allows partial responses to be retrieved. See
  56272. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56273. // for more information.
  56274. func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall {
  56275. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56276. return c
  56277. }
  56278. // Context sets the context to be used in this call's Do method. Any
  56279. // pending HTTP request will be aborted if the provided context is
  56280. // canceled.
  56281. func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall {
  56282. c.ctx_ = ctx
  56283. return c
  56284. }
  56285. // Header returns an http.Header that can be modified by the caller to
  56286. // add HTTP headers to the request.
  56287. func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header {
  56288. if c.header_ == nil {
  56289. c.header_ = make(http.Header)
  56290. }
  56291. return c.header_
  56292. }
  56293. func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) {
  56294. reqHeaders := make(http.Header)
  56295. for k, v := range c.header_ {
  56296. reqHeaders[k] = v
  56297. }
  56298. reqHeaders.Set("User-Agent", c.s.userAgent())
  56299. var body io.Reader = nil
  56300. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface)
  56301. if err != nil {
  56302. return nil, err
  56303. }
  56304. reqHeaders.Set("Content-Type", "application/json")
  56305. c.urlParams_.Set("alt", alt)
  56306. c.urlParams_.Set("prettyPrint", "false")
  56307. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface")
  56308. urls += "?" + c.urlParams_.Encode()
  56309. req, err := http.NewRequest("PATCH", urls, body)
  56310. if err != nil {
  56311. return nil, err
  56312. }
  56313. req.Header = reqHeaders
  56314. googleapi.Expand(req.URL, map[string]string{
  56315. "project": c.project,
  56316. "zone": c.zone,
  56317. "instance": c.instance,
  56318. })
  56319. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56320. }
  56321. // Do executes the "compute.instances.updateNetworkInterface" call.
  56322. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56323. // status code is an error. Response headers are in either
  56324. // *Operation.ServerResponse.Header or (if a response was returned at
  56325. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56326. // to check whether the returned error was because
  56327. // http.StatusNotModified was returned.
  56328. func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56329. gensupport.SetOptions(c.urlParams_, opts...)
  56330. res, err := c.doRequest("json")
  56331. if res != nil && res.StatusCode == http.StatusNotModified {
  56332. if res.Body != nil {
  56333. res.Body.Close()
  56334. }
  56335. return nil, &googleapi.Error{
  56336. Code: res.StatusCode,
  56337. Header: res.Header,
  56338. }
  56339. }
  56340. if err != nil {
  56341. return nil, err
  56342. }
  56343. defer googleapi.CloseBody(res)
  56344. if err := googleapi.CheckResponse(res); err != nil {
  56345. return nil, err
  56346. }
  56347. ret := &Operation{
  56348. ServerResponse: googleapi.ServerResponse{
  56349. Header: res.Header,
  56350. HTTPStatusCode: res.StatusCode,
  56351. },
  56352. }
  56353. target := &ret
  56354. if err := gensupport.DecodeResponse(target, res); err != nil {
  56355. return nil, err
  56356. }
  56357. return ret, nil
  56358. // {
  56359. // "description": "Updates an instance's network interface. This method follows PATCH semantics.",
  56360. // "httpMethod": "PATCH",
  56361. // "id": "compute.instances.updateNetworkInterface",
  56362. // "parameterOrder": [
  56363. // "project",
  56364. // "zone",
  56365. // "instance",
  56366. // "networkInterface"
  56367. // ],
  56368. // "parameters": {
  56369. // "instance": {
  56370. // "description": "The instance name for this request.",
  56371. // "location": "path",
  56372. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56373. // "required": true,
  56374. // "type": "string"
  56375. // },
  56376. // "networkInterface": {
  56377. // "description": "The name of the network interface to update.",
  56378. // "location": "query",
  56379. // "required": true,
  56380. // "type": "string"
  56381. // },
  56382. // "project": {
  56383. // "description": "Project ID for this request.",
  56384. // "location": "path",
  56385. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56386. // "required": true,
  56387. // "type": "string"
  56388. // },
  56389. // "requestId": {
  56390. // "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).",
  56391. // "location": "query",
  56392. // "type": "string"
  56393. // },
  56394. // "zone": {
  56395. // "description": "The name of the zone for this request.",
  56396. // "location": "path",
  56397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56398. // "required": true,
  56399. // "type": "string"
  56400. // }
  56401. // },
  56402. // "path": "{project}/zones/{zone}/instances/{instance}/updateNetworkInterface",
  56403. // "request": {
  56404. // "$ref": "NetworkInterface"
  56405. // },
  56406. // "response": {
  56407. // "$ref": "Operation"
  56408. // },
  56409. // "scopes": [
  56410. // "https://www.googleapis.com/auth/cloud-platform",
  56411. // "https://www.googleapis.com/auth/compute"
  56412. // ]
  56413. // }
  56414. }
  56415. // method id "compute.instances.updateShieldedInstanceConfig":
  56416. type InstancesUpdateShieldedInstanceConfigCall struct {
  56417. s *Service
  56418. project string
  56419. zone string
  56420. instance string
  56421. shieldedinstanceconfig *ShieldedInstanceConfig
  56422. urlParams_ gensupport.URLParams
  56423. ctx_ context.Context
  56424. header_ http.Header
  56425. }
  56426. // UpdateShieldedInstanceConfig: Updates the Shielded Instance config
  56427. // for an instance. You can only use this method on a stopped instance.
  56428. // This method supports PATCH semantics and uses the JSON merge patch
  56429. // format and processing rules.
  56430. func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone string, instance string, shieldedinstanceconfig *ShieldedInstanceConfig) *InstancesUpdateShieldedInstanceConfigCall {
  56431. c := &InstancesUpdateShieldedInstanceConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56432. c.project = project
  56433. c.zone = zone
  56434. c.instance = instance
  56435. c.shieldedinstanceconfig = shieldedinstanceconfig
  56436. return c
  56437. }
  56438. // RequestId sets the optional parameter "requestId": An optional
  56439. // request ID to identify requests. Specify a unique request ID so that
  56440. // if you must retry your request, the server will know to ignore the
  56441. // request if it has already been completed.
  56442. //
  56443. // For example, consider a situation where you make an initial request
  56444. // and the request times out. If you make the request again with the
  56445. // same request ID, the server can check if original operation with the
  56446. // same request ID was received, and if so, will ignore the second
  56447. // request. This prevents clients from accidentally creating duplicate
  56448. // commitments.
  56449. //
  56450. // The request ID must be a valid UUID with the exception that zero UUID
  56451. // is not supported (00000000-0000-0000-0000-000000000000).
  56452. func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) *InstancesUpdateShieldedInstanceConfigCall {
  56453. c.urlParams_.Set("requestId", requestId)
  56454. return c
  56455. }
  56456. // Fields allows partial responses to be retrieved. See
  56457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56458. // for more information.
  56459. func (c *InstancesUpdateShieldedInstanceConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedInstanceConfigCall {
  56460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56461. return c
  56462. }
  56463. // Context sets the context to be used in this call's Do method. Any
  56464. // pending HTTP request will be aborted if the provided context is
  56465. // canceled.
  56466. func (c *InstancesUpdateShieldedInstanceConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedInstanceConfigCall {
  56467. c.ctx_ = ctx
  56468. return c
  56469. }
  56470. // Header returns an http.Header that can be modified by the caller to
  56471. // add HTTP headers to the request.
  56472. func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header {
  56473. if c.header_ == nil {
  56474. c.header_ = make(http.Header)
  56475. }
  56476. return c.header_
  56477. }
  56478. func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) {
  56479. reqHeaders := make(http.Header)
  56480. for k, v := range c.header_ {
  56481. reqHeaders[k] = v
  56482. }
  56483. reqHeaders.Set("User-Agent", c.s.userAgent())
  56484. var body io.Reader = nil
  56485. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig)
  56486. if err != nil {
  56487. return nil, err
  56488. }
  56489. reqHeaders.Set("Content-Type", "application/json")
  56490. c.urlParams_.Set("alt", alt)
  56491. c.urlParams_.Set("prettyPrint", "false")
  56492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig")
  56493. urls += "?" + c.urlParams_.Encode()
  56494. req, err := http.NewRequest("PATCH", urls, body)
  56495. if err != nil {
  56496. return nil, err
  56497. }
  56498. req.Header = reqHeaders
  56499. googleapi.Expand(req.URL, map[string]string{
  56500. "project": c.project,
  56501. "zone": c.zone,
  56502. "instance": c.instance,
  56503. })
  56504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56505. }
  56506. // Do executes the "compute.instances.updateShieldedInstanceConfig" call.
  56507. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56508. // status code is an error. Response headers are in either
  56509. // *Operation.ServerResponse.Header or (if a response was returned at
  56510. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56511. // to check whether the returned error was because
  56512. // http.StatusNotModified was returned.
  56513. func (c *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56514. gensupport.SetOptions(c.urlParams_, opts...)
  56515. res, err := c.doRequest("json")
  56516. if res != nil && res.StatusCode == http.StatusNotModified {
  56517. if res.Body != nil {
  56518. res.Body.Close()
  56519. }
  56520. return nil, &googleapi.Error{
  56521. Code: res.StatusCode,
  56522. Header: res.Header,
  56523. }
  56524. }
  56525. if err != nil {
  56526. return nil, err
  56527. }
  56528. defer googleapi.CloseBody(res)
  56529. if err := googleapi.CheckResponse(res); err != nil {
  56530. return nil, err
  56531. }
  56532. ret := &Operation{
  56533. ServerResponse: googleapi.ServerResponse{
  56534. Header: res.Header,
  56535. HTTPStatusCode: res.StatusCode,
  56536. },
  56537. }
  56538. target := &ret
  56539. if err := gensupport.DecodeResponse(target, res); err != nil {
  56540. return nil, err
  56541. }
  56542. return ret, nil
  56543. // {
  56544. // "description": "Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.",
  56545. // "httpMethod": "PATCH",
  56546. // "id": "compute.instances.updateShieldedInstanceConfig",
  56547. // "parameterOrder": [
  56548. // "project",
  56549. // "zone",
  56550. // "instance"
  56551. // ],
  56552. // "parameters": {
  56553. // "instance": {
  56554. // "description": "Name or id of the instance scoping this request.",
  56555. // "location": "path",
  56556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56557. // "required": true,
  56558. // "type": "string"
  56559. // },
  56560. // "project": {
  56561. // "description": "Project ID for this request.",
  56562. // "location": "path",
  56563. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56564. // "required": true,
  56565. // "type": "string"
  56566. // },
  56567. // "requestId": {
  56568. // "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).",
  56569. // "location": "query",
  56570. // "type": "string"
  56571. // },
  56572. // "zone": {
  56573. // "description": "The name of the zone for this request.",
  56574. // "location": "path",
  56575. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56576. // "required": true,
  56577. // "type": "string"
  56578. // }
  56579. // },
  56580. // "path": "{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig",
  56581. // "request": {
  56582. // "$ref": "ShieldedInstanceConfig"
  56583. // },
  56584. // "response": {
  56585. // "$ref": "Operation"
  56586. // },
  56587. // "scopes": [
  56588. // "https://www.googleapis.com/auth/cloud-platform",
  56589. // "https://www.googleapis.com/auth/compute"
  56590. // ]
  56591. // }
  56592. }
  56593. // method id "compute.interconnectAttachments.aggregatedList":
  56594. type InterconnectAttachmentsAggregatedListCall struct {
  56595. s *Service
  56596. project string
  56597. urlParams_ gensupport.URLParams
  56598. ifNoneMatch_ string
  56599. ctx_ context.Context
  56600. header_ http.Header
  56601. }
  56602. // AggregatedList: Retrieves an aggregated list of interconnect
  56603. // attachments.
  56604. func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall {
  56605. c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56606. c.project = project
  56607. return c
  56608. }
  56609. // Filter sets the optional parameter "filter": A filter expression that
  56610. // filters resources listed in the response. The expression must specify
  56611. // the field name, a comparison operator, and the value that you want to
  56612. // use for filtering. The value must be a string, a number, or a
  56613. // boolean. The comparison operator must be either =, !=, >, or <.
  56614. //
  56615. // For example, if you are filtering Compute Engine instances, you can
  56616. // exclude instances named example-instance by specifying name !=
  56617. // example-instance.
  56618. //
  56619. // You can also filter nested fields. For example, you could specify
  56620. // scheduling.automaticRestart = false to include instances only if they
  56621. // are not scheduled for automatic restarts. You can use filtering on
  56622. // nested fields to filter based on resource labels.
  56623. //
  56624. // To filter on multiple expressions, provide each separate expression
  56625. // within parentheses. For example, (scheduling.automaticRestart = true)
  56626. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  56627. // AND expression. However, you can include AND and OR expressions
  56628. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  56629. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  56630. // true).
  56631. func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall {
  56632. c.urlParams_.Set("filter", filter)
  56633. return c
  56634. }
  56635. // MaxResults sets the optional parameter "maxResults": The maximum
  56636. // number of results per page that should be returned. If the number of
  56637. // available results is larger than maxResults, Compute Engine returns a
  56638. // nextPageToken that can be used to get the next page of results in
  56639. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  56640. // (Default: 500)
  56641. func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall {
  56642. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  56643. return c
  56644. }
  56645. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  56646. // a certain order. By default, results are returned in alphanumerical
  56647. // order based on the resource name.
  56648. //
  56649. // You can also sort results in descending order based on the creation
  56650. // timestamp using orderBy="creationTimestamp desc". This sorts results
  56651. // based on the creationTimestamp field in reverse chronological order
  56652. // (newest result first). Use this to sort resources like operations so
  56653. // that the newest operation is returned first.
  56654. //
  56655. // Currently, only sorting by name or creationTimestamp desc is
  56656. // supported.
  56657. func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall {
  56658. c.urlParams_.Set("orderBy", orderBy)
  56659. return c
  56660. }
  56661. // PageToken sets the optional parameter "pageToken": Specifies a page
  56662. // token to use. Set pageToken to the nextPageToken returned by a
  56663. // previous list request to get the next page of results.
  56664. func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall {
  56665. c.urlParams_.Set("pageToken", pageToken)
  56666. return c
  56667. }
  56668. // Fields allows partial responses to be retrieved. See
  56669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56670. // for more information.
  56671. func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall {
  56672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56673. return c
  56674. }
  56675. // IfNoneMatch sets the optional parameter which makes the operation
  56676. // fail if the object's ETag matches the given value. This is useful for
  56677. // getting updates only after the object has changed since the last
  56678. // request. Use googleapi.IsNotModified to check whether the response
  56679. // error from Do is the result of In-None-Match.
  56680. func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall {
  56681. c.ifNoneMatch_ = entityTag
  56682. return c
  56683. }
  56684. // Context sets the context to be used in this call's Do method. Any
  56685. // pending HTTP request will be aborted if the provided context is
  56686. // canceled.
  56687. func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall {
  56688. c.ctx_ = ctx
  56689. return c
  56690. }
  56691. // Header returns an http.Header that can be modified by the caller to
  56692. // add HTTP headers to the request.
  56693. func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header {
  56694. if c.header_ == nil {
  56695. c.header_ = make(http.Header)
  56696. }
  56697. return c.header_
  56698. }
  56699. func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  56700. reqHeaders := make(http.Header)
  56701. for k, v := range c.header_ {
  56702. reqHeaders[k] = v
  56703. }
  56704. reqHeaders.Set("User-Agent", c.s.userAgent())
  56705. if c.ifNoneMatch_ != "" {
  56706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  56707. }
  56708. var body io.Reader = nil
  56709. c.urlParams_.Set("alt", alt)
  56710. c.urlParams_.Set("prettyPrint", "false")
  56711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/interconnectAttachments")
  56712. urls += "?" + c.urlParams_.Encode()
  56713. req, err := http.NewRequest("GET", urls, body)
  56714. if err != nil {
  56715. return nil, err
  56716. }
  56717. req.Header = reqHeaders
  56718. googleapi.Expand(req.URL, map[string]string{
  56719. "project": c.project,
  56720. })
  56721. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56722. }
  56723. // Do executes the "compute.interconnectAttachments.aggregatedList" call.
  56724. // Exactly one of *InterconnectAttachmentAggregatedList or error will be
  56725. // non-nil. Any non-2xx status code is an error. Response headers are in
  56726. // either *InterconnectAttachmentAggregatedList.ServerResponse.Header or
  56727. // (if a response was returned at all) in
  56728. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  56729. // whether the returned error was because http.StatusNotModified was
  56730. // returned.
  56731. func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) {
  56732. gensupport.SetOptions(c.urlParams_, opts...)
  56733. res, err := c.doRequest("json")
  56734. if res != nil && res.StatusCode == http.StatusNotModified {
  56735. if res.Body != nil {
  56736. res.Body.Close()
  56737. }
  56738. return nil, &googleapi.Error{
  56739. Code: res.StatusCode,
  56740. Header: res.Header,
  56741. }
  56742. }
  56743. if err != nil {
  56744. return nil, err
  56745. }
  56746. defer googleapi.CloseBody(res)
  56747. if err := googleapi.CheckResponse(res); err != nil {
  56748. return nil, err
  56749. }
  56750. ret := &InterconnectAttachmentAggregatedList{
  56751. ServerResponse: googleapi.ServerResponse{
  56752. Header: res.Header,
  56753. HTTPStatusCode: res.StatusCode,
  56754. },
  56755. }
  56756. target := &ret
  56757. if err := gensupport.DecodeResponse(target, res); err != nil {
  56758. return nil, err
  56759. }
  56760. return ret, nil
  56761. // {
  56762. // "description": "Retrieves an aggregated list of interconnect attachments.",
  56763. // "httpMethod": "GET",
  56764. // "id": "compute.interconnectAttachments.aggregatedList",
  56765. // "parameterOrder": [
  56766. // "project"
  56767. // ],
  56768. // "parameters": {
  56769. // "filter": {
  56770. // "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).",
  56771. // "location": "query",
  56772. // "type": "string"
  56773. // },
  56774. // "maxResults": {
  56775. // "default": "500",
  56776. // "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)",
  56777. // "format": "uint32",
  56778. // "location": "query",
  56779. // "minimum": "0",
  56780. // "type": "integer"
  56781. // },
  56782. // "orderBy": {
  56783. // "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.",
  56784. // "location": "query",
  56785. // "type": "string"
  56786. // },
  56787. // "pageToken": {
  56788. // "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.",
  56789. // "location": "query",
  56790. // "type": "string"
  56791. // },
  56792. // "project": {
  56793. // "description": "Project ID for this request.",
  56794. // "location": "path",
  56795. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56796. // "required": true,
  56797. // "type": "string"
  56798. // }
  56799. // },
  56800. // "path": "{project}/aggregated/interconnectAttachments",
  56801. // "response": {
  56802. // "$ref": "InterconnectAttachmentAggregatedList"
  56803. // },
  56804. // "scopes": [
  56805. // "https://www.googleapis.com/auth/cloud-platform",
  56806. // "https://www.googleapis.com/auth/compute",
  56807. // "https://www.googleapis.com/auth/compute.readonly"
  56808. // ]
  56809. // }
  56810. }
  56811. // Pages invokes f for each page of results.
  56812. // A non-nil error returned from f will halt the iteration.
  56813. // The provided context supersedes any context provided to the Context method.
  56814. func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error {
  56815. c.ctx_ = ctx
  56816. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  56817. for {
  56818. x, err := c.Do()
  56819. if err != nil {
  56820. return err
  56821. }
  56822. if err := f(x); err != nil {
  56823. return err
  56824. }
  56825. if x.NextPageToken == "" {
  56826. return nil
  56827. }
  56828. c.PageToken(x.NextPageToken)
  56829. }
  56830. }
  56831. // method id "compute.interconnectAttachments.delete":
  56832. type InterconnectAttachmentsDeleteCall struct {
  56833. s *Service
  56834. project string
  56835. region string
  56836. interconnectAttachment string
  56837. urlParams_ gensupport.URLParams
  56838. ctx_ context.Context
  56839. header_ http.Header
  56840. }
  56841. // Delete: Deletes the specified interconnect attachment.
  56842. func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall {
  56843. c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  56844. c.project = project
  56845. c.region = region
  56846. c.interconnectAttachment = interconnectAttachment
  56847. return c
  56848. }
  56849. // RequestId sets the optional parameter "requestId": An optional
  56850. // request ID to identify requests. Specify a unique request ID so that
  56851. // if you must retry your request, the server will know to ignore the
  56852. // request if it has already been completed.
  56853. //
  56854. // For example, consider a situation where you make an initial request
  56855. // and the request times out. If you make the request again with the
  56856. // same request ID, the server can check if original operation with the
  56857. // same request ID was received, and if so, will ignore the second
  56858. // request. This prevents clients from accidentally creating duplicate
  56859. // commitments.
  56860. //
  56861. // The request ID must be a valid UUID with the exception that zero UUID
  56862. // is not supported (00000000-0000-0000-0000-000000000000).
  56863. func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall {
  56864. c.urlParams_.Set("requestId", requestId)
  56865. return c
  56866. }
  56867. // Fields allows partial responses to be retrieved. See
  56868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  56869. // for more information.
  56870. func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall {
  56871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  56872. return c
  56873. }
  56874. // Context sets the context to be used in this call's Do method. Any
  56875. // pending HTTP request will be aborted if the provided context is
  56876. // canceled.
  56877. func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall {
  56878. c.ctx_ = ctx
  56879. return c
  56880. }
  56881. // Header returns an http.Header that can be modified by the caller to
  56882. // add HTTP headers to the request.
  56883. func (c *InterconnectAttachmentsDeleteCall) Header() http.Header {
  56884. if c.header_ == nil {
  56885. c.header_ = make(http.Header)
  56886. }
  56887. return c.header_
  56888. }
  56889. func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  56890. reqHeaders := make(http.Header)
  56891. for k, v := range c.header_ {
  56892. reqHeaders[k] = v
  56893. }
  56894. reqHeaders.Set("User-Agent", c.s.userAgent())
  56895. var body io.Reader = nil
  56896. c.urlParams_.Set("alt", alt)
  56897. c.urlParams_.Set("prettyPrint", "false")
  56898. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  56899. urls += "?" + c.urlParams_.Encode()
  56900. req, err := http.NewRequest("DELETE", urls, body)
  56901. if err != nil {
  56902. return nil, err
  56903. }
  56904. req.Header = reqHeaders
  56905. googleapi.Expand(req.URL, map[string]string{
  56906. "project": c.project,
  56907. "region": c.region,
  56908. "interconnectAttachment": c.interconnectAttachment,
  56909. })
  56910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  56911. }
  56912. // Do executes the "compute.interconnectAttachments.delete" call.
  56913. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  56914. // status code is an error. Response headers are in either
  56915. // *Operation.ServerResponse.Header or (if a response was returned at
  56916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  56917. // to check whether the returned error was because
  56918. // http.StatusNotModified was returned.
  56919. func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  56920. gensupport.SetOptions(c.urlParams_, opts...)
  56921. res, err := c.doRequest("json")
  56922. if res != nil && res.StatusCode == http.StatusNotModified {
  56923. if res.Body != nil {
  56924. res.Body.Close()
  56925. }
  56926. return nil, &googleapi.Error{
  56927. Code: res.StatusCode,
  56928. Header: res.Header,
  56929. }
  56930. }
  56931. if err != nil {
  56932. return nil, err
  56933. }
  56934. defer googleapi.CloseBody(res)
  56935. if err := googleapi.CheckResponse(res); err != nil {
  56936. return nil, err
  56937. }
  56938. ret := &Operation{
  56939. ServerResponse: googleapi.ServerResponse{
  56940. Header: res.Header,
  56941. HTTPStatusCode: res.StatusCode,
  56942. },
  56943. }
  56944. target := &ret
  56945. if err := gensupport.DecodeResponse(target, res); err != nil {
  56946. return nil, err
  56947. }
  56948. return ret, nil
  56949. // {
  56950. // "description": "Deletes the specified interconnect attachment.",
  56951. // "httpMethod": "DELETE",
  56952. // "id": "compute.interconnectAttachments.delete",
  56953. // "parameterOrder": [
  56954. // "project",
  56955. // "region",
  56956. // "interconnectAttachment"
  56957. // ],
  56958. // "parameters": {
  56959. // "interconnectAttachment": {
  56960. // "description": "Name of the interconnect attachment to delete.",
  56961. // "location": "path",
  56962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  56963. // "required": true,
  56964. // "type": "string"
  56965. // },
  56966. // "project": {
  56967. // "description": "Project ID for this request.",
  56968. // "location": "path",
  56969. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  56970. // "required": true,
  56971. // "type": "string"
  56972. // },
  56973. // "region": {
  56974. // "description": "Name of the region for this request.",
  56975. // "location": "path",
  56976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  56977. // "required": true,
  56978. // "type": "string"
  56979. // },
  56980. // "requestId": {
  56981. // "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).",
  56982. // "location": "query",
  56983. // "type": "string"
  56984. // }
  56985. // },
  56986. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  56987. // "response": {
  56988. // "$ref": "Operation"
  56989. // },
  56990. // "scopes": [
  56991. // "https://www.googleapis.com/auth/cloud-platform",
  56992. // "https://www.googleapis.com/auth/compute"
  56993. // ]
  56994. // }
  56995. }
  56996. // method id "compute.interconnectAttachments.get":
  56997. type InterconnectAttachmentsGetCall struct {
  56998. s *Service
  56999. project string
  57000. region string
  57001. interconnectAttachment string
  57002. urlParams_ gensupport.URLParams
  57003. ifNoneMatch_ string
  57004. ctx_ context.Context
  57005. header_ http.Header
  57006. }
  57007. // Get: Returns the specified interconnect attachment.
  57008. func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall {
  57009. c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57010. c.project = project
  57011. c.region = region
  57012. c.interconnectAttachment = interconnectAttachment
  57013. return c
  57014. }
  57015. // Fields allows partial responses to be retrieved. See
  57016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57017. // for more information.
  57018. func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall {
  57019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57020. return c
  57021. }
  57022. // IfNoneMatch sets the optional parameter which makes the operation
  57023. // fail if the object's ETag matches the given value. This is useful for
  57024. // getting updates only after the object has changed since the last
  57025. // request. Use googleapi.IsNotModified to check whether the response
  57026. // error from Do is the result of In-None-Match.
  57027. func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall {
  57028. c.ifNoneMatch_ = entityTag
  57029. return c
  57030. }
  57031. // Context sets the context to be used in this call's Do method. Any
  57032. // pending HTTP request will be aborted if the provided context is
  57033. // canceled.
  57034. func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall {
  57035. c.ctx_ = ctx
  57036. return c
  57037. }
  57038. // Header returns an http.Header that can be modified by the caller to
  57039. // add HTTP headers to the request.
  57040. func (c *InterconnectAttachmentsGetCall) Header() http.Header {
  57041. if c.header_ == nil {
  57042. c.header_ = make(http.Header)
  57043. }
  57044. return c.header_
  57045. }
  57046. func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  57047. reqHeaders := make(http.Header)
  57048. for k, v := range c.header_ {
  57049. reqHeaders[k] = v
  57050. }
  57051. reqHeaders.Set("User-Agent", c.s.userAgent())
  57052. if c.ifNoneMatch_ != "" {
  57053. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57054. }
  57055. var body io.Reader = nil
  57056. c.urlParams_.Set("alt", alt)
  57057. c.urlParams_.Set("prettyPrint", "false")
  57058. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  57059. urls += "?" + c.urlParams_.Encode()
  57060. req, err := http.NewRequest("GET", urls, body)
  57061. if err != nil {
  57062. return nil, err
  57063. }
  57064. req.Header = reqHeaders
  57065. googleapi.Expand(req.URL, map[string]string{
  57066. "project": c.project,
  57067. "region": c.region,
  57068. "interconnectAttachment": c.interconnectAttachment,
  57069. })
  57070. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57071. }
  57072. // Do executes the "compute.interconnectAttachments.get" call.
  57073. // Exactly one of *InterconnectAttachment or error will be non-nil. Any
  57074. // non-2xx status code is an error. Response headers are in either
  57075. // *InterconnectAttachment.ServerResponse.Header or (if a response was
  57076. // returned at all) in error.(*googleapi.Error).Header. Use
  57077. // googleapi.IsNotModified to check whether the returned error was
  57078. // because http.StatusNotModified was returned.
  57079. func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) {
  57080. gensupport.SetOptions(c.urlParams_, opts...)
  57081. res, err := c.doRequest("json")
  57082. if res != nil && res.StatusCode == http.StatusNotModified {
  57083. if res.Body != nil {
  57084. res.Body.Close()
  57085. }
  57086. return nil, &googleapi.Error{
  57087. Code: res.StatusCode,
  57088. Header: res.Header,
  57089. }
  57090. }
  57091. if err != nil {
  57092. return nil, err
  57093. }
  57094. defer googleapi.CloseBody(res)
  57095. if err := googleapi.CheckResponse(res); err != nil {
  57096. return nil, err
  57097. }
  57098. ret := &InterconnectAttachment{
  57099. ServerResponse: googleapi.ServerResponse{
  57100. Header: res.Header,
  57101. HTTPStatusCode: res.StatusCode,
  57102. },
  57103. }
  57104. target := &ret
  57105. if err := gensupport.DecodeResponse(target, res); err != nil {
  57106. return nil, err
  57107. }
  57108. return ret, nil
  57109. // {
  57110. // "description": "Returns the specified interconnect attachment.",
  57111. // "httpMethod": "GET",
  57112. // "id": "compute.interconnectAttachments.get",
  57113. // "parameterOrder": [
  57114. // "project",
  57115. // "region",
  57116. // "interconnectAttachment"
  57117. // ],
  57118. // "parameters": {
  57119. // "interconnectAttachment": {
  57120. // "description": "Name of the interconnect attachment to return.",
  57121. // "location": "path",
  57122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57123. // "required": true,
  57124. // "type": "string"
  57125. // },
  57126. // "project": {
  57127. // "description": "Project ID for this request.",
  57128. // "location": "path",
  57129. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57130. // "required": true,
  57131. // "type": "string"
  57132. // },
  57133. // "region": {
  57134. // "description": "Name of the region for this request.",
  57135. // "location": "path",
  57136. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57137. // "required": true,
  57138. // "type": "string"
  57139. // }
  57140. // },
  57141. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  57142. // "response": {
  57143. // "$ref": "InterconnectAttachment"
  57144. // },
  57145. // "scopes": [
  57146. // "https://www.googleapis.com/auth/cloud-platform",
  57147. // "https://www.googleapis.com/auth/compute",
  57148. // "https://www.googleapis.com/auth/compute.readonly"
  57149. // ]
  57150. // }
  57151. }
  57152. // method id "compute.interconnectAttachments.insert":
  57153. type InterconnectAttachmentsInsertCall struct {
  57154. s *Service
  57155. project string
  57156. region string
  57157. interconnectattachment *InterconnectAttachment
  57158. urlParams_ gensupport.URLParams
  57159. ctx_ context.Context
  57160. header_ http.Header
  57161. }
  57162. // Insert: Creates an InterconnectAttachment in the specified project
  57163. // using the data included in the request.
  57164. func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall {
  57165. c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57166. c.project = project
  57167. c.region = region
  57168. c.interconnectattachment = interconnectattachment
  57169. return c
  57170. }
  57171. // RequestId sets the optional parameter "requestId": An optional
  57172. // request ID to identify requests. Specify a unique request ID so that
  57173. // if you must retry your request, the server will know to ignore the
  57174. // request if it has already been completed.
  57175. //
  57176. // For example, consider a situation where you make an initial request
  57177. // and the request times out. If you make the request again with the
  57178. // same request ID, the server can check if original operation with the
  57179. // same request ID was received, and if so, will ignore the second
  57180. // request. This prevents clients from accidentally creating duplicate
  57181. // commitments.
  57182. //
  57183. // The request ID must be a valid UUID with the exception that zero UUID
  57184. // is not supported (00000000-0000-0000-0000-000000000000).
  57185. func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall {
  57186. c.urlParams_.Set("requestId", requestId)
  57187. return c
  57188. }
  57189. // Fields allows partial responses to be retrieved. See
  57190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57191. // for more information.
  57192. func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall {
  57193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57194. return c
  57195. }
  57196. // Context sets the context to be used in this call's Do method. Any
  57197. // pending HTTP request will be aborted if the provided context is
  57198. // canceled.
  57199. func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall {
  57200. c.ctx_ = ctx
  57201. return c
  57202. }
  57203. // Header returns an http.Header that can be modified by the caller to
  57204. // add HTTP headers to the request.
  57205. func (c *InterconnectAttachmentsInsertCall) Header() http.Header {
  57206. if c.header_ == nil {
  57207. c.header_ = make(http.Header)
  57208. }
  57209. return c.header_
  57210. }
  57211. func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  57212. reqHeaders := make(http.Header)
  57213. for k, v := range c.header_ {
  57214. reqHeaders[k] = v
  57215. }
  57216. reqHeaders.Set("User-Agent", c.s.userAgent())
  57217. var body io.Reader = nil
  57218. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  57219. if err != nil {
  57220. return nil, err
  57221. }
  57222. reqHeaders.Set("Content-Type", "application/json")
  57223. c.urlParams_.Set("alt", alt)
  57224. c.urlParams_.Set("prettyPrint", "false")
  57225. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  57226. urls += "?" + c.urlParams_.Encode()
  57227. req, err := http.NewRequest("POST", urls, body)
  57228. if err != nil {
  57229. return nil, err
  57230. }
  57231. req.Header = reqHeaders
  57232. googleapi.Expand(req.URL, map[string]string{
  57233. "project": c.project,
  57234. "region": c.region,
  57235. })
  57236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57237. }
  57238. // Do executes the "compute.interconnectAttachments.insert" call.
  57239. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57240. // status code is an error. Response headers are in either
  57241. // *Operation.ServerResponse.Header or (if a response was returned at
  57242. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57243. // to check whether the returned error was because
  57244. // http.StatusNotModified was returned.
  57245. func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57246. gensupport.SetOptions(c.urlParams_, opts...)
  57247. res, err := c.doRequest("json")
  57248. if res != nil && res.StatusCode == http.StatusNotModified {
  57249. if res.Body != nil {
  57250. res.Body.Close()
  57251. }
  57252. return nil, &googleapi.Error{
  57253. Code: res.StatusCode,
  57254. Header: res.Header,
  57255. }
  57256. }
  57257. if err != nil {
  57258. return nil, err
  57259. }
  57260. defer googleapi.CloseBody(res)
  57261. if err := googleapi.CheckResponse(res); err != nil {
  57262. return nil, err
  57263. }
  57264. ret := &Operation{
  57265. ServerResponse: googleapi.ServerResponse{
  57266. Header: res.Header,
  57267. HTTPStatusCode: res.StatusCode,
  57268. },
  57269. }
  57270. target := &ret
  57271. if err := gensupport.DecodeResponse(target, res); err != nil {
  57272. return nil, err
  57273. }
  57274. return ret, nil
  57275. // {
  57276. // "description": "Creates an InterconnectAttachment in the specified project using the data included in the request.",
  57277. // "httpMethod": "POST",
  57278. // "id": "compute.interconnectAttachments.insert",
  57279. // "parameterOrder": [
  57280. // "project",
  57281. // "region"
  57282. // ],
  57283. // "parameters": {
  57284. // "project": {
  57285. // "description": "Project ID for this request.",
  57286. // "location": "path",
  57287. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57288. // "required": true,
  57289. // "type": "string"
  57290. // },
  57291. // "region": {
  57292. // "description": "Name of the region for this request.",
  57293. // "location": "path",
  57294. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57295. // "required": true,
  57296. // "type": "string"
  57297. // },
  57298. // "requestId": {
  57299. // "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).",
  57300. // "location": "query",
  57301. // "type": "string"
  57302. // }
  57303. // },
  57304. // "path": "{project}/regions/{region}/interconnectAttachments",
  57305. // "request": {
  57306. // "$ref": "InterconnectAttachment"
  57307. // },
  57308. // "response": {
  57309. // "$ref": "Operation"
  57310. // },
  57311. // "scopes": [
  57312. // "https://www.googleapis.com/auth/cloud-platform",
  57313. // "https://www.googleapis.com/auth/compute"
  57314. // ]
  57315. // }
  57316. }
  57317. // method id "compute.interconnectAttachments.list":
  57318. type InterconnectAttachmentsListCall struct {
  57319. s *Service
  57320. project string
  57321. region string
  57322. urlParams_ gensupport.URLParams
  57323. ifNoneMatch_ string
  57324. ctx_ context.Context
  57325. header_ http.Header
  57326. }
  57327. // List: Retrieves the list of interconnect attachments contained within
  57328. // the specified region.
  57329. func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall {
  57330. c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57331. c.project = project
  57332. c.region = region
  57333. return c
  57334. }
  57335. // Filter sets the optional parameter "filter": A filter expression that
  57336. // filters resources listed in the response. The expression must specify
  57337. // the field name, a comparison operator, and the value that you want to
  57338. // use for filtering. The value must be a string, a number, or a
  57339. // boolean. The comparison operator must be either =, !=, >, or <.
  57340. //
  57341. // For example, if you are filtering Compute Engine instances, you can
  57342. // exclude instances named example-instance by specifying name !=
  57343. // example-instance.
  57344. //
  57345. // You can also filter nested fields. For example, you could specify
  57346. // scheduling.automaticRestart = false to include instances only if they
  57347. // are not scheduled for automatic restarts. You can use filtering on
  57348. // nested fields to filter based on resource labels.
  57349. //
  57350. // To filter on multiple expressions, provide each separate expression
  57351. // within parentheses. For example, (scheduling.automaticRestart = true)
  57352. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57353. // AND expression. However, you can include AND and OR expressions
  57354. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57355. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57356. // true).
  57357. func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall {
  57358. c.urlParams_.Set("filter", filter)
  57359. return c
  57360. }
  57361. // MaxResults sets the optional parameter "maxResults": The maximum
  57362. // number of results per page that should be returned. If the number of
  57363. // available results is larger than maxResults, Compute Engine returns a
  57364. // nextPageToken that can be used to get the next page of results in
  57365. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57366. // (Default: 500)
  57367. func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall {
  57368. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57369. return c
  57370. }
  57371. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57372. // a certain order. By default, results are returned in alphanumerical
  57373. // order based on the resource name.
  57374. //
  57375. // You can also sort results in descending order based on the creation
  57376. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57377. // based on the creationTimestamp field in reverse chronological order
  57378. // (newest result first). Use this to sort resources like operations so
  57379. // that the newest operation is returned first.
  57380. //
  57381. // Currently, only sorting by name or creationTimestamp desc is
  57382. // supported.
  57383. func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall {
  57384. c.urlParams_.Set("orderBy", orderBy)
  57385. return c
  57386. }
  57387. // PageToken sets the optional parameter "pageToken": Specifies a page
  57388. // token to use. Set pageToken to the nextPageToken returned by a
  57389. // previous list request to get the next page of results.
  57390. func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall {
  57391. c.urlParams_.Set("pageToken", pageToken)
  57392. return c
  57393. }
  57394. // Fields allows partial responses to be retrieved. See
  57395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57396. // for more information.
  57397. func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall {
  57398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57399. return c
  57400. }
  57401. // IfNoneMatch sets the optional parameter which makes the operation
  57402. // fail if the object's ETag matches the given value. This is useful for
  57403. // getting updates only after the object has changed since the last
  57404. // request. Use googleapi.IsNotModified to check whether the response
  57405. // error from Do is the result of In-None-Match.
  57406. func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall {
  57407. c.ifNoneMatch_ = entityTag
  57408. return c
  57409. }
  57410. // Context sets the context to be used in this call's Do method. Any
  57411. // pending HTTP request will be aborted if the provided context is
  57412. // canceled.
  57413. func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall {
  57414. c.ctx_ = ctx
  57415. return c
  57416. }
  57417. // Header returns an http.Header that can be modified by the caller to
  57418. // add HTTP headers to the request.
  57419. func (c *InterconnectAttachmentsListCall) Header() http.Header {
  57420. if c.header_ == nil {
  57421. c.header_ = make(http.Header)
  57422. }
  57423. return c.header_
  57424. }
  57425. func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  57426. reqHeaders := make(http.Header)
  57427. for k, v := range c.header_ {
  57428. reqHeaders[k] = v
  57429. }
  57430. reqHeaders.Set("User-Agent", c.s.userAgent())
  57431. if c.ifNoneMatch_ != "" {
  57432. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57433. }
  57434. var body io.Reader = nil
  57435. c.urlParams_.Set("alt", alt)
  57436. c.urlParams_.Set("prettyPrint", "false")
  57437. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments")
  57438. urls += "?" + c.urlParams_.Encode()
  57439. req, err := http.NewRequest("GET", urls, body)
  57440. if err != nil {
  57441. return nil, err
  57442. }
  57443. req.Header = reqHeaders
  57444. googleapi.Expand(req.URL, map[string]string{
  57445. "project": c.project,
  57446. "region": c.region,
  57447. })
  57448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57449. }
  57450. // Do executes the "compute.interconnectAttachments.list" call.
  57451. // Exactly one of *InterconnectAttachmentList or error will be non-nil.
  57452. // Any non-2xx status code is an error. Response headers are in either
  57453. // *InterconnectAttachmentList.ServerResponse.Header or (if a response
  57454. // was returned at all) in error.(*googleapi.Error).Header. Use
  57455. // googleapi.IsNotModified to check whether the returned error was
  57456. // because http.StatusNotModified was returned.
  57457. func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) {
  57458. gensupport.SetOptions(c.urlParams_, opts...)
  57459. res, err := c.doRequest("json")
  57460. if res != nil && res.StatusCode == http.StatusNotModified {
  57461. if res.Body != nil {
  57462. res.Body.Close()
  57463. }
  57464. return nil, &googleapi.Error{
  57465. Code: res.StatusCode,
  57466. Header: res.Header,
  57467. }
  57468. }
  57469. if err != nil {
  57470. return nil, err
  57471. }
  57472. defer googleapi.CloseBody(res)
  57473. if err := googleapi.CheckResponse(res); err != nil {
  57474. return nil, err
  57475. }
  57476. ret := &InterconnectAttachmentList{
  57477. ServerResponse: googleapi.ServerResponse{
  57478. Header: res.Header,
  57479. HTTPStatusCode: res.StatusCode,
  57480. },
  57481. }
  57482. target := &ret
  57483. if err := gensupport.DecodeResponse(target, res); err != nil {
  57484. return nil, err
  57485. }
  57486. return ret, nil
  57487. // {
  57488. // "description": "Retrieves the list of interconnect attachments contained within the specified region.",
  57489. // "httpMethod": "GET",
  57490. // "id": "compute.interconnectAttachments.list",
  57491. // "parameterOrder": [
  57492. // "project",
  57493. // "region"
  57494. // ],
  57495. // "parameters": {
  57496. // "filter": {
  57497. // "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).",
  57498. // "location": "query",
  57499. // "type": "string"
  57500. // },
  57501. // "maxResults": {
  57502. // "default": "500",
  57503. // "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)",
  57504. // "format": "uint32",
  57505. // "location": "query",
  57506. // "minimum": "0",
  57507. // "type": "integer"
  57508. // },
  57509. // "orderBy": {
  57510. // "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.",
  57511. // "location": "query",
  57512. // "type": "string"
  57513. // },
  57514. // "pageToken": {
  57515. // "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.",
  57516. // "location": "query",
  57517. // "type": "string"
  57518. // },
  57519. // "project": {
  57520. // "description": "Project ID for this request.",
  57521. // "location": "path",
  57522. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57523. // "required": true,
  57524. // "type": "string"
  57525. // },
  57526. // "region": {
  57527. // "description": "Name of the region for this request.",
  57528. // "location": "path",
  57529. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57530. // "required": true,
  57531. // "type": "string"
  57532. // }
  57533. // },
  57534. // "path": "{project}/regions/{region}/interconnectAttachments",
  57535. // "response": {
  57536. // "$ref": "InterconnectAttachmentList"
  57537. // },
  57538. // "scopes": [
  57539. // "https://www.googleapis.com/auth/cloud-platform",
  57540. // "https://www.googleapis.com/auth/compute",
  57541. // "https://www.googleapis.com/auth/compute.readonly"
  57542. // ]
  57543. // }
  57544. }
  57545. // Pages invokes f for each page of results.
  57546. // A non-nil error returned from f will halt the iteration.
  57547. // The provided context supersedes any context provided to the Context method.
  57548. func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error {
  57549. c.ctx_ = ctx
  57550. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  57551. for {
  57552. x, err := c.Do()
  57553. if err != nil {
  57554. return err
  57555. }
  57556. if err := f(x); err != nil {
  57557. return err
  57558. }
  57559. if x.NextPageToken == "" {
  57560. return nil
  57561. }
  57562. c.PageToken(x.NextPageToken)
  57563. }
  57564. }
  57565. // method id "compute.interconnectAttachments.patch":
  57566. type InterconnectAttachmentsPatchCall struct {
  57567. s *Service
  57568. project string
  57569. region string
  57570. interconnectAttachment string
  57571. interconnectattachment *InterconnectAttachment
  57572. urlParams_ gensupport.URLParams
  57573. ctx_ context.Context
  57574. header_ http.Header
  57575. }
  57576. // Patch: Updates the specified interconnect attachment with the data
  57577. // included in the request. This method supports PATCH semantics and
  57578. // uses the JSON merge patch format and processing rules.
  57579. func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall {
  57580. c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57581. c.project = project
  57582. c.region = region
  57583. c.interconnectAttachment = interconnectAttachment
  57584. c.interconnectattachment = interconnectattachment
  57585. return c
  57586. }
  57587. // RequestId sets the optional parameter "requestId": An optional
  57588. // request ID to identify requests. Specify a unique request ID so that
  57589. // if you must retry your request, the server will know to ignore the
  57590. // request if it has already been completed.
  57591. //
  57592. // For example, consider a situation where you make an initial request
  57593. // and the request times out. If you make the request again with the
  57594. // same request ID, the server can check if original operation with the
  57595. // same request ID was received, and if so, will ignore the second
  57596. // request. This prevents clients from accidentally creating duplicate
  57597. // commitments.
  57598. //
  57599. // The request ID must be a valid UUID with the exception that zero UUID
  57600. // is not supported (00000000-0000-0000-0000-000000000000).
  57601. func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall {
  57602. c.urlParams_.Set("requestId", requestId)
  57603. return c
  57604. }
  57605. // Fields allows partial responses to be retrieved. See
  57606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57607. // for more information.
  57608. func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall {
  57609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57610. return c
  57611. }
  57612. // Context sets the context to be used in this call's Do method. Any
  57613. // pending HTTP request will be aborted if the provided context is
  57614. // canceled.
  57615. func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall {
  57616. c.ctx_ = ctx
  57617. return c
  57618. }
  57619. // Header returns an http.Header that can be modified by the caller to
  57620. // add HTTP headers to the request.
  57621. func (c *InterconnectAttachmentsPatchCall) Header() http.Header {
  57622. if c.header_ == nil {
  57623. c.header_ = make(http.Header)
  57624. }
  57625. return c.header_
  57626. }
  57627. func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  57628. reqHeaders := make(http.Header)
  57629. for k, v := range c.header_ {
  57630. reqHeaders[k] = v
  57631. }
  57632. reqHeaders.Set("User-Agent", c.s.userAgent())
  57633. var body io.Reader = nil
  57634. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment)
  57635. if err != nil {
  57636. return nil, err
  57637. }
  57638. reqHeaders.Set("Content-Type", "application/json")
  57639. c.urlParams_.Set("alt", alt)
  57640. c.urlParams_.Set("prettyPrint", "false")
  57641. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}")
  57642. urls += "?" + c.urlParams_.Encode()
  57643. req, err := http.NewRequest("PATCH", urls, body)
  57644. if err != nil {
  57645. return nil, err
  57646. }
  57647. req.Header = reqHeaders
  57648. googleapi.Expand(req.URL, map[string]string{
  57649. "project": c.project,
  57650. "region": c.region,
  57651. "interconnectAttachment": c.interconnectAttachment,
  57652. })
  57653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57654. }
  57655. // Do executes the "compute.interconnectAttachments.patch" call.
  57656. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  57657. // status code is an error. Response headers are in either
  57658. // *Operation.ServerResponse.Header or (if a response was returned at
  57659. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  57660. // to check whether the returned error was because
  57661. // http.StatusNotModified was returned.
  57662. func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  57663. gensupport.SetOptions(c.urlParams_, opts...)
  57664. res, err := c.doRequest("json")
  57665. if res != nil && res.StatusCode == http.StatusNotModified {
  57666. if res.Body != nil {
  57667. res.Body.Close()
  57668. }
  57669. return nil, &googleapi.Error{
  57670. Code: res.StatusCode,
  57671. Header: res.Header,
  57672. }
  57673. }
  57674. if err != nil {
  57675. return nil, err
  57676. }
  57677. defer googleapi.CloseBody(res)
  57678. if err := googleapi.CheckResponse(res); err != nil {
  57679. return nil, err
  57680. }
  57681. ret := &Operation{
  57682. ServerResponse: googleapi.ServerResponse{
  57683. Header: res.Header,
  57684. HTTPStatusCode: res.StatusCode,
  57685. },
  57686. }
  57687. target := &ret
  57688. if err := gensupport.DecodeResponse(target, res); err != nil {
  57689. return nil, err
  57690. }
  57691. return ret, nil
  57692. // {
  57693. // "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.",
  57694. // "httpMethod": "PATCH",
  57695. // "id": "compute.interconnectAttachments.patch",
  57696. // "parameterOrder": [
  57697. // "project",
  57698. // "region",
  57699. // "interconnectAttachment"
  57700. // ],
  57701. // "parameters": {
  57702. // "interconnectAttachment": {
  57703. // "description": "Name of the interconnect attachment to patch.",
  57704. // "location": "path",
  57705. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57706. // "required": true,
  57707. // "type": "string"
  57708. // },
  57709. // "project": {
  57710. // "description": "Project ID for this request.",
  57711. // "location": "path",
  57712. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57713. // "required": true,
  57714. // "type": "string"
  57715. // },
  57716. // "region": {
  57717. // "description": "Name of the region scoping this request.",
  57718. // "location": "path",
  57719. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  57720. // "required": true,
  57721. // "type": "string"
  57722. // },
  57723. // "requestId": {
  57724. // "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).",
  57725. // "location": "query",
  57726. // "type": "string"
  57727. // }
  57728. // },
  57729. // "path": "{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}",
  57730. // "request": {
  57731. // "$ref": "InterconnectAttachment"
  57732. // },
  57733. // "response": {
  57734. // "$ref": "Operation"
  57735. // },
  57736. // "scopes": [
  57737. // "https://www.googleapis.com/auth/cloud-platform",
  57738. // "https://www.googleapis.com/auth/compute"
  57739. // ]
  57740. // }
  57741. }
  57742. // method id "compute.interconnectLocations.get":
  57743. type InterconnectLocationsGetCall struct {
  57744. s *Service
  57745. project string
  57746. interconnectLocation string
  57747. urlParams_ gensupport.URLParams
  57748. ifNoneMatch_ string
  57749. ctx_ context.Context
  57750. header_ http.Header
  57751. }
  57752. // Get: Returns the details for the specified interconnect location.
  57753. // Gets a list of available interconnect locations by making a list()
  57754. // request.
  57755. func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall {
  57756. c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57757. c.project = project
  57758. c.interconnectLocation = interconnectLocation
  57759. return c
  57760. }
  57761. // Fields allows partial responses to be retrieved. See
  57762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57763. // for more information.
  57764. func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall {
  57765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57766. return c
  57767. }
  57768. // IfNoneMatch sets the optional parameter which makes the operation
  57769. // fail if the object's ETag matches the given value. This is useful for
  57770. // getting updates only after the object has changed since the last
  57771. // request. Use googleapi.IsNotModified to check whether the response
  57772. // error from Do is the result of In-None-Match.
  57773. func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall {
  57774. c.ifNoneMatch_ = entityTag
  57775. return c
  57776. }
  57777. // Context sets the context to be used in this call's Do method. Any
  57778. // pending HTTP request will be aborted if the provided context is
  57779. // canceled.
  57780. func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall {
  57781. c.ctx_ = ctx
  57782. return c
  57783. }
  57784. // Header returns an http.Header that can be modified by the caller to
  57785. // add HTTP headers to the request.
  57786. func (c *InterconnectLocationsGetCall) Header() http.Header {
  57787. if c.header_ == nil {
  57788. c.header_ = make(http.Header)
  57789. }
  57790. return c.header_
  57791. }
  57792. func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  57793. reqHeaders := make(http.Header)
  57794. for k, v := range c.header_ {
  57795. reqHeaders[k] = v
  57796. }
  57797. reqHeaders.Set("User-Agent", c.s.userAgent())
  57798. if c.ifNoneMatch_ != "" {
  57799. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  57800. }
  57801. var body io.Reader = nil
  57802. c.urlParams_.Set("alt", alt)
  57803. c.urlParams_.Set("prettyPrint", "false")
  57804. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations/{interconnectLocation}")
  57805. urls += "?" + c.urlParams_.Encode()
  57806. req, err := http.NewRequest("GET", urls, body)
  57807. if err != nil {
  57808. return nil, err
  57809. }
  57810. req.Header = reqHeaders
  57811. googleapi.Expand(req.URL, map[string]string{
  57812. "project": c.project,
  57813. "interconnectLocation": c.interconnectLocation,
  57814. })
  57815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  57816. }
  57817. // Do executes the "compute.interconnectLocations.get" call.
  57818. // Exactly one of *InterconnectLocation or error will be non-nil. Any
  57819. // non-2xx status code is an error. Response headers are in either
  57820. // *InterconnectLocation.ServerResponse.Header or (if a response was
  57821. // returned at all) in error.(*googleapi.Error).Header. Use
  57822. // googleapi.IsNotModified to check whether the returned error was
  57823. // because http.StatusNotModified was returned.
  57824. func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) {
  57825. gensupport.SetOptions(c.urlParams_, opts...)
  57826. res, err := c.doRequest("json")
  57827. if res != nil && res.StatusCode == http.StatusNotModified {
  57828. if res.Body != nil {
  57829. res.Body.Close()
  57830. }
  57831. return nil, &googleapi.Error{
  57832. Code: res.StatusCode,
  57833. Header: res.Header,
  57834. }
  57835. }
  57836. if err != nil {
  57837. return nil, err
  57838. }
  57839. defer googleapi.CloseBody(res)
  57840. if err := googleapi.CheckResponse(res); err != nil {
  57841. return nil, err
  57842. }
  57843. ret := &InterconnectLocation{
  57844. ServerResponse: googleapi.ServerResponse{
  57845. Header: res.Header,
  57846. HTTPStatusCode: res.StatusCode,
  57847. },
  57848. }
  57849. target := &ret
  57850. if err := gensupport.DecodeResponse(target, res); err != nil {
  57851. return nil, err
  57852. }
  57853. return ret, nil
  57854. // {
  57855. // "description": "Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request.",
  57856. // "httpMethod": "GET",
  57857. // "id": "compute.interconnectLocations.get",
  57858. // "parameterOrder": [
  57859. // "project",
  57860. // "interconnectLocation"
  57861. // ],
  57862. // "parameters": {
  57863. // "interconnectLocation": {
  57864. // "description": "Name of the interconnect location to return.",
  57865. // "location": "path",
  57866. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  57867. // "required": true,
  57868. // "type": "string"
  57869. // },
  57870. // "project": {
  57871. // "description": "Project ID for this request.",
  57872. // "location": "path",
  57873. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  57874. // "required": true,
  57875. // "type": "string"
  57876. // }
  57877. // },
  57878. // "path": "{project}/global/interconnectLocations/{interconnectLocation}",
  57879. // "response": {
  57880. // "$ref": "InterconnectLocation"
  57881. // },
  57882. // "scopes": [
  57883. // "https://www.googleapis.com/auth/cloud-platform",
  57884. // "https://www.googleapis.com/auth/compute",
  57885. // "https://www.googleapis.com/auth/compute.readonly"
  57886. // ]
  57887. // }
  57888. }
  57889. // method id "compute.interconnectLocations.list":
  57890. type InterconnectLocationsListCall struct {
  57891. s *Service
  57892. project string
  57893. urlParams_ gensupport.URLParams
  57894. ifNoneMatch_ string
  57895. ctx_ context.Context
  57896. header_ http.Header
  57897. }
  57898. // List: Retrieves the list of interconnect locations available to the
  57899. // specified project.
  57900. func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall {
  57901. c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  57902. c.project = project
  57903. return c
  57904. }
  57905. // Filter sets the optional parameter "filter": A filter expression that
  57906. // filters resources listed in the response. The expression must specify
  57907. // the field name, a comparison operator, and the value that you want to
  57908. // use for filtering. The value must be a string, a number, or a
  57909. // boolean. The comparison operator must be either =, !=, >, or <.
  57910. //
  57911. // For example, if you are filtering Compute Engine instances, you can
  57912. // exclude instances named example-instance by specifying name !=
  57913. // example-instance.
  57914. //
  57915. // You can also filter nested fields. For example, you could specify
  57916. // scheduling.automaticRestart = false to include instances only if they
  57917. // are not scheduled for automatic restarts. You can use filtering on
  57918. // nested fields to filter based on resource labels.
  57919. //
  57920. // To filter on multiple expressions, provide each separate expression
  57921. // within parentheses. For example, (scheduling.automaticRestart = true)
  57922. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  57923. // AND expression. However, you can include AND and OR expressions
  57924. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  57925. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  57926. // true).
  57927. func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall {
  57928. c.urlParams_.Set("filter", filter)
  57929. return c
  57930. }
  57931. // MaxResults sets the optional parameter "maxResults": The maximum
  57932. // number of results per page that should be returned. If the number of
  57933. // available results is larger than maxResults, Compute Engine returns a
  57934. // nextPageToken that can be used to get the next page of results in
  57935. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  57936. // (Default: 500)
  57937. func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall {
  57938. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  57939. return c
  57940. }
  57941. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  57942. // a certain order. By default, results are returned in alphanumerical
  57943. // order based on the resource name.
  57944. //
  57945. // You can also sort results in descending order based on the creation
  57946. // timestamp using orderBy="creationTimestamp desc". This sorts results
  57947. // based on the creationTimestamp field in reverse chronological order
  57948. // (newest result first). Use this to sort resources like operations so
  57949. // that the newest operation is returned first.
  57950. //
  57951. // Currently, only sorting by name or creationTimestamp desc is
  57952. // supported.
  57953. func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall {
  57954. c.urlParams_.Set("orderBy", orderBy)
  57955. return c
  57956. }
  57957. // PageToken sets the optional parameter "pageToken": Specifies a page
  57958. // token to use. Set pageToken to the nextPageToken returned by a
  57959. // previous list request to get the next page of results.
  57960. func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall {
  57961. c.urlParams_.Set("pageToken", pageToken)
  57962. return c
  57963. }
  57964. // Fields allows partial responses to be retrieved. See
  57965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  57966. // for more information.
  57967. func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall {
  57968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  57969. return c
  57970. }
  57971. // IfNoneMatch sets the optional parameter which makes the operation
  57972. // fail if the object's ETag matches the given value. This is useful for
  57973. // getting updates only after the object has changed since the last
  57974. // request. Use googleapi.IsNotModified to check whether the response
  57975. // error from Do is the result of In-None-Match.
  57976. func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall {
  57977. c.ifNoneMatch_ = entityTag
  57978. return c
  57979. }
  57980. // Context sets the context to be used in this call's Do method. Any
  57981. // pending HTTP request will be aborted if the provided context is
  57982. // canceled.
  57983. func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall {
  57984. c.ctx_ = ctx
  57985. return c
  57986. }
  57987. // Header returns an http.Header that can be modified by the caller to
  57988. // add HTTP headers to the request.
  57989. func (c *InterconnectLocationsListCall) Header() http.Header {
  57990. if c.header_ == nil {
  57991. c.header_ = make(http.Header)
  57992. }
  57993. return c.header_
  57994. }
  57995. func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) {
  57996. reqHeaders := make(http.Header)
  57997. for k, v := range c.header_ {
  57998. reqHeaders[k] = v
  57999. }
  58000. reqHeaders.Set("User-Agent", c.s.userAgent())
  58001. if c.ifNoneMatch_ != "" {
  58002. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58003. }
  58004. var body io.Reader = nil
  58005. c.urlParams_.Set("alt", alt)
  58006. c.urlParams_.Set("prettyPrint", "false")
  58007. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnectLocations")
  58008. urls += "?" + c.urlParams_.Encode()
  58009. req, err := http.NewRequest("GET", urls, body)
  58010. if err != nil {
  58011. return nil, err
  58012. }
  58013. req.Header = reqHeaders
  58014. googleapi.Expand(req.URL, map[string]string{
  58015. "project": c.project,
  58016. })
  58017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58018. }
  58019. // Do executes the "compute.interconnectLocations.list" call.
  58020. // Exactly one of *InterconnectLocationList or error will be non-nil.
  58021. // Any non-2xx status code is an error. Response headers are in either
  58022. // *InterconnectLocationList.ServerResponse.Header or (if a response was
  58023. // returned at all) in error.(*googleapi.Error).Header. Use
  58024. // googleapi.IsNotModified to check whether the returned error was
  58025. // because http.StatusNotModified was returned.
  58026. func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) {
  58027. gensupport.SetOptions(c.urlParams_, opts...)
  58028. res, err := c.doRequest("json")
  58029. if res != nil && res.StatusCode == http.StatusNotModified {
  58030. if res.Body != nil {
  58031. res.Body.Close()
  58032. }
  58033. return nil, &googleapi.Error{
  58034. Code: res.StatusCode,
  58035. Header: res.Header,
  58036. }
  58037. }
  58038. if err != nil {
  58039. return nil, err
  58040. }
  58041. defer googleapi.CloseBody(res)
  58042. if err := googleapi.CheckResponse(res); err != nil {
  58043. return nil, err
  58044. }
  58045. ret := &InterconnectLocationList{
  58046. ServerResponse: googleapi.ServerResponse{
  58047. Header: res.Header,
  58048. HTTPStatusCode: res.StatusCode,
  58049. },
  58050. }
  58051. target := &ret
  58052. if err := gensupport.DecodeResponse(target, res); err != nil {
  58053. return nil, err
  58054. }
  58055. return ret, nil
  58056. // {
  58057. // "description": "Retrieves the list of interconnect locations available to the specified project.",
  58058. // "httpMethod": "GET",
  58059. // "id": "compute.interconnectLocations.list",
  58060. // "parameterOrder": [
  58061. // "project"
  58062. // ],
  58063. // "parameters": {
  58064. // "filter": {
  58065. // "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).",
  58066. // "location": "query",
  58067. // "type": "string"
  58068. // },
  58069. // "maxResults": {
  58070. // "default": "500",
  58071. // "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)",
  58072. // "format": "uint32",
  58073. // "location": "query",
  58074. // "minimum": "0",
  58075. // "type": "integer"
  58076. // },
  58077. // "orderBy": {
  58078. // "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.",
  58079. // "location": "query",
  58080. // "type": "string"
  58081. // },
  58082. // "pageToken": {
  58083. // "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.",
  58084. // "location": "query",
  58085. // "type": "string"
  58086. // },
  58087. // "project": {
  58088. // "description": "Project ID for this request.",
  58089. // "location": "path",
  58090. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58091. // "required": true,
  58092. // "type": "string"
  58093. // }
  58094. // },
  58095. // "path": "{project}/global/interconnectLocations",
  58096. // "response": {
  58097. // "$ref": "InterconnectLocationList"
  58098. // },
  58099. // "scopes": [
  58100. // "https://www.googleapis.com/auth/cloud-platform",
  58101. // "https://www.googleapis.com/auth/compute",
  58102. // "https://www.googleapis.com/auth/compute.readonly"
  58103. // ]
  58104. // }
  58105. }
  58106. // Pages invokes f for each page of results.
  58107. // A non-nil error returned from f will halt the iteration.
  58108. // The provided context supersedes any context provided to the Context method.
  58109. func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error {
  58110. c.ctx_ = ctx
  58111. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58112. for {
  58113. x, err := c.Do()
  58114. if err != nil {
  58115. return err
  58116. }
  58117. if err := f(x); err != nil {
  58118. return err
  58119. }
  58120. if x.NextPageToken == "" {
  58121. return nil
  58122. }
  58123. c.PageToken(x.NextPageToken)
  58124. }
  58125. }
  58126. // method id "compute.interconnects.delete":
  58127. type InterconnectsDeleteCall struct {
  58128. s *Service
  58129. project string
  58130. interconnect string
  58131. urlParams_ gensupport.URLParams
  58132. ctx_ context.Context
  58133. header_ http.Header
  58134. }
  58135. // Delete: Deletes the specified interconnect.
  58136. func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall {
  58137. c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58138. c.project = project
  58139. c.interconnect = interconnect
  58140. return c
  58141. }
  58142. // RequestId sets the optional parameter "requestId": An optional
  58143. // request ID to identify requests. Specify a unique request ID so that
  58144. // if you must retry your request, the server will know to ignore the
  58145. // request if it has already been completed.
  58146. //
  58147. // For example, consider a situation where you make an initial request
  58148. // and the request times out. If you make the request again with the
  58149. // same request ID, the server can check if original operation with the
  58150. // same request ID was received, and if so, will ignore the second
  58151. // request. This prevents clients from accidentally creating duplicate
  58152. // commitments.
  58153. //
  58154. // The request ID must be a valid UUID with the exception that zero UUID
  58155. // is not supported (00000000-0000-0000-0000-000000000000).
  58156. func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall {
  58157. c.urlParams_.Set("requestId", requestId)
  58158. return c
  58159. }
  58160. // Fields allows partial responses to be retrieved. See
  58161. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58162. // for more information.
  58163. func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall {
  58164. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58165. return c
  58166. }
  58167. // Context sets the context to be used in this call's Do method. Any
  58168. // pending HTTP request will be aborted if the provided context is
  58169. // canceled.
  58170. func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall {
  58171. c.ctx_ = ctx
  58172. return c
  58173. }
  58174. // Header returns an http.Header that can be modified by the caller to
  58175. // add HTTP headers to the request.
  58176. func (c *InterconnectsDeleteCall) Header() http.Header {
  58177. if c.header_ == nil {
  58178. c.header_ = make(http.Header)
  58179. }
  58180. return c.header_
  58181. }
  58182. func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  58183. reqHeaders := make(http.Header)
  58184. for k, v := range c.header_ {
  58185. reqHeaders[k] = v
  58186. }
  58187. reqHeaders.Set("User-Agent", c.s.userAgent())
  58188. var body io.Reader = nil
  58189. c.urlParams_.Set("alt", alt)
  58190. c.urlParams_.Set("prettyPrint", "false")
  58191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  58192. urls += "?" + c.urlParams_.Encode()
  58193. req, err := http.NewRequest("DELETE", urls, body)
  58194. if err != nil {
  58195. return nil, err
  58196. }
  58197. req.Header = reqHeaders
  58198. googleapi.Expand(req.URL, map[string]string{
  58199. "project": c.project,
  58200. "interconnect": c.interconnect,
  58201. })
  58202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58203. }
  58204. // Do executes the "compute.interconnects.delete" call.
  58205. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58206. // status code is an error. Response headers are in either
  58207. // *Operation.ServerResponse.Header or (if a response was returned at
  58208. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58209. // to check whether the returned error was because
  58210. // http.StatusNotModified was returned.
  58211. func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58212. gensupport.SetOptions(c.urlParams_, opts...)
  58213. res, err := c.doRequest("json")
  58214. if res != nil && res.StatusCode == http.StatusNotModified {
  58215. if res.Body != nil {
  58216. res.Body.Close()
  58217. }
  58218. return nil, &googleapi.Error{
  58219. Code: res.StatusCode,
  58220. Header: res.Header,
  58221. }
  58222. }
  58223. if err != nil {
  58224. return nil, err
  58225. }
  58226. defer googleapi.CloseBody(res)
  58227. if err := googleapi.CheckResponse(res); err != nil {
  58228. return nil, err
  58229. }
  58230. ret := &Operation{
  58231. ServerResponse: googleapi.ServerResponse{
  58232. Header: res.Header,
  58233. HTTPStatusCode: res.StatusCode,
  58234. },
  58235. }
  58236. target := &ret
  58237. if err := gensupport.DecodeResponse(target, res); err != nil {
  58238. return nil, err
  58239. }
  58240. return ret, nil
  58241. // {
  58242. // "description": "Deletes the specified interconnect.",
  58243. // "httpMethod": "DELETE",
  58244. // "id": "compute.interconnects.delete",
  58245. // "parameterOrder": [
  58246. // "project",
  58247. // "interconnect"
  58248. // ],
  58249. // "parameters": {
  58250. // "interconnect": {
  58251. // "description": "Name of the interconnect to delete.",
  58252. // "location": "path",
  58253. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58254. // "required": true,
  58255. // "type": "string"
  58256. // },
  58257. // "project": {
  58258. // "description": "Project ID for this request.",
  58259. // "location": "path",
  58260. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58261. // "required": true,
  58262. // "type": "string"
  58263. // },
  58264. // "requestId": {
  58265. // "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).",
  58266. // "location": "query",
  58267. // "type": "string"
  58268. // }
  58269. // },
  58270. // "path": "{project}/global/interconnects/{interconnect}",
  58271. // "response": {
  58272. // "$ref": "Operation"
  58273. // },
  58274. // "scopes": [
  58275. // "https://www.googleapis.com/auth/cloud-platform",
  58276. // "https://www.googleapis.com/auth/compute"
  58277. // ]
  58278. // }
  58279. }
  58280. // method id "compute.interconnects.get":
  58281. type InterconnectsGetCall struct {
  58282. s *Service
  58283. project string
  58284. interconnect string
  58285. urlParams_ gensupport.URLParams
  58286. ifNoneMatch_ string
  58287. ctx_ context.Context
  58288. header_ http.Header
  58289. }
  58290. // Get: Returns the specified interconnect. Get a list of available
  58291. // interconnects by making a list() request.
  58292. func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall {
  58293. c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58294. c.project = project
  58295. c.interconnect = interconnect
  58296. return c
  58297. }
  58298. // Fields allows partial responses to be retrieved. See
  58299. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58300. // for more information.
  58301. func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall {
  58302. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58303. return c
  58304. }
  58305. // IfNoneMatch sets the optional parameter which makes the operation
  58306. // fail if the object's ETag matches the given value. This is useful for
  58307. // getting updates only after the object has changed since the last
  58308. // request. Use googleapi.IsNotModified to check whether the response
  58309. // error from Do is the result of In-None-Match.
  58310. func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall {
  58311. c.ifNoneMatch_ = entityTag
  58312. return c
  58313. }
  58314. // Context sets the context to be used in this call's Do method. Any
  58315. // pending HTTP request will be aborted if the provided context is
  58316. // canceled.
  58317. func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall {
  58318. c.ctx_ = ctx
  58319. return c
  58320. }
  58321. // Header returns an http.Header that can be modified by the caller to
  58322. // add HTTP headers to the request.
  58323. func (c *InterconnectsGetCall) Header() http.Header {
  58324. if c.header_ == nil {
  58325. c.header_ = make(http.Header)
  58326. }
  58327. return c.header_
  58328. }
  58329. func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) {
  58330. reqHeaders := make(http.Header)
  58331. for k, v := range c.header_ {
  58332. reqHeaders[k] = v
  58333. }
  58334. reqHeaders.Set("User-Agent", c.s.userAgent())
  58335. if c.ifNoneMatch_ != "" {
  58336. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58337. }
  58338. var body io.Reader = nil
  58339. c.urlParams_.Set("alt", alt)
  58340. c.urlParams_.Set("prettyPrint", "false")
  58341. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  58342. urls += "?" + c.urlParams_.Encode()
  58343. req, err := http.NewRequest("GET", urls, body)
  58344. if err != nil {
  58345. return nil, err
  58346. }
  58347. req.Header = reqHeaders
  58348. googleapi.Expand(req.URL, map[string]string{
  58349. "project": c.project,
  58350. "interconnect": c.interconnect,
  58351. })
  58352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58353. }
  58354. // Do executes the "compute.interconnects.get" call.
  58355. // Exactly one of *Interconnect or error will be non-nil. Any non-2xx
  58356. // status code is an error. Response headers are in either
  58357. // *Interconnect.ServerResponse.Header or (if a response was returned at
  58358. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58359. // to check whether the returned error was because
  58360. // http.StatusNotModified was returned.
  58361. func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) {
  58362. gensupport.SetOptions(c.urlParams_, opts...)
  58363. res, err := c.doRequest("json")
  58364. if res != nil && res.StatusCode == http.StatusNotModified {
  58365. if res.Body != nil {
  58366. res.Body.Close()
  58367. }
  58368. return nil, &googleapi.Error{
  58369. Code: res.StatusCode,
  58370. Header: res.Header,
  58371. }
  58372. }
  58373. if err != nil {
  58374. return nil, err
  58375. }
  58376. defer googleapi.CloseBody(res)
  58377. if err := googleapi.CheckResponse(res); err != nil {
  58378. return nil, err
  58379. }
  58380. ret := &Interconnect{
  58381. ServerResponse: googleapi.ServerResponse{
  58382. Header: res.Header,
  58383. HTTPStatusCode: res.StatusCode,
  58384. },
  58385. }
  58386. target := &ret
  58387. if err := gensupport.DecodeResponse(target, res); err != nil {
  58388. return nil, err
  58389. }
  58390. return ret, nil
  58391. // {
  58392. // "description": "Returns the specified interconnect. Get a list of available interconnects by making a list() request.",
  58393. // "httpMethod": "GET",
  58394. // "id": "compute.interconnects.get",
  58395. // "parameterOrder": [
  58396. // "project",
  58397. // "interconnect"
  58398. // ],
  58399. // "parameters": {
  58400. // "interconnect": {
  58401. // "description": "Name of the interconnect to return.",
  58402. // "location": "path",
  58403. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58404. // "required": true,
  58405. // "type": "string"
  58406. // },
  58407. // "project": {
  58408. // "description": "Project ID for this request.",
  58409. // "location": "path",
  58410. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58411. // "required": true,
  58412. // "type": "string"
  58413. // }
  58414. // },
  58415. // "path": "{project}/global/interconnects/{interconnect}",
  58416. // "response": {
  58417. // "$ref": "Interconnect"
  58418. // },
  58419. // "scopes": [
  58420. // "https://www.googleapis.com/auth/cloud-platform",
  58421. // "https://www.googleapis.com/auth/compute",
  58422. // "https://www.googleapis.com/auth/compute.readonly"
  58423. // ]
  58424. // }
  58425. }
  58426. // method id "compute.interconnects.getDiagnostics":
  58427. type InterconnectsGetDiagnosticsCall struct {
  58428. s *Service
  58429. project string
  58430. interconnect string
  58431. urlParams_ gensupport.URLParams
  58432. ifNoneMatch_ string
  58433. ctx_ context.Context
  58434. header_ http.Header
  58435. }
  58436. // GetDiagnostics: Returns the interconnectDiagnostics for the specified
  58437. // interconnect.
  58438. func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall {
  58439. c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58440. c.project = project
  58441. c.interconnect = interconnect
  58442. return c
  58443. }
  58444. // Fields allows partial responses to be retrieved. See
  58445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58446. // for more information.
  58447. func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall {
  58448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58449. return c
  58450. }
  58451. // IfNoneMatch sets the optional parameter which makes the operation
  58452. // fail if the object's ETag matches the given value. This is useful for
  58453. // getting updates only after the object has changed since the last
  58454. // request. Use googleapi.IsNotModified to check whether the response
  58455. // error from Do is the result of In-None-Match.
  58456. func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall {
  58457. c.ifNoneMatch_ = entityTag
  58458. return c
  58459. }
  58460. // Context sets the context to be used in this call's Do method. Any
  58461. // pending HTTP request will be aborted if the provided context is
  58462. // canceled.
  58463. func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall {
  58464. c.ctx_ = ctx
  58465. return c
  58466. }
  58467. // Header returns an http.Header that can be modified by the caller to
  58468. // add HTTP headers to the request.
  58469. func (c *InterconnectsGetDiagnosticsCall) Header() http.Header {
  58470. if c.header_ == nil {
  58471. c.header_ = make(http.Header)
  58472. }
  58473. return c.header_
  58474. }
  58475. func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) {
  58476. reqHeaders := make(http.Header)
  58477. for k, v := range c.header_ {
  58478. reqHeaders[k] = v
  58479. }
  58480. reqHeaders.Set("User-Agent", c.s.userAgent())
  58481. if c.ifNoneMatch_ != "" {
  58482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58483. }
  58484. var body io.Reader = nil
  58485. c.urlParams_.Set("alt", alt)
  58486. c.urlParams_.Set("prettyPrint", "false")
  58487. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}/getDiagnostics")
  58488. urls += "?" + c.urlParams_.Encode()
  58489. req, err := http.NewRequest("GET", urls, body)
  58490. if err != nil {
  58491. return nil, err
  58492. }
  58493. req.Header = reqHeaders
  58494. googleapi.Expand(req.URL, map[string]string{
  58495. "project": c.project,
  58496. "interconnect": c.interconnect,
  58497. })
  58498. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58499. }
  58500. // Do executes the "compute.interconnects.getDiagnostics" call.
  58501. // Exactly one of *InterconnectsGetDiagnosticsResponse or error will be
  58502. // non-nil. Any non-2xx status code is an error. Response headers are in
  58503. // either *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or
  58504. // (if a response was returned at all) in
  58505. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  58506. // whether the returned error was because http.StatusNotModified was
  58507. // returned.
  58508. func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) {
  58509. gensupport.SetOptions(c.urlParams_, opts...)
  58510. res, err := c.doRequest("json")
  58511. if res != nil && res.StatusCode == http.StatusNotModified {
  58512. if res.Body != nil {
  58513. res.Body.Close()
  58514. }
  58515. return nil, &googleapi.Error{
  58516. Code: res.StatusCode,
  58517. Header: res.Header,
  58518. }
  58519. }
  58520. if err != nil {
  58521. return nil, err
  58522. }
  58523. defer googleapi.CloseBody(res)
  58524. if err := googleapi.CheckResponse(res); err != nil {
  58525. return nil, err
  58526. }
  58527. ret := &InterconnectsGetDiagnosticsResponse{
  58528. ServerResponse: googleapi.ServerResponse{
  58529. Header: res.Header,
  58530. HTTPStatusCode: res.StatusCode,
  58531. },
  58532. }
  58533. target := &ret
  58534. if err := gensupport.DecodeResponse(target, res); err != nil {
  58535. return nil, err
  58536. }
  58537. return ret, nil
  58538. // {
  58539. // "description": "Returns the interconnectDiagnostics for the specified interconnect.",
  58540. // "httpMethod": "GET",
  58541. // "id": "compute.interconnects.getDiagnostics",
  58542. // "parameterOrder": [
  58543. // "project",
  58544. // "interconnect"
  58545. // ],
  58546. // "parameters": {
  58547. // "interconnect": {
  58548. // "description": "Name of the interconnect resource to query.",
  58549. // "location": "path",
  58550. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  58551. // "required": true,
  58552. // "type": "string"
  58553. // },
  58554. // "project": {
  58555. // "description": "Project ID for this request.",
  58556. // "location": "path",
  58557. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58558. // "required": true,
  58559. // "type": "string"
  58560. // }
  58561. // },
  58562. // "path": "{project}/global/interconnects/{interconnect}/getDiagnostics",
  58563. // "response": {
  58564. // "$ref": "InterconnectsGetDiagnosticsResponse"
  58565. // },
  58566. // "scopes": [
  58567. // "https://www.googleapis.com/auth/cloud-platform",
  58568. // "https://www.googleapis.com/auth/compute",
  58569. // "https://www.googleapis.com/auth/compute.readonly"
  58570. // ]
  58571. // }
  58572. }
  58573. // method id "compute.interconnects.insert":
  58574. type InterconnectsInsertCall struct {
  58575. s *Service
  58576. project string
  58577. interconnect *Interconnect
  58578. urlParams_ gensupport.URLParams
  58579. ctx_ context.Context
  58580. header_ http.Header
  58581. }
  58582. // Insert: Creates a Interconnect in the specified project using the
  58583. // data included in the request.
  58584. func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall {
  58585. c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58586. c.project = project
  58587. c.interconnect = interconnect
  58588. return c
  58589. }
  58590. // RequestId sets the optional parameter "requestId": An optional
  58591. // request ID to identify requests. Specify a unique request ID so that
  58592. // if you must retry your request, the server will know to ignore the
  58593. // request if it has already been completed.
  58594. //
  58595. // For example, consider a situation where you make an initial request
  58596. // and the request times out. If you make the request again with the
  58597. // same request ID, the server can check if original operation with the
  58598. // same request ID was received, and if so, will ignore the second
  58599. // request. This prevents clients from accidentally creating duplicate
  58600. // commitments.
  58601. //
  58602. // The request ID must be a valid UUID with the exception that zero UUID
  58603. // is not supported (00000000-0000-0000-0000-000000000000).
  58604. func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall {
  58605. c.urlParams_.Set("requestId", requestId)
  58606. return c
  58607. }
  58608. // Fields allows partial responses to be retrieved. See
  58609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58610. // for more information.
  58611. func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall {
  58612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58613. return c
  58614. }
  58615. // Context sets the context to be used in this call's Do method. Any
  58616. // pending HTTP request will be aborted if the provided context is
  58617. // canceled.
  58618. func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall {
  58619. c.ctx_ = ctx
  58620. return c
  58621. }
  58622. // Header returns an http.Header that can be modified by the caller to
  58623. // add HTTP headers to the request.
  58624. func (c *InterconnectsInsertCall) Header() http.Header {
  58625. if c.header_ == nil {
  58626. c.header_ = make(http.Header)
  58627. }
  58628. return c.header_
  58629. }
  58630. func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) {
  58631. reqHeaders := make(http.Header)
  58632. for k, v := range c.header_ {
  58633. reqHeaders[k] = v
  58634. }
  58635. reqHeaders.Set("User-Agent", c.s.userAgent())
  58636. var body io.Reader = nil
  58637. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect)
  58638. if err != nil {
  58639. return nil, err
  58640. }
  58641. reqHeaders.Set("Content-Type", "application/json")
  58642. c.urlParams_.Set("alt", alt)
  58643. c.urlParams_.Set("prettyPrint", "false")
  58644. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  58645. urls += "?" + c.urlParams_.Encode()
  58646. req, err := http.NewRequest("POST", urls, body)
  58647. if err != nil {
  58648. return nil, err
  58649. }
  58650. req.Header = reqHeaders
  58651. googleapi.Expand(req.URL, map[string]string{
  58652. "project": c.project,
  58653. })
  58654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58655. }
  58656. // Do executes the "compute.interconnects.insert" call.
  58657. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  58658. // status code is an error. Response headers are in either
  58659. // *Operation.ServerResponse.Header or (if a response was returned at
  58660. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  58661. // to check whether the returned error was because
  58662. // http.StatusNotModified was returned.
  58663. func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  58664. gensupport.SetOptions(c.urlParams_, opts...)
  58665. res, err := c.doRequest("json")
  58666. if res != nil && res.StatusCode == http.StatusNotModified {
  58667. if res.Body != nil {
  58668. res.Body.Close()
  58669. }
  58670. return nil, &googleapi.Error{
  58671. Code: res.StatusCode,
  58672. Header: res.Header,
  58673. }
  58674. }
  58675. if err != nil {
  58676. return nil, err
  58677. }
  58678. defer googleapi.CloseBody(res)
  58679. if err := googleapi.CheckResponse(res); err != nil {
  58680. return nil, err
  58681. }
  58682. ret := &Operation{
  58683. ServerResponse: googleapi.ServerResponse{
  58684. Header: res.Header,
  58685. HTTPStatusCode: res.StatusCode,
  58686. },
  58687. }
  58688. target := &ret
  58689. if err := gensupport.DecodeResponse(target, res); err != nil {
  58690. return nil, err
  58691. }
  58692. return ret, nil
  58693. // {
  58694. // "description": "Creates a Interconnect in the specified project using the data included in the request.",
  58695. // "httpMethod": "POST",
  58696. // "id": "compute.interconnects.insert",
  58697. // "parameterOrder": [
  58698. // "project"
  58699. // ],
  58700. // "parameters": {
  58701. // "project": {
  58702. // "description": "Project ID for this request.",
  58703. // "location": "path",
  58704. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58705. // "required": true,
  58706. // "type": "string"
  58707. // },
  58708. // "requestId": {
  58709. // "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).",
  58710. // "location": "query",
  58711. // "type": "string"
  58712. // }
  58713. // },
  58714. // "path": "{project}/global/interconnects",
  58715. // "request": {
  58716. // "$ref": "Interconnect"
  58717. // },
  58718. // "response": {
  58719. // "$ref": "Operation"
  58720. // },
  58721. // "scopes": [
  58722. // "https://www.googleapis.com/auth/cloud-platform",
  58723. // "https://www.googleapis.com/auth/compute"
  58724. // ]
  58725. // }
  58726. }
  58727. // method id "compute.interconnects.list":
  58728. type InterconnectsListCall struct {
  58729. s *Service
  58730. project string
  58731. urlParams_ gensupport.URLParams
  58732. ifNoneMatch_ string
  58733. ctx_ context.Context
  58734. header_ http.Header
  58735. }
  58736. // List: Retrieves the list of interconnect available to the specified
  58737. // project.
  58738. func (r *InterconnectsService) List(project string) *InterconnectsListCall {
  58739. c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58740. c.project = project
  58741. return c
  58742. }
  58743. // Filter sets the optional parameter "filter": A filter expression that
  58744. // filters resources listed in the response. The expression must specify
  58745. // the field name, a comparison operator, and the value that you want to
  58746. // use for filtering. The value must be a string, a number, or a
  58747. // boolean. The comparison operator must be either =, !=, >, or <.
  58748. //
  58749. // For example, if you are filtering Compute Engine instances, you can
  58750. // exclude instances named example-instance by specifying name !=
  58751. // example-instance.
  58752. //
  58753. // You can also filter nested fields. For example, you could specify
  58754. // scheduling.automaticRestart = false to include instances only if they
  58755. // are not scheduled for automatic restarts. You can use filtering on
  58756. // nested fields to filter based on resource labels.
  58757. //
  58758. // To filter on multiple expressions, provide each separate expression
  58759. // within parentheses. For example, (scheduling.automaticRestart = true)
  58760. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  58761. // AND expression. However, you can include AND and OR expressions
  58762. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  58763. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  58764. // true).
  58765. func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall {
  58766. c.urlParams_.Set("filter", filter)
  58767. return c
  58768. }
  58769. // MaxResults sets the optional parameter "maxResults": The maximum
  58770. // number of results per page that should be returned. If the number of
  58771. // available results is larger than maxResults, Compute Engine returns a
  58772. // nextPageToken that can be used to get the next page of results in
  58773. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  58774. // (Default: 500)
  58775. func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall {
  58776. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  58777. return c
  58778. }
  58779. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  58780. // a certain order. By default, results are returned in alphanumerical
  58781. // order based on the resource name.
  58782. //
  58783. // You can also sort results in descending order based on the creation
  58784. // timestamp using orderBy="creationTimestamp desc". This sorts results
  58785. // based on the creationTimestamp field in reverse chronological order
  58786. // (newest result first). Use this to sort resources like operations so
  58787. // that the newest operation is returned first.
  58788. //
  58789. // Currently, only sorting by name or creationTimestamp desc is
  58790. // supported.
  58791. func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall {
  58792. c.urlParams_.Set("orderBy", orderBy)
  58793. return c
  58794. }
  58795. // PageToken sets the optional parameter "pageToken": Specifies a page
  58796. // token to use. Set pageToken to the nextPageToken returned by a
  58797. // previous list request to get the next page of results.
  58798. func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall {
  58799. c.urlParams_.Set("pageToken", pageToken)
  58800. return c
  58801. }
  58802. // Fields allows partial responses to be retrieved. See
  58803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  58804. // for more information.
  58805. func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall {
  58806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  58807. return c
  58808. }
  58809. // IfNoneMatch sets the optional parameter which makes the operation
  58810. // fail if the object's ETag matches the given value. This is useful for
  58811. // getting updates only after the object has changed since the last
  58812. // request. Use googleapi.IsNotModified to check whether the response
  58813. // error from Do is the result of In-None-Match.
  58814. func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall {
  58815. c.ifNoneMatch_ = entityTag
  58816. return c
  58817. }
  58818. // Context sets the context to be used in this call's Do method. Any
  58819. // pending HTTP request will be aborted if the provided context is
  58820. // canceled.
  58821. func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall {
  58822. c.ctx_ = ctx
  58823. return c
  58824. }
  58825. // Header returns an http.Header that can be modified by the caller to
  58826. // add HTTP headers to the request.
  58827. func (c *InterconnectsListCall) Header() http.Header {
  58828. if c.header_ == nil {
  58829. c.header_ = make(http.Header)
  58830. }
  58831. return c.header_
  58832. }
  58833. func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) {
  58834. reqHeaders := make(http.Header)
  58835. for k, v := range c.header_ {
  58836. reqHeaders[k] = v
  58837. }
  58838. reqHeaders.Set("User-Agent", c.s.userAgent())
  58839. if c.ifNoneMatch_ != "" {
  58840. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  58841. }
  58842. var body io.Reader = nil
  58843. c.urlParams_.Set("alt", alt)
  58844. c.urlParams_.Set("prettyPrint", "false")
  58845. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects")
  58846. urls += "?" + c.urlParams_.Encode()
  58847. req, err := http.NewRequest("GET", urls, body)
  58848. if err != nil {
  58849. return nil, err
  58850. }
  58851. req.Header = reqHeaders
  58852. googleapi.Expand(req.URL, map[string]string{
  58853. "project": c.project,
  58854. })
  58855. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  58856. }
  58857. // Do executes the "compute.interconnects.list" call.
  58858. // Exactly one of *InterconnectList or error will be non-nil. Any
  58859. // non-2xx status code is an error. Response headers are in either
  58860. // *InterconnectList.ServerResponse.Header or (if a response was
  58861. // returned at all) in error.(*googleapi.Error).Header. Use
  58862. // googleapi.IsNotModified to check whether the returned error was
  58863. // because http.StatusNotModified was returned.
  58864. func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) {
  58865. gensupport.SetOptions(c.urlParams_, opts...)
  58866. res, err := c.doRequest("json")
  58867. if res != nil && res.StatusCode == http.StatusNotModified {
  58868. if res.Body != nil {
  58869. res.Body.Close()
  58870. }
  58871. return nil, &googleapi.Error{
  58872. Code: res.StatusCode,
  58873. Header: res.Header,
  58874. }
  58875. }
  58876. if err != nil {
  58877. return nil, err
  58878. }
  58879. defer googleapi.CloseBody(res)
  58880. if err := googleapi.CheckResponse(res); err != nil {
  58881. return nil, err
  58882. }
  58883. ret := &InterconnectList{
  58884. ServerResponse: googleapi.ServerResponse{
  58885. Header: res.Header,
  58886. HTTPStatusCode: res.StatusCode,
  58887. },
  58888. }
  58889. target := &ret
  58890. if err := gensupport.DecodeResponse(target, res); err != nil {
  58891. return nil, err
  58892. }
  58893. return ret, nil
  58894. // {
  58895. // "description": "Retrieves the list of interconnect available to the specified project.",
  58896. // "httpMethod": "GET",
  58897. // "id": "compute.interconnects.list",
  58898. // "parameterOrder": [
  58899. // "project"
  58900. // ],
  58901. // "parameters": {
  58902. // "filter": {
  58903. // "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).",
  58904. // "location": "query",
  58905. // "type": "string"
  58906. // },
  58907. // "maxResults": {
  58908. // "default": "500",
  58909. // "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)",
  58910. // "format": "uint32",
  58911. // "location": "query",
  58912. // "minimum": "0",
  58913. // "type": "integer"
  58914. // },
  58915. // "orderBy": {
  58916. // "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.",
  58917. // "location": "query",
  58918. // "type": "string"
  58919. // },
  58920. // "pageToken": {
  58921. // "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.",
  58922. // "location": "query",
  58923. // "type": "string"
  58924. // },
  58925. // "project": {
  58926. // "description": "Project ID for this request.",
  58927. // "location": "path",
  58928. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  58929. // "required": true,
  58930. // "type": "string"
  58931. // }
  58932. // },
  58933. // "path": "{project}/global/interconnects",
  58934. // "response": {
  58935. // "$ref": "InterconnectList"
  58936. // },
  58937. // "scopes": [
  58938. // "https://www.googleapis.com/auth/cloud-platform",
  58939. // "https://www.googleapis.com/auth/compute",
  58940. // "https://www.googleapis.com/auth/compute.readonly"
  58941. // ]
  58942. // }
  58943. }
  58944. // Pages invokes f for each page of results.
  58945. // A non-nil error returned from f will halt the iteration.
  58946. // The provided context supersedes any context provided to the Context method.
  58947. func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error {
  58948. c.ctx_ = ctx
  58949. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  58950. for {
  58951. x, err := c.Do()
  58952. if err != nil {
  58953. return err
  58954. }
  58955. if err := f(x); err != nil {
  58956. return err
  58957. }
  58958. if x.NextPageToken == "" {
  58959. return nil
  58960. }
  58961. c.PageToken(x.NextPageToken)
  58962. }
  58963. }
  58964. // method id "compute.interconnects.patch":
  58965. type InterconnectsPatchCall struct {
  58966. s *Service
  58967. project string
  58968. interconnect string
  58969. interconnect2 *Interconnect
  58970. urlParams_ gensupport.URLParams
  58971. ctx_ context.Context
  58972. header_ http.Header
  58973. }
  58974. // Patch: Updates the specified interconnect with the data included in
  58975. // the request. This method supports PATCH semantics and uses the JSON
  58976. // merge patch format and processing rules.
  58977. func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall {
  58978. c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  58979. c.project = project
  58980. c.interconnect = interconnect
  58981. c.interconnect2 = interconnect2
  58982. return c
  58983. }
  58984. // RequestId sets the optional parameter "requestId": An optional
  58985. // request ID to identify requests. Specify a unique request ID so that
  58986. // if you must retry your request, the server will know to ignore the
  58987. // request if it has already been completed.
  58988. //
  58989. // For example, consider a situation where you make an initial request
  58990. // and the request times out. If you make the request again with the
  58991. // same request ID, the server can check if original operation with the
  58992. // same request ID was received, and if so, will ignore the second
  58993. // request. This prevents clients from accidentally creating duplicate
  58994. // commitments.
  58995. //
  58996. // The request ID must be a valid UUID with the exception that zero UUID
  58997. // is not supported (00000000-0000-0000-0000-000000000000).
  58998. func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall {
  58999. c.urlParams_.Set("requestId", requestId)
  59000. return c
  59001. }
  59002. // Fields allows partial responses to be retrieved. See
  59003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59004. // for more information.
  59005. func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall {
  59006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59007. return c
  59008. }
  59009. // Context sets the context to be used in this call's Do method. Any
  59010. // pending HTTP request will be aborted if the provided context is
  59011. // canceled.
  59012. func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall {
  59013. c.ctx_ = ctx
  59014. return c
  59015. }
  59016. // Header returns an http.Header that can be modified by the caller to
  59017. // add HTTP headers to the request.
  59018. func (c *InterconnectsPatchCall) Header() http.Header {
  59019. if c.header_ == nil {
  59020. c.header_ = make(http.Header)
  59021. }
  59022. return c.header_
  59023. }
  59024. func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) {
  59025. reqHeaders := make(http.Header)
  59026. for k, v := range c.header_ {
  59027. reqHeaders[k] = v
  59028. }
  59029. reqHeaders.Set("User-Agent", c.s.userAgent())
  59030. var body io.Reader = nil
  59031. body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2)
  59032. if err != nil {
  59033. return nil, err
  59034. }
  59035. reqHeaders.Set("Content-Type", "application/json")
  59036. c.urlParams_.Set("alt", alt)
  59037. c.urlParams_.Set("prettyPrint", "false")
  59038. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/interconnects/{interconnect}")
  59039. urls += "?" + c.urlParams_.Encode()
  59040. req, err := http.NewRequest("PATCH", urls, body)
  59041. if err != nil {
  59042. return nil, err
  59043. }
  59044. req.Header = reqHeaders
  59045. googleapi.Expand(req.URL, map[string]string{
  59046. "project": c.project,
  59047. "interconnect": c.interconnect,
  59048. })
  59049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59050. }
  59051. // Do executes the "compute.interconnects.patch" call.
  59052. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59053. // status code is an error. Response headers are in either
  59054. // *Operation.ServerResponse.Header or (if a response was returned at
  59055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59056. // to check whether the returned error was because
  59057. // http.StatusNotModified was returned.
  59058. func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59059. gensupport.SetOptions(c.urlParams_, opts...)
  59060. res, err := c.doRequest("json")
  59061. if res != nil && res.StatusCode == http.StatusNotModified {
  59062. if res.Body != nil {
  59063. res.Body.Close()
  59064. }
  59065. return nil, &googleapi.Error{
  59066. Code: res.StatusCode,
  59067. Header: res.Header,
  59068. }
  59069. }
  59070. if err != nil {
  59071. return nil, err
  59072. }
  59073. defer googleapi.CloseBody(res)
  59074. if err := googleapi.CheckResponse(res); err != nil {
  59075. return nil, err
  59076. }
  59077. ret := &Operation{
  59078. ServerResponse: googleapi.ServerResponse{
  59079. Header: res.Header,
  59080. HTTPStatusCode: res.StatusCode,
  59081. },
  59082. }
  59083. target := &ret
  59084. if err := gensupport.DecodeResponse(target, res); err != nil {
  59085. return nil, err
  59086. }
  59087. return ret, nil
  59088. // {
  59089. // "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.",
  59090. // "httpMethod": "PATCH",
  59091. // "id": "compute.interconnects.patch",
  59092. // "parameterOrder": [
  59093. // "project",
  59094. // "interconnect"
  59095. // ],
  59096. // "parameters": {
  59097. // "interconnect": {
  59098. // "description": "Name of the interconnect to update.",
  59099. // "location": "path",
  59100. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59101. // "required": true,
  59102. // "type": "string"
  59103. // },
  59104. // "project": {
  59105. // "description": "Project ID for this request.",
  59106. // "location": "path",
  59107. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59108. // "required": true,
  59109. // "type": "string"
  59110. // },
  59111. // "requestId": {
  59112. // "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).",
  59113. // "location": "query",
  59114. // "type": "string"
  59115. // }
  59116. // },
  59117. // "path": "{project}/global/interconnects/{interconnect}",
  59118. // "request": {
  59119. // "$ref": "Interconnect"
  59120. // },
  59121. // "response": {
  59122. // "$ref": "Operation"
  59123. // },
  59124. // "scopes": [
  59125. // "https://www.googleapis.com/auth/cloud-platform",
  59126. // "https://www.googleapis.com/auth/compute"
  59127. // ]
  59128. // }
  59129. }
  59130. // method id "compute.licenseCodes.get":
  59131. type LicenseCodesGetCall struct {
  59132. s *Service
  59133. project string
  59134. licenseCode string
  59135. urlParams_ gensupport.URLParams
  59136. ifNoneMatch_ string
  59137. ctx_ context.Context
  59138. header_ http.Header
  59139. }
  59140. // Get: Return a specified license code. License codes are mirrored
  59141. // across all projects that have permissions to read the License Code.
  59142. func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall {
  59143. c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59144. c.project = project
  59145. c.licenseCode = licenseCode
  59146. return c
  59147. }
  59148. // Fields allows partial responses to be retrieved. See
  59149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59150. // for more information.
  59151. func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall {
  59152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59153. return c
  59154. }
  59155. // IfNoneMatch sets the optional parameter which makes the operation
  59156. // fail if the object's ETag matches the given value. This is useful for
  59157. // getting updates only after the object has changed since the last
  59158. // request. Use googleapi.IsNotModified to check whether the response
  59159. // error from Do is the result of In-None-Match.
  59160. func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall {
  59161. c.ifNoneMatch_ = entityTag
  59162. return c
  59163. }
  59164. // Context sets the context to be used in this call's Do method. Any
  59165. // pending HTTP request will be aborted if the provided context is
  59166. // canceled.
  59167. func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall {
  59168. c.ctx_ = ctx
  59169. return c
  59170. }
  59171. // Header returns an http.Header that can be modified by the caller to
  59172. // add HTTP headers to the request.
  59173. func (c *LicenseCodesGetCall) Header() http.Header {
  59174. if c.header_ == nil {
  59175. c.header_ = make(http.Header)
  59176. }
  59177. return c.header_
  59178. }
  59179. func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) {
  59180. reqHeaders := make(http.Header)
  59181. for k, v := range c.header_ {
  59182. reqHeaders[k] = v
  59183. }
  59184. reqHeaders.Set("User-Agent", c.s.userAgent())
  59185. if c.ifNoneMatch_ != "" {
  59186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59187. }
  59188. var body io.Reader = nil
  59189. c.urlParams_.Set("alt", alt)
  59190. c.urlParams_.Set("prettyPrint", "false")
  59191. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{licenseCode}")
  59192. urls += "?" + c.urlParams_.Encode()
  59193. req, err := http.NewRequest("GET", urls, body)
  59194. if err != nil {
  59195. return nil, err
  59196. }
  59197. req.Header = reqHeaders
  59198. googleapi.Expand(req.URL, map[string]string{
  59199. "project": c.project,
  59200. "licenseCode": c.licenseCode,
  59201. })
  59202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59203. }
  59204. // Do executes the "compute.licenseCodes.get" call.
  59205. // Exactly one of *LicenseCode or error will be non-nil. Any non-2xx
  59206. // status code is an error. Response headers are in either
  59207. // *LicenseCode.ServerResponse.Header or (if a response was returned at
  59208. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59209. // to check whether the returned error was because
  59210. // http.StatusNotModified was returned.
  59211. func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) {
  59212. gensupport.SetOptions(c.urlParams_, opts...)
  59213. res, err := c.doRequest("json")
  59214. if res != nil && res.StatusCode == http.StatusNotModified {
  59215. if res.Body != nil {
  59216. res.Body.Close()
  59217. }
  59218. return nil, &googleapi.Error{
  59219. Code: res.StatusCode,
  59220. Header: res.Header,
  59221. }
  59222. }
  59223. if err != nil {
  59224. return nil, err
  59225. }
  59226. defer googleapi.CloseBody(res)
  59227. if err := googleapi.CheckResponse(res); err != nil {
  59228. return nil, err
  59229. }
  59230. ret := &LicenseCode{
  59231. ServerResponse: googleapi.ServerResponse{
  59232. Header: res.Header,
  59233. HTTPStatusCode: res.StatusCode,
  59234. },
  59235. }
  59236. target := &ret
  59237. if err := gensupport.DecodeResponse(target, res); err != nil {
  59238. return nil, err
  59239. }
  59240. return ret, nil
  59241. // {
  59242. // "description": "Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.",
  59243. // "httpMethod": "GET",
  59244. // "id": "compute.licenseCodes.get",
  59245. // "parameterOrder": [
  59246. // "project",
  59247. // "licenseCode"
  59248. // ],
  59249. // "parameters": {
  59250. // "licenseCode": {
  59251. // "description": "Number corresponding to the License code resource to return.",
  59252. // "location": "path",
  59253. // "pattern": "[0-9]{0,61}?",
  59254. // "required": true,
  59255. // "type": "string"
  59256. // },
  59257. // "project": {
  59258. // "description": "Project ID for this request.",
  59259. // "location": "path",
  59260. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59261. // "required": true,
  59262. // "type": "string"
  59263. // }
  59264. // },
  59265. // "path": "{project}/global/licenseCodes/{licenseCode}",
  59266. // "response": {
  59267. // "$ref": "LicenseCode"
  59268. // },
  59269. // "scopes": [
  59270. // "https://www.googleapis.com/auth/cloud-platform",
  59271. // "https://www.googleapis.com/auth/compute",
  59272. // "https://www.googleapis.com/auth/compute.readonly"
  59273. // ]
  59274. // }
  59275. }
  59276. // method id "compute.licenseCodes.testIamPermissions":
  59277. type LicenseCodesTestIamPermissionsCall struct {
  59278. s *Service
  59279. project string
  59280. resource string
  59281. testpermissionsrequest *TestPermissionsRequest
  59282. urlParams_ gensupport.URLParams
  59283. ctx_ context.Context
  59284. header_ http.Header
  59285. }
  59286. // TestIamPermissions: Returns permissions that a caller has on the
  59287. // specified resource.
  59288. func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall {
  59289. c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59290. c.project = project
  59291. c.resource = resource
  59292. c.testpermissionsrequest = testpermissionsrequest
  59293. return c
  59294. }
  59295. // Fields allows partial responses to be retrieved. See
  59296. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59297. // for more information.
  59298. func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall {
  59299. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59300. return c
  59301. }
  59302. // Context sets the context to be used in this call's Do method. Any
  59303. // pending HTTP request will be aborted if the provided context is
  59304. // canceled.
  59305. func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall {
  59306. c.ctx_ = ctx
  59307. return c
  59308. }
  59309. // Header returns an http.Header that can be modified by the caller to
  59310. // add HTTP headers to the request.
  59311. func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header {
  59312. if c.header_ == nil {
  59313. c.header_ = make(http.Header)
  59314. }
  59315. return c.header_
  59316. }
  59317. func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  59318. reqHeaders := make(http.Header)
  59319. for k, v := range c.header_ {
  59320. reqHeaders[k] = v
  59321. }
  59322. reqHeaders.Set("User-Agent", c.s.userAgent())
  59323. var body io.Reader = nil
  59324. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  59325. if err != nil {
  59326. return nil, err
  59327. }
  59328. reqHeaders.Set("Content-Type", "application/json")
  59329. c.urlParams_.Set("alt", alt)
  59330. c.urlParams_.Set("prettyPrint", "false")
  59331. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenseCodes/{resource}/testIamPermissions")
  59332. urls += "?" + c.urlParams_.Encode()
  59333. req, err := http.NewRequest("POST", urls, body)
  59334. if err != nil {
  59335. return nil, err
  59336. }
  59337. req.Header = reqHeaders
  59338. googleapi.Expand(req.URL, map[string]string{
  59339. "project": c.project,
  59340. "resource": c.resource,
  59341. })
  59342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59343. }
  59344. // Do executes the "compute.licenseCodes.testIamPermissions" call.
  59345. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  59346. // non-2xx status code is an error. Response headers are in either
  59347. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  59348. // returned at all) in error.(*googleapi.Error).Header. Use
  59349. // googleapi.IsNotModified to check whether the returned error was
  59350. // because http.StatusNotModified was returned.
  59351. func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  59352. gensupport.SetOptions(c.urlParams_, opts...)
  59353. res, err := c.doRequest("json")
  59354. if res != nil && res.StatusCode == http.StatusNotModified {
  59355. if res.Body != nil {
  59356. res.Body.Close()
  59357. }
  59358. return nil, &googleapi.Error{
  59359. Code: res.StatusCode,
  59360. Header: res.Header,
  59361. }
  59362. }
  59363. if err != nil {
  59364. return nil, err
  59365. }
  59366. defer googleapi.CloseBody(res)
  59367. if err := googleapi.CheckResponse(res); err != nil {
  59368. return nil, err
  59369. }
  59370. ret := &TestPermissionsResponse{
  59371. ServerResponse: googleapi.ServerResponse{
  59372. Header: res.Header,
  59373. HTTPStatusCode: res.StatusCode,
  59374. },
  59375. }
  59376. target := &ret
  59377. if err := gensupport.DecodeResponse(target, res); err != nil {
  59378. return nil, err
  59379. }
  59380. return ret, nil
  59381. // {
  59382. // "description": "Returns permissions that a caller has on the specified resource.",
  59383. // "httpMethod": "POST",
  59384. // "id": "compute.licenseCodes.testIamPermissions",
  59385. // "parameterOrder": [
  59386. // "project",
  59387. // "resource"
  59388. // ],
  59389. // "parameters": {
  59390. // "project": {
  59391. // "description": "Project ID for this request.",
  59392. // "location": "path",
  59393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59394. // "required": true,
  59395. // "type": "string"
  59396. // },
  59397. // "resource": {
  59398. // "description": "Name or id of the resource for this request.",
  59399. // "location": "path",
  59400. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59401. // "required": true,
  59402. // "type": "string"
  59403. // }
  59404. // },
  59405. // "path": "{project}/global/licenseCodes/{resource}/testIamPermissions",
  59406. // "request": {
  59407. // "$ref": "TestPermissionsRequest"
  59408. // },
  59409. // "response": {
  59410. // "$ref": "TestPermissionsResponse"
  59411. // },
  59412. // "scopes": [
  59413. // "https://www.googleapis.com/auth/cloud-platform",
  59414. // "https://www.googleapis.com/auth/compute",
  59415. // "https://www.googleapis.com/auth/compute.readonly"
  59416. // ]
  59417. // }
  59418. }
  59419. // method id "compute.licenses.delete":
  59420. type LicensesDeleteCall struct {
  59421. s *Service
  59422. project string
  59423. license string
  59424. urlParams_ gensupport.URLParams
  59425. ctx_ context.Context
  59426. header_ http.Header
  59427. }
  59428. // Delete: Deletes the specified license.
  59429. func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall {
  59430. c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59431. c.project = project
  59432. c.license = license
  59433. return c
  59434. }
  59435. // RequestId sets the optional parameter "requestId": An optional
  59436. // request ID to identify requests. Specify a unique request ID so that
  59437. // if you must retry your request, the server will know to ignore the
  59438. // request if it has already been completed.
  59439. //
  59440. // For example, consider a situation where you make an initial request
  59441. // and the request times out. If you make the request again with the
  59442. // same request ID, the server can check if original operation with the
  59443. // same request ID was received, and if so, will ignore the second
  59444. // request. This prevents clients from accidentally creating duplicate
  59445. // commitments.
  59446. //
  59447. // The request ID must be a valid UUID with the exception that zero UUID
  59448. // is not supported (00000000-0000-0000-0000-000000000000).
  59449. func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall {
  59450. c.urlParams_.Set("requestId", requestId)
  59451. return c
  59452. }
  59453. // Fields allows partial responses to be retrieved. See
  59454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59455. // for more information.
  59456. func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall {
  59457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59458. return c
  59459. }
  59460. // Context sets the context to be used in this call's Do method. Any
  59461. // pending HTTP request will be aborted if the provided context is
  59462. // canceled.
  59463. func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall {
  59464. c.ctx_ = ctx
  59465. return c
  59466. }
  59467. // Header returns an http.Header that can be modified by the caller to
  59468. // add HTTP headers to the request.
  59469. func (c *LicensesDeleteCall) Header() http.Header {
  59470. if c.header_ == nil {
  59471. c.header_ = make(http.Header)
  59472. }
  59473. return c.header_
  59474. }
  59475. func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) {
  59476. reqHeaders := make(http.Header)
  59477. for k, v := range c.header_ {
  59478. reqHeaders[k] = v
  59479. }
  59480. reqHeaders.Set("User-Agent", c.s.userAgent())
  59481. var body io.Reader = nil
  59482. c.urlParams_.Set("alt", alt)
  59483. c.urlParams_.Set("prettyPrint", "false")
  59484. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  59485. urls += "?" + c.urlParams_.Encode()
  59486. req, err := http.NewRequest("DELETE", urls, body)
  59487. if err != nil {
  59488. return nil, err
  59489. }
  59490. req.Header = reqHeaders
  59491. googleapi.Expand(req.URL, map[string]string{
  59492. "project": c.project,
  59493. "license": c.license,
  59494. })
  59495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59496. }
  59497. // Do executes the "compute.licenses.delete" call.
  59498. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59499. // status code is an error. Response headers are in either
  59500. // *Operation.ServerResponse.Header or (if a response was returned at
  59501. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59502. // to check whether the returned error was because
  59503. // http.StatusNotModified was returned.
  59504. func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59505. gensupport.SetOptions(c.urlParams_, opts...)
  59506. res, err := c.doRequest("json")
  59507. if res != nil && res.StatusCode == http.StatusNotModified {
  59508. if res.Body != nil {
  59509. res.Body.Close()
  59510. }
  59511. return nil, &googleapi.Error{
  59512. Code: res.StatusCode,
  59513. Header: res.Header,
  59514. }
  59515. }
  59516. if err != nil {
  59517. return nil, err
  59518. }
  59519. defer googleapi.CloseBody(res)
  59520. if err := googleapi.CheckResponse(res); err != nil {
  59521. return nil, err
  59522. }
  59523. ret := &Operation{
  59524. ServerResponse: googleapi.ServerResponse{
  59525. Header: res.Header,
  59526. HTTPStatusCode: res.StatusCode,
  59527. },
  59528. }
  59529. target := &ret
  59530. if err := gensupport.DecodeResponse(target, res); err != nil {
  59531. return nil, err
  59532. }
  59533. return ret, nil
  59534. // {
  59535. // "description": "Deletes the specified license.",
  59536. // "httpMethod": "DELETE",
  59537. // "id": "compute.licenses.delete",
  59538. // "parameterOrder": [
  59539. // "project",
  59540. // "license"
  59541. // ],
  59542. // "parameters": {
  59543. // "license": {
  59544. // "description": "Name of the license resource to delete.",
  59545. // "location": "path",
  59546. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59547. // "required": true,
  59548. // "type": "string"
  59549. // },
  59550. // "project": {
  59551. // "description": "Project ID for this request.",
  59552. // "location": "path",
  59553. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59554. // "required": true,
  59555. // "type": "string"
  59556. // },
  59557. // "requestId": {
  59558. // "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).",
  59559. // "location": "query",
  59560. // "type": "string"
  59561. // }
  59562. // },
  59563. // "path": "{project}/global/licenses/{license}",
  59564. // "response": {
  59565. // "$ref": "Operation"
  59566. // },
  59567. // "scopes": [
  59568. // "https://www.googleapis.com/auth/cloud-platform",
  59569. // "https://www.googleapis.com/auth/compute"
  59570. // ]
  59571. // }
  59572. }
  59573. // method id "compute.licenses.get":
  59574. type LicensesGetCall struct {
  59575. s *Service
  59576. project string
  59577. license string
  59578. urlParams_ gensupport.URLParams
  59579. ifNoneMatch_ string
  59580. ctx_ context.Context
  59581. header_ http.Header
  59582. }
  59583. // Get: Returns the specified License resource.
  59584. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get
  59585. func (r *LicensesService) Get(project string, license string) *LicensesGetCall {
  59586. c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59587. c.project = project
  59588. c.license = license
  59589. return c
  59590. }
  59591. // Fields allows partial responses to be retrieved. See
  59592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59593. // for more information.
  59594. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall {
  59595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59596. return c
  59597. }
  59598. // IfNoneMatch sets the optional parameter which makes the operation
  59599. // fail if the object's ETag matches the given value. This is useful for
  59600. // getting updates only after the object has changed since the last
  59601. // request. Use googleapi.IsNotModified to check whether the response
  59602. // error from Do is the result of In-None-Match.
  59603. func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall {
  59604. c.ifNoneMatch_ = entityTag
  59605. return c
  59606. }
  59607. // Context sets the context to be used in this call's Do method. Any
  59608. // pending HTTP request will be aborted if the provided context is
  59609. // canceled.
  59610. func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall {
  59611. c.ctx_ = ctx
  59612. return c
  59613. }
  59614. // Header returns an http.Header that can be modified by the caller to
  59615. // add HTTP headers to the request.
  59616. func (c *LicensesGetCall) Header() http.Header {
  59617. if c.header_ == nil {
  59618. c.header_ = make(http.Header)
  59619. }
  59620. return c.header_
  59621. }
  59622. func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) {
  59623. reqHeaders := make(http.Header)
  59624. for k, v := range c.header_ {
  59625. reqHeaders[k] = v
  59626. }
  59627. reqHeaders.Set("User-Agent", c.s.userAgent())
  59628. if c.ifNoneMatch_ != "" {
  59629. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59630. }
  59631. var body io.Reader = nil
  59632. c.urlParams_.Set("alt", alt)
  59633. c.urlParams_.Set("prettyPrint", "false")
  59634. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}")
  59635. urls += "?" + c.urlParams_.Encode()
  59636. req, err := http.NewRequest("GET", urls, body)
  59637. if err != nil {
  59638. return nil, err
  59639. }
  59640. req.Header = reqHeaders
  59641. googleapi.Expand(req.URL, map[string]string{
  59642. "project": c.project,
  59643. "license": c.license,
  59644. })
  59645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59646. }
  59647. // Do executes the "compute.licenses.get" call.
  59648. // Exactly one of *License or error will be non-nil. Any non-2xx status
  59649. // code is an error. Response headers are in either
  59650. // *License.ServerResponse.Header or (if a response was returned at all)
  59651. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  59652. // check whether the returned error was because http.StatusNotModified
  59653. // was returned.
  59654. func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) {
  59655. gensupport.SetOptions(c.urlParams_, opts...)
  59656. res, err := c.doRequest("json")
  59657. if res != nil && res.StatusCode == http.StatusNotModified {
  59658. if res.Body != nil {
  59659. res.Body.Close()
  59660. }
  59661. return nil, &googleapi.Error{
  59662. Code: res.StatusCode,
  59663. Header: res.Header,
  59664. }
  59665. }
  59666. if err != nil {
  59667. return nil, err
  59668. }
  59669. defer googleapi.CloseBody(res)
  59670. if err := googleapi.CheckResponse(res); err != nil {
  59671. return nil, err
  59672. }
  59673. ret := &License{
  59674. ServerResponse: googleapi.ServerResponse{
  59675. Header: res.Header,
  59676. HTTPStatusCode: res.StatusCode,
  59677. },
  59678. }
  59679. target := &ret
  59680. if err := gensupport.DecodeResponse(target, res); err != nil {
  59681. return nil, err
  59682. }
  59683. return ret, nil
  59684. // {
  59685. // "description": "Returns the specified License resource.",
  59686. // "httpMethod": "GET",
  59687. // "id": "compute.licenses.get",
  59688. // "parameterOrder": [
  59689. // "project",
  59690. // "license"
  59691. // ],
  59692. // "parameters": {
  59693. // "license": {
  59694. // "description": "Name of the License resource to return.",
  59695. // "location": "path",
  59696. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59697. // "required": true,
  59698. // "type": "string"
  59699. // },
  59700. // "project": {
  59701. // "description": "Project ID for this request.",
  59702. // "location": "path",
  59703. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59704. // "required": true,
  59705. // "type": "string"
  59706. // }
  59707. // },
  59708. // "path": "{project}/global/licenses/{license}",
  59709. // "response": {
  59710. // "$ref": "License"
  59711. // },
  59712. // "scopes": [
  59713. // "https://www.googleapis.com/auth/cloud-platform",
  59714. // "https://www.googleapis.com/auth/compute",
  59715. // "https://www.googleapis.com/auth/compute.readonly"
  59716. // ]
  59717. // }
  59718. }
  59719. // method id "compute.licenses.getIamPolicy":
  59720. type LicensesGetIamPolicyCall struct {
  59721. s *Service
  59722. project string
  59723. resource string
  59724. urlParams_ gensupport.URLParams
  59725. ifNoneMatch_ string
  59726. ctx_ context.Context
  59727. header_ http.Header
  59728. }
  59729. // GetIamPolicy: Gets the access control policy for a resource. May be
  59730. // empty if no such policy or resource exists.
  59731. func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall {
  59732. c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59733. c.project = project
  59734. c.resource = resource
  59735. return c
  59736. }
  59737. // Fields allows partial responses to be retrieved. See
  59738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59739. // for more information.
  59740. func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall {
  59741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59742. return c
  59743. }
  59744. // IfNoneMatch sets the optional parameter which makes the operation
  59745. // fail if the object's ETag matches the given value. This is useful for
  59746. // getting updates only after the object has changed since the last
  59747. // request. Use googleapi.IsNotModified to check whether the response
  59748. // error from Do is the result of In-None-Match.
  59749. func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall {
  59750. c.ifNoneMatch_ = entityTag
  59751. return c
  59752. }
  59753. // Context sets the context to be used in this call's Do method. Any
  59754. // pending HTTP request will be aborted if the provided context is
  59755. // canceled.
  59756. func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall {
  59757. c.ctx_ = ctx
  59758. return c
  59759. }
  59760. // Header returns an http.Header that can be modified by the caller to
  59761. // add HTTP headers to the request.
  59762. func (c *LicensesGetIamPolicyCall) Header() http.Header {
  59763. if c.header_ == nil {
  59764. c.header_ = make(http.Header)
  59765. }
  59766. return c.header_
  59767. }
  59768. func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  59769. reqHeaders := make(http.Header)
  59770. for k, v := range c.header_ {
  59771. reqHeaders[k] = v
  59772. }
  59773. reqHeaders.Set("User-Agent", c.s.userAgent())
  59774. if c.ifNoneMatch_ != "" {
  59775. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  59776. }
  59777. var body io.Reader = nil
  59778. c.urlParams_.Set("alt", alt)
  59779. c.urlParams_.Set("prettyPrint", "false")
  59780. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/getIamPolicy")
  59781. urls += "?" + c.urlParams_.Encode()
  59782. req, err := http.NewRequest("GET", urls, body)
  59783. if err != nil {
  59784. return nil, err
  59785. }
  59786. req.Header = reqHeaders
  59787. googleapi.Expand(req.URL, map[string]string{
  59788. "project": c.project,
  59789. "resource": c.resource,
  59790. })
  59791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59792. }
  59793. // Do executes the "compute.licenses.getIamPolicy" call.
  59794. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  59795. // code is an error. Response headers are in either
  59796. // *Policy.ServerResponse.Header or (if a response was returned at all)
  59797. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  59798. // check whether the returned error was because http.StatusNotModified
  59799. // was returned.
  59800. func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  59801. gensupport.SetOptions(c.urlParams_, opts...)
  59802. res, err := c.doRequest("json")
  59803. if res != nil && res.StatusCode == http.StatusNotModified {
  59804. if res.Body != nil {
  59805. res.Body.Close()
  59806. }
  59807. return nil, &googleapi.Error{
  59808. Code: res.StatusCode,
  59809. Header: res.Header,
  59810. }
  59811. }
  59812. if err != nil {
  59813. return nil, err
  59814. }
  59815. defer googleapi.CloseBody(res)
  59816. if err := googleapi.CheckResponse(res); err != nil {
  59817. return nil, err
  59818. }
  59819. ret := &Policy{
  59820. ServerResponse: googleapi.ServerResponse{
  59821. Header: res.Header,
  59822. HTTPStatusCode: res.StatusCode,
  59823. },
  59824. }
  59825. target := &ret
  59826. if err := gensupport.DecodeResponse(target, res); err != nil {
  59827. return nil, err
  59828. }
  59829. return ret, nil
  59830. // {
  59831. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  59832. // "httpMethod": "GET",
  59833. // "id": "compute.licenses.getIamPolicy",
  59834. // "parameterOrder": [
  59835. // "project",
  59836. // "resource"
  59837. // ],
  59838. // "parameters": {
  59839. // "project": {
  59840. // "description": "Project ID for this request.",
  59841. // "location": "path",
  59842. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59843. // "required": true,
  59844. // "type": "string"
  59845. // },
  59846. // "resource": {
  59847. // "description": "Name or id of the resource for this request.",
  59848. // "location": "path",
  59849. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  59850. // "required": true,
  59851. // "type": "string"
  59852. // }
  59853. // },
  59854. // "path": "{project}/global/licenses/{resource}/getIamPolicy",
  59855. // "response": {
  59856. // "$ref": "Policy"
  59857. // },
  59858. // "scopes": [
  59859. // "https://www.googleapis.com/auth/cloud-platform",
  59860. // "https://www.googleapis.com/auth/compute",
  59861. // "https://www.googleapis.com/auth/compute.readonly"
  59862. // ]
  59863. // }
  59864. }
  59865. // method id "compute.licenses.insert":
  59866. type LicensesInsertCall struct {
  59867. s *Service
  59868. project string
  59869. license *License
  59870. urlParams_ gensupport.URLParams
  59871. ctx_ context.Context
  59872. header_ http.Header
  59873. }
  59874. // Insert: Create a License resource in the specified project.
  59875. func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall {
  59876. c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  59877. c.project = project
  59878. c.license = license
  59879. return c
  59880. }
  59881. // RequestId sets the optional parameter "requestId": An optional
  59882. // request ID to identify requests. Specify a unique request ID so that
  59883. // if you must retry your request, the server will know to ignore the
  59884. // request if it has already been completed.
  59885. //
  59886. // For example, consider a situation where you make an initial request
  59887. // and the request times out. If you make the request again with the
  59888. // same request ID, the server can check if original operation with the
  59889. // same request ID was received, and if so, will ignore the second
  59890. // request. This prevents clients from accidentally creating duplicate
  59891. // commitments.
  59892. //
  59893. // The request ID must be a valid UUID with the exception that zero UUID
  59894. // is not supported (00000000-0000-0000-0000-000000000000).
  59895. func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall {
  59896. c.urlParams_.Set("requestId", requestId)
  59897. return c
  59898. }
  59899. // Fields allows partial responses to be retrieved. See
  59900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  59901. // for more information.
  59902. func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall {
  59903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  59904. return c
  59905. }
  59906. // Context sets the context to be used in this call's Do method. Any
  59907. // pending HTTP request will be aborted if the provided context is
  59908. // canceled.
  59909. func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall {
  59910. c.ctx_ = ctx
  59911. return c
  59912. }
  59913. // Header returns an http.Header that can be modified by the caller to
  59914. // add HTTP headers to the request.
  59915. func (c *LicensesInsertCall) Header() http.Header {
  59916. if c.header_ == nil {
  59917. c.header_ = make(http.Header)
  59918. }
  59919. return c.header_
  59920. }
  59921. func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) {
  59922. reqHeaders := make(http.Header)
  59923. for k, v := range c.header_ {
  59924. reqHeaders[k] = v
  59925. }
  59926. reqHeaders.Set("User-Agent", c.s.userAgent())
  59927. var body io.Reader = nil
  59928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.license)
  59929. if err != nil {
  59930. return nil, err
  59931. }
  59932. reqHeaders.Set("Content-Type", "application/json")
  59933. c.urlParams_.Set("alt", alt)
  59934. c.urlParams_.Set("prettyPrint", "false")
  59935. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  59936. urls += "?" + c.urlParams_.Encode()
  59937. req, err := http.NewRequest("POST", urls, body)
  59938. if err != nil {
  59939. return nil, err
  59940. }
  59941. req.Header = reqHeaders
  59942. googleapi.Expand(req.URL, map[string]string{
  59943. "project": c.project,
  59944. })
  59945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  59946. }
  59947. // Do executes the "compute.licenses.insert" call.
  59948. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  59949. // status code is an error. Response headers are in either
  59950. // *Operation.ServerResponse.Header or (if a response was returned at
  59951. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  59952. // to check whether the returned error was because
  59953. // http.StatusNotModified was returned.
  59954. func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  59955. gensupport.SetOptions(c.urlParams_, opts...)
  59956. res, err := c.doRequest("json")
  59957. if res != nil && res.StatusCode == http.StatusNotModified {
  59958. if res.Body != nil {
  59959. res.Body.Close()
  59960. }
  59961. return nil, &googleapi.Error{
  59962. Code: res.StatusCode,
  59963. Header: res.Header,
  59964. }
  59965. }
  59966. if err != nil {
  59967. return nil, err
  59968. }
  59969. defer googleapi.CloseBody(res)
  59970. if err := googleapi.CheckResponse(res); err != nil {
  59971. return nil, err
  59972. }
  59973. ret := &Operation{
  59974. ServerResponse: googleapi.ServerResponse{
  59975. Header: res.Header,
  59976. HTTPStatusCode: res.StatusCode,
  59977. },
  59978. }
  59979. target := &ret
  59980. if err := gensupport.DecodeResponse(target, res); err != nil {
  59981. return nil, err
  59982. }
  59983. return ret, nil
  59984. // {
  59985. // "description": "Create a License resource in the specified project.",
  59986. // "httpMethod": "POST",
  59987. // "id": "compute.licenses.insert",
  59988. // "parameterOrder": [
  59989. // "project"
  59990. // ],
  59991. // "parameters": {
  59992. // "project": {
  59993. // "description": "Project ID for this request.",
  59994. // "location": "path",
  59995. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  59996. // "required": true,
  59997. // "type": "string"
  59998. // },
  59999. // "requestId": {
  60000. // "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).",
  60001. // "location": "query",
  60002. // "type": "string"
  60003. // }
  60004. // },
  60005. // "path": "{project}/global/licenses",
  60006. // "request": {
  60007. // "$ref": "License"
  60008. // },
  60009. // "response": {
  60010. // "$ref": "Operation"
  60011. // },
  60012. // "scopes": [
  60013. // "https://www.googleapis.com/auth/cloud-platform",
  60014. // "https://www.googleapis.com/auth/compute",
  60015. // "https://www.googleapis.com/auth/devstorage.full_control",
  60016. // "https://www.googleapis.com/auth/devstorage.read_only",
  60017. // "https://www.googleapis.com/auth/devstorage.read_write"
  60018. // ]
  60019. // }
  60020. }
  60021. // method id "compute.licenses.list":
  60022. type LicensesListCall struct {
  60023. s *Service
  60024. project string
  60025. urlParams_ gensupport.URLParams
  60026. ifNoneMatch_ string
  60027. ctx_ context.Context
  60028. header_ http.Header
  60029. }
  60030. // List: Retrieves the list of licenses available in the specified
  60031. // project. This method does not get any licenses that belong to other
  60032. // projects, including licenses attached to publicly-available images,
  60033. // like Debian 9. If you want to get a list of publicly-available
  60034. // licenses, use this method to make a request to the respective image
  60035. // project, such as debian-cloud or windows-cloud.
  60036. func (r *LicensesService) List(project string) *LicensesListCall {
  60037. c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60038. c.project = project
  60039. return c
  60040. }
  60041. // Filter sets the optional parameter "filter": A filter expression that
  60042. // filters resources listed in the response. The expression must specify
  60043. // the field name, a comparison operator, and the value that you want to
  60044. // use for filtering. The value must be a string, a number, or a
  60045. // boolean. The comparison operator must be either =, !=, >, or <.
  60046. //
  60047. // For example, if you are filtering Compute Engine instances, you can
  60048. // exclude instances named example-instance by specifying name !=
  60049. // example-instance.
  60050. //
  60051. // You can also filter nested fields. For example, you could specify
  60052. // scheduling.automaticRestart = false to include instances only if they
  60053. // are not scheduled for automatic restarts. You can use filtering on
  60054. // nested fields to filter based on resource labels.
  60055. //
  60056. // To filter on multiple expressions, provide each separate expression
  60057. // within parentheses. For example, (scheduling.automaticRestart = true)
  60058. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60059. // AND expression. However, you can include AND and OR expressions
  60060. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60061. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60062. // true).
  60063. func (c *LicensesListCall) Filter(filter string) *LicensesListCall {
  60064. c.urlParams_.Set("filter", filter)
  60065. return c
  60066. }
  60067. // MaxResults sets the optional parameter "maxResults": The maximum
  60068. // number of results per page that should be returned. If the number of
  60069. // available results is larger than maxResults, Compute Engine returns a
  60070. // nextPageToken that can be used to get the next page of results in
  60071. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60072. // (Default: 500)
  60073. func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall {
  60074. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60075. return c
  60076. }
  60077. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60078. // a certain order. By default, results are returned in alphanumerical
  60079. // order based on the resource name.
  60080. //
  60081. // You can also sort results in descending order based on the creation
  60082. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60083. // based on the creationTimestamp field in reverse chronological order
  60084. // (newest result first). Use this to sort resources like operations so
  60085. // that the newest operation is returned first.
  60086. //
  60087. // Currently, only sorting by name or creationTimestamp desc is
  60088. // supported.
  60089. func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall {
  60090. c.urlParams_.Set("orderBy", orderBy)
  60091. return c
  60092. }
  60093. // PageToken sets the optional parameter "pageToken": Specifies a page
  60094. // token to use. Set pageToken to the nextPageToken returned by a
  60095. // previous list request to get the next page of results.
  60096. func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall {
  60097. c.urlParams_.Set("pageToken", pageToken)
  60098. return c
  60099. }
  60100. // Fields allows partial responses to be retrieved. See
  60101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60102. // for more information.
  60103. func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall {
  60104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60105. return c
  60106. }
  60107. // IfNoneMatch sets the optional parameter which makes the operation
  60108. // fail if the object's ETag matches the given value. This is useful for
  60109. // getting updates only after the object has changed since the last
  60110. // request. Use googleapi.IsNotModified to check whether the response
  60111. // error from Do is the result of In-None-Match.
  60112. func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall {
  60113. c.ifNoneMatch_ = entityTag
  60114. return c
  60115. }
  60116. // Context sets the context to be used in this call's Do method. Any
  60117. // pending HTTP request will be aborted if the provided context is
  60118. // canceled.
  60119. func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall {
  60120. c.ctx_ = ctx
  60121. return c
  60122. }
  60123. // Header returns an http.Header that can be modified by the caller to
  60124. // add HTTP headers to the request.
  60125. func (c *LicensesListCall) Header() http.Header {
  60126. if c.header_ == nil {
  60127. c.header_ = make(http.Header)
  60128. }
  60129. return c.header_
  60130. }
  60131. func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) {
  60132. reqHeaders := make(http.Header)
  60133. for k, v := range c.header_ {
  60134. reqHeaders[k] = v
  60135. }
  60136. reqHeaders.Set("User-Agent", c.s.userAgent())
  60137. if c.ifNoneMatch_ != "" {
  60138. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60139. }
  60140. var body io.Reader = nil
  60141. c.urlParams_.Set("alt", alt)
  60142. c.urlParams_.Set("prettyPrint", "false")
  60143. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses")
  60144. urls += "?" + c.urlParams_.Encode()
  60145. req, err := http.NewRequest("GET", urls, body)
  60146. if err != nil {
  60147. return nil, err
  60148. }
  60149. req.Header = reqHeaders
  60150. googleapi.Expand(req.URL, map[string]string{
  60151. "project": c.project,
  60152. })
  60153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60154. }
  60155. // Do executes the "compute.licenses.list" call.
  60156. // Exactly one of *LicensesListResponse or error will be non-nil. Any
  60157. // non-2xx status code is an error. Response headers are in either
  60158. // *LicensesListResponse.ServerResponse.Header or (if a response was
  60159. // returned at all) in error.(*googleapi.Error).Header. Use
  60160. // googleapi.IsNotModified to check whether the returned error was
  60161. // because http.StatusNotModified was returned.
  60162. func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) {
  60163. gensupport.SetOptions(c.urlParams_, opts...)
  60164. res, err := c.doRequest("json")
  60165. if res != nil && res.StatusCode == http.StatusNotModified {
  60166. if res.Body != nil {
  60167. res.Body.Close()
  60168. }
  60169. return nil, &googleapi.Error{
  60170. Code: res.StatusCode,
  60171. Header: res.Header,
  60172. }
  60173. }
  60174. if err != nil {
  60175. return nil, err
  60176. }
  60177. defer googleapi.CloseBody(res)
  60178. if err := googleapi.CheckResponse(res); err != nil {
  60179. return nil, err
  60180. }
  60181. ret := &LicensesListResponse{
  60182. ServerResponse: googleapi.ServerResponse{
  60183. Header: res.Header,
  60184. HTTPStatusCode: res.StatusCode,
  60185. },
  60186. }
  60187. target := &ret
  60188. if err := gensupport.DecodeResponse(target, res); err != nil {
  60189. return nil, err
  60190. }
  60191. return ret, nil
  60192. // {
  60193. // "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.",
  60194. // "httpMethod": "GET",
  60195. // "id": "compute.licenses.list",
  60196. // "parameterOrder": [
  60197. // "project"
  60198. // ],
  60199. // "parameters": {
  60200. // "filter": {
  60201. // "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).",
  60202. // "location": "query",
  60203. // "type": "string"
  60204. // },
  60205. // "maxResults": {
  60206. // "default": "500",
  60207. // "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)",
  60208. // "format": "uint32",
  60209. // "location": "query",
  60210. // "minimum": "0",
  60211. // "type": "integer"
  60212. // },
  60213. // "orderBy": {
  60214. // "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.",
  60215. // "location": "query",
  60216. // "type": "string"
  60217. // },
  60218. // "pageToken": {
  60219. // "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.",
  60220. // "location": "query",
  60221. // "type": "string"
  60222. // },
  60223. // "project": {
  60224. // "description": "Project ID for this request.",
  60225. // "location": "path",
  60226. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60227. // "required": true,
  60228. // "type": "string"
  60229. // }
  60230. // },
  60231. // "path": "{project}/global/licenses",
  60232. // "response": {
  60233. // "$ref": "LicensesListResponse"
  60234. // },
  60235. // "scopes": [
  60236. // "https://www.googleapis.com/auth/cloud-platform",
  60237. // "https://www.googleapis.com/auth/compute",
  60238. // "https://www.googleapis.com/auth/compute.readonly"
  60239. // ]
  60240. // }
  60241. }
  60242. // Pages invokes f for each page of results.
  60243. // A non-nil error returned from f will halt the iteration.
  60244. // The provided context supersedes any context provided to the Context method.
  60245. func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error {
  60246. c.ctx_ = ctx
  60247. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60248. for {
  60249. x, err := c.Do()
  60250. if err != nil {
  60251. return err
  60252. }
  60253. if err := f(x); err != nil {
  60254. return err
  60255. }
  60256. if x.NextPageToken == "" {
  60257. return nil
  60258. }
  60259. c.PageToken(x.NextPageToken)
  60260. }
  60261. }
  60262. // method id "compute.licenses.setIamPolicy":
  60263. type LicensesSetIamPolicyCall struct {
  60264. s *Service
  60265. project string
  60266. resource string
  60267. globalsetpolicyrequest *GlobalSetPolicyRequest
  60268. urlParams_ gensupport.URLParams
  60269. ctx_ context.Context
  60270. header_ http.Header
  60271. }
  60272. // SetIamPolicy: Sets the access control policy on the specified
  60273. // resource. Replaces any existing policy.
  60274. func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall {
  60275. c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60276. c.project = project
  60277. c.resource = resource
  60278. c.globalsetpolicyrequest = globalsetpolicyrequest
  60279. return c
  60280. }
  60281. // Fields allows partial responses to be retrieved. See
  60282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60283. // for more information.
  60284. func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall {
  60285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60286. return c
  60287. }
  60288. // Context sets the context to be used in this call's Do method. Any
  60289. // pending HTTP request will be aborted if the provided context is
  60290. // canceled.
  60291. func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall {
  60292. c.ctx_ = ctx
  60293. return c
  60294. }
  60295. // Header returns an http.Header that can be modified by the caller to
  60296. // add HTTP headers to the request.
  60297. func (c *LicensesSetIamPolicyCall) Header() http.Header {
  60298. if c.header_ == nil {
  60299. c.header_ = make(http.Header)
  60300. }
  60301. return c.header_
  60302. }
  60303. func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  60304. reqHeaders := make(http.Header)
  60305. for k, v := range c.header_ {
  60306. reqHeaders[k] = v
  60307. }
  60308. reqHeaders.Set("User-Agent", c.s.userAgent())
  60309. var body io.Reader = nil
  60310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  60311. if err != nil {
  60312. return nil, err
  60313. }
  60314. reqHeaders.Set("Content-Type", "application/json")
  60315. c.urlParams_.Set("alt", alt)
  60316. c.urlParams_.Set("prettyPrint", "false")
  60317. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/setIamPolicy")
  60318. urls += "?" + c.urlParams_.Encode()
  60319. req, err := http.NewRequest("POST", urls, body)
  60320. if err != nil {
  60321. return nil, err
  60322. }
  60323. req.Header = reqHeaders
  60324. googleapi.Expand(req.URL, map[string]string{
  60325. "project": c.project,
  60326. "resource": c.resource,
  60327. })
  60328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60329. }
  60330. // Do executes the "compute.licenses.setIamPolicy" call.
  60331. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  60332. // code is an error. Response headers are in either
  60333. // *Policy.ServerResponse.Header or (if a response was returned at all)
  60334. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  60335. // check whether the returned error was because http.StatusNotModified
  60336. // was returned.
  60337. func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  60338. gensupport.SetOptions(c.urlParams_, opts...)
  60339. res, err := c.doRequest("json")
  60340. if res != nil && res.StatusCode == http.StatusNotModified {
  60341. if res.Body != nil {
  60342. res.Body.Close()
  60343. }
  60344. return nil, &googleapi.Error{
  60345. Code: res.StatusCode,
  60346. Header: res.Header,
  60347. }
  60348. }
  60349. if err != nil {
  60350. return nil, err
  60351. }
  60352. defer googleapi.CloseBody(res)
  60353. if err := googleapi.CheckResponse(res); err != nil {
  60354. return nil, err
  60355. }
  60356. ret := &Policy{
  60357. ServerResponse: googleapi.ServerResponse{
  60358. Header: res.Header,
  60359. HTTPStatusCode: res.StatusCode,
  60360. },
  60361. }
  60362. target := &ret
  60363. if err := gensupport.DecodeResponse(target, res); err != nil {
  60364. return nil, err
  60365. }
  60366. return ret, nil
  60367. // {
  60368. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  60369. // "httpMethod": "POST",
  60370. // "id": "compute.licenses.setIamPolicy",
  60371. // "parameterOrder": [
  60372. // "project",
  60373. // "resource"
  60374. // ],
  60375. // "parameters": {
  60376. // "project": {
  60377. // "description": "Project ID for this request.",
  60378. // "location": "path",
  60379. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60380. // "required": true,
  60381. // "type": "string"
  60382. // },
  60383. // "resource": {
  60384. // "description": "Name or id of the resource for this request.",
  60385. // "location": "path",
  60386. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60387. // "required": true,
  60388. // "type": "string"
  60389. // }
  60390. // },
  60391. // "path": "{project}/global/licenses/{resource}/setIamPolicy",
  60392. // "request": {
  60393. // "$ref": "GlobalSetPolicyRequest"
  60394. // },
  60395. // "response": {
  60396. // "$ref": "Policy"
  60397. // },
  60398. // "scopes": [
  60399. // "https://www.googleapis.com/auth/cloud-platform",
  60400. // "https://www.googleapis.com/auth/compute"
  60401. // ]
  60402. // }
  60403. }
  60404. // method id "compute.licenses.testIamPermissions":
  60405. type LicensesTestIamPermissionsCall struct {
  60406. s *Service
  60407. project string
  60408. resource string
  60409. testpermissionsrequest *TestPermissionsRequest
  60410. urlParams_ gensupport.URLParams
  60411. ctx_ context.Context
  60412. header_ http.Header
  60413. }
  60414. // TestIamPermissions: Returns permissions that a caller has on the
  60415. // specified resource.
  60416. func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall {
  60417. c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60418. c.project = project
  60419. c.resource = resource
  60420. c.testpermissionsrequest = testpermissionsrequest
  60421. return c
  60422. }
  60423. // Fields allows partial responses to be retrieved. See
  60424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60425. // for more information.
  60426. func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall {
  60427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60428. return c
  60429. }
  60430. // Context sets the context to be used in this call's Do method. Any
  60431. // pending HTTP request will be aborted if the provided context is
  60432. // canceled.
  60433. func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall {
  60434. c.ctx_ = ctx
  60435. return c
  60436. }
  60437. // Header returns an http.Header that can be modified by the caller to
  60438. // add HTTP headers to the request.
  60439. func (c *LicensesTestIamPermissionsCall) Header() http.Header {
  60440. if c.header_ == nil {
  60441. c.header_ = make(http.Header)
  60442. }
  60443. return c.header_
  60444. }
  60445. func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  60446. reqHeaders := make(http.Header)
  60447. for k, v := range c.header_ {
  60448. reqHeaders[k] = v
  60449. }
  60450. reqHeaders.Set("User-Agent", c.s.userAgent())
  60451. var body io.Reader = nil
  60452. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  60453. if err != nil {
  60454. return nil, err
  60455. }
  60456. reqHeaders.Set("Content-Type", "application/json")
  60457. c.urlParams_.Set("alt", alt)
  60458. c.urlParams_.Set("prettyPrint", "false")
  60459. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{resource}/testIamPermissions")
  60460. urls += "?" + c.urlParams_.Encode()
  60461. req, err := http.NewRequest("POST", urls, body)
  60462. if err != nil {
  60463. return nil, err
  60464. }
  60465. req.Header = reqHeaders
  60466. googleapi.Expand(req.URL, map[string]string{
  60467. "project": c.project,
  60468. "resource": c.resource,
  60469. })
  60470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60471. }
  60472. // Do executes the "compute.licenses.testIamPermissions" call.
  60473. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  60474. // non-2xx status code is an error. Response headers are in either
  60475. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  60476. // returned at all) in error.(*googleapi.Error).Header. Use
  60477. // googleapi.IsNotModified to check whether the returned error was
  60478. // because http.StatusNotModified was returned.
  60479. func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  60480. gensupport.SetOptions(c.urlParams_, opts...)
  60481. res, err := c.doRequest("json")
  60482. if res != nil && res.StatusCode == http.StatusNotModified {
  60483. if res.Body != nil {
  60484. res.Body.Close()
  60485. }
  60486. return nil, &googleapi.Error{
  60487. Code: res.StatusCode,
  60488. Header: res.Header,
  60489. }
  60490. }
  60491. if err != nil {
  60492. return nil, err
  60493. }
  60494. defer googleapi.CloseBody(res)
  60495. if err := googleapi.CheckResponse(res); err != nil {
  60496. return nil, err
  60497. }
  60498. ret := &TestPermissionsResponse{
  60499. ServerResponse: googleapi.ServerResponse{
  60500. Header: res.Header,
  60501. HTTPStatusCode: res.StatusCode,
  60502. },
  60503. }
  60504. target := &ret
  60505. if err := gensupport.DecodeResponse(target, res); err != nil {
  60506. return nil, err
  60507. }
  60508. return ret, nil
  60509. // {
  60510. // "description": "Returns permissions that a caller has on the specified resource.",
  60511. // "httpMethod": "POST",
  60512. // "id": "compute.licenses.testIamPermissions",
  60513. // "parameterOrder": [
  60514. // "project",
  60515. // "resource"
  60516. // ],
  60517. // "parameters": {
  60518. // "project": {
  60519. // "description": "Project ID for this request.",
  60520. // "location": "path",
  60521. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60522. // "required": true,
  60523. // "type": "string"
  60524. // },
  60525. // "resource": {
  60526. // "description": "Name or id of the resource for this request.",
  60527. // "location": "path",
  60528. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60529. // "required": true,
  60530. // "type": "string"
  60531. // }
  60532. // },
  60533. // "path": "{project}/global/licenses/{resource}/testIamPermissions",
  60534. // "request": {
  60535. // "$ref": "TestPermissionsRequest"
  60536. // },
  60537. // "response": {
  60538. // "$ref": "TestPermissionsResponse"
  60539. // },
  60540. // "scopes": [
  60541. // "https://www.googleapis.com/auth/cloud-platform",
  60542. // "https://www.googleapis.com/auth/compute",
  60543. // "https://www.googleapis.com/auth/compute.readonly"
  60544. // ]
  60545. // }
  60546. }
  60547. // method id "compute.machineTypes.aggregatedList":
  60548. type MachineTypesAggregatedListCall struct {
  60549. s *Service
  60550. project string
  60551. urlParams_ gensupport.URLParams
  60552. ifNoneMatch_ string
  60553. ctx_ context.Context
  60554. header_ http.Header
  60555. }
  60556. // AggregatedList: Retrieves an aggregated list of machine types.
  60557. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList
  60558. func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall {
  60559. c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60560. c.project = project
  60561. return c
  60562. }
  60563. // Filter sets the optional parameter "filter": A filter expression that
  60564. // filters resources listed in the response. The expression must specify
  60565. // the field name, a comparison operator, and the value that you want to
  60566. // use for filtering. The value must be a string, a number, or a
  60567. // boolean. The comparison operator must be either =, !=, >, or <.
  60568. //
  60569. // For example, if you are filtering Compute Engine instances, you can
  60570. // exclude instances named example-instance by specifying name !=
  60571. // example-instance.
  60572. //
  60573. // You can also filter nested fields. For example, you could specify
  60574. // scheduling.automaticRestart = false to include instances only if they
  60575. // are not scheduled for automatic restarts. You can use filtering on
  60576. // nested fields to filter based on resource labels.
  60577. //
  60578. // To filter on multiple expressions, provide each separate expression
  60579. // within parentheses. For example, (scheduling.automaticRestart = true)
  60580. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60581. // AND expression. However, you can include AND and OR expressions
  60582. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60583. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60584. // true).
  60585. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall {
  60586. c.urlParams_.Set("filter", filter)
  60587. return c
  60588. }
  60589. // MaxResults sets the optional parameter "maxResults": The maximum
  60590. // number of results per page that should be returned. If the number of
  60591. // available results is larger than maxResults, Compute Engine returns a
  60592. // nextPageToken that can be used to get the next page of results in
  60593. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60594. // (Default: 500)
  60595. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall {
  60596. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60597. return c
  60598. }
  60599. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60600. // a certain order. By default, results are returned in alphanumerical
  60601. // order based on the resource name.
  60602. //
  60603. // You can also sort results in descending order based on the creation
  60604. // timestamp using orderBy="creationTimestamp desc". This sorts results
  60605. // based on the creationTimestamp field in reverse chronological order
  60606. // (newest result first). Use this to sort resources like operations so
  60607. // that the newest operation is returned first.
  60608. //
  60609. // Currently, only sorting by name or creationTimestamp desc is
  60610. // supported.
  60611. func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall {
  60612. c.urlParams_.Set("orderBy", orderBy)
  60613. return c
  60614. }
  60615. // PageToken sets the optional parameter "pageToken": Specifies a page
  60616. // token to use. Set pageToken to the nextPageToken returned by a
  60617. // previous list request to get the next page of results.
  60618. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall {
  60619. c.urlParams_.Set("pageToken", pageToken)
  60620. return c
  60621. }
  60622. // Fields allows partial responses to be retrieved. See
  60623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60624. // for more information.
  60625. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall {
  60626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60627. return c
  60628. }
  60629. // IfNoneMatch sets the optional parameter which makes the operation
  60630. // fail if the object's ETag matches the given value. This is useful for
  60631. // getting updates only after the object has changed since the last
  60632. // request. Use googleapi.IsNotModified to check whether the response
  60633. // error from Do is the result of In-None-Match.
  60634. func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall {
  60635. c.ifNoneMatch_ = entityTag
  60636. return c
  60637. }
  60638. // Context sets the context to be used in this call's Do method. Any
  60639. // pending HTTP request will be aborted if the provided context is
  60640. // canceled.
  60641. func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall {
  60642. c.ctx_ = ctx
  60643. return c
  60644. }
  60645. // Header returns an http.Header that can be modified by the caller to
  60646. // add HTTP headers to the request.
  60647. func (c *MachineTypesAggregatedListCall) Header() http.Header {
  60648. if c.header_ == nil {
  60649. c.header_ = make(http.Header)
  60650. }
  60651. return c.header_
  60652. }
  60653. func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  60654. reqHeaders := make(http.Header)
  60655. for k, v := range c.header_ {
  60656. reqHeaders[k] = v
  60657. }
  60658. reqHeaders.Set("User-Agent", c.s.userAgent())
  60659. if c.ifNoneMatch_ != "" {
  60660. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60661. }
  60662. var body io.Reader = nil
  60663. c.urlParams_.Set("alt", alt)
  60664. c.urlParams_.Set("prettyPrint", "false")
  60665. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes")
  60666. urls += "?" + c.urlParams_.Encode()
  60667. req, err := http.NewRequest("GET", urls, body)
  60668. if err != nil {
  60669. return nil, err
  60670. }
  60671. req.Header = reqHeaders
  60672. googleapi.Expand(req.URL, map[string]string{
  60673. "project": c.project,
  60674. })
  60675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60676. }
  60677. // Do executes the "compute.machineTypes.aggregatedList" call.
  60678. // Exactly one of *MachineTypeAggregatedList or error will be non-nil.
  60679. // Any non-2xx status code is an error. Response headers are in either
  60680. // *MachineTypeAggregatedList.ServerResponse.Header or (if a response
  60681. // was returned at all) in error.(*googleapi.Error).Header. Use
  60682. // googleapi.IsNotModified to check whether the returned error was
  60683. // because http.StatusNotModified was returned.
  60684. func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) {
  60685. gensupport.SetOptions(c.urlParams_, opts...)
  60686. res, err := c.doRequest("json")
  60687. if res != nil && res.StatusCode == http.StatusNotModified {
  60688. if res.Body != nil {
  60689. res.Body.Close()
  60690. }
  60691. return nil, &googleapi.Error{
  60692. Code: res.StatusCode,
  60693. Header: res.Header,
  60694. }
  60695. }
  60696. if err != nil {
  60697. return nil, err
  60698. }
  60699. defer googleapi.CloseBody(res)
  60700. if err := googleapi.CheckResponse(res); err != nil {
  60701. return nil, err
  60702. }
  60703. ret := &MachineTypeAggregatedList{
  60704. ServerResponse: googleapi.ServerResponse{
  60705. Header: res.Header,
  60706. HTTPStatusCode: res.StatusCode,
  60707. },
  60708. }
  60709. target := &ret
  60710. if err := gensupport.DecodeResponse(target, res); err != nil {
  60711. return nil, err
  60712. }
  60713. return ret, nil
  60714. // {
  60715. // "description": "Retrieves an aggregated list of machine types.",
  60716. // "httpMethod": "GET",
  60717. // "id": "compute.machineTypes.aggregatedList",
  60718. // "parameterOrder": [
  60719. // "project"
  60720. // ],
  60721. // "parameters": {
  60722. // "filter": {
  60723. // "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).",
  60724. // "location": "query",
  60725. // "type": "string"
  60726. // },
  60727. // "maxResults": {
  60728. // "default": "500",
  60729. // "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)",
  60730. // "format": "uint32",
  60731. // "location": "query",
  60732. // "minimum": "0",
  60733. // "type": "integer"
  60734. // },
  60735. // "orderBy": {
  60736. // "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.",
  60737. // "location": "query",
  60738. // "type": "string"
  60739. // },
  60740. // "pageToken": {
  60741. // "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.",
  60742. // "location": "query",
  60743. // "type": "string"
  60744. // },
  60745. // "project": {
  60746. // "description": "Project ID for this request.",
  60747. // "location": "path",
  60748. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60749. // "required": true,
  60750. // "type": "string"
  60751. // }
  60752. // },
  60753. // "path": "{project}/aggregated/machineTypes",
  60754. // "response": {
  60755. // "$ref": "MachineTypeAggregatedList"
  60756. // },
  60757. // "scopes": [
  60758. // "https://www.googleapis.com/auth/cloud-platform",
  60759. // "https://www.googleapis.com/auth/compute",
  60760. // "https://www.googleapis.com/auth/compute.readonly"
  60761. // ]
  60762. // }
  60763. }
  60764. // Pages invokes f for each page of results.
  60765. // A non-nil error returned from f will halt the iteration.
  60766. // The provided context supersedes any context provided to the Context method.
  60767. func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error {
  60768. c.ctx_ = ctx
  60769. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  60770. for {
  60771. x, err := c.Do()
  60772. if err != nil {
  60773. return err
  60774. }
  60775. if err := f(x); err != nil {
  60776. return err
  60777. }
  60778. if x.NextPageToken == "" {
  60779. return nil
  60780. }
  60781. c.PageToken(x.NextPageToken)
  60782. }
  60783. }
  60784. // method id "compute.machineTypes.get":
  60785. type MachineTypesGetCall struct {
  60786. s *Service
  60787. project string
  60788. zone string
  60789. machineType string
  60790. urlParams_ gensupport.URLParams
  60791. ifNoneMatch_ string
  60792. ctx_ context.Context
  60793. header_ http.Header
  60794. }
  60795. // Get: Returns the specified machine type. Gets a list of available
  60796. // machine types by making a list() request.
  60797. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get
  60798. func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall {
  60799. c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60800. c.project = project
  60801. c.zone = zone
  60802. c.machineType = machineType
  60803. return c
  60804. }
  60805. // Fields allows partial responses to be retrieved. See
  60806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  60807. // for more information.
  60808. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall {
  60809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  60810. return c
  60811. }
  60812. // IfNoneMatch sets the optional parameter which makes the operation
  60813. // fail if the object's ETag matches the given value. This is useful for
  60814. // getting updates only after the object has changed since the last
  60815. // request. Use googleapi.IsNotModified to check whether the response
  60816. // error from Do is the result of In-None-Match.
  60817. func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall {
  60818. c.ifNoneMatch_ = entityTag
  60819. return c
  60820. }
  60821. // Context sets the context to be used in this call's Do method. Any
  60822. // pending HTTP request will be aborted if the provided context is
  60823. // canceled.
  60824. func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall {
  60825. c.ctx_ = ctx
  60826. return c
  60827. }
  60828. // Header returns an http.Header that can be modified by the caller to
  60829. // add HTTP headers to the request.
  60830. func (c *MachineTypesGetCall) Header() http.Header {
  60831. if c.header_ == nil {
  60832. c.header_ = make(http.Header)
  60833. }
  60834. return c.header_
  60835. }
  60836. func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) {
  60837. reqHeaders := make(http.Header)
  60838. for k, v := range c.header_ {
  60839. reqHeaders[k] = v
  60840. }
  60841. reqHeaders.Set("User-Agent", c.s.userAgent())
  60842. if c.ifNoneMatch_ != "" {
  60843. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  60844. }
  60845. var body io.Reader = nil
  60846. c.urlParams_.Set("alt", alt)
  60847. c.urlParams_.Set("prettyPrint", "false")
  60848. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}")
  60849. urls += "?" + c.urlParams_.Encode()
  60850. req, err := http.NewRequest("GET", urls, body)
  60851. if err != nil {
  60852. return nil, err
  60853. }
  60854. req.Header = reqHeaders
  60855. googleapi.Expand(req.URL, map[string]string{
  60856. "project": c.project,
  60857. "zone": c.zone,
  60858. "machineType": c.machineType,
  60859. })
  60860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  60861. }
  60862. // Do executes the "compute.machineTypes.get" call.
  60863. // Exactly one of *MachineType or error will be non-nil. Any non-2xx
  60864. // status code is an error. Response headers are in either
  60865. // *MachineType.ServerResponse.Header or (if a response was returned at
  60866. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  60867. // to check whether the returned error was because
  60868. // http.StatusNotModified was returned.
  60869. func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) {
  60870. gensupport.SetOptions(c.urlParams_, opts...)
  60871. res, err := c.doRequest("json")
  60872. if res != nil && res.StatusCode == http.StatusNotModified {
  60873. if res.Body != nil {
  60874. res.Body.Close()
  60875. }
  60876. return nil, &googleapi.Error{
  60877. Code: res.StatusCode,
  60878. Header: res.Header,
  60879. }
  60880. }
  60881. if err != nil {
  60882. return nil, err
  60883. }
  60884. defer googleapi.CloseBody(res)
  60885. if err := googleapi.CheckResponse(res); err != nil {
  60886. return nil, err
  60887. }
  60888. ret := &MachineType{
  60889. ServerResponse: googleapi.ServerResponse{
  60890. Header: res.Header,
  60891. HTTPStatusCode: res.StatusCode,
  60892. },
  60893. }
  60894. target := &ret
  60895. if err := gensupport.DecodeResponse(target, res); err != nil {
  60896. return nil, err
  60897. }
  60898. return ret, nil
  60899. // {
  60900. // "description": "Returns the specified machine type. Gets a list of available machine types by making a list() request.",
  60901. // "httpMethod": "GET",
  60902. // "id": "compute.machineTypes.get",
  60903. // "parameterOrder": [
  60904. // "project",
  60905. // "zone",
  60906. // "machineType"
  60907. // ],
  60908. // "parameters": {
  60909. // "machineType": {
  60910. // "description": "Name of the machine type to return.",
  60911. // "location": "path",
  60912. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  60913. // "required": true,
  60914. // "type": "string"
  60915. // },
  60916. // "project": {
  60917. // "description": "Project ID for this request.",
  60918. // "location": "path",
  60919. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  60920. // "required": true,
  60921. // "type": "string"
  60922. // },
  60923. // "zone": {
  60924. // "description": "The name of the zone for this request.",
  60925. // "location": "path",
  60926. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  60927. // "required": true,
  60928. // "type": "string"
  60929. // }
  60930. // },
  60931. // "path": "{project}/zones/{zone}/machineTypes/{machineType}",
  60932. // "response": {
  60933. // "$ref": "MachineType"
  60934. // },
  60935. // "scopes": [
  60936. // "https://www.googleapis.com/auth/cloud-platform",
  60937. // "https://www.googleapis.com/auth/compute",
  60938. // "https://www.googleapis.com/auth/compute.readonly"
  60939. // ]
  60940. // }
  60941. }
  60942. // method id "compute.machineTypes.list":
  60943. type MachineTypesListCall struct {
  60944. s *Service
  60945. project string
  60946. zone string
  60947. urlParams_ gensupport.URLParams
  60948. ifNoneMatch_ string
  60949. ctx_ context.Context
  60950. header_ http.Header
  60951. }
  60952. // List: Retrieves a list of machine types available to the specified
  60953. // project.
  60954. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list
  60955. func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall {
  60956. c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  60957. c.project = project
  60958. c.zone = zone
  60959. return c
  60960. }
  60961. // Filter sets the optional parameter "filter": A filter expression that
  60962. // filters resources listed in the response. The expression must specify
  60963. // the field name, a comparison operator, and the value that you want to
  60964. // use for filtering. The value must be a string, a number, or a
  60965. // boolean. The comparison operator must be either =, !=, >, or <.
  60966. //
  60967. // For example, if you are filtering Compute Engine instances, you can
  60968. // exclude instances named example-instance by specifying name !=
  60969. // example-instance.
  60970. //
  60971. // You can also filter nested fields. For example, you could specify
  60972. // scheduling.automaticRestart = false to include instances only if they
  60973. // are not scheduled for automatic restarts. You can use filtering on
  60974. // nested fields to filter based on resource labels.
  60975. //
  60976. // To filter on multiple expressions, provide each separate expression
  60977. // within parentheses. For example, (scheduling.automaticRestart = true)
  60978. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  60979. // AND expression. However, you can include AND and OR expressions
  60980. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  60981. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  60982. // true).
  60983. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall {
  60984. c.urlParams_.Set("filter", filter)
  60985. return c
  60986. }
  60987. // MaxResults sets the optional parameter "maxResults": The maximum
  60988. // number of results per page that should be returned. If the number of
  60989. // available results is larger than maxResults, Compute Engine returns a
  60990. // nextPageToken that can be used to get the next page of results in
  60991. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  60992. // (Default: 500)
  60993. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall {
  60994. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  60995. return c
  60996. }
  60997. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  60998. // a certain order. By default, results are returned in alphanumerical
  60999. // order based on the resource name.
  61000. //
  61001. // You can also sort results in descending order based on the creation
  61002. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61003. // based on the creationTimestamp field in reverse chronological order
  61004. // (newest result first). Use this to sort resources like operations so
  61005. // that the newest operation is returned first.
  61006. //
  61007. // Currently, only sorting by name or creationTimestamp desc is
  61008. // supported.
  61009. func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall {
  61010. c.urlParams_.Set("orderBy", orderBy)
  61011. return c
  61012. }
  61013. // PageToken sets the optional parameter "pageToken": Specifies a page
  61014. // token to use. Set pageToken to the nextPageToken returned by a
  61015. // previous list request to get the next page of results.
  61016. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall {
  61017. c.urlParams_.Set("pageToken", pageToken)
  61018. return c
  61019. }
  61020. // Fields allows partial responses to be retrieved. See
  61021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61022. // for more information.
  61023. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall {
  61024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61025. return c
  61026. }
  61027. // IfNoneMatch sets the optional parameter which makes the operation
  61028. // fail if the object's ETag matches the given value. This is useful for
  61029. // getting updates only after the object has changed since the last
  61030. // request. Use googleapi.IsNotModified to check whether the response
  61031. // error from Do is the result of In-None-Match.
  61032. func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall {
  61033. c.ifNoneMatch_ = entityTag
  61034. return c
  61035. }
  61036. // Context sets the context to be used in this call's Do method. Any
  61037. // pending HTTP request will be aborted if the provided context is
  61038. // canceled.
  61039. func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall {
  61040. c.ctx_ = ctx
  61041. return c
  61042. }
  61043. // Header returns an http.Header that can be modified by the caller to
  61044. // add HTTP headers to the request.
  61045. func (c *MachineTypesListCall) Header() http.Header {
  61046. if c.header_ == nil {
  61047. c.header_ = make(http.Header)
  61048. }
  61049. return c.header_
  61050. }
  61051. func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) {
  61052. reqHeaders := make(http.Header)
  61053. for k, v := range c.header_ {
  61054. reqHeaders[k] = v
  61055. }
  61056. reqHeaders.Set("User-Agent", c.s.userAgent())
  61057. if c.ifNoneMatch_ != "" {
  61058. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61059. }
  61060. var body io.Reader = nil
  61061. c.urlParams_.Set("alt", alt)
  61062. c.urlParams_.Set("prettyPrint", "false")
  61063. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes")
  61064. urls += "?" + c.urlParams_.Encode()
  61065. req, err := http.NewRequest("GET", urls, body)
  61066. if err != nil {
  61067. return nil, err
  61068. }
  61069. req.Header = reqHeaders
  61070. googleapi.Expand(req.URL, map[string]string{
  61071. "project": c.project,
  61072. "zone": c.zone,
  61073. })
  61074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61075. }
  61076. // Do executes the "compute.machineTypes.list" call.
  61077. // Exactly one of *MachineTypeList or error will be non-nil. Any non-2xx
  61078. // status code is an error. Response headers are in either
  61079. // *MachineTypeList.ServerResponse.Header or (if a response was returned
  61080. // at all) in error.(*googleapi.Error).Header. Use
  61081. // googleapi.IsNotModified to check whether the returned error was
  61082. // because http.StatusNotModified was returned.
  61083. func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) {
  61084. gensupport.SetOptions(c.urlParams_, opts...)
  61085. res, err := c.doRequest("json")
  61086. if res != nil && res.StatusCode == http.StatusNotModified {
  61087. if res.Body != nil {
  61088. res.Body.Close()
  61089. }
  61090. return nil, &googleapi.Error{
  61091. Code: res.StatusCode,
  61092. Header: res.Header,
  61093. }
  61094. }
  61095. if err != nil {
  61096. return nil, err
  61097. }
  61098. defer googleapi.CloseBody(res)
  61099. if err := googleapi.CheckResponse(res); err != nil {
  61100. return nil, err
  61101. }
  61102. ret := &MachineTypeList{
  61103. ServerResponse: googleapi.ServerResponse{
  61104. Header: res.Header,
  61105. HTTPStatusCode: res.StatusCode,
  61106. },
  61107. }
  61108. target := &ret
  61109. if err := gensupport.DecodeResponse(target, res); err != nil {
  61110. return nil, err
  61111. }
  61112. return ret, nil
  61113. // {
  61114. // "description": "Retrieves a list of machine types available to the specified project.",
  61115. // "httpMethod": "GET",
  61116. // "id": "compute.machineTypes.list",
  61117. // "parameterOrder": [
  61118. // "project",
  61119. // "zone"
  61120. // ],
  61121. // "parameters": {
  61122. // "filter": {
  61123. // "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).",
  61124. // "location": "query",
  61125. // "type": "string"
  61126. // },
  61127. // "maxResults": {
  61128. // "default": "500",
  61129. // "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)",
  61130. // "format": "uint32",
  61131. // "location": "query",
  61132. // "minimum": "0",
  61133. // "type": "integer"
  61134. // },
  61135. // "orderBy": {
  61136. // "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.",
  61137. // "location": "query",
  61138. // "type": "string"
  61139. // },
  61140. // "pageToken": {
  61141. // "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.",
  61142. // "location": "query",
  61143. // "type": "string"
  61144. // },
  61145. // "project": {
  61146. // "description": "Project ID for this request.",
  61147. // "location": "path",
  61148. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61149. // "required": true,
  61150. // "type": "string"
  61151. // },
  61152. // "zone": {
  61153. // "description": "The name of the zone for this request.",
  61154. // "location": "path",
  61155. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  61156. // "required": true,
  61157. // "type": "string"
  61158. // }
  61159. // },
  61160. // "path": "{project}/zones/{zone}/machineTypes",
  61161. // "response": {
  61162. // "$ref": "MachineTypeList"
  61163. // },
  61164. // "scopes": [
  61165. // "https://www.googleapis.com/auth/cloud-platform",
  61166. // "https://www.googleapis.com/auth/compute",
  61167. // "https://www.googleapis.com/auth/compute.readonly"
  61168. // ]
  61169. // }
  61170. }
  61171. // Pages invokes f for each page of results.
  61172. // A non-nil error returned from f will halt the iteration.
  61173. // The provided context supersedes any context provided to the Context method.
  61174. func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error {
  61175. c.ctx_ = ctx
  61176. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61177. for {
  61178. x, err := c.Do()
  61179. if err != nil {
  61180. return err
  61181. }
  61182. if err := f(x); err != nil {
  61183. return err
  61184. }
  61185. if x.NextPageToken == "" {
  61186. return nil
  61187. }
  61188. c.PageToken(x.NextPageToken)
  61189. }
  61190. }
  61191. // method id "compute.networkEndpointGroups.aggregatedList":
  61192. type NetworkEndpointGroupsAggregatedListCall struct {
  61193. s *Service
  61194. project string
  61195. urlParams_ gensupport.URLParams
  61196. ifNoneMatch_ string
  61197. ctx_ context.Context
  61198. header_ http.Header
  61199. }
  61200. // AggregatedList: Retrieves the list of network endpoint groups and
  61201. // sorts them by zone.
  61202. func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall {
  61203. c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61204. c.project = project
  61205. return c
  61206. }
  61207. // Filter sets the optional parameter "filter": A filter expression that
  61208. // filters resources listed in the response. The expression must specify
  61209. // the field name, a comparison operator, and the value that you want to
  61210. // use for filtering. The value must be a string, a number, or a
  61211. // boolean. The comparison operator must be either =, !=, >, or <.
  61212. //
  61213. // For example, if you are filtering Compute Engine instances, you can
  61214. // exclude instances named example-instance by specifying name !=
  61215. // example-instance.
  61216. //
  61217. // You can also filter nested fields. For example, you could specify
  61218. // scheduling.automaticRestart = false to include instances only if they
  61219. // are not scheduled for automatic restarts. You can use filtering on
  61220. // nested fields to filter based on resource labels.
  61221. //
  61222. // To filter on multiple expressions, provide each separate expression
  61223. // within parentheses. For example, (scheduling.automaticRestart = true)
  61224. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  61225. // AND expression. However, you can include AND and OR expressions
  61226. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  61227. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  61228. // true).
  61229. func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall {
  61230. c.urlParams_.Set("filter", filter)
  61231. return c
  61232. }
  61233. // MaxResults sets the optional parameter "maxResults": The maximum
  61234. // number of results per page that should be returned. If the number of
  61235. // available results is larger than maxResults, Compute Engine returns a
  61236. // nextPageToken that can be used to get the next page of results in
  61237. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  61238. // (Default: 500)
  61239. func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall {
  61240. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  61241. return c
  61242. }
  61243. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  61244. // a certain order. By default, results are returned in alphanumerical
  61245. // order based on the resource name.
  61246. //
  61247. // You can also sort results in descending order based on the creation
  61248. // timestamp using orderBy="creationTimestamp desc". This sorts results
  61249. // based on the creationTimestamp field in reverse chronological order
  61250. // (newest result first). Use this to sort resources like operations so
  61251. // that the newest operation is returned first.
  61252. //
  61253. // Currently, only sorting by name or creationTimestamp desc is
  61254. // supported.
  61255. func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall {
  61256. c.urlParams_.Set("orderBy", orderBy)
  61257. return c
  61258. }
  61259. // PageToken sets the optional parameter "pageToken": Specifies a page
  61260. // token to use. Set pageToken to the nextPageToken returned by a
  61261. // previous list request to get the next page of results.
  61262. func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall {
  61263. c.urlParams_.Set("pageToken", pageToken)
  61264. return c
  61265. }
  61266. // Fields allows partial responses to be retrieved. See
  61267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61268. // for more information.
  61269. func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall {
  61270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61271. return c
  61272. }
  61273. // IfNoneMatch sets the optional parameter which makes the operation
  61274. // fail if the object's ETag matches the given value. This is useful for
  61275. // getting updates only after the object has changed since the last
  61276. // request. Use googleapi.IsNotModified to check whether the response
  61277. // error from Do is the result of In-None-Match.
  61278. func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall {
  61279. c.ifNoneMatch_ = entityTag
  61280. return c
  61281. }
  61282. // Context sets the context to be used in this call's Do method. Any
  61283. // pending HTTP request will be aborted if the provided context is
  61284. // canceled.
  61285. func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall {
  61286. c.ctx_ = ctx
  61287. return c
  61288. }
  61289. // Header returns an http.Header that can be modified by the caller to
  61290. // add HTTP headers to the request.
  61291. func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header {
  61292. if c.header_ == nil {
  61293. c.header_ = make(http.Header)
  61294. }
  61295. return c.header_
  61296. }
  61297. func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  61298. reqHeaders := make(http.Header)
  61299. for k, v := range c.header_ {
  61300. reqHeaders[k] = v
  61301. }
  61302. reqHeaders.Set("User-Agent", c.s.userAgent())
  61303. if c.ifNoneMatch_ != "" {
  61304. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  61305. }
  61306. var body io.Reader = nil
  61307. c.urlParams_.Set("alt", alt)
  61308. c.urlParams_.Set("prettyPrint", "false")
  61309. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/networkEndpointGroups")
  61310. urls += "?" + c.urlParams_.Encode()
  61311. req, err := http.NewRequest("GET", urls, body)
  61312. if err != nil {
  61313. return nil, err
  61314. }
  61315. req.Header = reqHeaders
  61316. googleapi.Expand(req.URL, map[string]string{
  61317. "project": c.project,
  61318. })
  61319. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61320. }
  61321. // Do executes the "compute.networkEndpointGroups.aggregatedList" call.
  61322. // Exactly one of *NetworkEndpointGroupAggregatedList or error will be
  61323. // non-nil. Any non-2xx status code is an error. Response headers are in
  61324. // either *NetworkEndpointGroupAggregatedList.ServerResponse.Header or
  61325. // (if a response was returned at all) in
  61326. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  61327. // whether the returned error was because http.StatusNotModified was
  61328. // returned.
  61329. func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) {
  61330. gensupport.SetOptions(c.urlParams_, opts...)
  61331. res, err := c.doRequest("json")
  61332. if res != nil && res.StatusCode == http.StatusNotModified {
  61333. if res.Body != nil {
  61334. res.Body.Close()
  61335. }
  61336. return nil, &googleapi.Error{
  61337. Code: res.StatusCode,
  61338. Header: res.Header,
  61339. }
  61340. }
  61341. if err != nil {
  61342. return nil, err
  61343. }
  61344. defer googleapi.CloseBody(res)
  61345. if err := googleapi.CheckResponse(res); err != nil {
  61346. return nil, err
  61347. }
  61348. ret := &NetworkEndpointGroupAggregatedList{
  61349. ServerResponse: googleapi.ServerResponse{
  61350. Header: res.Header,
  61351. HTTPStatusCode: res.StatusCode,
  61352. },
  61353. }
  61354. target := &ret
  61355. if err := gensupport.DecodeResponse(target, res); err != nil {
  61356. return nil, err
  61357. }
  61358. return ret, nil
  61359. // {
  61360. // "description": "Retrieves the list of network endpoint groups and sorts them by zone.",
  61361. // "httpMethod": "GET",
  61362. // "id": "compute.networkEndpointGroups.aggregatedList",
  61363. // "parameterOrder": [
  61364. // "project"
  61365. // ],
  61366. // "parameters": {
  61367. // "filter": {
  61368. // "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).",
  61369. // "location": "query",
  61370. // "type": "string"
  61371. // },
  61372. // "maxResults": {
  61373. // "default": "500",
  61374. // "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)",
  61375. // "format": "uint32",
  61376. // "location": "query",
  61377. // "minimum": "0",
  61378. // "type": "integer"
  61379. // },
  61380. // "orderBy": {
  61381. // "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.",
  61382. // "location": "query",
  61383. // "type": "string"
  61384. // },
  61385. // "pageToken": {
  61386. // "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.",
  61387. // "location": "query",
  61388. // "type": "string"
  61389. // },
  61390. // "project": {
  61391. // "description": "Project ID for this request.",
  61392. // "location": "path",
  61393. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61394. // "required": true,
  61395. // "type": "string"
  61396. // }
  61397. // },
  61398. // "path": "{project}/aggregated/networkEndpointGroups",
  61399. // "response": {
  61400. // "$ref": "NetworkEndpointGroupAggregatedList"
  61401. // },
  61402. // "scopes": [
  61403. // "https://www.googleapis.com/auth/cloud-platform",
  61404. // "https://www.googleapis.com/auth/compute",
  61405. // "https://www.googleapis.com/auth/compute.readonly"
  61406. // ]
  61407. // }
  61408. }
  61409. // Pages invokes f for each page of results.
  61410. // A non-nil error returned from f will halt the iteration.
  61411. // The provided context supersedes any context provided to the Context method.
  61412. func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error {
  61413. c.ctx_ = ctx
  61414. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  61415. for {
  61416. x, err := c.Do()
  61417. if err != nil {
  61418. return err
  61419. }
  61420. if err := f(x); err != nil {
  61421. return err
  61422. }
  61423. if x.NextPageToken == "" {
  61424. return nil
  61425. }
  61426. c.PageToken(x.NextPageToken)
  61427. }
  61428. }
  61429. // method id "compute.networkEndpointGroups.attachNetworkEndpoints":
  61430. type NetworkEndpointGroupsAttachNetworkEndpointsCall struct {
  61431. s *Service
  61432. project string
  61433. zone string
  61434. networkEndpointGroup string
  61435. networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest
  61436. urlParams_ gensupport.URLParams
  61437. ctx_ context.Context
  61438. header_ http.Header
  61439. }
  61440. // AttachNetworkEndpoints: Attach a list of network endpoints to the
  61441. // specified network endpoint group.
  61442. func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61443. c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61444. c.project = project
  61445. c.zone = zone
  61446. c.networkEndpointGroup = networkEndpointGroup
  61447. c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest
  61448. return c
  61449. }
  61450. // RequestId sets the optional parameter "requestId": An optional
  61451. // request ID to identify requests. Specify a unique request ID so that
  61452. // if you must retry your request, the server will know to ignore the
  61453. // request if it has already been completed.
  61454. //
  61455. // For example, consider a situation where you make an initial request
  61456. // and the request times out. If you make the request again with the
  61457. // same request ID, the server can check if original operation with the
  61458. // same request ID was received, and if so, will ignore the second
  61459. // request. This prevents clients from accidentally creating duplicate
  61460. // commitments.
  61461. //
  61462. // The request ID must be a valid UUID with the exception that zero UUID
  61463. // is not supported (00000000-0000-0000-0000-000000000000).
  61464. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61465. c.urlParams_.Set("requestId", requestId)
  61466. return c
  61467. }
  61468. // Fields allows partial responses to be retrieved. See
  61469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61470. // for more information.
  61471. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61473. return c
  61474. }
  61475. // Context sets the context to be used in this call's Do method. Any
  61476. // pending HTTP request will be aborted if the provided context is
  61477. // canceled.
  61478. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall {
  61479. c.ctx_ = ctx
  61480. return c
  61481. }
  61482. // Header returns an http.Header that can be modified by the caller to
  61483. // add HTTP headers to the request.
  61484. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header {
  61485. if c.header_ == nil {
  61486. c.header_ = make(http.Header)
  61487. }
  61488. return c.header_
  61489. }
  61490. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  61491. reqHeaders := make(http.Header)
  61492. for k, v := range c.header_ {
  61493. reqHeaders[k] = v
  61494. }
  61495. reqHeaders.Set("User-Agent", c.s.userAgent())
  61496. var body io.Reader = nil
  61497. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest)
  61498. if err != nil {
  61499. return nil, err
  61500. }
  61501. reqHeaders.Set("Content-Type", "application/json")
  61502. c.urlParams_.Set("alt", alt)
  61503. c.urlParams_.Set("prettyPrint", "false")
  61504. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints")
  61505. urls += "?" + c.urlParams_.Encode()
  61506. req, err := http.NewRequest("POST", urls, body)
  61507. if err != nil {
  61508. return nil, err
  61509. }
  61510. req.Header = reqHeaders
  61511. googleapi.Expand(req.URL, map[string]string{
  61512. "project": c.project,
  61513. "zone": c.zone,
  61514. "networkEndpointGroup": c.networkEndpointGroup,
  61515. })
  61516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61517. }
  61518. // Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call.
  61519. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61520. // status code is an error. Response headers are in either
  61521. // *Operation.ServerResponse.Header or (if a response was returned at
  61522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61523. // to check whether the returned error was because
  61524. // http.StatusNotModified was returned.
  61525. func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61526. gensupport.SetOptions(c.urlParams_, opts...)
  61527. res, err := c.doRequest("json")
  61528. if res != nil && res.StatusCode == http.StatusNotModified {
  61529. if res.Body != nil {
  61530. res.Body.Close()
  61531. }
  61532. return nil, &googleapi.Error{
  61533. Code: res.StatusCode,
  61534. Header: res.Header,
  61535. }
  61536. }
  61537. if err != nil {
  61538. return nil, err
  61539. }
  61540. defer googleapi.CloseBody(res)
  61541. if err := googleapi.CheckResponse(res); err != nil {
  61542. return nil, err
  61543. }
  61544. ret := &Operation{
  61545. ServerResponse: googleapi.ServerResponse{
  61546. Header: res.Header,
  61547. HTTPStatusCode: res.StatusCode,
  61548. },
  61549. }
  61550. target := &ret
  61551. if err := gensupport.DecodeResponse(target, res); err != nil {
  61552. return nil, err
  61553. }
  61554. return ret, nil
  61555. // {
  61556. // "description": "Attach a list of network endpoints to the specified network endpoint group.",
  61557. // "httpMethod": "POST",
  61558. // "id": "compute.networkEndpointGroups.attachNetworkEndpoints",
  61559. // "parameterOrder": [
  61560. // "project",
  61561. // "zone",
  61562. // "networkEndpointGroup"
  61563. // ],
  61564. // "parameters": {
  61565. // "networkEndpointGroup": {
  61566. // "description": "The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035.",
  61567. // "location": "path",
  61568. // "required": true,
  61569. // "type": "string"
  61570. // },
  61571. // "project": {
  61572. // "description": "Project ID for this request.",
  61573. // "location": "path",
  61574. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61575. // "required": true,
  61576. // "type": "string"
  61577. // },
  61578. // "requestId": {
  61579. // "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).",
  61580. // "location": "query",
  61581. // "type": "string"
  61582. // },
  61583. // "zone": {
  61584. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  61585. // "location": "path",
  61586. // "required": true,
  61587. // "type": "string"
  61588. // }
  61589. // },
  61590. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints",
  61591. // "request": {
  61592. // "$ref": "NetworkEndpointGroupsAttachEndpointsRequest"
  61593. // },
  61594. // "response": {
  61595. // "$ref": "Operation"
  61596. // },
  61597. // "scopes": [
  61598. // "https://www.googleapis.com/auth/cloud-platform",
  61599. // "https://www.googleapis.com/auth/compute"
  61600. // ]
  61601. // }
  61602. }
  61603. // method id "compute.networkEndpointGroups.delete":
  61604. type NetworkEndpointGroupsDeleteCall struct {
  61605. s *Service
  61606. project string
  61607. zone string
  61608. networkEndpointGroup string
  61609. urlParams_ gensupport.URLParams
  61610. ctx_ context.Context
  61611. header_ http.Header
  61612. }
  61613. // Delete: Deletes the specified network endpoint group. The network
  61614. // endpoints in the NEG and the VM instances they belong to are not
  61615. // terminated when the NEG is deleted. Note that the NEG cannot be
  61616. // deleted if there are backend services referencing it.
  61617. func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall {
  61618. c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61619. c.project = project
  61620. c.zone = zone
  61621. c.networkEndpointGroup = networkEndpointGroup
  61622. return c
  61623. }
  61624. // RequestId sets the optional parameter "requestId": An optional
  61625. // request ID to identify requests. Specify a unique request ID so that
  61626. // if you must retry your request, the server will know to ignore the
  61627. // request if it has already been completed.
  61628. //
  61629. // For example, consider a situation where you make an initial request
  61630. // and the request times out. If you make the request again with the
  61631. // same request ID, the server can check if original operation with the
  61632. // same request ID was received, and if so, will ignore the second
  61633. // request. This prevents clients from accidentally creating duplicate
  61634. // commitments.
  61635. //
  61636. // The request ID must be a valid UUID with the exception that zero UUID
  61637. // is not supported (00000000-0000-0000-0000-000000000000).
  61638. func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall {
  61639. c.urlParams_.Set("requestId", requestId)
  61640. return c
  61641. }
  61642. // Fields allows partial responses to be retrieved. See
  61643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61644. // for more information.
  61645. func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall {
  61646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61647. return c
  61648. }
  61649. // Context sets the context to be used in this call's Do method. Any
  61650. // pending HTTP request will be aborted if the provided context is
  61651. // canceled.
  61652. func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall {
  61653. c.ctx_ = ctx
  61654. return c
  61655. }
  61656. // Header returns an http.Header that can be modified by the caller to
  61657. // add HTTP headers to the request.
  61658. func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header {
  61659. if c.header_ == nil {
  61660. c.header_ = make(http.Header)
  61661. }
  61662. return c.header_
  61663. }
  61664. func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  61665. reqHeaders := make(http.Header)
  61666. for k, v := range c.header_ {
  61667. reqHeaders[k] = v
  61668. }
  61669. reqHeaders.Set("User-Agent", c.s.userAgent())
  61670. var body io.Reader = nil
  61671. c.urlParams_.Set("alt", alt)
  61672. c.urlParams_.Set("prettyPrint", "false")
  61673. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  61674. urls += "?" + c.urlParams_.Encode()
  61675. req, err := http.NewRequest("DELETE", urls, body)
  61676. if err != nil {
  61677. return nil, err
  61678. }
  61679. req.Header = reqHeaders
  61680. googleapi.Expand(req.URL, map[string]string{
  61681. "project": c.project,
  61682. "zone": c.zone,
  61683. "networkEndpointGroup": c.networkEndpointGroup,
  61684. })
  61685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61686. }
  61687. // Do executes the "compute.networkEndpointGroups.delete" call.
  61688. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61689. // status code is an error. Response headers are in either
  61690. // *Operation.ServerResponse.Header or (if a response was returned at
  61691. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61692. // to check whether the returned error was because
  61693. // http.StatusNotModified was returned.
  61694. func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61695. gensupport.SetOptions(c.urlParams_, opts...)
  61696. res, err := c.doRequest("json")
  61697. if res != nil && res.StatusCode == http.StatusNotModified {
  61698. if res.Body != nil {
  61699. res.Body.Close()
  61700. }
  61701. return nil, &googleapi.Error{
  61702. Code: res.StatusCode,
  61703. Header: res.Header,
  61704. }
  61705. }
  61706. if err != nil {
  61707. return nil, err
  61708. }
  61709. defer googleapi.CloseBody(res)
  61710. if err := googleapi.CheckResponse(res); err != nil {
  61711. return nil, err
  61712. }
  61713. ret := &Operation{
  61714. ServerResponse: googleapi.ServerResponse{
  61715. Header: res.Header,
  61716. HTTPStatusCode: res.StatusCode,
  61717. },
  61718. }
  61719. target := &ret
  61720. if err := gensupport.DecodeResponse(target, res); err != nil {
  61721. return nil, err
  61722. }
  61723. return ret, nil
  61724. // {
  61725. // "description": "Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it.",
  61726. // "httpMethod": "DELETE",
  61727. // "id": "compute.networkEndpointGroups.delete",
  61728. // "parameterOrder": [
  61729. // "project",
  61730. // "zone",
  61731. // "networkEndpointGroup"
  61732. // ],
  61733. // "parameters": {
  61734. // "networkEndpointGroup": {
  61735. // "description": "The name of the network endpoint group to delete. It should comply with RFC1035.",
  61736. // "location": "path",
  61737. // "required": true,
  61738. // "type": "string"
  61739. // },
  61740. // "project": {
  61741. // "description": "Project ID for this request.",
  61742. // "location": "path",
  61743. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61744. // "required": true,
  61745. // "type": "string"
  61746. // },
  61747. // "requestId": {
  61748. // "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).",
  61749. // "location": "query",
  61750. // "type": "string"
  61751. // },
  61752. // "zone": {
  61753. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  61754. // "location": "path",
  61755. // "required": true,
  61756. // "type": "string"
  61757. // }
  61758. // },
  61759. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  61760. // "response": {
  61761. // "$ref": "Operation"
  61762. // },
  61763. // "scopes": [
  61764. // "https://www.googleapis.com/auth/cloud-platform",
  61765. // "https://www.googleapis.com/auth/compute"
  61766. // ]
  61767. // }
  61768. }
  61769. // method id "compute.networkEndpointGroups.detachNetworkEndpoints":
  61770. type NetworkEndpointGroupsDetachNetworkEndpointsCall struct {
  61771. s *Service
  61772. project string
  61773. zone string
  61774. networkEndpointGroup string
  61775. networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest
  61776. urlParams_ gensupport.URLParams
  61777. ctx_ context.Context
  61778. header_ http.Header
  61779. }
  61780. // DetachNetworkEndpoints: Detach a list of network endpoints from the
  61781. // specified network endpoint group.
  61782. func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61783. c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61784. c.project = project
  61785. c.zone = zone
  61786. c.networkEndpointGroup = networkEndpointGroup
  61787. c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest
  61788. return c
  61789. }
  61790. // RequestId sets the optional parameter "requestId": An optional
  61791. // request ID to identify requests. Specify a unique request ID so that
  61792. // if you must retry your request, the server will know to ignore the
  61793. // request if it has already been completed.
  61794. //
  61795. // For example, consider a situation where you make an initial request
  61796. // and the request times out. If you make the request again with the
  61797. // same request ID, the server can check if original operation with the
  61798. // same request ID was received, and if so, will ignore the second
  61799. // request. This prevents clients from accidentally creating duplicate
  61800. // commitments.
  61801. //
  61802. // The request ID must be a valid UUID with the exception that zero UUID
  61803. // is not supported (00000000-0000-0000-0000-000000000000).
  61804. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61805. c.urlParams_.Set("requestId", requestId)
  61806. return c
  61807. }
  61808. // Fields allows partial responses to be retrieved. See
  61809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61810. // for more information.
  61811. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61813. return c
  61814. }
  61815. // Context sets the context to be used in this call's Do method. Any
  61816. // pending HTTP request will be aborted if the provided context is
  61817. // canceled.
  61818. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall {
  61819. c.ctx_ = ctx
  61820. return c
  61821. }
  61822. // Header returns an http.Header that can be modified by the caller to
  61823. // add HTTP headers to the request.
  61824. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header {
  61825. if c.header_ == nil {
  61826. c.header_ = make(http.Header)
  61827. }
  61828. return c.header_
  61829. }
  61830. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  61831. reqHeaders := make(http.Header)
  61832. for k, v := range c.header_ {
  61833. reqHeaders[k] = v
  61834. }
  61835. reqHeaders.Set("User-Agent", c.s.userAgent())
  61836. var body io.Reader = nil
  61837. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest)
  61838. if err != nil {
  61839. return nil, err
  61840. }
  61841. reqHeaders.Set("Content-Type", "application/json")
  61842. c.urlParams_.Set("alt", alt)
  61843. c.urlParams_.Set("prettyPrint", "false")
  61844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints")
  61845. urls += "?" + c.urlParams_.Encode()
  61846. req, err := http.NewRequest("POST", urls, body)
  61847. if err != nil {
  61848. return nil, err
  61849. }
  61850. req.Header = reqHeaders
  61851. googleapi.Expand(req.URL, map[string]string{
  61852. "project": c.project,
  61853. "zone": c.zone,
  61854. "networkEndpointGroup": c.networkEndpointGroup,
  61855. })
  61856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  61857. }
  61858. // Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call.
  61859. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  61860. // status code is an error. Response headers are in either
  61861. // *Operation.ServerResponse.Header or (if a response was returned at
  61862. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  61863. // to check whether the returned error was because
  61864. // http.StatusNotModified was returned.
  61865. func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  61866. gensupport.SetOptions(c.urlParams_, opts...)
  61867. res, err := c.doRequest("json")
  61868. if res != nil && res.StatusCode == http.StatusNotModified {
  61869. if res.Body != nil {
  61870. res.Body.Close()
  61871. }
  61872. return nil, &googleapi.Error{
  61873. Code: res.StatusCode,
  61874. Header: res.Header,
  61875. }
  61876. }
  61877. if err != nil {
  61878. return nil, err
  61879. }
  61880. defer googleapi.CloseBody(res)
  61881. if err := googleapi.CheckResponse(res); err != nil {
  61882. return nil, err
  61883. }
  61884. ret := &Operation{
  61885. ServerResponse: googleapi.ServerResponse{
  61886. Header: res.Header,
  61887. HTTPStatusCode: res.StatusCode,
  61888. },
  61889. }
  61890. target := &ret
  61891. if err := gensupport.DecodeResponse(target, res); err != nil {
  61892. return nil, err
  61893. }
  61894. return ret, nil
  61895. // {
  61896. // "description": "Detach a list of network endpoints from the specified network endpoint group.",
  61897. // "httpMethod": "POST",
  61898. // "id": "compute.networkEndpointGroups.detachNetworkEndpoints",
  61899. // "parameterOrder": [
  61900. // "project",
  61901. // "zone",
  61902. // "networkEndpointGroup"
  61903. // ],
  61904. // "parameters": {
  61905. // "networkEndpointGroup": {
  61906. // "description": "The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035.",
  61907. // "location": "path",
  61908. // "required": true,
  61909. // "type": "string"
  61910. // },
  61911. // "project": {
  61912. // "description": "Project ID for this request.",
  61913. // "location": "path",
  61914. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  61915. // "required": true,
  61916. // "type": "string"
  61917. // },
  61918. // "requestId": {
  61919. // "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).",
  61920. // "location": "query",
  61921. // "type": "string"
  61922. // },
  61923. // "zone": {
  61924. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  61925. // "location": "path",
  61926. // "required": true,
  61927. // "type": "string"
  61928. // }
  61929. // },
  61930. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints",
  61931. // "request": {
  61932. // "$ref": "NetworkEndpointGroupsDetachEndpointsRequest"
  61933. // },
  61934. // "response": {
  61935. // "$ref": "Operation"
  61936. // },
  61937. // "scopes": [
  61938. // "https://www.googleapis.com/auth/cloud-platform",
  61939. // "https://www.googleapis.com/auth/compute"
  61940. // ]
  61941. // }
  61942. }
  61943. // method id "compute.networkEndpointGroups.get":
  61944. type NetworkEndpointGroupsGetCall struct {
  61945. s *Service
  61946. project string
  61947. zone string
  61948. networkEndpointGroup string
  61949. urlParams_ gensupport.URLParams
  61950. ifNoneMatch_ string
  61951. ctx_ context.Context
  61952. header_ http.Header
  61953. }
  61954. // Get: Returns the specified network endpoint group. Gets a list of
  61955. // available network endpoint groups by making a list() request.
  61956. func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall {
  61957. c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  61958. c.project = project
  61959. c.zone = zone
  61960. c.networkEndpointGroup = networkEndpointGroup
  61961. return c
  61962. }
  61963. // Fields allows partial responses to be retrieved. See
  61964. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  61965. // for more information.
  61966. func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall {
  61967. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  61968. return c
  61969. }
  61970. // IfNoneMatch sets the optional parameter which makes the operation
  61971. // fail if the object's ETag matches the given value. This is useful for
  61972. // getting updates only after the object has changed since the last
  61973. // request. Use googleapi.IsNotModified to check whether the response
  61974. // error from Do is the result of In-None-Match.
  61975. func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall {
  61976. c.ifNoneMatch_ = entityTag
  61977. return c
  61978. }
  61979. // Context sets the context to be used in this call's Do method. Any
  61980. // pending HTTP request will be aborted if the provided context is
  61981. // canceled.
  61982. func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall {
  61983. c.ctx_ = ctx
  61984. return c
  61985. }
  61986. // Header returns an http.Header that can be modified by the caller to
  61987. // add HTTP headers to the request.
  61988. func (c *NetworkEndpointGroupsGetCall) Header() http.Header {
  61989. if c.header_ == nil {
  61990. c.header_ = make(http.Header)
  61991. }
  61992. return c.header_
  61993. }
  61994. func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  61995. reqHeaders := make(http.Header)
  61996. for k, v := range c.header_ {
  61997. reqHeaders[k] = v
  61998. }
  61999. reqHeaders.Set("User-Agent", c.s.userAgent())
  62000. if c.ifNoneMatch_ != "" {
  62001. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62002. }
  62003. var body io.Reader = nil
  62004. c.urlParams_.Set("alt", alt)
  62005. c.urlParams_.Set("prettyPrint", "false")
  62006. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}")
  62007. urls += "?" + c.urlParams_.Encode()
  62008. req, err := http.NewRequest("GET", urls, body)
  62009. if err != nil {
  62010. return nil, err
  62011. }
  62012. req.Header = reqHeaders
  62013. googleapi.Expand(req.URL, map[string]string{
  62014. "project": c.project,
  62015. "zone": c.zone,
  62016. "networkEndpointGroup": c.networkEndpointGroup,
  62017. })
  62018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62019. }
  62020. // Do executes the "compute.networkEndpointGroups.get" call.
  62021. // Exactly one of *NetworkEndpointGroup or error will be non-nil. Any
  62022. // non-2xx status code is an error. Response headers are in either
  62023. // *NetworkEndpointGroup.ServerResponse.Header or (if a response was
  62024. // returned at all) in error.(*googleapi.Error).Header. Use
  62025. // googleapi.IsNotModified to check whether the returned error was
  62026. // because http.StatusNotModified was returned.
  62027. func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) {
  62028. gensupport.SetOptions(c.urlParams_, opts...)
  62029. res, err := c.doRequest("json")
  62030. if res != nil && res.StatusCode == http.StatusNotModified {
  62031. if res.Body != nil {
  62032. res.Body.Close()
  62033. }
  62034. return nil, &googleapi.Error{
  62035. Code: res.StatusCode,
  62036. Header: res.Header,
  62037. }
  62038. }
  62039. if err != nil {
  62040. return nil, err
  62041. }
  62042. defer googleapi.CloseBody(res)
  62043. if err := googleapi.CheckResponse(res); err != nil {
  62044. return nil, err
  62045. }
  62046. ret := &NetworkEndpointGroup{
  62047. ServerResponse: googleapi.ServerResponse{
  62048. Header: res.Header,
  62049. HTTPStatusCode: res.StatusCode,
  62050. },
  62051. }
  62052. target := &ret
  62053. if err := gensupport.DecodeResponse(target, res); err != nil {
  62054. return nil, err
  62055. }
  62056. return ret, nil
  62057. // {
  62058. // "description": "Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.",
  62059. // "httpMethod": "GET",
  62060. // "id": "compute.networkEndpointGroups.get",
  62061. // "parameterOrder": [
  62062. // "project",
  62063. // "zone",
  62064. // "networkEndpointGroup"
  62065. // ],
  62066. // "parameters": {
  62067. // "networkEndpointGroup": {
  62068. // "description": "The name of the network endpoint group. It should comply with RFC1035.",
  62069. // "location": "path",
  62070. // "required": true,
  62071. // "type": "string"
  62072. // },
  62073. // "project": {
  62074. // "description": "Project ID for this request.",
  62075. // "location": "path",
  62076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62077. // "required": true,
  62078. // "type": "string"
  62079. // },
  62080. // "zone": {
  62081. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  62082. // "location": "path",
  62083. // "required": true,
  62084. // "type": "string"
  62085. // }
  62086. // },
  62087. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}",
  62088. // "response": {
  62089. // "$ref": "NetworkEndpointGroup"
  62090. // },
  62091. // "scopes": [
  62092. // "https://www.googleapis.com/auth/cloud-platform",
  62093. // "https://www.googleapis.com/auth/compute",
  62094. // "https://www.googleapis.com/auth/compute.readonly"
  62095. // ]
  62096. // }
  62097. }
  62098. // method id "compute.networkEndpointGroups.insert":
  62099. type NetworkEndpointGroupsInsertCall struct {
  62100. s *Service
  62101. project string
  62102. zone string
  62103. networkendpointgroup *NetworkEndpointGroup
  62104. urlParams_ gensupport.URLParams
  62105. ctx_ context.Context
  62106. header_ http.Header
  62107. }
  62108. // Insert: Creates a network endpoint group in the specified project
  62109. // using the parameters that are included in the request.
  62110. func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall {
  62111. c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62112. c.project = project
  62113. c.zone = zone
  62114. c.networkendpointgroup = networkendpointgroup
  62115. return c
  62116. }
  62117. // RequestId sets the optional parameter "requestId": An optional
  62118. // request ID to identify requests. Specify a unique request ID so that
  62119. // if you must retry your request, the server will know to ignore the
  62120. // request if it has already been completed.
  62121. //
  62122. // For example, consider a situation where you make an initial request
  62123. // and the request times out. If you make the request again with the
  62124. // same request ID, the server can check if original operation with the
  62125. // same request ID was received, and if so, will ignore the second
  62126. // request. This prevents clients from accidentally creating duplicate
  62127. // commitments.
  62128. //
  62129. // The request ID must be a valid UUID with the exception that zero UUID
  62130. // is not supported (00000000-0000-0000-0000-000000000000).
  62131. func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall {
  62132. c.urlParams_.Set("requestId", requestId)
  62133. return c
  62134. }
  62135. // Fields allows partial responses to be retrieved. See
  62136. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62137. // for more information.
  62138. func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall {
  62139. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62140. return c
  62141. }
  62142. // Context sets the context to be used in this call's Do method. Any
  62143. // pending HTTP request will be aborted if the provided context is
  62144. // canceled.
  62145. func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall {
  62146. c.ctx_ = ctx
  62147. return c
  62148. }
  62149. // Header returns an http.Header that can be modified by the caller to
  62150. // add HTTP headers to the request.
  62151. func (c *NetworkEndpointGroupsInsertCall) Header() http.Header {
  62152. if c.header_ == nil {
  62153. c.header_ = make(http.Header)
  62154. }
  62155. return c.header_
  62156. }
  62157. func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  62158. reqHeaders := make(http.Header)
  62159. for k, v := range c.header_ {
  62160. reqHeaders[k] = v
  62161. }
  62162. reqHeaders.Set("User-Agent", c.s.userAgent())
  62163. var body io.Reader = nil
  62164. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup)
  62165. if err != nil {
  62166. return nil, err
  62167. }
  62168. reqHeaders.Set("Content-Type", "application/json")
  62169. c.urlParams_.Set("alt", alt)
  62170. c.urlParams_.Set("prettyPrint", "false")
  62171. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  62172. urls += "?" + c.urlParams_.Encode()
  62173. req, err := http.NewRequest("POST", urls, body)
  62174. if err != nil {
  62175. return nil, err
  62176. }
  62177. req.Header = reqHeaders
  62178. googleapi.Expand(req.URL, map[string]string{
  62179. "project": c.project,
  62180. "zone": c.zone,
  62181. })
  62182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62183. }
  62184. // Do executes the "compute.networkEndpointGroups.insert" call.
  62185. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  62186. // status code is an error. Response headers are in either
  62187. // *Operation.ServerResponse.Header or (if a response was returned at
  62188. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  62189. // to check whether the returned error was because
  62190. // http.StatusNotModified was returned.
  62191. func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  62192. gensupport.SetOptions(c.urlParams_, opts...)
  62193. res, err := c.doRequest("json")
  62194. if res != nil && res.StatusCode == http.StatusNotModified {
  62195. if res.Body != nil {
  62196. res.Body.Close()
  62197. }
  62198. return nil, &googleapi.Error{
  62199. Code: res.StatusCode,
  62200. Header: res.Header,
  62201. }
  62202. }
  62203. if err != nil {
  62204. return nil, err
  62205. }
  62206. defer googleapi.CloseBody(res)
  62207. if err := googleapi.CheckResponse(res); err != nil {
  62208. return nil, err
  62209. }
  62210. ret := &Operation{
  62211. ServerResponse: googleapi.ServerResponse{
  62212. Header: res.Header,
  62213. HTTPStatusCode: res.StatusCode,
  62214. },
  62215. }
  62216. target := &ret
  62217. if err := gensupport.DecodeResponse(target, res); err != nil {
  62218. return nil, err
  62219. }
  62220. return ret, nil
  62221. // {
  62222. // "description": "Creates a network endpoint group in the specified project using the parameters that are included in the request.",
  62223. // "httpMethod": "POST",
  62224. // "id": "compute.networkEndpointGroups.insert",
  62225. // "parameterOrder": [
  62226. // "project",
  62227. // "zone"
  62228. // ],
  62229. // "parameters": {
  62230. // "project": {
  62231. // "description": "Project ID for this request.",
  62232. // "location": "path",
  62233. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62234. // "required": true,
  62235. // "type": "string"
  62236. // },
  62237. // "requestId": {
  62238. // "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).",
  62239. // "location": "query",
  62240. // "type": "string"
  62241. // },
  62242. // "zone": {
  62243. // "description": "The name of the zone where you want to create the network endpoint group. It should comply with RFC1035.",
  62244. // "location": "path",
  62245. // "required": true,
  62246. // "type": "string"
  62247. // }
  62248. // },
  62249. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  62250. // "request": {
  62251. // "$ref": "NetworkEndpointGroup"
  62252. // },
  62253. // "response": {
  62254. // "$ref": "Operation"
  62255. // },
  62256. // "scopes": [
  62257. // "https://www.googleapis.com/auth/cloud-platform",
  62258. // "https://www.googleapis.com/auth/compute"
  62259. // ]
  62260. // }
  62261. }
  62262. // method id "compute.networkEndpointGroups.list":
  62263. type NetworkEndpointGroupsListCall struct {
  62264. s *Service
  62265. project string
  62266. zone string
  62267. urlParams_ gensupport.URLParams
  62268. ifNoneMatch_ string
  62269. ctx_ context.Context
  62270. header_ http.Header
  62271. }
  62272. // List: Retrieves the list of network endpoint groups that are located
  62273. // in the specified project and zone.
  62274. func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall {
  62275. c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62276. c.project = project
  62277. c.zone = zone
  62278. return c
  62279. }
  62280. // Filter sets the optional parameter "filter": A filter expression that
  62281. // filters resources listed in the response. The expression must specify
  62282. // the field name, a comparison operator, and the value that you want to
  62283. // use for filtering. The value must be a string, a number, or a
  62284. // boolean. The comparison operator must be either =, !=, >, or <.
  62285. //
  62286. // For example, if you are filtering Compute Engine instances, you can
  62287. // exclude instances named example-instance by specifying name !=
  62288. // example-instance.
  62289. //
  62290. // You can also filter nested fields. For example, you could specify
  62291. // scheduling.automaticRestart = false to include instances only if they
  62292. // are not scheduled for automatic restarts. You can use filtering on
  62293. // nested fields to filter based on resource labels.
  62294. //
  62295. // To filter on multiple expressions, provide each separate expression
  62296. // within parentheses. For example, (scheduling.automaticRestart = true)
  62297. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62298. // AND expression. However, you can include AND and OR expressions
  62299. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62300. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62301. // true).
  62302. func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall {
  62303. c.urlParams_.Set("filter", filter)
  62304. return c
  62305. }
  62306. // MaxResults sets the optional parameter "maxResults": The maximum
  62307. // number of results per page that should be returned. If the number of
  62308. // available results is larger than maxResults, Compute Engine returns a
  62309. // nextPageToken that can be used to get the next page of results in
  62310. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62311. // (Default: 500)
  62312. func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall {
  62313. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62314. return c
  62315. }
  62316. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62317. // a certain order. By default, results are returned in alphanumerical
  62318. // order based on the resource name.
  62319. //
  62320. // You can also sort results in descending order based on the creation
  62321. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62322. // based on the creationTimestamp field in reverse chronological order
  62323. // (newest result first). Use this to sort resources like operations so
  62324. // that the newest operation is returned first.
  62325. //
  62326. // Currently, only sorting by name or creationTimestamp desc is
  62327. // supported.
  62328. func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall {
  62329. c.urlParams_.Set("orderBy", orderBy)
  62330. return c
  62331. }
  62332. // PageToken sets the optional parameter "pageToken": Specifies a page
  62333. // token to use. Set pageToken to the nextPageToken returned by a
  62334. // previous list request to get the next page of results.
  62335. func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall {
  62336. c.urlParams_.Set("pageToken", pageToken)
  62337. return c
  62338. }
  62339. // Fields allows partial responses to be retrieved. See
  62340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62341. // for more information.
  62342. func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall {
  62343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62344. return c
  62345. }
  62346. // IfNoneMatch sets the optional parameter which makes the operation
  62347. // fail if the object's ETag matches the given value. This is useful for
  62348. // getting updates only after the object has changed since the last
  62349. // request. Use googleapi.IsNotModified to check whether the response
  62350. // error from Do is the result of In-None-Match.
  62351. func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall {
  62352. c.ifNoneMatch_ = entityTag
  62353. return c
  62354. }
  62355. // Context sets the context to be used in this call's Do method. Any
  62356. // pending HTTP request will be aborted if the provided context is
  62357. // canceled.
  62358. func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall {
  62359. c.ctx_ = ctx
  62360. return c
  62361. }
  62362. // Header returns an http.Header that can be modified by the caller to
  62363. // add HTTP headers to the request.
  62364. func (c *NetworkEndpointGroupsListCall) Header() http.Header {
  62365. if c.header_ == nil {
  62366. c.header_ = make(http.Header)
  62367. }
  62368. return c.header_
  62369. }
  62370. func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) {
  62371. reqHeaders := make(http.Header)
  62372. for k, v := range c.header_ {
  62373. reqHeaders[k] = v
  62374. }
  62375. reqHeaders.Set("User-Agent", c.s.userAgent())
  62376. if c.ifNoneMatch_ != "" {
  62377. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  62378. }
  62379. var body io.Reader = nil
  62380. c.urlParams_.Set("alt", alt)
  62381. c.urlParams_.Set("prettyPrint", "false")
  62382. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups")
  62383. urls += "?" + c.urlParams_.Encode()
  62384. req, err := http.NewRequest("GET", urls, body)
  62385. if err != nil {
  62386. return nil, err
  62387. }
  62388. req.Header = reqHeaders
  62389. googleapi.Expand(req.URL, map[string]string{
  62390. "project": c.project,
  62391. "zone": c.zone,
  62392. })
  62393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62394. }
  62395. // Do executes the "compute.networkEndpointGroups.list" call.
  62396. // Exactly one of *NetworkEndpointGroupList or error will be non-nil.
  62397. // Any non-2xx status code is an error. Response headers are in either
  62398. // *NetworkEndpointGroupList.ServerResponse.Header or (if a response was
  62399. // returned at all) in error.(*googleapi.Error).Header. Use
  62400. // googleapi.IsNotModified to check whether the returned error was
  62401. // because http.StatusNotModified was returned.
  62402. func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) {
  62403. gensupport.SetOptions(c.urlParams_, opts...)
  62404. res, err := c.doRequest("json")
  62405. if res != nil && res.StatusCode == http.StatusNotModified {
  62406. if res.Body != nil {
  62407. res.Body.Close()
  62408. }
  62409. return nil, &googleapi.Error{
  62410. Code: res.StatusCode,
  62411. Header: res.Header,
  62412. }
  62413. }
  62414. if err != nil {
  62415. return nil, err
  62416. }
  62417. defer googleapi.CloseBody(res)
  62418. if err := googleapi.CheckResponse(res); err != nil {
  62419. return nil, err
  62420. }
  62421. ret := &NetworkEndpointGroupList{
  62422. ServerResponse: googleapi.ServerResponse{
  62423. Header: res.Header,
  62424. HTTPStatusCode: res.StatusCode,
  62425. },
  62426. }
  62427. target := &ret
  62428. if err := gensupport.DecodeResponse(target, res); err != nil {
  62429. return nil, err
  62430. }
  62431. return ret, nil
  62432. // {
  62433. // "description": "Retrieves the list of network endpoint groups that are located in the specified project and zone.",
  62434. // "httpMethod": "GET",
  62435. // "id": "compute.networkEndpointGroups.list",
  62436. // "parameterOrder": [
  62437. // "project",
  62438. // "zone"
  62439. // ],
  62440. // "parameters": {
  62441. // "filter": {
  62442. // "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).",
  62443. // "location": "query",
  62444. // "type": "string"
  62445. // },
  62446. // "maxResults": {
  62447. // "default": "500",
  62448. // "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)",
  62449. // "format": "uint32",
  62450. // "location": "query",
  62451. // "minimum": "0",
  62452. // "type": "integer"
  62453. // },
  62454. // "orderBy": {
  62455. // "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.",
  62456. // "location": "query",
  62457. // "type": "string"
  62458. // },
  62459. // "pageToken": {
  62460. // "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.",
  62461. // "location": "query",
  62462. // "type": "string"
  62463. // },
  62464. // "project": {
  62465. // "description": "Project ID for this request.",
  62466. // "location": "path",
  62467. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62468. // "required": true,
  62469. // "type": "string"
  62470. // },
  62471. // "zone": {
  62472. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  62473. // "location": "path",
  62474. // "required": true,
  62475. // "type": "string"
  62476. // }
  62477. // },
  62478. // "path": "{project}/zones/{zone}/networkEndpointGroups",
  62479. // "response": {
  62480. // "$ref": "NetworkEndpointGroupList"
  62481. // },
  62482. // "scopes": [
  62483. // "https://www.googleapis.com/auth/cloud-platform",
  62484. // "https://www.googleapis.com/auth/compute",
  62485. // "https://www.googleapis.com/auth/compute.readonly"
  62486. // ]
  62487. // }
  62488. }
  62489. // Pages invokes f for each page of results.
  62490. // A non-nil error returned from f will halt the iteration.
  62491. // The provided context supersedes any context provided to the Context method.
  62492. func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error {
  62493. c.ctx_ = ctx
  62494. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62495. for {
  62496. x, err := c.Do()
  62497. if err != nil {
  62498. return err
  62499. }
  62500. if err := f(x); err != nil {
  62501. return err
  62502. }
  62503. if x.NextPageToken == "" {
  62504. return nil
  62505. }
  62506. c.PageToken(x.NextPageToken)
  62507. }
  62508. }
  62509. // method id "compute.networkEndpointGroups.listNetworkEndpoints":
  62510. type NetworkEndpointGroupsListNetworkEndpointsCall struct {
  62511. s *Service
  62512. project string
  62513. zone string
  62514. networkEndpointGroup string
  62515. networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest
  62516. urlParams_ gensupport.URLParams
  62517. ctx_ context.Context
  62518. header_ http.Header
  62519. }
  62520. // ListNetworkEndpoints: Lists the network endpoints in the specified
  62521. // network endpoint group.
  62522. func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62523. c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62524. c.project = project
  62525. c.zone = zone
  62526. c.networkEndpointGroup = networkEndpointGroup
  62527. c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest
  62528. return c
  62529. }
  62530. // Filter sets the optional parameter "filter": A filter expression that
  62531. // filters resources listed in the response. The expression must specify
  62532. // the field name, a comparison operator, and the value that you want to
  62533. // use for filtering. The value must be a string, a number, or a
  62534. // boolean. The comparison operator must be either =, !=, >, or <.
  62535. //
  62536. // For example, if you are filtering Compute Engine instances, you can
  62537. // exclude instances named example-instance by specifying name !=
  62538. // example-instance.
  62539. //
  62540. // You can also filter nested fields. For example, you could specify
  62541. // scheduling.automaticRestart = false to include instances only if they
  62542. // are not scheduled for automatic restarts. You can use filtering on
  62543. // nested fields to filter based on resource labels.
  62544. //
  62545. // To filter on multiple expressions, provide each separate expression
  62546. // within parentheses. For example, (scheduling.automaticRestart = true)
  62547. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  62548. // AND expression. However, you can include AND and OR expressions
  62549. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  62550. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  62551. // true).
  62552. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62553. c.urlParams_.Set("filter", filter)
  62554. return c
  62555. }
  62556. // MaxResults sets the optional parameter "maxResults": The maximum
  62557. // number of results per page that should be returned. If the number of
  62558. // available results is larger than maxResults, Compute Engine returns a
  62559. // nextPageToken that can be used to get the next page of results in
  62560. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  62561. // (Default: 500)
  62562. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62563. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  62564. return c
  62565. }
  62566. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  62567. // a certain order. By default, results are returned in alphanumerical
  62568. // order based on the resource name.
  62569. //
  62570. // You can also sort results in descending order based on the creation
  62571. // timestamp using orderBy="creationTimestamp desc". This sorts results
  62572. // based on the creationTimestamp field in reverse chronological order
  62573. // (newest result first). Use this to sort resources like operations so
  62574. // that the newest operation is returned first.
  62575. //
  62576. // Currently, only sorting by name or creationTimestamp desc is
  62577. // supported.
  62578. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62579. c.urlParams_.Set("orderBy", orderBy)
  62580. return c
  62581. }
  62582. // PageToken sets the optional parameter "pageToken": Specifies a page
  62583. // token to use. Set pageToken to the nextPageToken returned by a
  62584. // previous list request to get the next page of results.
  62585. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62586. c.urlParams_.Set("pageToken", pageToken)
  62587. return c
  62588. }
  62589. // Fields allows partial responses to be retrieved. See
  62590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62591. // for more information.
  62592. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62594. return c
  62595. }
  62596. // Context sets the context to be used in this call's Do method. Any
  62597. // pending HTTP request will be aborted if the provided context is
  62598. // canceled.
  62599. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall {
  62600. c.ctx_ = ctx
  62601. return c
  62602. }
  62603. // Header returns an http.Header that can be modified by the caller to
  62604. // add HTTP headers to the request.
  62605. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header {
  62606. if c.header_ == nil {
  62607. c.header_ = make(http.Header)
  62608. }
  62609. return c.header_
  62610. }
  62611. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) {
  62612. reqHeaders := make(http.Header)
  62613. for k, v := range c.header_ {
  62614. reqHeaders[k] = v
  62615. }
  62616. reqHeaders.Set("User-Agent", c.s.userAgent())
  62617. var body io.Reader = nil
  62618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest)
  62619. if err != nil {
  62620. return nil, err
  62621. }
  62622. reqHeaders.Set("Content-Type", "application/json")
  62623. c.urlParams_.Set("alt", alt)
  62624. c.urlParams_.Set("prettyPrint", "false")
  62625. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints")
  62626. urls += "?" + c.urlParams_.Encode()
  62627. req, err := http.NewRequest("POST", urls, body)
  62628. if err != nil {
  62629. return nil, err
  62630. }
  62631. req.Header = reqHeaders
  62632. googleapi.Expand(req.URL, map[string]string{
  62633. "project": c.project,
  62634. "zone": c.zone,
  62635. "networkEndpointGroup": c.networkEndpointGroup,
  62636. })
  62637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62638. }
  62639. // Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call.
  62640. // Exactly one of *NetworkEndpointGroupsListNetworkEndpoints or error
  62641. // will be non-nil. Any non-2xx status code is an error. Response
  62642. // headers are in either
  62643. // *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or
  62644. // (if a response was returned at all) in
  62645. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  62646. // whether the returned error was because http.StatusNotModified was
  62647. // returned.
  62648. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) {
  62649. gensupport.SetOptions(c.urlParams_, opts...)
  62650. res, err := c.doRequest("json")
  62651. if res != nil && res.StatusCode == http.StatusNotModified {
  62652. if res.Body != nil {
  62653. res.Body.Close()
  62654. }
  62655. return nil, &googleapi.Error{
  62656. Code: res.StatusCode,
  62657. Header: res.Header,
  62658. }
  62659. }
  62660. if err != nil {
  62661. return nil, err
  62662. }
  62663. defer googleapi.CloseBody(res)
  62664. if err := googleapi.CheckResponse(res); err != nil {
  62665. return nil, err
  62666. }
  62667. ret := &NetworkEndpointGroupsListNetworkEndpoints{
  62668. ServerResponse: googleapi.ServerResponse{
  62669. Header: res.Header,
  62670. HTTPStatusCode: res.StatusCode,
  62671. },
  62672. }
  62673. target := &ret
  62674. if err := gensupport.DecodeResponse(target, res); err != nil {
  62675. return nil, err
  62676. }
  62677. return ret, nil
  62678. // {
  62679. // "description": "Lists the network endpoints in the specified network endpoint group.",
  62680. // "httpMethod": "POST",
  62681. // "id": "compute.networkEndpointGroups.listNetworkEndpoints",
  62682. // "parameterOrder": [
  62683. // "project",
  62684. // "zone",
  62685. // "networkEndpointGroup"
  62686. // ],
  62687. // "parameters": {
  62688. // "filter": {
  62689. // "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).",
  62690. // "location": "query",
  62691. // "type": "string"
  62692. // },
  62693. // "maxResults": {
  62694. // "default": "500",
  62695. // "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)",
  62696. // "format": "uint32",
  62697. // "location": "query",
  62698. // "minimum": "0",
  62699. // "type": "integer"
  62700. // },
  62701. // "networkEndpointGroup": {
  62702. // "description": "The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035.",
  62703. // "location": "path",
  62704. // "required": true,
  62705. // "type": "string"
  62706. // },
  62707. // "orderBy": {
  62708. // "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.",
  62709. // "location": "query",
  62710. // "type": "string"
  62711. // },
  62712. // "pageToken": {
  62713. // "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.",
  62714. // "location": "query",
  62715. // "type": "string"
  62716. // },
  62717. // "project": {
  62718. // "description": "Project ID for this request.",
  62719. // "location": "path",
  62720. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62721. // "required": true,
  62722. // "type": "string"
  62723. // },
  62724. // "zone": {
  62725. // "description": "The name of the zone where the network endpoint group is located. It should comply with RFC1035.",
  62726. // "location": "path",
  62727. // "required": true,
  62728. // "type": "string"
  62729. // }
  62730. // },
  62731. // "path": "{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints",
  62732. // "request": {
  62733. // "$ref": "NetworkEndpointGroupsListEndpointsRequest"
  62734. // },
  62735. // "response": {
  62736. // "$ref": "NetworkEndpointGroupsListNetworkEndpoints"
  62737. // },
  62738. // "scopes": [
  62739. // "https://www.googleapis.com/auth/cloud-platform",
  62740. // "https://www.googleapis.com/auth/compute",
  62741. // "https://www.googleapis.com/auth/compute.readonly"
  62742. // ]
  62743. // }
  62744. }
  62745. // Pages invokes f for each page of results.
  62746. // A non-nil error returned from f will halt the iteration.
  62747. // The provided context supersedes any context provided to the Context method.
  62748. func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error {
  62749. c.ctx_ = ctx
  62750. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  62751. for {
  62752. x, err := c.Do()
  62753. if err != nil {
  62754. return err
  62755. }
  62756. if err := f(x); err != nil {
  62757. return err
  62758. }
  62759. if x.NextPageToken == "" {
  62760. return nil
  62761. }
  62762. c.PageToken(x.NextPageToken)
  62763. }
  62764. }
  62765. // method id "compute.networkEndpointGroups.testIamPermissions":
  62766. type NetworkEndpointGroupsTestIamPermissionsCall struct {
  62767. s *Service
  62768. project string
  62769. zone string
  62770. resource string
  62771. testpermissionsrequest *TestPermissionsRequest
  62772. urlParams_ gensupport.URLParams
  62773. ctx_ context.Context
  62774. header_ http.Header
  62775. }
  62776. // TestIamPermissions: Returns permissions that a caller has on the
  62777. // specified resource.
  62778. func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall {
  62779. c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62780. c.project = project
  62781. c.zone = zone
  62782. c.resource = resource
  62783. c.testpermissionsrequest = testpermissionsrequest
  62784. return c
  62785. }
  62786. // Fields allows partial responses to be retrieved. See
  62787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62788. // for more information.
  62789. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall {
  62790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62791. return c
  62792. }
  62793. // Context sets the context to be used in this call's Do method. Any
  62794. // pending HTTP request will be aborted if the provided context is
  62795. // canceled.
  62796. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall {
  62797. c.ctx_ = ctx
  62798. return c
  62799. }
  62800. // Header returns an http.Header that can be modified by the caller to
  62801. // add HTTP headers to the request.
  62802. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header {
  62803. if c.header_ == nil {
  62804. c.header_ = make(http.Header)
  62805. }
  62806. return c.header_
  62807. }
  62808. func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  62809. reqHeaders := make(http.Header)
  62810. for k, v := range c.header_ {
  62811. reqHeaders[k] = v
  62812. }
  62813. reqHeaders.Set("User-Agent", c.s.userAgent())
  62814. var body io.Reader = nil
  62815. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  62816. if err != nil {
  62817. return nil, err
  62818. }
  62819. reqHeaders.Set("Content-Type", "application/json")
  62820. c.urlParams_.Set("alt", alt)
  62821. c.urlParams_.Set("prettyPrint", "false")
  62822. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions")
  62823. urls += "?" + c.urlParams_.Encode()
  62824. req, err := http.NewRequest("POST", urls, body)
  62825. if err != nil {
  62826. return nil, err
  62827. }
  62828. req.Header = reqHeaders
  62829. googleapi.Expand(req.URL, map[string]string{
  62830. "project": c.project,
  62831. "zone": c.zone,
  62832. "resource": c.resource,
  62833. })
  62834. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  62835. }
  62836. // Do executes the "compute.networkEndpointGroups.testIamPermissions" call.
  62837. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  62838. // non-2xx status code is an error. Response headers are in either
  62839. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  62840. // returned at all) in error.(*googleapi.Error).Header. Use
  62841. // googleapi.IsNotModified to check whether the returned error was
  62842. // because http.StatusNotModified was returned.
  62843. func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  62844. gensupport.SetOptions(c.urlParams_, opts...)
  62845. res, err := c.doRequest("json")
  62846. if res != nil && res.StatusCode == http.StatusNotModified {
  62847. if res.Body != nil {
  62848. res.Body.Close()
  62849. }
  62850. return nil, &googleapi.Error{
  62851. Code: res.StatusCode,
  62852. Header: res.Header,
  62853. }
  62854. }
  62855. if err != nil {
  62856. return nil, err
  62857. }
  62858. defer googleapi.CloseBody(res)
  62859. if err := googleapi.CheckResponse(res); err != nil {
  62860. return nil, err
  62861. }
  62862. ret := &TestPermissionsResponse{
  62863. ServerResponse: googleapi.ServerResponse{
  62864. Header: res.Header,
  62865. HTTPStatusCode: res.StatusCode,
  62866. },
  62867. }
  62868. target := &ret
  62869. if err := gensupport.DecodeResponse(target, res); err != nil {
  62870. return nil, err
  62871. }
  62872. return ret, nil
  62873. // {
  62874. // "description": "Returns permissions that a caller has on the specified resource.",
  62875. // "httpMethod": "POST",
  62876. // "id": "compute.networkEndpointGroups.testIamPermissions",
  62877. // "parameterOrder": [
  62878. // "project",
  62879. // "zone",
  62880. // "resource"
  62881. // ],
  62882. // "parameters": {
  62883. // "project": {
  62884. // "description": "Project ID for this request.",
  62885. // "location": "path",
  62886. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  62887. // "required": true,
  62888. // "type": "string"
  62889. // },
  62890. // "resource": {
  62891. // "description": "Name or id of the resource for this request.",
  62892. // "location": "path",
  62893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  62894. // "required": true,
  62895. // "type": "string"
  62896. // },
  62897. // "zone": {
  62898. // "description": "The name of the zone for this request.",
  62899. // "location": "path",
  62900. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  62901. // "required": true,
  62902. // "type": "string"
  62903. // }
  62904. // },
  62905. // "path": "{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions",
  62906. // "request": {
  62907. // "$ref": "TestPermissionsRequest"
  62908. // },
  62909. // "response": {
  62910. // "$ref": "TestPermissionsResponse"
  62911. // },
  62912. // "scopes": [
  62913. // "https://www.googleapis.com/auth/cloud-platform",
  62914. // "https://www.googleapis.com/auth/compute",
  62915. // "https://www.googleapis.com/auth/compute.readonly"
  62916. // ]
  62917. // }
  62918. }
  62919. // method id "compute.networks.addPeering":
  62920. type NetworksAddPeeringCall struct {
  62921. s *Service
  62922. project string
  62923. network string
  62924. networksaddpeeringrequest *NetworksAddPeeringRequest
  62925. urlParams_ gensupport.URLParams
  62926. ctx_ context.Context
  62927. header_ http.Header
  62928. }
  62929. // AddPeering: Adds a peering to the specified network.
  62930. func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall {
  62931. c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  62932. c.project = project
  62933. c.network = network
  62934. c.networksaddpeeringrequest = networksaddpeeringrequest
  62935. return c
  62936. }
  62937. // RequestId sets the optional parameter "requestId": An optional
  62938. // request ID to identify requests. Specify a unique request ID so that
  62939. // if you must retry your request, the server will know to ignore the
  62940. // request if it has already been completed.
  62941. //
  62942. // For example, consider a situation where you make an initial request
  62943. // and the request times out. If you make the request again with the
  62944. // same request ID, the server can check if original operation with the
  62945. // same request ID was received, and if so, will ignore the second
  62946. // request. This prevents clients from accidentally creating duplicate
  62947. // commitments.
  62948. //
  62949. // The request ID must be a valid UUID with the exception that zero UUID
  62950. // is not supported (00000000-0000-0000-0000-000000000000).
  62951. func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall {
  62952. c.urlParams_.Set("requestId", requestId)
  62953. return c
  62954. }
  62955. // Fields allows partial responses to be retrieved. See
  62956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  62957. // for more information.
  62958. func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall {
  62959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  62960. return c
  62961. }
  62962. // Context sets the context to be used in this call's Do method. Any
  62963. // pending HTTP request will be aborted if the provided context is
  62964. // canceled.
  62965. func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall {
  62966. c.ctx_ = ctx
  62967. return c
  62968. }
  62969. // Header returns an http.Header that can be modified by the caller to
  62970. // add HTTP headers to the request.
  62971. func (c *NetworksAddPeeringCall) Header() http.Header {
  62972. if c.header_ == nil {
  62973. c.header_ = make(http.Header)
  62974. }
  62975. return c.header_
  62976. }
  62977. func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) {
  62978. reqHeaders := make(http.Header)
  62979. for k, v := range c.header_ {
  62980. reqHeaders[k] = v
  62981. }
  62982. reqHeaders.Set("User-Agent", c.s.userAgent())
  62983. var body io.Reader = nil
  62984. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest)
  62985. if err != nil {
  62986. return nil, err
  62987. }
  62988. reqHeaders.Set("Content-Type", "application/json")
  62989. c.urlParams_.Set("alt", alt)
  62990. c.urlParams_.Set("prettyPrint", "false")
  62991. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/addPeering")
  62992. urls += "?" + c.urlParams_.Encode()
  62993. req, err := http.NewRequest("POST", urls, body)
  62994. if err != nil {
  62995. return nil, err
  62996. }
  62997. req.Header = reqHeaders
  62998. googleapi.Expand(req.URL, map[string]string{
  62999. "project": c.project,
  63000. "network": c.network,
  63001. })
  63002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63003. }
  63004. // Do executes the "compute.networks.addPeering" call.
  63005. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63006. // status code is an error. Response headers are in either
  63007. // *Operation.ServerResponse.Header or (if a response was returned at
  63008. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63009. // to check whether the returned error was because
  63010. // http.StatusNotModified was returned.
  63011. func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63012. gensupport.SetOptions(c.urlParams_, opts...)
  63013. res, err := c.doRequest("json")
  63014. if res != nil && res.StatusCode == http.StatusNotModified {
  63015. if res.Body != nil {
  63016. res.Body.Close()
  63017. }
  63018. return nil, &googleapi.Error{
  63019. Code: res.StatusCode,
  63020. Header: res.Header,
  63021. }
  63022. }
  63023. if err != nil {
  63024. return nil, err
  63025. }
  63026. defer googleapi.CloseBody(res)
  63027. if err := googleapi.CheckResponse(res); err != nil {
  63028. return nil, err
  63029. }
  63030. ret := &Operation{
  63031. ServerResponse: googleapi.ServerResponse{
  63032. Header: res.Header,
  63033. HTTPStatusCode: res.StatusCode,
  63034. },
  63035. }
  63036. target := &ret
  63037. if err := gensupport.DecodeResponse(target, res); err != nil {
  63038. return nil, err
  63039. }
  63040. return ret, nil
  63041. // {
  63042. // "description": "Adds a peering to the specified network.",
  63043. // "httpMethod": "POST",
  63044. // "id": "compute.networks.addPeering",
  63045. // "parameterOrder": [
  63046. // "project",
  63047. // "network"
  63048. // ],
  63049. // "parameters": {
  63050. // "network": {
  63051. // "description": "Name of the network resource to add peering to.",
  63052. // "location": "path",
  63053. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63054. // "required": true,
  63055. // "type": "string"
  63056. // },
  63057. // "project": {
  63058. // "description": "Project ID for this request.",
  63059. // "location": "path",
  63060. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63061. // "required": true,
  63062. // "type": "string"
  63063. // },
  63064. // "requestId": {
  63065. // "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).",
  63066. // "location": "query",
  63067. // "type": "string"
  63068. // }
  63069. // },
  63070. // "path": "{project}/global/networks/{network}/addPeering",
  63071. // "request": {
  63072. // "$ref": "NetworksAddPeeringRequest"
  63073. // },
  63074. // "response": {
  63075. // "$ref": "Operation"
  63076. // },
  63077. // "scopes": [
  63078. // "https://www.googleapis.com/auth/cloud-platform",
  63079. // "https://www.googleapis.com/auth/compute"
  63080. // ]
  63081. // }
  63082. }
  63083. // method id "compute.networks.delete":
  63084. type NetworksDeleteCall struct {
  63085. s *Service
  63086. project string
  63087. network string
  63088. urlParams_ gensupport.URLParams
  63089. ctx_ context.Context
  63090. header_ http.Header
  63091. }
  63092. // Delete: Deletes the specified network.
  63093. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete
  63094. func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall {
  63095. c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63096. c.project = project
  63097. c.network = network
  63098. return c
  63099. }
  63100. // RequestId sets the optional parameter "requestId": An optional
  63101. // request ID to identify requests. Specify a unique request ID so that
  63102. // if you must retry your request, the server will know to ignore the
  63103. // request if it has already been completed.
  63104. //
  63105. // For example, consider a situation where you make an initial request
  63106. // and the request times out. If you make the request again with the
  63107. // same request ID, the server can check if original operation with the
  63108. // same request ID was received, and if so, will ignore the second
  63109. // request. This prevents clients from accidentally creating duplicate
  63110. // commitments.
  63111. //
  63112. // The request ID must be a valid UUID with the exception that zero UUID
  63113. // is not supported (00000000-0000-0000-0000-000000000000).
  63114. func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall {
  63115. c.urlParams_.Set("requestId", requestId)
  63116. return c
  63117. }
  63118. // Fields allows partial responses to be retrieved. See
  63119. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63120. // for more information.
  63121. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall {
  63122. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63123. return c
  63124. }
  63125. // Context sets the context to be used in this call's Do method. Any
  63126. // pending HTTP request will be aborted if the provided context is
  63127. // canceled.
  63128. func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall {
  63129. c.ctx_ = ctx
  63130. return c
  63131. }
  63132. // Header returns an http.Header that can be modified by the caller to
  63133. // add HTTP headers to the request.
  63134. func (c *NetworksDeleteCall) Header() http.Header {
  63135. if c.header_ == nil {
  63136. c.header_ = make(http.Header)
  63137. }
  63138. return c.header_
  63139. }
  63140. func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  63141. reqHeaders := make(http.Header)
  63142. for k, v := range c.header_ {
  63143. reqHeaders[k] = v
  63144. }
  63145. reqHeaders.Set("User-Agent", c.s.userAgent())
  63146. var body io.Reader = nil
  63147. c.urlParams_.Set("alt", alt)
  63148. c.urlParams_.Set("prettyPrint", "false")
  63149. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  63150. urls += "?" + c.urlParams_.Encode()
  63151. req, err := http.NewRequest("DELETE", urls, body)
  63152. if err != nil {
  63153. return nil, err
  63154. }
  63155. req.Header = reqHeaders
  63156. googleapi.Expand(req.URL, map[string]string{
  63157. "project": c.project,
  63158. "network": c.network,
  63159. })
  63160. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63161. }
  63162. // Do executes the "compute.networks.delete" call.
  63163. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63164. // status code is an error. Response headers are in either
  63165. // *Operation.ServerResponse.Header or (if a response was returned at
  63166. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63167. // to check whether the returned error was because
  63168. // http.StatusNotModified was returned.
  63169. func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63170. gensupport.SetOptions(c.urlParams_, opts...)
  63171. res, err := c.doRequest("json")
  63172. if res != nil && res.StatusCode == http.StatusNotModified {
  63173. if res.Body != nil {
  63174. res.Body.Close()
  63175. }
  63176. return nil, &googleapi.Error{
  63177. Code: res.StatusCode,
  63178. Header: res.Header,
  63179. }
  63180. }
  63181. if err != nil {
  63182. return nil, err
  63183. }
  63184. defer googleapi.CloseBody(res)
  63185. if err := googleapi.CheckResponse(res); err != nil {
  63186. return nil, err
  63187. }
  63188. ret := &Operation{
  63189. ServerResponse: googleapi.ServerResponse{
  63190. Header: res.Header,
  63191. HTTPStatusCode: res.StatusCode,
  63192. },
  63193. }
  63194. target := &ret
  63195. if err := gensupport.DecodeResponse(target, res); err != nil {
  63196. return nil, err
  63197. }
  63198. return ret, nil
  63199. // {
  63200. // "description": "Deletes the specified network.",
  63201. // "httpMethod": "DELETE",
  63202. // "id": "compute.networks.delete",
  63203. // "parameterOrder": [
  63204. // "project",
  63205. // "network"
  63206. // ],
  63207. // "parameters": {
  63208. // "network": {
  63209. // "description": "Name of the network to delete.",
  63210. // "location": "path",
  63211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63212. // "required": true,
  63213. // "type": "string"
  63214. // },
  63215. // "project": {
  63216. // "description": "Project ID for this request.",
  63217. // "location": "path",
  63218. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63219. // "required": true,
  63220. // "type": "string"
  63221. // },
  63222. // "requestId": {
  63223. // "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).",
  63224. // "location": "query",
  63225. // "type": "string"
  63226. // }
  63227. // },
  63228. // "path": "{project}/global/networks/{network}",
  63229. // "response": {
  63230. // "$ref": "Operation"
  63231. // },
  63232. // "scopes": [
  63233. // "https://www.googleapis.com/auth/cloud-platform",
  63234. // "https://www.googleapis.com/auth/compute"
  63235. // ]
  63236. // }
  63237. }
  63238. // method id "compute.networks.get":
  63239. type NetworksGetCall struct {
  63240. s *Service
  63241. project string
  63242. network string
  63243. urlParams_ gensupport.URLParams
  63244. ifNoneMatch_ string
  63245. ctx_ context.Context
  63246. header_ http.Header
  63247. }
  63248. // Get: Returns the specified network. Gets a list of available networks
  63249. // by making a list() request.
  63250. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get
  63251. func (r *NetworksService) Get(project string, network string) *NetworksGetCall {
  63252. c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63253. c.project = project
  63254. c.network = network
  63255. return c
  63256. }
  63257. // Fields allows partial responses to be retrieved. See
  63258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63259. // for more information.
  63260. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall {
  63261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63262. return c
  63263. }
  63264. // IfNoneMatch sets the optional parameter which makes the operation
  63265. // fail if the object's ETag matches the given value. This is useful for
  63266. // getting updates only after the object has changed since the last
  63267. // request. Use googleapi.IsNotModified to check whether the response
  63268. // error from Do is the result of In-None-Match.
  63269. func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall {
  63270. c.ifNoneMatch_ = entityTag
  63271. return c
  63272. }
  63273. // Context sets the context to be used in this call's Do method. Any
  63274. // pending HTTP request will be aborted if the provided context is
  63275. // canceled.
  63276. func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall {
  63277. c.ctx_ = ctx
  63278. return c
  63279. }
  63280. // Header returns an http.Header that can be modified by the caller to
  63281. // add HTTP headers to the request.
  63282. func (c *NetworksGetCall) Header() http.Header {
  63283. if c.header_ == nil {
  63284. c.header_ = make(http.Header)
  63285. }
  63286. return c.header_
  63287. }
  63288. func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) {
  63289. reqHeaders := make(http.Header)
  63290. for k, v := range c.header_ {
  63291. reqHeaders[k] = v
  63292. }
  63293. reqHeaders.Set("User-Agent", c.s.userAgent())
  63294. if c.ifNoneMatch_ != "" {
  63295. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63296. }
  63297. var body io.Reader = nil
  63298. c.urlParams_.Set("alt", alt)
  63299. c.urlParams_.Set("prettyPrint", "false")
  63300. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  63301. urls += "?" + c.urlParams_.Encode()
  63302. req, err := http.NewRequest("GET", urls, body)
  63303. if err != nil {
  63304. return nil, err
  63305. }
  63306. req.Header = reqHeaders
  63307. googleapi.Expand(req.URL, map[string]string{
  63308. "project": c.project,
  63309. "network": c.network,
  63310. })
  63311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63312. }
  63313. // Do executes the "compute.networks.get" call.
  63314. // Exactly one of *Network or error will be non-nil. Any non-2xx status
  63315. // code is an error. Response headers are in either
  63316. // *Network.ServerResponse.Header or (if a response was returned at all)
  63317. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  63318. // check whether the returned error was because http.StatusNotModified
  63319. // was returned.
  63320. func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) {
  63321. gensupport.SetOptions(c.urlParams_, opts...)
  63322. res, err := c.doRequest("json")
  63323. if res != nil && res.StatusCode == http.StatusNotModified {
  63324. if res.Body != nil {
  63325. res.Body.Close()
  63326. }
  63327. return nil, &googleapi.Error{
  63328. Code: res.StatusCode,
  63329. Header: res.Header,
  63330. }
  63331. }
  63332. if err != nil {
  63333. return nil, err
  63334. }
  63335. defer googleapi.CloseBody(res)
  63336. if err := googleapi.CheckResponse(res); err != nil {
  63337. return nil, err
  63338. }
  63339. ret := &Network{
  63340. ServerResponse: googleapi.ServerResponse{
  63341. Header: res.Header,
  63342. HTTPStatusCode: res.StatusCode,
  63343. },
  63344. }
  63345. target := &ret
  63346. if err := gensupport.DecodeResponse(target, res); err != nil {
  63347. return nil, err
  63348. }
  63349. return ret, nil
  63350. // {
  63351. // "description": "Returns the specified network. Gets a list of available networks by making a list() request.",
  63352. // "httpMethod": "GET",
  63353. // "id": "compute.networks.get",
  63354. // "parameterOrder": [
  63355. // "project",
  63356. // "network"
  63357. // ],
  63358. // "parameters": {
  63359. // "network": {
  63360. // "description": "Name of the network to return.",
  63361. // "location": "path",
  63362. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63363. // "required": true,
  63364. // "type": "string"
  63365. // },
  63366. // "project": {
  63367. // "description": "Project ID for this request.",
  63368. // "location": "path",
  63369. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63370. // "required": true,
  63371. // "type": "string"
  63372. // }
  63373. // },
  63374. // "path": "{project}/global/networks/{network}",
  63375. // "response": {
  63376. // "$ref": "Network"
  63377. // },
  63378. // "scopes": [
  63379. // "https://www.googleapis.com/auth/cloud-platform",
  63380. // "https://www.googleapis.com/auth/compute",
  63381. // "https://www.googleapis.com/auth/compute.readonly"
  63382. // ]
  63383. // }
  63384. }
  63385. // method id "compute.networks.insert":
  63386. type NetworksInsertCall struct {
  63387. s *Service
  63388. project string
  63389. network *Network
  63390. urlParams_ gensupport.URLParams
  63391. ctx_ context.Context
  63392. header_ http.Header
  63393. }
  63394. // Insert: Creates a network in the specified project using the data
  63395. // included in the request.
  63396. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert
  63397. func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall {
  63398. c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63399. c.project = project
  63400. c.network = network
  63401. return c
  63402. }
  63403. // RequestId sets the optional parameter "requestId": An optional
  63404. // request ID to identify requests. Specify a unique request ID so that
  63405. // if you must retry your request, the server will know to ignore the
  63406. // request if it has already been completed.
  63407. //
  63408. // For example, consider a situation where you make an initial request
  63409. // and the request times out. If you make the request again with the
  63410. // same request ID, the server can check if original operation with the
  63411. // same request ID was received, and if so, will ignore the second
  63412. // request. This prevents clients from accidentally creating duplicate
  63413. // commitments.
  63414. //
  63415. // The request ID must be a valid UUID with the exception that zero UUID
  63416. // is not supported (00000000-0000-0000-0000-000000000000).
  63417. func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall {
  63418. c.urlParams_.Set("requestId", requestId)
  63419. return c
  63420. }
  63421. // Fields allows partial responses to be retrieved. See
  63422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63423. // for more information.
  63424. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall {
  63425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63426. return c
  63427. }
  63428. // Context sets the context to be used in this call's Do method. Any
  63429. // pending HTTP request will be aborted if the provided context is
  63430. // canceled.
  63431. func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall {
  63432. c.ctx_ = ctx
  63433. return c
  63434. }
  63435. // Header returns an http.Header that can be modified by the caller to
  63436. // add HTTP headers to the request.
  63437. func (c *NetworksInsertCall) Header() http.Header {
  63438. if c.header_ == nil {
  63439. c.header_ = make(http.Header)
  63440. }
  63441. return c.header_
  63442. }
  63443. func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  63444. reqHeaders := make(http.Header)
  63445. for k, v := range c.header_ {
  63446. reqHeaders[k] = v
  63447. }
  63448. reqHeaders.Set("User-Agent", c.s.userAgent())
  63449. var body io.Reader = nil
  63450. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network)
  63451. if err != nil {
  63452. return nil, err
  63453. }
  63454. reqHeaders.Set("Content-Type", "application/json")
  63455. c.urlParams_.Set("alt", alt)
  63456. c.urlParams_.Set("prettyPrint", "false")
  63457. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  63458. urls += "?" + c.urlParams_.Encode()
  63459. req, err := http.NewRequest("POST", urls, body)
  63460. if err != nil {
  63461. return nil, err
  63462. }
  63463. req.Header = reqHeaders
  63464. googleapi.Expand(req.URL, map[string]string{
  63465. "project": c.project,
  63466. })
  63467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63468. }
  63469. // Do executes the "compute.networks.insert" call.
  63470. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63471. // status code is an error. Response headers are in either
  63472. // *Operation.ServerResponse.Header or (if a response was returned at
  63473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63474. // to check whether the returned error was because
  63475. // http.StatusNotModified was returned.
  63476. func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63477. gensupport.SetOptions(c.urlParams_, opts...)
  63478. res, err := c.doRequest("json")
  63479. if res != nil && res.StatusCode == http.StatusNotModified {
  63480. if res.Body != nil {
  63481. res.Body.Close()
  63482. }
  63483. return nil, &googleapi.Error{
  63484. Code: res.StatusCode,
  63485. Header: res.Header,
  63486. }
  63487. }
  63488. if err != nil {
  63489. return nil, err
  63490. }
  63491. defer googleapi.CloseBody(res)
  63492. if err := googleapi.CheckResponse(res); err != nil {
  63493. return nil, err
  63494. }
  63495. ret := &Operation{
  63496. ServerResponse: googleapi.ServerResponse{
  63497. Header: res.Header,
  63498. HTTPStatusCode: res.StatusCode,
  63499. },
  63500. }
  63501. target := &ret
  63502. if err := gensupport.DecodeResponse(target, res); err != nil {
  63503. return nil, err
  63504. }
  63505. return ret, nil
  63506. // {
  63507. // "description": "Creates a network in the specified project using the data included in the request.",
  63508. // "httpMethod": "POST",
  63509. // "id": "compute.networks.insert",
  63510. // "parameterOrder": [
  63511. // "project"
  63512. // ],
  63513. // "parameters": {
  63514. // "project": {
  63515. // "description": "Project ID for this request.",
  63516. // "location": "path",
  63517. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63518. // "required": true,
  63519. // "type": "string"
  63520. // },
  63521. // "requestId": {
  63522. // "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).",
  63523. // "location": "query",
  63524. // "type": "string"
  63525. // }
  63526. // },
  63527. // "path": "{project}/global/networks",
  63528. // "request": {
  63529. // "$ref": "Network"
  63530. // },
  63531. // "response": {
  63532. // "$ref": "Operation"
  63533. // },
  63534. // "scopes": [
  63535. // "https://www.googleapis.com/auth/cloud-platform",
  63536. // "https://www.googleapis.com/auth/compute"
  63537. // ]
  63538. // }
  63539. }
  63540. // method id "compute.networks.list":
  63541. type NetworksListCall struct {
  63542. s *Service
  63543. project string
  63544. urlParams_ gensupport.URLParams
  63545. ifNoneMatch_ string
  63546. ctx_ context.Context
  63547. header_ http.Header
  63548. }
  63549. // List: Retrieves the list of networks available to the specified
  63550. // project.
  63551. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list
  63552. func (r *NetworksService) List(project string) *NetworksListCall {
  63553. c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63554. c.project = project
  63555. return c
  63556. }
  63557. // Filter sets the optional parameter "filter": A filter expression that
  63558. // filters resources listed in the response. The expression must specify
  63559. // the field name, a comparison operator, and the value that you want to
  63560. // use for filtering. The value must be a string, a number, or a
  63561. // boolean. The comparison operator must be either =, !=, >, or <.
  63562. //
  63563. // For example, if you are filtering Compute Engine instances, you can
  63564. // exclude instances named example-instance by specifying name !=
  63565. // example-instance.
  63566. //
  63567. // You can also filter nested fields. For example, you could specify
  63568. // scheduling.automaticRestart = false to include instances only if they
  63569. // are not scheduled for automatic restarts. You can use filtering on
  63570. // nested fields to filter based on resource labels.
  63571. //
  63572. // To filter on multiple expressions, provide each separate expression
  63573. // within parentheses. For example, (scheduling.automaticRestart = true)
  63574. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  63575. // AND expression. However, you can include AND and OR expressions
  63576. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  63577. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  63578. // true).
  63579. func (c *NetworksListCall) Filter(filter string) *NetworksListCall {
  63580. c.urlParams_.Set("filter", filter)
  63581. return c
  63582. }
  63583. // MaxResults sets the optional parameter "maxResults": The maximum
  63584. // number of results per page that should be returned. If the number of
  63585. // available results is larger than maxResults, Compute Engine returns a
  63586. // nextPageToken that can be used to get the next page of results in
  63587. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  63588. // (Default: 500)
  63589. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall {
  63590. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  63591. return c
  63592. }
  63593. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  63594. // a certain order. By default, results are returned in alphanumerical
  63595. // order based on the resource name.
  63596. //
  63597. // You can also sort results in descending order based on the creation
  63598. // timestamp using orderBy="creationTimestamp desc". This sorts results
  63599. // based on the creationTimestamp field in reverse chronological order
  63600. // (newest result first). Use this to sort resources like operations so
  63601. // that the newest operation is returned first.
  63602. //
  63603. // Currently, only sorting by name or creationTimestamp desc is
  63604. // supported.
  63605. func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall {
  63606. c.urlParams_.Set("orderBy", orderBy)
  63607. return c
  63608. }
  63609. // PageToken sets the optional parameter "pageToken": Specifies a page
  63610. // token to use. Set pageToken to the nextPageToken returned by a
  63611. // previous list request to get the next page of results.
  63612. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall {
  63613. c.urlParams_.Set("pageToken", pageToken)
  63614. return c
  63615. }
  63616. // Fields allows partial responses to be retrieved. See
  63617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63618. // for more information.
  63619. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall {
  63620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63621. return c
  63622. }
  63623. // IfNoneMatch sets the optional parameter which makes the operation
  63624. // fail if the object's ETag matches the given value. This is useful for
  63625. // getting updates only after the object has changed since the last
  63626. // request. Use googleapi.IsNotModified to check whether the response
  63627. // error from Do is the result of In-None-Match.
  63628. func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall {
  63629. c.ifNoneMatch_ = entityTag
  63630. return c
  63631. }
  63632. // Context sets the context to be used in this call's Do method. Any
  63633. // pending HTTP request will be aborted if the provided context is
  63634. // canceled.
  63635. func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall {
  63636. c.ctx_ = ctx
  63637. return c
  63638. }
  63639. // Header returns an http.Header that can be modified by the caller to
  63640. // add HTTP headers to the request.
  63641. func (c *NetworksListCall) Header() http.Header {
  63642. if c.header_ == nil {
  63643. c.header_ = make(http.Header)
  63644. }
  63645. return c.header_
  63646. }
  63647. func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) {
  63648. reqHeaders := make(http.Header)
  63649. for k, v := range c.header_ {
  63650. reqHeaders[k] = v
  63651. }
  63652. reqHeaders.Set("User-Agent", c.s.userAgent())
  63653. if c.ifNoneMatch_ != "" {
  63654. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  63655. }
  63656. var body io.Reader = nil
  63657. c.urlParams_.Set("alt", alt)
  63658. c.urlParams_.Set("prettyPrint", "false")
  63659. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks")
  63660. urls += "?" + c.urlParams_.Encode()
  63661. req, err := http.NewRequest("GET", urls, body)
  63662. if err != nil {
  63663. return nil, err
  63664. }
  63665. req.Header = reqHeaders
  63666. googleapi.Expand(req.URL, map[string]string{
  63667. "project": c.project,
  63668. })
  63669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63670. }
  63671. // Do executes the "compute.networks.list" call.
  63672. // Exactly one of *NetworkList or error will be non-nil. Any non-2xx
  63673. // status code is an error. Response headers are in either
  63674. // *NetworkList.ServerResponse.Header or (if a response was returned at
  63675. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63676. // to check whether the returned error was because
  63677. // http.StatusNotModified was returned.
  63678. func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) {
  63679. gensupport.SetOptions(c.urlParams_, opts...)
  63680. res, err := c.doRequest("json")
  63681. if res != nil && res.StatusCode == http.StatusNotModified {
  63682. if res.Body != nil {
  63683. res.Body.Close()
  63684. }
  63685. return nil, &googleapi.Error{
  63686. Code: res.StatusCode,
  63687. Header: res.Header,
  63688. }
  63689. }
  63690. if err != nil {
  63691. return nil, err
  63692. }
  63693. defer googleapi.CloseBody(res)
  63694. if err := googleapi.CheckResponse(res); err != nil {
  63695. return nil, err
  63696. }
  63697. ret := &NetworkList{
  63698. ServerResponse: googleapi.ServerResponse{
  63699. Header: res.Header,
  63700. HTTPStatusCode: res.StatusCode,
  63701. },
  63702. }
  63703. target := &ret
  63704. if err := gensupport.DecodeResponse(target, res); err != nil {
  63705. return nil, err
  63706. }
  63707. return ret, nil
  63708. // {
  63709. // "description": "Retrieves the list of networks available to the specified project.",
  63710. // "httpMethod": "GET",
  63711. // "id": "compute.networks.list",
  63712. // "parameterOrder": [
  63713. // "project"
  63714. // ],
  63715. // "parameters": {
  63716. // "filter": {
  63717. // "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).",
  63718. // "location": "query",
  63719. // "type": "string"
  63720. // },
  63721. // "maxResults": {
  63722. // "default": "500",
  63723. // "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)",
  63724. // "format": "uint32",
  63725. // "location": "query",
  63726. // "minimum": "0",
  63727. // "type": "integer"
  63728. // },
  63729. // "orderBy": {
  63730. // "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.",
  63731. // "location": "query",
  63732. // "type": "string"
  63733. // },
  63734. // "pageToken": {
  63735. // "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.",
  63736. // "location": "query",
  63737. // "type": "string"
  63738. // },
  63739. // "project": {
  63740. // "description": "Project ID for this request.",
  63741. // "location": "path",
  63742. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63743. // "required": true,
  63744. // "type": "string"
  63745. // }
  63746. // },
  63747. // "path": "{project}/global/networks",
  63748. // "response": {
  63749. // "$ref": "NetworkList"
  63750. // },
  63751. // "scopes": [
  63752. // "https://www.googleapis.com/auth/cloud-platform",
  63753. // "https://www.googleapis.com/auth/compute",
  63754. // "https://www.googleapis.com/auth/compute.readonly"
  63755. // ]
  63756. // }
  63757. }
  63758. // Pages invokes f for each page of results.
  63759. // A non-nil error returned from f will halt the iteration.
  63760. // The provided context supersedes any context provided to the Context method.
  63761. func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error {
  63762. c.ctx_ = ctx
  63763. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  63764. for {
  63765. x, err := c.Do()
  63766. if err != nil {
  63767. return err
  63768. }
  63769. if err := f(x); err != nil {
  63770. return err
  63771. }
  63772. if x.NextPageToken == "" {
  63773. return nil
  63774. }
  63775. c.PageToken(x.NextPageToken)
  63776. }
  63777. }
  63778. // method id "compute.networks.patch":
  63779. type NetworksPatchCall struct {
  63780. s *Service
  63781. project string
  63782. network string
  63783. network2 *Network
  63784. urlParams_ gensupport.URLParams
  63785. ctx_ context.Context
  63786. header_ http.Header
  63787. }
  63788. // Patch: Patches the specified network with the data included in the
  63789. // request. Only the following fields can be modified:
  63790. // routingConfig.routingMode.
  63791. func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall {
  63792. c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63793. c.project = project
  63794. c.network = network
  63795. c.network2 = network2
  63796. return c
  63797. }
  63798. // RequestId sets the optional parameter "requestId": An optional
  63799. // request ID to identify requests. Specify a unique request ID so that
  63800. // if you must retry your request, the server will know to ignore the
  63801. // request if it has already been completed.
  63802. //
  63803. // For example, consider a situation where you make an initial request
  63804. // and the request times out. If you make the request again with the
  63805. // same request ID, the server can check if original operation with the
  63806. // same request ID was received, and if so, will ignore the second
  63807. // request. This prevents clients from accidentally creating duplicate
  63808. // commitments.
  63809. //
  63810. // The request ID must be a valid UUID with the exception that zero UUID
  63811. // is not supported (00000000-0000-0000-0000-000000000000).
  63812. func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall {
  63813. c.urlParams_.Set("requestId", requestId)
  63814. return c
  63815. }
  63816. // Fields allows partial responses to be retrieved. See
  63817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63818. // for more information.
  63819. func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall {
  63820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63821. return c
  63822. }
  63823. // Context sets the context to be used in this call's Do method. Any
  63824. // pending HTTP request will be aborted if the provided context is
  63825. // canceled.
  63826. func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall {
  63827. c.ctx_ = ctx
  63828. return c
  63829. }
  63830. // Header returns an http.Header that can be modified by the caller to
  63831. // add HTTP headers to the request.
  63832. func (c *NetworksPatchCall) Header() http.Header {
  63833. if c.header_ == nil {
  63834. c.header_ = make(http.Header)
  63835. }
  63836. return c.header_
  63837. }
  63838. func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  63839. reqHeaders := make(http.Header)
  63840. for k, v := range c.header_ {
  63841. reqHeaders[k] = v
  63842. }
  63843. reqHeaders.Set("User-Agent", c.s.userAgent())
  63844. var body io.Reader = nil
  63845. body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2)
  63846. if err != nil {
  63847. return nil, err
  63848. }
  63849. reqHeaders.Set("Content-Type", "application/json")
  63850. c.urlParams_.Set("alt", alt)
  63851. c.urlParams_.Set("prettyPrint", "false")
  63852. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}")
  63853. urls += "?" + c.urlParams_.Encode()
  63854. req, err := http.NewRequest("PATCH", urls, body)
  63855. if err != nil {
  63856. return nil, err
  63857. }
  63858. req.Header = reqHeaders
  63859. googleapi.Expand(req.URL, map[string]string{
  63860. "project": c.project,
  63861. "network": c.network,
  63862. })
  63863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  63864. }
  63865. // Do executes the "compute.networks.patch" call.
  63866. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  63867. // status code is an error. Response headers are in either
  63868. // *Operation.ServerResponse.Header or (if a response was returned at
  63869. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  63870. // to check whether the returned error was because
  63871. // http.StatusNotModified was returned.
  63872. func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  63873. gensupport.SetOptions(c.urlParams_, opts...)
  63874. res, err := c.doRequest("json")
  63875. if res != nil && res.StatusCode == http.StatusNotModified {
  63876. if res.Body != nil {
  63877. res.Body.Close()
  63878. }
  63879. return nil, &googleapi.Error{
  63880. Code: res.StatusCode,
  63881. Header: res.Header,
  63882. }
  63883. }
  63884. if err != nil {
  63885. return nil, err
  63886. }
  63887. defer googleapi.CloseBody(res)
  63888. if err := googleapi.CheckResponse(res); err != nil {
  63889. return nil, err
  63890. }
  63891. ret := &Operation{
  63892. ServerResponse: googleapi.ServerResponse{
  63893. Header: res.Header,
  63894. HTTPStatusCode: res.StatusCode,
  63895. },
  63896. }
  63897. target := &ret
  63898. if err := gensupport.DecodeResponse(target, res); err != nil {
  63899. return nil, err
  63900. }
  63901. return ret, nil
  63902. // {
  63903. // "description": "Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode.",
  63904. // "httpMethod": "PATCH",
  63905. // "id": "compute.networks.patch",
  63906. // "parameterOrder": [
  63907. // "project",
  63908. // "network"
  63909. // ],
  63910. // "parameters": {
  63911. // "network": {
  63912. // "description": "Name of the network to update.",
  63913. // "location": "path",
  63914. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  63915. // "required": true,
  63916. // "type": "string"
  63917. // },
  63918. // "project": {
  63919. // "description": "Project ID for this request.",
  63920. // "location": "path",
  63921. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  63922. // "required": true,
  63923. // "type": "string"
  63924. // },
  63925. // "requestId": {
  63926. // "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).",
  63927. // "location": "query",
  63928. // "type": "string"
  63929. // }
  63930. // },
  63931. // "path": "{project}/global/networks/{network}",
  63932. // "request": {
  63933. // "$ref": "Network"
  63934. // },
  63935. // "response": {
  63936. // "$ref": "Operation"
  63937. // },
  63938. // "scopes": [
  63939. // "https://www.googleapis.com/auth/cloud-platform",
  63940. // "https://www.googleapis.com/auth/compute"
  63941. // ]
  63942. // }
  63943. }
  63944. // method id "compute.networks.removePeering":
  63945. type NetworksRemovePeeringCall struct {
  63946. s *Service
  63947. project string
  63948. network string
  63949. networksremovepeeringrequest *NetworksRemovePeeringRequest
  63950. urlParams_ gensupport.URLParams
  63951. ctx_ context.Context
  63952. header_ http.Header
  63953. }
  63954. // RemovePeering: Removes a peering from the specified network.
  63955. func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall {
  63956. c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  63957. c.project = project
  63958. c.network = network
  63959. c.networksremovepeeringrequest = networksremovepeeringrequest
  63960. return c
  63961. }
  63962. // RequestId sets the optional parameter "requestId": An optional
  63963. // request ID to identify requests. Specify a unique request ID so that
  63964. // if you must retry your request, the server will know to ignore the
  63965. // request if it has already been completed.
  63966. //
  63967. // For example, consider a situation where you make an initial request
  63968. // and the request times out. If you make the request again with the
  63969. // same request ID, the server can check if original operation with the
  63970. // same request ID was received, and if so, will ignore the second
  63971. // request. This prevents clients from accidentally creating duplicate
  63972. // commitments.
  63973. //
  63974. // The request ID must be a valid UUID with the exception that zero UUID
  63975. // is not supported (00000000-0000-0000-0000-000000000000).
  63976. func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall {
  63977. c.urlParams_.Set("requestId", requestId)
  63978. return c
  63979. }
  63980. // Fields allows partial responses to be retrieved. See
  63981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  63982. // for more information.
  63983. func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall {
  63984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  63985. return c
  63986. }
  63987. // Context sets the context to be used in this call's Do method. Any
  63988. // pending HTTP request will be aborted if the provided context is
  63989. // canceled.
  63990. func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall {
  63991. c.ctx_ = ctx
  63992. return c
  63993. }
  63994. // Header returns an http.Header that can be modified by the caller to
  63995. // add HTTP headers to the request.
  63996. func (c *NetworksRemovePeeringCall) Header() http.Header {
  63997. if c.header_ == nil {
  63998. c.header_ = make(http.Header)
  63999. }
  64000. return c.header_
  64001. }
  64002. func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) {
  64003. reqHeaders := make(http.Header)
  64004. for k, v := range c.header_ {
  64005. reqHeaders[k] = v
  64006. }
  64007. reqHeaders.Set("User-Agent", c.s.userAgent())
  64008. var body io.Reader = nil
  64009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest)
  64010. if err != nil {
  64011. return nil, err
  64012. }
  64013. reqHeaders.Set("Content-Type", "application/json")
  64014. c.urlParams_.Set("alt", alt)
  64015. c.urlParams_.Set("prettyPrint", "false")
  64016. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/removePeering")
  64017. urls += "?" + c.urlParams_.Encode()
  64018. req, err := http.NewRequest("POST", urls, body)
  64019. if err != nil {
  64020. return nil, err
  64021. }
  64022. req.Header = reqHeaders
  64023. googleapi.Expand(req.URL, map[string]string{
  64024. "project": c.project,
  64025. "network": c.network,
  64026. })
  64027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64028. }
  64029. // Do executes the "compute.networks.removePeering" call.
  64030. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64031. // status code is an error. Response headers are in either
  64032. // *Operation.ServerResponse.Header or (if a response was returned at
  64033. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64034. // to check whether the returned error was because
  64035. // http.StatusNotModified was returned.
  64036. func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64037. gensupport.SetOptions(c.urlParams_, opts...)
  64038. res, err := c.doRequest("json")
  64039. if res != nil && res.StatusCode == http.StatusNotModified {
  64040. if res.Body != nil {
  64041. res.Body.Close()
  64042. }
  64043. return nil, &googleapi.Error{
  64044. Code: res.StatusCode,
  64045. Header: res.Header,
  64046. }
  64047. }
  64048. if err != nil {
  64049. return nil, err
  64050. }
  64051. defer googleapi.CloseBody(res)
  64052. if err := googleapi.CheckResponse(res); err != nil {
  64053. return nil, err
  64054. }
  64055. ret := &Operation{
  64056. ServerResponse: googleapi.ServerResponse{
  64057. Header: res.Header,
  64058. HTTPStatusCode: res.StatusCode,
  64059. },
  64060. }
  64061. target := &ret
  64062. if err := gensupport.DecodeResponse(target, res); err != nil {
  64063. return nil, err
  64064. }
  64065. return ret, nil
  64066. // {
  64067. // "description": "Removes a peering from the specified network.",
  64068. // "httpMethod": "POST",
  64069. // "id": "compute.networks.removePeering",
  64070. // "parameterOrder": [
  64071. // "project",
  64072. // "network"
  64073. // ],
  64074. // "parameters": {
  64075. // "network": {
  64076. // "description": "Name of the network resource to remove peering from.",
  64077. // "location": "path",
  64078. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64079. // "required": true,
  64080. // "type": "string"
  64081. // },
  64082. // "project": {
  64083. // "description": "Project ID for this request.",
  64084. // "location": "path",
  64085. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64086. // "required": true,
  64087. // "type": "string"
  64088. // },
  64089. // "requestId": {
  64090. // "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).",
  64091. // "location": "query",
  64092. // "type": "string"
  64093. // }
  64094. // },
  64095. // "path": "{project}/global/networks/{network}/removePeering",
  64096. // "request": {
  64097. // "$ref": "NetworksRemovePeeringRequest"
  64098. // },
  64099. // "response": {
  64100. // "$ref": "Operation"
  64101. // },
  64102. // "scopes": [
  64103. // "https://www.googleapis.com/auth/cloud-platform",
  64104. // "https://www.googleapis.com/auth/compute"
  64105. // ]
  64106. // }
  64107. }
  64108. // method id "compute.networks.switchToCustomMode":
  64109. type NetworksSwitchToCustomModeCall struct {
  64110. s *Service
  64111. project string
  64112. network string
  64113. urlParams_ gensupport.URLParams
  64114. ctx_ context.Context
  64115. header_ http.Header
  64116. }
  64117. // SwitchToCustomMode: Switches the network mode from auto subnet mode
  64118. // to custom subnet mode.
  64119. func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall {
  64120. c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64121. c.project = project
  64122. c.network = network
  64123. return c
  64124. }
  64125. // RequestId sets the optional parameter "requestId": An optional
  64126. // request ID to identify requests. Specify a unique request ID so that
  64127. // if you must retry your request, the server will know to ignore the
  64128. // request if it has already been completed.
  64129. //
  64130. // For example, consider a situation where you make an initial request
  64131. // and the request times out. If you make the request again with the
  64132. // same request ID, the server can check if original operation with the
  64133. // same request ID was received, and if so, will ignore the second
  64134. // request. This prevents clients from accidentally creating duplicate
  64135. // commitments.
  64136. //
  64137. // The request ID must be a valid UUID with the exception that zero UUID
  64138. // is not supported (00000000-0000-0000-0000-000000000000).
  64139. func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall {
  64140. c.urlParams_.Set("requestId", requestId)
  64141. return c
  64142. }
  64143. // Fields allows partial responses to be retrieved. See
  64144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64145. // for more information.
  64146. func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall {
  64147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64148. return c
  64149. }
  64150. // Context sets the context to be used in this call's Do method. Any
  64151. // pending HTTP request will be aborted if the provided context is
  64152. // canceled.
  64153. func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall {
  64154. c.ctx_ = ctx
  64155. return c
  64156. }
  64157. // Header returns an http.Header that can be modified by the caller to
  64158. // add HTTP headers to the request.
  64159. func (c *NetworksSwitchToCustomModeCall) Header() http.Header {
  64160. if c.header_ == nil {
  64161. c.header_ = make(http.Header)
  64162. }
  64163. return c.header_
  64164. }
  64165. func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) {
  64166. reqHeaders := make(http.Header)
  64167. for k, v := range c.header_ {
  64168. reqHeaders[k] = v
  64169. }
  64170. reqHeaders.Set("User-Agent", c.s.userAgent())
  64171. var body io.Reader = nil
  64172. c.urlParams_.Set("alt", alt)
  64173. c.urlParams_.Set("prettyPrint", "false")
  64174. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}/switchToCustomMode")
  64175. urls += "?" + c.urlParams_.Encode()
  64176. req, err := http.NewRequest("POST", urls, body)
  64177. if err != nil {
  64178. return nil, err
  64179. }
  64180. req.Header = reqHeaders
  64181. googleapi.Expand(req.URL, map[string]string{
  64182. "project": c.project,
  64183. "network": c.network,
  64184. })
  64185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64186. }
  64187. // Do executes the "compute.networks.switchToCustomMode" call.
  64188. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64189. // status code is an error. Response headers are in either
  64190. // *Operation.ServerResponse.Header or (if a response was returned at
  64191. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64192. // to check whether the returned error was because
  64193. // http.StatusNotModified was returned.
  64194. func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64195. gensupport.SetOptions(c.urlParams_, opts...)
  64196. res, err := c.doRequest("json")
  64197. if res != nil && res.StatusCode == http.StatusNotModified {
  64198. if res.Body != nil {
  64199. res.Body.Close()
  64200. }
  64201. return nil, &googleapi.Error{
  64202. Code: res.StatusCode,
  64203. Header: res.Header,
  64204. }
  64205. }
  64206. if err != nil {
  64207. return nil, err
  64208. }
  64209. defer googleapi.CloseBody(res)
  64210. if err := googleapi.CheckResponse(res); err != nil {
  64211. return nil, err
  64212. }
  64213. ret := &Operation{
  64214. ServerResponse: googleapi.ServerResponse{
  64215. Header: res.Header,
  64216. HTTPStatusCode: res.StatusCode,
  64217. },
  64218. }
  64219. target := &ret
  64220. if err := gensupport.DecodeResponse(target, res); err != nil {
  64221. return nil, err
  64222. }
  64223. return ret, nil
  64224. // {
  64225. // "description": "Switches the network mode from auto subnet mode to custom subnet mode.",
  64226. // "httpMethod": "POST",
  64227. // "id": "compute.networks.switchToCustomMode",
  64228. // "parameterOrder": [
  64229. // "project",
  64230. // "network"
  64231. // ],
  64232. // "parameters": {
  64233. // "network": {
  64234. // "description": "Name of the network to be updated.",
  64235. // "location": "path",
  64236. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64237. // "required": true,
  64238. // "type": "string"
  64239. // },
  64240. // "project": {
  64241. // "description": "Project ID for this request.",
  64242. // "location": "path",
  64243. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64244. // "required": true,
  64245. // "type": "string"
  64246. // },
  64247. // "requestId": {
  64248. // "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).",
  64249. // "location": "query",
  64250. // "type": "string"
  64251. // }
  64252. // },
  64253. // "path": "{project}/global/networks/{network}/switchToCustomMode",
  64254. // "response": {
  64255. // "$ref": "Operation"
  64256. // },
  64257. // "scopes": [
  64258. // "https://www.googleapis.com/auth/cloud-platform",
  64259. // "https://www.googleapis.com/auth/compute"
  64260. // ]
  64261. // }
  64262. }
  64263. // method id "compute.nodeGroups.addNodes":
  64264. type NodeGroupsAddNodesCall struct {
  64265. s *Service
  64266. project string
  64267. zone string
  64268. nodeGroup string
  64269. nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest
  64270. urlParams_ gensupport.URLParams
  64271. ctx_ context.Context
  64272. header_ http.Header
  64273. }
  64274. // AddNodes: Adds specified number of nodes to the node group.
  64275. func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall {
  64276. c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64277. c.project = project
  64278. c.zone = zone
  64279. c.nodeGroup = nodeGroup
  64280. c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest
  64281. return c
  64282. }
  64283. // RequestId sets the optional parameter "requestId": An optional
  64284. // request ID to identify requests. Specify a unique request ID so that
  64285. // if you must retry your request, the server will know to ignore the
  64286. // request if it has already been completed.
  64287. //
  64288. // For example, consider a situation where you make an initial request
  64289. // and the request times out. If you make the request again with the
  64290. // same request ID, the server can check if original operation with the
  64291. // same request ID was received, and if so, will ignore the second
  64292. // request. This prevents clients from accidentally creating duplicate
  64293. // commitments.
  64294. //
  64295. // The request ID must be a valid UUID with the exception that zero UUID
  64296. // is not supported (00000000-0000-0000-0000-000000000000).
  64297. func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall {
  64298. c.urlParams_.Set("requestId", requestId)
  64299. return c
  64300. }
  64301. // Fields allows partial responses to be retrieved. See
  64302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64303. // for more information.
  64304. func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall {
  64305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64306. return c
  64307. }
  64308. // Context sets the context to be used in this call's Do method. Any
  64309. // pending HTTP request will be aborted if the provided context is
  64310. // canceled.
  64311. func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall {
  64312. c.ctx_ = ctx
  64313. return c
  64314. }
  64315. // Header returns an http.Header that can be modified by the caller to
  64316. // add HTTP headers to the request.
  64317. func (c *NodeGroupsAddNodesCall) Header() http.Header {
  64318. if c.header_ == nil {
  64319. c.header_ = make(http.Header)
  64320. }
  64321. return c.header_
  64322. }
  64323. func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) {
  64324. reqHeaders := make(http.Header)
  64325. for k, v := range c.header_ {
  64326. reqHeaders[k] = v
  64327. }
  64328. reqHeaders.Set("User-Agent", c.s.userAgent())
  64329. var body io.Reader = nil
  64330. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest)
  64331. if err != nil {
  64332. return nil, err
  64333. }
  64334. reqHeaders.Set("Content-Type", "application/json")
  64335. c.urlParams_.Set("alt", alt)
  64336. c.urlParams_.Set("prettyPrint", "false")
  64337. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes")
  64338. urls += "?" + c.urlParams_.Encode()
  64339. req, err := http.NewRequest("POST", urls, body)
  64340. if err != nil {
  64341. return nil, err
  64342. }
  64343. req.Header = reqHeaders
  64344. googleapi.Expand(req.URL, map[string]string{
  64345. "project": c.project,
  64346. "zone": c.zone,
  64347. "nodeGroup": c.nodeGroup,
  64348. })
  64349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64350. }
  64351. // Do executes the "compute.nodeGroups.addNodes" call.
  64352. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64353. // status code is an error. Response headers are in either
  64354. // *Operation.ServerResponse.Header or (if a response was returned at
  64355. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64356. // to check whether the returned error was because
  64357. // http.StatusNotModified was returned.
  64358. func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64359. gensupport.SetOptions(c.urlParams_, opts...)
  64360. res, err := c.doRequest("json")
  64361. if res != nil && res.StatusCode == http.StatusNotModified {
  64362. if res.Body != nil {
  64363. res.Body.Close()
  64364. }
  64365. return nil, &googleapi.Error{
  64366. Code: res.StatusCode,
  64367. Header: res.Header,
  64368. }
  64369. }
  64370. if err != nil {
  64371. return nil, err
  64372. }
  64373. defer googleapi.CloseBody(res)
  64374. if err := googleapi.CheckResponse(res); err != nil {
  64375. return nil, err
  64376. }
  64377. ret := &Operation{
  64378. ServerResponse: googleapi.ServerResponse{
  64379. Header: res.Header,
  64380. HTTPStatusCode: res.StatusCode,
  64381. },
  64382. }
  64383. target := &ret
  64384. if err := gensupport.DecodeResponse(target, res); err != nil {
  64385. return nil, err
  64386. }
  64387. return ret, nil
  64388. // {
  64389. // "description": "Adds specified number of nodes to the node group.",
  64390. // "httpMethod": "POST",
  64391. // "id": "compute.nodeGroups.addNodes",
  64392. // "parameterOrder": [
  64393. // "project",
  64394. // "zone",
  64395. // "nodeGroup"
  64396. // ],
  64397. // "parameters": {
  64398. // "nodeGroup": {
  64399. // "description": "Name of the NodeGroup resource.",
  64400. // "location": "path",
  64401. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64402. // "required": true,
  64403. // "type": "string"
  64404. // },
  64405. // "project": {
  64406. // "description": "Project ID for this request.",
  64407. // "location": "path",
  64408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64409. // "required": true,
  64410. // "type": "string"
  64411. // },
  64412. // "requestId": {
  64413. // "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).",
  64414. // "location": "query",
  64415. // "type": "string"
  64416. // },
  64417. // "zone": {
  64418. // "description": "The name of the zone for this request.",
  64419. // "location": "path",
  64420. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64421. // "required": true,
  64422. // "type": "string"
  64423. // }
  64424. // },
  64425. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes",
  64426. // "request": {
  64427. // "$ref": "NodeGroupsAddNodesRequest"
  64428. // },
  64429. // "response": {
  64430. // "$ref": "Operation"
  64431. // },
  64432. // "scopes": [
  64433. // "https://www.googleapis.com/auth/cloud-platform",
  64434. // "https://www.googleapis.com/auth/compute"
  64435. // ]
  64436. // }
  64437. }
  64438. // method id "compute.nodeGroups.aggregatedList":
  64439. type NodeGroupsAggregatedListCall struct {
  64440. s *Service
  64441. project string
  64442. urlParams_ gensupport.URLParams
  64443. ifNoneMatch_ string
  64444. ctx_ context.Context
  64445. header_ http.Header
  64446. }
  64447. // AggregatedList: Retrieves an aggregated list of node groups. Note:
  64448. // use nodeGroups.listNodes for more details about each group.
  64449. func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall {
  64450. c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64451. c.project = project
  64452. return c
  64453. }
  64454. // Filter sets the optional parameter "filter": A filter expression that
  64455. // filters resources listed in the response. The expression must specify
  64456. // the field name, a comparison operator, and the value that you want to
  64457. // use for filtering. The value must be a string, a number, or a
  64458. // boolean. The comparison operator must be either =, !=, >, or <.
  64459. //
  64460. // For example, if you are filtering Compute Engine instances, you can
  64461. // exclude instances named example-instance by specifying name !=
  64462. // example-instance.
  64463. //
  64464. // You can also filter nested fields. For example, you could specify
  64465. // scheduling.automaticRestart = false to include instances only if they
  64466. // are not scheduled for automatic restarts. You can use filtering on
  64467. // nested fields to filter based on resource labels.
  64468. //
  64469. // To filter on multiple expressions, provide each separate expression
  64470. // within parentheses. For example, (scheduling.automaticRestart = true)
  64471. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  64472. // AND expression. However, you can include AND and OR expressions
  64473. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  64474. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  64475. // true).
  64476. func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall {
  64477. c.urlParams_.Set("filter", filter)
  64478. return c
  64479. }
  64480. // MaxResults sets the optional parameter "maxResults": The maximum
  64481. // number of results per page that should be returned. If the number of
  64482. // available results is larger than maxResults, Compute Engine returns a
  64483. // nextPageToken that can be used to get the next page of results in
  64484. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  64485. // (Default: 500)
  64486. func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall {
  64487. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  64488. return c
  64489. }
  64490. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  64491. // a certain order. By default, results are returned in alphanumerical
  64492. // order based on the resource name.
  64493. //
  64494. // You can also sort results in descending order based on the creation
  64495. // timestamp using orderBy="creationTimestamp desc". This sorts results
  64496. // based on the creationTimestamp field in reverse chronological order
  64497. // (newest result first). Use this to sort resources like operations so
  64498. // that the newest operation is returned first.
  64499. //
  64500. // Currently, only sorting by name or creationTimestamp desc is
  64501. // supported.
  64502. func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall {
  64503. c.urlParams_.Set("orderBy", orderBy)
  64504. return c
  64505. }
  64506. // PageToken sets the optional parameter "pageToken": Specifies a page
  64507. // token to use. Set pageToken to the nextPageToken returned by a
  64508. // previous list request to get the next page of results.
  64509. func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall {
  64510. c.urlParams_.Set("pageToken", pageToken)
  64511. return c
  64512. }
  64513. // Fields allows partial responses to be retrieved. See
  64514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64515. // for more information.
  64516. func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall {
  64517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64518. return c
  64519. }
  64520. // IfNoneMatch sets the optional parameter which makes the operation
  64521. // fail if the object's ETag matches the given value. This is useful for
  64522. // getting updates only after the object has changed since the last
  64523. // request. Use googleapi.IsNotModified to check whether the response
  64524. // error from Do is the result of In-None-Match.
  64525. func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall {
  64526. c.ifNoneMatch_ = entityTag
  64527. return c
  64528. }
  64529. // Context sets the context to be used in this call's Do method. Any
  64530. // pending HTTP request will be aborted if the provided context is
  64531. // canceled.
  64532. func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall {
  64533. c.ctx_ = ctx
  64534. return c
  64535. }
  64536. // Header returns an http.Header that can be modified by the caller to
  64537. // add HTTP headers to the request.
  64538. func (c *NodeGroupsAggregatedListCall) Header() http.Header {
  64539. if c.header_ == nil {
  64540. c.header_ = make(http.Header)
  64541. }
  64542. return c.header_
  64543. }
  64544. func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  64545. reqHeaders := make(http.Header)
  64546. for k, v := range c.header_ {
  64547. reqHeaders[k] = v
  64548. }
  64549. reqHeaders.Set("User-Agent", c.s.userAgent())
  64550. if c.ifNoneMatch_ != "" {
  64551. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  64552. }
  64553. var body io.Reader = nil
  64554. c.urlParams_.Set("alt", alt)
  64555. c.urlParams_.Set("prettyPrint", "false")
  64556. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeGroups")
  64557. urls += "?" + c.urlParams_.Encode()
  64558. req, err := http.NewRequest("GET", urls, body)
  64559. if err != nil {
  64560. return nil, err
  64561. }
  64562. req.Header = reqHeaders
  64563. googleapi.Expand(req.URL, map[string]string{
  64564. "project": c.project,
  64565. })
  64566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64567. }
  64568. // Do executes the "compute.nodeGroups.aggregatedList" call.
  64569. // Exactly one of *NodeGroupAggregatedList or error will be non-nil. Any
  64570. // non-2xx status code is an error. Response headers are in either
  64571. // *NodeGroupAggregatedList.ServerResponse.Header or (if a response was
  64572. // returned at all) in error.(*googleapi.Error).Header. Use
  64573. // googleapi.IsNotModified to check whether the returned error was
  64574. // because http.StatusNotModified was returned.
  64575. func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) {
  64576. gensupport.SetOptions(c.urlParams_, opts...)
  64577. res, err := c.doRequest("json")
  64578. if res != nil && res.StatusCode == http.StatusNotModified {
  64579. if res.Body != nil {
  64580. res.Body.Close()
  64581. }
  64582. return nil, &googleapi.Error{
  64583. Code: res.StatusCode,
  64584. Header: res.Header,
  64585. }
  64586. }
  64587. if err != nil {
  64588. return nil, err
  64589. }
  64590. defer googleapi.CloseBody(res)
  64591. if err := googleapi.CheckResponse(res); err != nil {
  64592. return nil, err
  64593. }
  64594. ret := &NodeGroupAggregatedList{
  64595. ServerResponse: googleapi.ServerResponse{
  64596. Header: res.Header,
  64597. HTTPStatusCode: res.StatusCode,
  64598. },
  64599. }
  64600. target := &ret
  64601. if err := gensupport.DecodeResponse(target, res); err != nil {
  64602. return nil, err
  64603. }
  64604. return ret, nil
  64605. // {
  64606. // "description": "Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group.",
  64607. // "httpMethod": "GET",
  64608. // "id": "compute.nodeGroups.aggregatedList",
  64609. // "parameterOrder": [
  64610. // "project"
  64611. // ],
  64612. // "parameters": {
  64613. // "filter": {
  64614. // "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).",
  64615. // "location": "query",
  64616. // "type": "string"
  64617. // },
  64618. // "maxResults": {
  64619. // "default": "500",
  64620. // "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)",
  64621. // "format": "uint32",
  64622. // "location": "query",
  64623. // "minimum": "0",
  64624. // "type": "integer"
  64625. // },
  64626. // "orderBy": {
  64627. // "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.",
  64628. // "location": "query",
  64629. // "type": "string"
  64630. // },
  64631. // "pageToken": {
  64632. // "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.",
  64633. // "location": "query",
  64634. // "type": "string"
  64635. // },
  64636. // "project": {
  64637. // "description": "Project ID for this request.",
  64638. // "location": "path",
  64639. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64640. // "required": true,
  64641. // "type": "string"
  64642. // }
  64643. // },
  64644. // "path": "{project}/aggregated/nodeGroups",
  64645. // "response": {
  64646. // "$ref": "NodeGroupAggregatedList"
  64647. // },
  64648. // "scopes": [
  64649. // "https://www.googleapis.com/auth/cloud-platform",
  64650. // "https://www.googleapis.com/auth/compute",
  64651. // "https://www.googleapis.com/auth/compute.readonly"
  64652. // ]
  64653. // }
  64654. }
  64655. // Pages invokes f for each page of results.
  64656. // A non-nil error returned from f will halt the iteration.
  64657. // The provided context supersedes any context provided to the Context method.
  64658. func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error {
  64659. c.ctx_ = ctx
  64660. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  64661. for {
  64662. x, err := c.Do()
  64663. if err != nil {
  64664. return err
  64665. }
  64666. if err := f(x); err != nil {
  64667. return err
  64668. }
  64669. if x.NextPageToken == "" {
  64670. return nil
  64671. }
  64672. c.PageToken(x.NextPageToken)
  64673. }
  64674. }
  64675. // method id "compute.nodeGroups.delete":
  64676. type NodeGroupsDeleteCall struct {
  64677. s *Service
  64678. project string
  64679. zone string
  64680. nodeGroup string
  64681. urlParams_ gensupport.URLParams
  64682. ctx_ context.Context
  64683. header_ http.Header
  64684. }
  64685. // Delete: Deletes the specified NodeGroup resource.
  64686. func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall {
  64687. c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64688. c.project = project
  64689. c.zone = zone
  64690. c.nodeGroup = nodeGroup
  64691. return c
  64692. }
  64693. // RequestId sets the optional parameter "requestId": An optional
  64694. // request ID to identify requests. Specify a unique request ID so that
  64695. // if you must retry your request, the server will know to ignore the
  64696. // request if it has already been completed.
  64697. //
  64698. // For example, consider a situation where you make an initial request
  64699. // and the request times out. If you make the request again with the
  64700. // same request ID, the server can check if original operation with the
  64701. // same request ID was received, and if so, will ignore the second
  64702. // request. This prevents clients from accidentally creating duplicate
  64703. // commitments.
  64704. //
  64705. // The request ID must be a valid UUID with the exception that zero UUID
  64706. // is not supported (00000000-0000-0000-0000-000000000000).
  64707. func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall {
  64708. c.urlParams_.Set("requestId", requestId)
  64709. return c
  64710. }
  64711. // Fields allows partial responses to be retrieved. See
  64712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64713. // for more information.
  64714. func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall {
  64715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64716. return c
  64717. }
  64718. // Context sets the context to be used in this call's Do method. Any
  64719. // pending HTTP request will be aborted if the provided context is
  64720. // canceled.
  64721. func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall {
  64722. c.ctx_ = ctx
  64723. return c
  64724. }
  64725. // Header returns an http.Header that can be modified by the caller to
  64726. // add HTTP headers to the request.
  64727. func (c *NodeGroupsDeleteCall) Header() http.Header {
  64728. if c.header_ == nil {
  64729. c.header_ = make(http.Header)
  64730. }
  64731. return c.header_
  64732. }
  64733. func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  64734. reqHeaders := make(http.Header)
  64735. for k, v := range c.header_ {
  64736. reqHeaders[k] = v
  64737. }
  64738. reqHeaders.Set("User-Agent", c.s.userAgent())
  64739. var body io.Reader = nil
  64740. c.urlParams_.Set("alt", alt)
  64741. c.urlParams_.Set("prettyPrint", "false")
  64742. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  64743. urls += "?" + c.urlParams_.Encode()
  64744. req, err := http.NewRequest("DELETE", urls, body)
  64745. if err != nil {
  64746. return nil, err
  64747. }
  64748. req.Header = reqHeaders
  64749. googleapi.Expand(req.URL, map[string]string{
  64750. "project": c.project,
  64751. "zone": c.zone,
  64752. "nodeGroup": c.nodeGroup,
  64753. })
  64754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64755. }
  64756. // Do executes the "compute.nodeGroups.delete" call.
  64757. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64758. // status code is an error. Response headers are in either
  64759. // *Operation.ServerResponse.Header or (if a response was returned at
  64760. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64761. // to check whether the returned error was because
  64762. // http.StatusNotModified was returned.
  64763. func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64764. gensupport.SetOptions(c.urlParams_, opts...)
  64765. res, err := c.doRequest("json")
  64766. if res != nil && res.StatusCode == http.StatusNotModified {
  64767. if res.Body != nil {
  64768. res.Body.Close()
  64769. }
  64770. return nil, &googleapi.Error{
  64771. Code: res.StatusCode,
  64772. Header: res.Header,
  64773. }
  64774. }
  64775. if err != nil {
  64776. return nil, err
  64777. }
  64778. defer googleapi.CloseBody(res)
  64779. if err := googleapi.CheckResponse(res); err != nil {
  64780. return nil, err
  64781. }
  64782. ret := &Operation{
  64783. ServerResponse: googleapi.ServerResponse{
  64784. Header: res.Header,
  64785. HTTPStatusCode: res.StatusCode,
  64786. },
  64787. }
  64788. target := &ret
  64789. if err := gensupport.DecodeResponse(target, res); err != nil {
  64790. return nil, err
  64791. }
  64792. return ret, nil
  64793. // {
  64794. // "description": "Deletes the specified NodeGroup resource.",
  64795. // "httpMethod": "DELETE",
  64796. // "id": "compute.nodeGroups.delete",
  64797. // "parameterOrder": [
  64798. // "project",
  64799. // "zone",
  64800. // "nodeGroup"
  64801. // ],
  64802. // "parameters": {
  64803. // "nodeGroup": {
  64804. // "description": "Name of the NodeGroup resource to delete.",
  64805. // "location": "path",
  64806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64807. // "required": true,
  64808. // "type": "string"
  64809. // },
  64810. // "project": {
  64811. // "description": "Project ID for this request.",
  64812. // "location": "path",
  64813. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64814. // "required": true,
  64815. // "type": "string"
  64816. // },
  64817. // "requestId": {
  64818. // "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).",
  64819. // "location": "query",
  64820. // "type": "string"
  64821. // },
  64822. // "zone": {
  64823. // "description": "The name of the zone for this request.",
  64824. // "location": "path",
  64825. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64826. // "required": true,
  64827. // "type": "string"
  64828. // }
  64829. // },
  64830. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  64831. // "response": {
  64832. // "$ref": "Operation"
  64833. // },
  64834. // "scopes": [
  64835. // "https://www.googleapis.com/auth/cloud-platform",
  64836. // "https://www.googleapis.com/auth/compute"
  64837. // ]
  64838. // }
  64839. }
  64840. // method id "compute.nodeGroups.deleteNodes":
  64841. type NodeGroupsDeleteNodesCall struct {
  64842. s *Service
  64843. project string
  64844. zone string
  64845. nodeGroup string
  64846. nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest
  64847. urlParams_ gensupport.URLParams
  64848. ctx_ context.Context
  64849. header_ http.Header
  64850. }
  64851. // DeleteNodes: Deletes specified nodes from the node group.
  64852. func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall {
  64853. c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  64854. c.project = project
  64855. c.zone = zone
  64856. c.nodeGroup = nodeGroup
  64857. c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest
  64858. return c
  64859. }
  64860. // RequestId sets the optional parameter "requestId": An optional
  64861. // request ID to identify requests. Specify a unique request ID so that
  64862. // if you must retry your request, the server will know to ignore the
  64863. // request if it has already been completed.
  64864. //
  64865. // For example, consider a situation where you make an initial request
  64866. // and the request times out. If you make the request again with the
  64867. // same request ID, the server can check if original operation with the
  64868. // same request ID was received, and if so, will ignore the second
  64869. // request. This prevents clients from accidentally creating duplicate
  64870. // commitments.
  64871. //
  64872. // The request ID must be a valid UUID with the exception that zero UUID
  64873. // is not supported (00000000-0000-0000-0000-000000000000).
  64874. func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall {
  64875. c.urlParams_.Set("requestId", requestId)
  64876. return c
  64877. }
  64878. // Fields allows partial responses to be retrieved. See
  64879. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  64880. // for more information.
  64881. func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall {
  64882. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  64883. return c
  64884. }
  64885. // Context sets the context to be used in this call's Do method. Any
  64886. // pending HTTP request will be aborted if the provided context is
  64887. // canceled.
  64888. func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall {
  64889. c.ctx_ = ctx
  64890. return c
  64891. }
  64892. // Header returns an http.Header that can be modified by the caller to
  64893. // add HTTP headers to the request.
  64894. func (c *NodeGroupsDeleteNodesCall) Header() http.Header {
  64895. if c.header_ == nil {
  64896. c.header_ = make(http.Header)
  64897. }
  64898. return c.header_
  64899. }
  64900. func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) {
  64901. reqHeaders := make(http.Header)
  64902. for k, v := range c.header_ {
  64903. reqHeaders[k] = v
  64904. }
  64905. reqHeaders.Set("User-Agent", c.s.userAgent())
  64906. var body io.Reader = nil
  64907. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest)
  64908. if err != nil {
  64909. return nil, err
  64910. }
  64911. reqHeaders.Set("Content-Type", "application/json")
  64912. c.urlParams_.Set("alt", alt)
  64913. c.urlParams_.Set("prettyPrint", "false")
  64914. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes")
  64915. urls += "?" + c.urlParams_.Encode()
  64916. req, err := http.NewRequest("POST", urls, body)
  64917. if err != nil {
  64918. return nil, err
  64919. }
  64920. req.Header = reqHeaders
  64921. googleapi.Expand(req.URL, map[string]string{
  64922. "project": c.project,
  64923. "zone": c.zone,
  64924. "nodeGroup": c.nodeGroup,
  64925. })
  64926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  64927. }
  64928. // Do executes the "compute.nodeGroups.deleteNodes" call.
  64929. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  64930. // status code is an error. Response headers are in either
  64931. // *Operation.ServerResponse.Header or (if a response was returned at
  64932. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  64933. // to check whether the returned error was because
  64934. // http.StatusNotModified was returned.
  64935. func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  64936. gensupport.SetOptions(c.urlParams_, opts...)
  64937. res, err := c.doRequest("json")
  64938. if res != nil && res.StatusCode == http.StatusNotModified {
  64939. if res.Body != nil {
  64940. res.Body.Close()
  64941. }
  64942. return nil, &googleapi.Error{
  64943. Code: res.StatusCode,
  64944. Header: res.Header,
  64945. }
  64946. }
  64947. if err != nil {
  64948. return nil, err
  64949. }
  64950. defer googleapi.CloseBody(res)
  64951. if err := googleapi.CheckResponse(res); err != nil {
  64952. return nil, err
  64953. }
  64954. ret := &Operation{
  64955. ServerResponse: googleapi.ServerResponse{
  64956. Header: res.Header,
  64957. HTTPStatusCode: res.StatusCode,
  64958. },
  64959. }
  64960. target := &ret
  64961. if err := gensupport.DecodeResponse(target, res); err != nil {
  64962. return nil, err
  64963. }
  64964. return ret, nil
  64965. // {
  64966. // "description": "Deletes specified nodes from the node group.",
  64967. // "httpMethod": "POST",
  64968. // "id": "compute.nodeGroups.deleteNodes",
  64969. // "parameterOrder": [
  64970. // "project",
  64971. // "zone",
  64972. // "nodeGroup"
  64973. // ],
  64974. // "parameters": {
  64975. // "nodeGroup": {
  64976. // "description": "Name of the NodeGroup resource to delete.",
  64977. // "location": "path",
  64978. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  64979. // "required": true,
  64980. // "type": "string"
  64981. // },
  64982. // "project": {
  64983. // "description": "Project ID for this request.",
  64984. // "location": "path",
  64985. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  64986. // "required": true,
  64987. // "type": "string"
  64988. // },
  64989. // "requestId": {
  64990. // "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).",
  64991. // "location": "query",
  64992. // "type": "string"
  64993. // },
  64994. // "zone": {
  64995. // "description": "The name of the zone for this request.",
  64996. // "location": "path",
  64997. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  64998. // "required": true,
  64999. // "type": "string"
  65000. // }
  65001. // },
  65002. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes",
  65003. // "request": {
  65004. // "$ref": "NodeGroupsDeleteNodesRequest"
  65005. // },
  65006. // "response": {
  65007. // "$ref": "Operation"
  65008. // },
  65009. // "scopes": [
  65010. // "https://www.googleapis.com/auth/cloud-platform",
  65011. // "https://www.googleapis.com/auth/compute"
  65012. // ]
  65013. // }
  65014. }
  65015. // method id "compute.nodeGroups.get":
  65016. type NodeGroupsGetCall struct {
  65017. s *Service
  65018. project string
  65019. zone string
  65020. nodeGroup string
  65021. urlParams_ gensupport.URLParams
  65022. ifNoneMatch_ string
  65023. ctx_ context.Context
  65024. header_ http.Header
  65025. }
  65026. // Get: Returns the specified NodeGroup. Get a list of available
  65027. // NodeGroups by making a list() request. Note: the "nodes" field should
  65028. // not be used. Use nodeGroups.listNodes instead.
  65029. func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall {
  65030. c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65031. c.project = project
  65032. c.zone = zone
  65033. c.nodeGroup = nodeGroup
  65034. return c
  65035. }
  65036. // Fields allows partial responses to be retrieved. See
  65037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65038. // for more information.
  65039. func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall {
  65040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65041. return c
  65042. }
  65043. // IfNoneMatch sets the optional parameter which makes the operation
  65044. // fail if the object's ETag matches the given value. This is useful for
  65045. // getting updates only after the object has changed since the last
  65046. // request. Use googleapi.IsNotModified to check whether the response
  65047. // error from Do is the result of In-None-Match.
  65048. func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall {
  65049. c.ifNoneMatch_ = entityTag
  65050. return c
  65051. }
  65052. // Context sets the context to be used in this call's Do method. Any
  65053. // pending HTTP request will be aborted if the provided context is
  65054. // canceled.
  65055. func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall {
  65056. c.ctx_ = ctx
  65057. return c
  65058. }
  65059. // Header returns an http.Header that can be modified by the caller to
  65060. // add HTTP headers to the request.
  65061. func (c *NodeGroupsGetCall) Header() http.Header {
  65062. if c.header_ == nil {
  65063. c.header_ = make(http.Header)
  65064. }
  65065. return c.header_
  65066. }
  65067. func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  65068. reqHeaders := make(http.Header)
  65069. for k, v := range c.header_ {
  65070. reqHeaders[k] = v
  65071. }
  65072. reqHeaders.Set("User-Agent", c.s.userAgent())
  65073. if c.ifNoneMatch_ != "" {
  65074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65075. }
  65076. var body io.Reader = nil
  65077. c.urlParams_.Set("alt", alt)
  65078. c.urlParams_.Set("prettyPrint", "false")
  65079. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}")
  65080. urls += "?" + c.urlParams_.Encode()
  65081. req, err := http.NewRequest("GET", urls, body)
  65082. if err != nil {
  65083. return nil, err
  65084. }
  65085. req.Header = reqHeaders
  65086. googleapi.Expand(req.URL, map[string]string{
  65087. "project": c.project,
  65088. "zone": c.zone,
  65089. "nodeGroup": c.nodeGroup,
  65090. })
  65091. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65092. }
  65093. // Do executes the "compute.nodeGroups.get" call.
  65094. // Exactly one of *NodeGroup or error will be non-nil. Any non-2xx
  65095. // status code is an error. Response headers are in either
  65096. // *NodeGroup.ServerResponse.Header or (if a response was returned at
  65097. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65098. // to check whether the returned error was because
  65099. // http.StatusNotModified was returned.
  65100. func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) {
  65101. gensupport.SetOptions(c.urlParams_, opts...)
  65102. res, err := c.doRequest("json")
  65103. if res != nil && res.StatusCode == http.StatusNotModified {
  65104. if res.Body != nil {
  65105. res.Body.Close()
  65106. }
  65107. return nil, &googleapi.Error{
  65108. Code: res.StatusCode,
  65109. Header: res.Header,
  65110. }
  65111. }
  65112. if err != nil {
  65113. return nil, err
  65114. }
  65115. defer googleapi.CloseBody(res)
  65116. if err := googleapi.CheckResponse(res); err != nil {
  65117. return nil, err
  65118. }
  65119. ret := &NodeGroup{
  65120. ServerResponse: googleapi.ServerResponse{
  65121. Header: res.Header,
  65122. HTTPStatusCode: res.StatusCode,
  65123. },
  65124. }
  65125. target := &ret
  65126. if err := gensupport.DecodeResponse(target, res); err != nil {
  65127. return nil, err
  65128. }
  65129. return ret, nil
  65130. // {
  65131. // "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.",
  65132. // "httpMethod": "GET",
  65133. // "id": "compute.nodeGroups.get",
  65134. // "parameterOrder": [
  65135. // "project",
  65136. // "zone",
  65137. // "nodeGroup"
  65138. // ],
  65139. // "parameters": {
  65140. // "nodeGroup": {
  65141. // "description": "Name of the node group to return.",
  65142. // "location": "path",
  65143. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65144. // "required": true,
  65145. // "type": "string"
  65146. // },
  65147. // "project": {
  65148. // "description": "Project ID for this request.",
  65149. // "location": "path",
  65150. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65151. // "required": true,
  65152. // "type": "string"
  65153. // },
  65154. // "zone": {
  65155. // "description": "The name of the zone for this request.",
  65156. // "location": "path",
  65157. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65158. // "required": true,
  65159. // "type": "string"
  65160. // }
  65161. // },
  65162. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}",
  65163. // "response": {
  65164. // "$ref": "NodeGroup"
  65165. // },
  65166. // "scopes": [
  65167. // "https://www.googleapis.com/auth/cloud-platform",
  65168. // "https://www.googleapis.com/auth/compute",
  65169. // "https://www.googleapis.com/auth/compute.readonly"
  65170. // ]
  65171. // }
  65172. }
  65173. // method id "compute.nodeGroups.getIamPolicy":
  65174. type NodeGroupsGetIamPolicyCall struct {
  65175. s *Service
  65176. project string
  65177. zone string
  65178. resource string
  65179. urlParams_ gensupport.URLParams
  65180. ifNoneMatch_ string
  65181. ctx_ context.Context
  65182. header_ http.Header
  65183. }
  65184. // GetIamPolicy: Gets the access control policy for a resource. May be
  65185. // empty if no such policy or resource exists.
  65186. func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall {
  65187. c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65188. c.project = project
  65189. c.zone = zone
  65190. c.resource = resource
  65191. return c
  65192. }
  65193. // Fields allows partial responses to be retrieved. See
  65194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65195. // for more information.
  65196. func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall {
  65197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65198. return c
  65199. }
  65200. // IfNoneMatch sets the optional parameter which makes the operation
  65201. // fail if the object's ETag matches the given value. This is useful for
  65202. // getting updates only after the object has changed since the last
  65203. // request. Use googleapi.IsNotModified to check whether the response
  65204. // error from Do is the result of In-None-Match.
  65205. func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall {
  65206. c.ifNoneMatch_ = entityTag
  65207. return c
  65208. }
  65209. // Context sets the context to be used in this call's Do method. Any
  65210. // pending HTTP request will be aborted if the provided context is
  65211. // canceled.
  65212. func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall {
  65213. c.ctx_ = ctx
  65214. return c
  65215. }
  65216. // Header returns an http.Header that can be modified by the caller to
  65217. // add HTTP headers to the request.
  65218. func (c *NodeGroupsGetIamPolicyCall) Header() http.Header {
  65219. if c.header_ == nil {
  65220. c.header_ = make(http.Header)
  65221. }
  65222. return c.header_
  65223. }
  65224. func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  65225. reqHeaders := make(http.Header)
  65226. for k, v := range c.header_ {
  65227. reqHeaders[k] = v
  65228. }
  65229. reqHeaders.Set("User-Agent", c.s.userAgent())
  65230. if c.ifNoneMatch_ != "" {
  65231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65232. }
  65233. var body io.Reader = nil
  65234. c.urlParams_.Set("alt", alt)
  65235. c.urlParams_.Set("prettyPrint", "false")
  65236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy")
  65237. urls += "?" + c.urlParams_.Encode()
  65238. req, err := http.NewRequest("GET", urls, body)
  65239. if err != nil {
  65240. return nil, err
  65241. }
  65242. req.Header = reqHeaders
  65243. googleapi.Expand(req.URL, map[string]string{
  65244. "project": c.project,
  65245. "zone": c.zone,
  65246. "resource": c.resource,
  65247. })
  65248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65249. }
  65250. // Do executes the "compute.nodeGroups.getIamPolicy" call.
  65251. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  65252. // code is an error. Response headers are in either
  65253. // *Policy.ServerResponse.Header or (if a response was returned at all)
  65254. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  65255. // check whether the returned error was because http.StatusNotModified
  65256. // was returned.
  65257. func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  65258. gensupport.SetOptions(c.urlParams_, opts...)
  65259. res, err := c.doRequest("json")
  65260. if res != nil && res.StatusCode == http.StatusNotModified {
  65261. if res.Body != nil {
  65262. res.Body.Close()
  65263. }
  65264. return nil, &googleapi.Error{
  65265. Code: res.StatusCode,
  65266. Header: res.Header,
  65267. }
  65268. }
  65269. if err != nil {
  65270. return nil, err
  65271. }
  65272. defer googleapi.CloseBody(res)
  65273. if err := googleapi.CheckResponse(res); err != nil {
  65274. return nil, err
  65275. }
  65276. ret := &Policy{
  65277. ServerResponse: googleapi.ServerResponse{
  65278. Header: res.Header,
  65279. HTTPStatusCode: res.StatusCode,
  65280. },
  65281. }
  65282. target := &ret
  65283. if err := gensupport.DecodeResponse(target, res); err != nil {
  65284. return nil, err
  65285. }
  65286. return ret, nil
  65287. // {
  65288. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  65289. // "httpMethod": "GET",
  65290. // "id": "compute.nodeGroups.getIamPolicy",
  65291. // "parameterOrder": [
  65292. // "project",
  65293. // "zone",
  65294. // "resource"
  65295. // ],
  65296. // "parameters": {
  65297. // "project": {
  65298. // "description": "Project ID for this request.",
  65299. // "location": "path",
  65300. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65301. // "required": true,
  65302. // "type": "string"
  65303. // },
  65304. // "resource": {
  65305. // "description": "Name or id of the resource for this request.",
  65306. // "location": "path",
  65307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65308. // "required": true,
  65309. // "type": "string"
  65310. // },
  65311. // "zone": {
  65312. // "description": "The name of the zone for this request.",
  65313. // "location": "path",
  65314. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65315. // "required": true,
  65316. // "type": "string"
  65317. // }
  65318. // },
  65319. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy",
  65320. // "response": {
  65321. // "$ref": "Policy"
  65322. // },
  65323. // "scopes": [
  65324. // "https://www.googleapis.com/auth/cloud-platform",
  65325. // "https://www.googleapis.com/auth/compute",
  65326. // "https://www.googleapis.com/auth/compute.readonly"
  65327. // ]
  65328. // }
  65329. }
  65330. // method id "compute.nodeGroups.insert":
  65331. type NodeGroupsInsertCall struct {
  65332. s *Service
  65333. project string
  65334. zone string
  65335. nodegroup *NodeGroup
  65336. urlParams_ gensupport.URLParams
  65337. ctx_ context.Context
  65338. header_ http.Header
  65339. }
  65340. // Insert: Creates a NodeGroup resource in the specified project using
  65341. // the data included in the request.
  65342. func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall {
  65343. c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65344. c.project = project
  65345. c.zone = zone
  65346. c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount))
  65347. c.nodegroup = nodegroup
  65348. return c
  65349. }
  65350. // RequestId sets the optional parameter "requestId": An optional
  65351. // request ID to identify requests. Specify a unique request ID so that
  65352. // if you must retry your request, the server will know to ignore the
  65353. // request if it has already been completed.
  65354. //
  65355. // For example, consider a situation where you make an initial request
  65356. // and the request times out. If you make the request again with the
  65357. // same request ID, the server can check if original operation with the
  65358. // same request ID was received, and if so, will ignore the second
  65359. // request. This prevents clients from accidentally creating duplicate
  65360. // commitments.
  65361. //
  65362. // The request ID must be a valid UUID with the exception that zero UUID
  65363. // is not supported (00000000-0000-0000-0000-000000000000).
  65364. func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall {
  65365. c.urlParams_.Set("requestId", requestId)
  65366. return c
  65367. }
  65368. // Fields allows partial responses to be retrieved. See
  65369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65370. // for more information.
  65371. func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall {
  65372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65373. return c
  65374. }
  65375. // Context sets the context to be used in this call's Do method. Any
  65376. // pending HTTP request will be aborted if the provided context is
  65377. // canceled.
  65378. func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall {
  65379. c.ctx_ = ctx
  65380. return c
  65381. }
  65382. // Header returns an http.Header that can be modified by the caller to
  65383. // add HTTP headers to the request.
  65384. func (c *NodeGroupsInsertCall) Header() http.Header {
  65385. if c.header_ == nil {
  65386. c.header_ = make(http.Header)
  65387. }
  65388. return c.header_
  65389. }
  65390. func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  65391. reqHeaders := make(http.Header)
  65392. for k, v := range c.header_ {
  65393. reqHeaders[k] = v
  65394. }
  65395. reqHeaders.Set("User-Agent", c.s.userAgent())
  65396. var body io.Reader = nil
  65397. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup)
  65398. if err != nil {
  65399. return nil, err
  65400. }
  65401. reqHeaders.Set("Content-Type", "application/json")
  65402. c.urlParams_.Set("alt", alt)
  65403. c.urlParams_.Set("prettyPrint", "false")
  65404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  65405. urls += "?" + c.urlParams_.Encode()
  65406. req, err := http.NewRequest("POST", urls, body)
  65407. if err != nil {
  65408. return nil, err
  65409. }
  65410. req.Header = reqHeaders
  65411. googleapi.Expand(req.URL, map[string]string{
  65412. "project": c.project,
  65413. "zone": c.zone,
  65414. })
  65415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65416. }
  65417. // Do executes the "compute.nodeGroups.insert" call.
  65418. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  65419. // status code is an error. Response headers are in either
  65420. // *Operation.ServerResponse.Header or (if a response was returned at
  65421. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  65422. // to check whether the returned error was because
  65423. // http.StatusNotModified was returned.
  65424. func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  65425. gensupport.SetOptions(c.urlParams_, opts...)
  65426. res, err := c.doRequest("json")
  65427. if res != nil && res.StatusCode == http.StatusNotModified {
  65428. if res.Body != nil {
  65429. res.Body.Close()
  65430. }
  65431. return nil, &googleapi.Error{
  65432. Code: res.StatusCode,
  65433. Header: res.Header,
  65434. }
  65435. }
  65436. if err != nil {
  65437. return nil, err
  65438. }
  65439. defer googleapi.CloseBody(res)
  65440. if err := googleapi.CheckResponse(res); err != nil {
  65441. return nil, err
  65442. }
  65443. ret := &Operation{
  65444. ServerResponse: googleapi.ServerResponse{
  65445. Header: res.Header,
  65446. HTTPStatusCode: res.StatusCode,
  65447. },
  65448. }
  65449. target := &ret
  65450. if err := gensupport.DecodeResponse(target, res); err != nil {
  65451. return nil, err
  65452. }
  65453. return ret, nil
  65454. // {
  65455. // "description": "Creates a NodeGroup resource in the specified project using the data included in the request.",
  65456. // "httpMethod": "POST",
  65457. // "id": "compute.nodeGroups.insert",
  65458. // "parameterOrder": [
  65459. // "project",
  65460. // "zone",
  65461. // "initialNodeCount"
  65462. // ],
  65463. // "parameters": {
  65464. // "initialNodeCount": {
  65465. // "description": "Initial count of nodes in the node group.",
  65466. // "format": "int32",
  65467. // "location": "query",
  65468. // "required": true,
  65469. // "type": "integer"
  65470. // },
  65471. // "project": {
  65472. // "description": "Project ID for this request.",
  65473. // "location": "path",
  65474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65475. // "required": true,
  65476. // "type": "string"
  65477. // },
  65478. // "requestId": {
  65479. // "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).",
  65480. // "location": "query",
  65481. // "type": "string"
  65482. // },
  65483. // "zone": {
  65484. // "description": "The name of the zone for this request.",
  65485. // "location": "path",
  65486. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65487. // "required": true,
  65488. // "type": "string"
  65489. // }
  65490. // },
  65491. // "path": "{project}/zones/{zone}/nodeGroups",
  65492. // "request": {
  65493. // "$ref": "NodeGroup"
  65494. // },
  65495. // "response": {
  65496. // "$ref": "Operation"
  65497. // },
  65498. // "scopes": [
  65499. // "https://www.googleapis.com/auth/cloud-platform",
  65500. // "https://www.googleapis.com/auth/compute"
  65501. // ]
  65502. // }
  65503. }
  65504. // method id "compute.nodeGroups.list":
  65505. type NodeGroupsListCall struct {
  65506. s *Service
  65507. project string
  65508. zone string
  65509. urlParams_ gensupport.URLParams
  65510. ifNoneMatch_ string
  65511. ctx_ context.Context
  65512. header_ http.Header
  65513. }
  65514. // List: Retrieves a list of node groups available to the specified
  65515. // project. Note: use nodeGroups.listNodes for more details about each
  65516. // group.
  65517. func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall {
  65518. c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65519. c.project = project
  65520. c.zone = zone
  65521. return c
  65522. }
  65523. // Filter sets the optional parameter "filter": A filter expression that
  65524. // filters resources listed in the response. The expression must specify
  65525. // the field name, a comparison operator, and the value that you want to
  65526. // use for filtering. The value must be a string, a number, or a
  65527. // boolean. The comparison operator must be either =, !=, >, or <.
  65528. //
  65529. // For example, if you are filtering Compute Engine instances, you can
  65530. // exclude instances named example-instance by specifying name !=
  65531. // example-instance.
  65532. //
  65533. // You can also filter nested fields. For example, you could specify
  65534. // scheduling.automaticRestart = false to include instances only if they
  65535. // are not scheduled for automatic restarts. You can use filtering on
  65536. // nested fields to filter based on resource labels.
  65537. //
  65538. // To filter on multiple expressions, provide each separate expression
  65539. // within parentheses. For example, (scheduling.automaticRestart = true)
  65540. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65541. // AND expression. However, you can include AND and OR expressions
  65542. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65543. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65544. // true).
  65545. func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall {
  65546. c.urlParams_.Set("filter", filter)
  65547. return c
  65548. }
  65549. // MaxResults sets the optional parameter "maxResults": The maximum
  65550. // number of results per page that should be returned. If the number of
  65551. // available results is larger than maxResults, Compute Engine returns a
  65552. // nextPageToken that can be used to get the next page of results in
  65553. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65554. // (Default: 500)
  65555. func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall {
  65556. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65557. return c
  65558. }
  65559. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  65560. // a certain order. By default, results are returned in alphanumerical
  65561. // order based on the resource name.
  65562. //
  65563. // You can also sort results in descending order based on the creation
  65564. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65565. // based on the creationTimestamp field in reverse chronological order
  65566. // (newest result first). Use this to sort resources like operations so
  65567. // that the newest operation is returned first.
  65568. //
  65569. // Currently, only sorting by name or creationTimestamp desc is
  65570. // supported.
  65571. func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall {
  65572. c.urlParams_.Set("orderBy", orderBy)
  65573. return c
  65574. }
  65575. // PageToken sets the optional parameter "pageToken": Specifies a page
  65576. // token to use. Set pageToken to the nextPageToken returned by a
  65577. // previous list request to get the next page of results.
  65578. func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall {
  65579. c.urlParams_.Set("pageToken", pageToken)
  65580. return c
  65581. }
  65582. // Fields allows partial responses to be retrieved. See
  65583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65584. // for more information.
  65585. func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall {
  65586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65587. return c
  65588. }
  65589. // IfNoneMatch sets the optional parameter which makes the operation
  65590. // fail if the object's ETag matches the given value. This is useful for
  65591. // getting updates only after the object has changed since the last
  65592. // request. Use googleapi.IsNotModified to check whether the response
  65593. // error from Do is the result of In-None-Match.
  65594. func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall {
  65595. c.ifNoneMatch_ = entityTag
  65596. return c
  65597. }
  65598. // Context sets the context to be used in this call's Do method. Any
  65599. // pending HTTP request will be aborted if the provided context is
  65600. // canceled.
  65601. func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall {
  65602. c.ctx_ = ctx
  65603. return c
  65604. }
  65605. // Header returns an http.Header that can be modified by the caller to
  65606. // add HTTP headers to the request.
  65607. func (c *NodeGroupsListCall) Header() http.Header {
  65608. if c.header_ == nil {
  65609. c.header_ = make(http.Header)
  65610. }
  65611. return c.header_
  65612. }
  65613. func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  65614. reqHeaders := make(http.Header)
  65615. for k, v := range c.header_ {
  65616. reqHeaders[k] = v
  65617. }
  65618. reqHeaders.Set("User-Agent", c.s.userAgent())
  65619. if c.ifNoneMatch_ != "" {
  65620. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  65621. }
  65622. var body io.Reader = nil
  65623. c.urlParams_.Set("alt", alt)
  65624. c.urlParams_.Set("prettyPrint", "false")
  65625. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups")
  65626. urls += "?" + c.urlParams_.Encode()
  65627. req, err := http.NewRequest("GET", urls, body)
  65628. if err != nil {
  65629. return nil, err
  65630. }
  65631. req.Header = reqHeaders
  65632. googleapi.Expand(req.URL, map[string]string{
  65633. "project": c.project,
  65634. "zone": c.zone,
  65635. })
  65636. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65637. }
  65638. // Do executes the "compute.nodeGroups.list" call.
  65639. // Exactly one of *NodeGroupList or error will be non-nil. Any non-2xx
  65640. // status code is an error. Response headers are in either
  65641. // *NodeGroupList.ServerResponse.Header or (if a response was returned
  65642. // at all) in error.(*googleapi.Error).Header. Use
  65643. // googleapi.IsNotModified to check whether the returned error was
  65644. // because http.StatusNotModified was returned.
  65645. func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) {
  65646. gensupport.SetOptions(c.urlParams_, opts...)
  65647. res, err := c.doRequest("json")
  65648. if res != nil && res.StatusCode == http.StatusNotModified {
  65649. if res.Body != nil {
  65650. res.Body.Close()
  65651. }
  65652. return nil, &googleapi.Error{
  65653. Code: res.StatusCode,
  65654. Header: res.Header,
  65655. }
  65656. }
  65657. if err != nil {
  65658. return nil, err
  65659. }
  65660. defer googleapi.CloseBody(res)
  65661. if err := googleapi.CheckResponse(res); err != nil {
  65662. return nil, err
  65663. }
  65664. ret := &NodeGroupList{
  65665. ServerResponse: googleapi.ServerResponse{
  65666. Header: res.Header,
  65667. HTTPStatusCode: res.StatusCode,
  65668. },
  65669. }
  65670. target := &ret
  65671. if err := gensupport.DecodeResponse(target, res); err != nil {
  65672. return nil, err
  65673. }
  65674. return ret, nil
  65675. // {
  65676. // "description": "Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.",
  65677. // "httpMethod": "GET",
  65678. // "id": "compute.nodeGroups.list",
  65679. // "parameterOrder": [
  65680. // "project",
  65681. // "zone"
  65682. // ],
  65683. // "parameters": {
  65684. // "filter": {
  65685. // "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).",
  65686. // "location": "query",
  65687. // "type": "string"
  65688. // },
  65689. // "maxResults": {
  65690. // "default": "500",
  65691. // "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)",
  65692. // "format": "uint32",
  65693. // "location": "query",
  65694. // "minimum": "0",
  65695. // "type": "integer"
  65696. // },
  65697. // "orderBy": {
  65698. // "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.",
  65699. // "location": "query",
  65700. // "type": "string"
  65701. // },
  65702. // "pageToken": {
  65703. // "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.",
  65704. // "location": "query",
  65705. // "type": "string"
  65706. // },
  65707. // "project": {
  65708. // "description": "Project ID for this request.",
  65709. // "location": "path",
  65710. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65711. // "required": true,
  65712. // "type": "string"
  65713. // },
  65714. // "zone": {
  65715. // "description": "The name of the zone for this request.",
  65716. // "location": "path",
  65717. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65718. // "required": true,
  65719. // "type": "string"
  65720. // }
  65721. // },
  65722. // "path": "{project}/zones/{zone}/nodeGroups",
  65723. // "response": {
  65724. // "$ref": "NodeGroupList"
  65725. // },
  65726. // "scopes": [
  65727. // "https://www.googleapis.com/auth/cloud-platform",
  65728. // "https://www.googleapis.com/auth/compute",
  65729. // "https://www.googleapis.com/auth/compute.readonly"
  65730. // ]
  65731. // }
  65732. }
  65733. // Pages invokes f for each page of results.
  65734. // A non-nil error returned from f will halt the iteration.
  65735. // The provided context supersedes any context provided to the Context method.
  65736. func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error {
  65737. c.ctx_ = ctx
  65738. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65739. for {
  65740. x, err := c.Do()
  65741. if err != nil {
  65742. return err
  65743. }
  65744. if err := f(x); err != nil {
  65745. return err
  65746. }
  65747. if x.NextPageToken == "" {
  65748. return nil
  65749. }
  65750. c.PageToken(x.NextPageToken)
  65751. }
  65752. }
  65753. // method id "compute.nodeGroups.listNodes":
  65754. type NodeGroupsListNodesCall struct {
  65755. s *Service
  65756. project string
  65757. zone string
  65758. nodeGroup string
  65759. urlParams_ gensupport.URLParams
  65760. ctx_ context.Context
  65761. header_ http.Header
  65762. }
  65763. // ListNodes: Lists nodes in the node group.
  65764. func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall {
  65765. c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  65766. c.project = project
  65767. c.zone = zone
  65768. c.nodeGroup = nodeGroup
  65769. return c
  65770. }
  65771. // Filter sets the optional parameter "filter": A filter expression that
  65772. // filters resources listed in the response. The expression must specify
  65773. // the field name, a comparison operator, and the value that you want to
  65774. // use for filtering. The value must be a string, a number, or a
  65775. // boolean. The comparison operator must be either =, !=, >, or <.
  65776. //
  65777. // For example, if you are filtering Compute Engine instances, you can
  65778. // exclude instances named example-instance by specifying name !=
  65779. // example-instance.
  65780. //
  65781. // You can also filter nested fields. For example, you could specify
  65782. // scheduling.automaticRestart = false to include instances only if they
  65783. // are not scheduled for automatic restarts. You can use filtering on
  65784. // nested fields to filter based on resource labels.
  65785. //
  65786. // To filter on multiple expressions, provide each separate expression
  65787. // within parentheses. For example, (scheduling.automaticRestart = true)
  65788. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  65789. // AND expression. However, you can include AND and OR expressions
  65790. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  65791. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  65792. // true).
  65793. func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall {
  65794. c.urlParams_.Set("filter", filter)
  65795. return c
  65796. }
  65797. // MaxResults sets the optional parameter "maxResults": The maximum
  65798. // number of results per page that should be returned. If the number of
  65799. // available results is larger than maxResults, Compute Engine returns a
  65800. // nextPageToken that can be used to get the next page of results in
  65801. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  65802. // (Default: 500)
  65803. func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall {
  65804. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  65805. return c
  65806. }
  65807. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  65808. // a certain order. By default, results are returned in alphanumerical
  65809. // order based on the resource name.
  65810. //
  65811. // You can also sort results in descending order based on the creation
  65812. // timestamp using orderBy="creationTimestamp desc". This sorts results
  65813. // based on the creationTimestamp field in reverse chronological order
  65814. // (newest result first). Use this to sort resources like operations so
  65815. // that the newest operation is returned first.
  65816. //
  65817. // Currently, only sorting by name or creationTimestamp desc is
  65818. // supported.
  65819. func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall {
  65820. c.urlParams_.Set("orderBy", orderBy)
  65821. return c
  65822. }
  65823. // PageToken sets the optional parameter "pageToken": Specifies a page
  65824. // token to use. Set pageToken to the nextPageToken returned by a
  65825. // previous list request to get the next page of results.
  65826. func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall {
  65827. c.urlParams_.Set("pageToken", pageToken)
  65828. return c
  65829. }
  65830. // Fields allows partial responses to be retrieved. See
  65831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  65832. // for more information.
  65833. func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall {
  65834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  65835. return c
  65836. }
  65837. // Context sets the context to be used in this call's Do method. Any
  65838. // pending HTTP request will be aborted if the provided context is
  65839. // canceled.
  65840. func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall {
  65841. c.ctx_ = ctx
  65842. return c
  65843. }
  65844. // Header returns an http.Header that can be modified by the caller to
  65845. // add HTTP headers to the request.
  65846. func (c *NodeGroupsListNodesCall) Header() http.Header {
  65847. if c.header_ == nil {
  65848. c.header_ = make(http.Header)
  65849. }
  65850. return c.header_
  65851. }
  65852. func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) {
  65853. reqHeaders := make(http.Header)
  65854. for k, v := range c.header_ {
  65855. reqHeaders[k] = v
  65856. }
  65857. reqHeaders.Set("User-Agent", c.s.userAgent())
  65858. var body io.Reader = nil
  65859. c.urlParams_.Set("alt", alt)
  65860. c.urlParams_.Set("prettyPrint", "false")
  65861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes")
  65862. urls += "?" + c.urlParams_.Encode()
  65863. req, err := http.NewRequest("POST", urls, body)
  65864. if err != nil {
  65865. return nil, err
  65866. }
  65867. req.Header = reqHeaders
  65868. googleapi.Expand(req.URL, map[string]string{
  65869. "project": c.project,
  65870. "zone": c.zone,
  65871. "nodeGroup": c.nodeGroup,
  65872. })
  65873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  65874. }
  65875. // Do executes the "compute.nodeGroups.listNodes" call.
  65876. // Exactly one of *NodeGroupsListNodes or error will be non-nil. Any
  65877. // non-2xx status code is an error. Response headers are in either
  65878. // *NodeGroupsListNodes.ServerResponse.Header or (if a response was
  65879. // returned at all) in error.(*googleapi.Error).Header. Use
  65880. // googleapi.IsNotModified to check whether the returned error was
  65881. // because http.StatusNotModified was returned.
  65882. func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) {
  65883. gensupport.SetOptions(c.urlParams_, opts...)
  65884. res, err := c.doRequest("json")
  65885. if res != nil && res.StatusCode == http.StatusNotModified {
  65886. if res.Body != nil {
  65887. res.Body.Close()
  65888. }
  65889. return nil, &googleapi.Error{
  65890. Code: res.StatusCode,
  65891. Header: res.Header,
  65892. }
  65893. }
  65894. if err != nil {
  65895. return nil, err
  65896. }
  65897. defer googleapi.CloseBody(res)
  65898. if err := googleapi.CheckResponse(res); err != nil {
  65899. return nil, err
  65900. }
  65901. ret := &NodeGroupsListNodes{
  65902. ServerResponse: googleapi.ServerResponse{
  65903. Header: res.Header,
  65904. HTTPStatusCode: res.StatusCode,
  65905. },
  65906. }
  65907. target := &ret
  65908. if err := gensupport.DecodeResponse(target, res); err != nil {
  65909. return nil, err
  65910. }
  65911. return ret, nil
  65912. // {
  65913. // "description": "Lists nodes in the node group.",
  65914. // "httpMethod": "POST",
  65915. // "id": "compute.nodeGroups.listNodes",
  65916. // "parameterOrder": [
  65917. // "project",
  65918. // "zone",
  65919. // "nodeGroup"
  65920. // ],
  65921. // "parameters": {
  65922. // "filter": {
  65923. // "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).",
  65924. // "location": "query",
  65925. // "type": "string"
  65926. // },
  65927. // "maxResults": {
  65928. // "default": "500",
  65929. // "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)",
  65930. // "format": "uint32",
  65931. // "location": "query",
  65932. // "minimum": "0",
  65933. // "type": "integer"
  65934. // },
  65935. // "nodeGroup": {
  65936. // "description": "Name of the NodeGroup resource whose nodes you want to list.",
  65937. // "location": "path",
  65938. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  65939. // "required": true,
  65940. // "type": "string"
  65941. // },
  65942. // "orderBy": {
  65943. // "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.",
  65944. // "location": "query",
  65945. // "type": "string"
  65946. // },
  65947. // "pageToken": {
  65948. // "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.",
  65949. // "location": "query",
  65950. // "type": "string"
  65951. // },
  65952. // "project": {
  65953. // "description": "Project ID for this request.",
  65954. // "location": "path",
  65955. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  65956. // "required": true,
  65957. // "type": "string"
  65958. // },
  65959. // "zone": {
  65960. // "description": "The name of the zone for this request.",
  65961. // "location": "path",
  65962. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  65963. // "required": true,
  65964. // "type": "string"
  65965. // }
  65966. // },
  65967. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes",
  65968. // "response": {
  65969. // "$ref": "NodeGroupsListNodes"
  65970. // },
  65971. // "scopes": [
  65972. // "https://www.googleapis.com/auth/cloud-platform",
  65973. // "https://www.googleapis.com/auth/compute",
  65974. // "https://www.googleapis.com/auth/compute.readonly"
  65975. // ]
  65976. // }
  65977. }
  65978. // Pages invokes f for each page of results.
  65979. // A non-nil error returned from f will halt the iteration.
  65980. // The provided context supersedes any context provided to the Context method.
  65981. func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error {
  65982. c.ctx_ = ctx
  65983. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  65984. for {
  65985. x, err := c.Do()
  65986. if err != nil {
  65987. return err
  65988. }
  65989. if err := f(x); err != nil {
  65990. return err
  65991. }
  65992. if x.NextPageToken == "" {
  65993. return nil
  65994. }
  65995. c.PageToken(x.NextPageToken)
  65996. }
  65997. }
  65998. // method id "compute.nodeGroups.setIamPolicy":
  65999. type NodeGroupsSetIamPolicyCall struct {
  66000. s *Service
  66001. project string
  66002. zone string
  66003. resource string
  66004. zonesetpolicyrequest *ZoneSetPolicyRequest
  66005. urlParams_ gensupport.URLParams
  66006. ctx_ context.Context
  66007. header_ http.Header
  66008. }
  66009. // SetIamPolicy: Sets the access control policy on the specified
  66010. // resource. Replaces any existing policy.
  66011. func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall {
  66012. c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66013. c.project = project
  66014. c.zone = zone
  66015. c.resource = resource
  66016. c.zonesetpolicyrequest = zonesetpolicyrequest
  66017. return c
  66018. }
  66019. // Fields allows partial responses to be retrieved. See
  66020. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66021. // for more information.
  66022. func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall {
  66023. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66024. return c
  66025. }
  66026. // Context sets the context to be used in this call's Do method. Any
  66027. // pending HTTP request will be aborted if the provided context is
  66028. // canceled.
  66029. func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall {
  66030. c.ctx_ = ctx
  66031. return c
  66032. }
  66033. // Header returns an http.Header that can be modified by the caller to
  66034. // add HTTP headers to the request.
  66035. func (c *NodeGroupsSetIamPolicyCall) Header() http.Header {
  66036. if c.header_ == nil {
  66037. c.header_ = make(http.Header)
  66038. }
  66039. return c.header_
  66040. }
  66041. func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  66042. reqHeaders := make(http.Header)
  66043. for k, v := range c.header_ {
  66044. reqHeaders[k] = v
  66045. }
  66046. reqHeaders.Set("User-Agent", c.s.userAgent())
  66047. var body io.Reader = nil
  66048. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest)
  66049. if err != nil {
  66050. return nil, err
  66051. }
  66052. reqHeaders.Set("Content-Type", "application/json")
  66053. c.urlParams_.Set("alt", alt)
  66054. c.urlParams_.Set("prettyPrint", "false")
  66055. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy")
  66056. urls += "?" + c.urlParams_.Encode()
  66057. req, err := http.NewRequest("POST", urls, body)
  66058. if err != nil {
  66059. return nil, err
  66060. }
  66061. req.Header = reqHeaders
  66062. googleapi.Expand(req.URL, map[string]string{
  66063. "project": c.project,
  66064. "zone": c.zone,
  66065. "resource": c.resource,
  66066. })
  66067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66068. }
  66069. // Do executes the "compute.nodeGroups.setIamPolicy" call.
  66070. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  66071. // code is an error. Response headers are in either
  66072. // *Policy.ServerResponse.Header or (if a response was returned at all)
  66073. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  66074. // check whether the returned error was because http.StatusNotModified
  66075. // was returned.
  66076. func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  66077. gensupport.SetOptions(c.urlParams_, opts...)
  66078. res, err := c.doRequest("json")
  66079. if res != nil && res.StatusCode == http.StatusNotModified {
  66080. if res.Body != nil {
  66081. res.Body.Close()
  66082. }
  66083. return nil, &googleapi.Error{
  66084. Code: res.StatusCode,
  66085. Header: res.Header,
  66086. }
  66087. }
  66088. if err != nil {
  66089. return nil, err
  66090. }
  66091. defer googleapi.CloseBody(res)
  66092. if err := googleapi.CheckResponse(res); err != nil {
  66093. return nil, err
  66094. }
  66095. ret := &Policy{
  66096. ServerResponse: googleapi.ServerResponse{
  66097. Header: res.Header,
  66098. HTTPStatusCode: res.StatusCode,
  66099. },
  66100. }
  66101. target := &ret
  66102. if err := gensupport.DecodeResponse(target, res); err != nil {
  66103. return nil, err
  66104. }
  66105. return ret, nil
  66106. // {
  66107. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  66108. // "httpMethod": "POST",
  66109. // "id": "compute.nodeGroups.setIamPolicy",
  66110. // "parameterOrder": [
  66111. // "project",
  66112. // "zone",
  66113. // "resource"
  66114. // ],
  66115. // "parameters": {
  66116. // "project": {
  66117. // "description": "Project ID for this request.",
  66118. // "location": "path",
  66119. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66120. // "required": true,
  66121. // "type": "string"
  66122. // },
  66123. // "resource": {
  66124. // "description": "Name or id of the resource for this request.",
  66125. // "location": "path",
  66126. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66127. // "required": true,
  66128. // "type": "string"
  66129. // },
  66130. // "zone": {
  66131. // "description": "The name of the zone for this request.",
  66132. // "location": "path",
  66133. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66134. // "required": true,
  66135. // "type": "string"
  66136. // }
  66137. // },
  66138. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy",
  66139. // "request": {
  66140. // "$ref": "ZoneSetPolicyRequest"
  66141. // },
  66142. // "response": {
  66143. // "$ref": "Policy"
  66144. // },
  66145. // "scopes": [
  66146. // "https://www.googleapis.com/auth/cloud-platform",
  66147. // "https://www.googleapis.com/auth/compute"
  66148. // ]
  66149. // }
  66150. }
  66151. // method id "compute.nodeGroups.setNodeTemplate":
  66152. type NodeGroupsSetNodeTemplateCall struct {
  66153. s *Service
  66154. project string
  66155. zone string
  66156. nodeGroup string
  66157. nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest
  66158. urlParams_ gensupport.URLParams
  66159. ctx_ context.Context
  66160. header_ http.Header
  66161. }
  66162. // SetNodeTemplate: Updates the node template of the node group.
  66163. func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall {
  66164. c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66165. c.project = project
  66166. c.zone = zone
  66167. c.nodeGroup = nodeGroup
  66168. c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest
  66169. return c
  66170. }
  66171. // RequestId sets the optional parameter "requestId": An optional
  66172. // request ID to identify requests. Specify a unique request ID so that
  66173. // if you must retry your request, the server will know to ignore the
  66174. // request if it has already been completed.
  66175. //
  66176. // For example, consider a situation where you make an initial request
  66177. // and the request times out. If you make the request again with the
  66178. // same request ID, the server can check if original operation with the
  66179. // same request ID was received, and if so, will ignore the second
  66180. // request. This prevents clients from accidentally creating duplicate
  66181. // commitments.
  66182. //
  66183. // The request ID must be a valid UUID with the exception that zero UUID
  66184. // is not supported (00000000-0000-0000-0000-000000000000).
  66185. func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall {
  66186. c.urlParams_.Set("requestId", requestId)
  66187. return c
  66188. }
  66189. // Fields allows partial responses to be retrieved. See
  66190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66191. // for more information.
  66192. func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall {
  66193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66194. return c
  66195. }
  66196. // Context sets the context to be used in this call's Do method. Any
  66197. // pending HTTP request will be aborted if the provided context is
  66198. // canceled.
  66199. func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall {
  66200. c.ctx_ = ctx
  66201. return c
  66202. }
  66203. // Header returns an http.Header that can be modified by the caller to
  66204. // add HTTP headers to the request.
  66205. func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header {
  66206. if c.header_ == nil {
  66207. c.header_ = make(http.Header)
  66208. }
  66209. return c.header_
  66210. }
  66211. func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) {
  66212. reqHeaders := make(http.Header)
  66213. for k, v := range c.header_ {
  66214. reqHeaders[k] = v
  66215. }
  66216. reqHeaders.Set("User-Agent", c.s.userAgent())
  66217. var body io.Reader = nil
  66218. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest)
  66219. if err != nil {
  66220. return nil, err
  66221. }
  66222. reqHeaders.Set("Content-Type", "application/json")
  66223. c.urlParams_.Set("alt", alt)
  66224. c.urlParams_.Set("prettyPrint", "false")
  66225. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate")
  66226. urls += "?" + c.urlParams_.Encode()
  66227. req, err := http.NewRequest("POST", urls, body)
  66228. if err != nil {
  66229. return nil, err
  66230. }
  66231. req.Header = reqHeaders
  66232. googleapi.Expand(req.URL, map[string]string{
  66233. "project": c.project,
  66234. "zone": c.zone,
  66235. "nodeGroup": c.nodeGroup,
  66236. })
  66237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66238. }
  66239. // Do executes the "compute.nodeGroups.setNodeTemplate" call.
  66240. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66241. // status code is an error. Response headers are in either
  66242. // *Operation.ServerResponse.Header or (if a response was returned at
  66243. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66244. // to check whether the returned error was because
  66245. // http.StatusNotModified was returned.
  66246. func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66247. gensupport.SetOptions(c.urlParams_, opts...)
  66248. res, err := c.doRequest("json")
  66249. if res != nil && res.StatusCode == http.StatusNotModified {
  66250. if res.Body != nil {
  66251. res.Body.Close()
  66252. }
  66253. return nil, &googleapi.Error{
  66254. Code: res.StatusCode,
  66255. Header: res.Header,
  66256. }
  66257. }
  66258. if err != nil {
  66259. return nil, err
  66260. }
  66261. defer googleapi.CloseBody(res)
  66262. if err := googleapi.CheckResponse(res); err != nil {
  66263. return nil, err
  66264. }
  66265. ret := &Operation{
  66266. ServerResponse: googleapi.ServerResponse{
  66267. Header: res.Header,
  66268. HTTPStatusCode: res.StatusCode,
  66269. },
  66270. }
  66271. target := &ret
  66272. if err := gensupport.DecodeResponse(target, res); err != nil {
  66273. return nil, err
  66274. }
  66275. return ret, nil
  66276. // {
  66277. // "description": "Updates the node template of the node group.",
  66278. // "httpMethod": "POST",
  66279. // "id": "compute.nodeGroups.setNodeTemplate",
  66280. // "parameterOrder": [
  66281. // "project",
  66282. // "zone",
  66283. // "nodeGroup"
  66284. // ],
  66285. // "parameters": {
  66286. // "nodeGroup": {
  66287. // "description": "Name of the NodeGroup resource to update.",
  66288. // "location": "path",
  66289. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66290. // "required": true,
  66291. // "type": "string"
  66292. // },
  66293. // "project": {
  66294. // "description": "Project ID for this request.",
  66295. // "location": "path",
  66296. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66297. // "required": true,
  66298. // "type": "string"
  66299. // },
  66300. // "requestId": {
  66301. // "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).",
  66302. // "location": "query",
  66303. // "type": "string"
  66304. // },
  66305. // "zone": {
  66306. // "description": "The name of the zone for this request.",
  66307. // "location": "path",
  66308. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66309. // "required": true,
  66310. // "type": "string"
  66311. // }
  66312. // },
  66313. // "path": "{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate",
  66314. // "request": {
  66315. // "$ref": "NodeGroupsSetNodeTemplateRequest"
  66316. // },
  66317. // "response": {
  66318. // "$ref": "Operation"
  66319. // },
  66320. // "scopes": [
  66321. // "https://www.googleapis.com/auth/cloud-platform",
  66322. // "https://www.googleapis.com/auth/compute"
  66323. // ]
  66324. // }
  66325. }
  66326. // method id "compute.nodeGroups.testIamPermissions":
  66327. type NodeGroupsTestIamPermissionsCall struct {
  66328. s *Service
  66329. project string
  66330. zone string
  66331. resource string
  66332. testpermissionsrequest *TestPermissionsRequest
  66333. urlParams_ gensupport.URLParams
  66334. ctx_ context.Context
  66335. header_ http.Header
  66336. }
  66337. // TestIamPermissions: Returns permissions that a caller has on the
  66338. // specified resource.
  66339. func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall {
  66340. c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66341. c.project = project
  66342. c.zone = zone
  66343. c.resource = resource
  66344. c.testpermissionsrequest = testpermissionsrequest
  66345. return c
  66346. }
  66347. // Fields allows partial responses to be retrieved. See
  66348. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66349. // for more information.
  66350. func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall {
  66351. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66352. return c
  66353. }
  66354. // Context sets the context to be used in this call's Do method. Any
  66355. // pending HTTP request will be aborted if the provided context is
  66356. // canceled.
  66357. func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall {
  66358. c.ctx_ = ctx
  66359. return c
  66360. }
  66361. // Header returns an http.Header that can be modified by the caller to
  66362. // add HTTP headers to the request.
  66363. func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header {
  66364. if c.header_ == nil {
  66365. c.header_ = make(http.Header)
  66366. }
  66367. return c.header_
  66368. }
  66369. func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  66370. reqHeaders := make(http.Header)
  66371. for k, v := range c.header_ {
  66372. reqHeaders[k] = v
  66373. }
  66374. reqHeaders.Set("User-Agent", c.s.userAgent())
  66375. var body io.Reader = nil
  66376. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  66377. if err != nil {
  66378. return nil, err
  66379. }
  66380. reqHeaders.Set("Content-Type", "application/json")
  66381. c.urlParams_.Set("alt", alt)
  66382. c.urlParams_.Set("prettyPrint", "false")
  66383. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions")
  66384. urls += "?" + c.urlParams_.Encode()
  66385. req, err := http.NewRequest("POST", urls, body)
  66386. if err != nil {
  66387. return nil, err
  66388. }
  66389. req.Header = reqHeaders
  66390. googleapi.Expand(req.URL, map[string]string{
  66391. "project": c.project,
  66392. "zone": c.zone,
  66393. "resource": c.resource,
  66394. })
  66395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66396. }
  66397. // Do executes the "compute.nodeGroups.testIamPermissions" call.
  66398. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  66399. // non-2xx status code is an error. Response headers are in either
  66400. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  66401. // returned at all) in error.(*googleapi.Error).Header. Use
  66402. // googleapi.IsNotModified to check whether the returned error was
  66403. // because http.StatusNotModified was returned.
  66404. func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  66405. gensupport.SetOptions(c.urlParams_, opts...)
  66406. res, err := c.doRequest("json")
  66407. if res != nil && res.StatusCode == http.StatusNotModified {
  66408. if res.Body != nil {
  66409. res.Body.Close()
  66410. }
  66411. return nil, &googleapi.Error{
  66412. Code: res.StatusCode,
  66413. Header: res.Header,
  66414. }
  66415. }
  66416. if err != nil {
  66417. return nil, err
  66418. }
  66419. defer googleapi.CloseBody(res)
  66420. if err := googleapi.CheckResponse(res); err != nil {
  66421. return nil, err
  66422. }
  66423. ret := &TestPermissionsResponse{
  66424. ServerResponse: googleapi.ServerResponse{
  66425. Header: res.Header,
  66426. HTTPStatusCode: res.StatusCode,
  66427. },
  66428. }
  66429. target := &ret
  66430. if err := gensupport.DecodeResponse(target, res); err != nil {
  66431. return nil, err
  66432. }
  66433. return ret, nil
  66434. // {
  66435. // "description": "Returns permissions that a caller has on the specified resource.",
  66436. // "httpMethod": "POST",
  66437. // "id": "compute.nodeGroups.testIamPermissions",
  66438. // "parameterOrder": [
  66439. // "project",
  66440. // "zone",
  66441. // "resource"
  66442. // ],
  66443. // "parameters": {
  66444. // "project": {
  66445. // "description": "Project ID for this request.",
  66446. // "location": "path",
  66447. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66448. // "required": true,
  66449. // "type": "string"
  66450. // },
  66451. // "resource": {
  66452. // "description": "Name or id of the resource for this request.",
  66453. // "location": "path",
  66454. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66455. // "required": true,
  66456. // "type": "string"
  66457. // },
  66458. // "zone": {
  66459. // "description": "The name of the zone for this request.",
  66460. // "location": "path",
  66461. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66462. // "required": true,
  66463. // "type": "string"
  66464. // }
  66465. // },
  66466. // "path": "{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions",
  66467. // "request": {
  66468. // "$ref": "TestPermissionsRequest"
  66469. // },
  66470. // "response": {
  66471. // "$ref": "TestPermissionsResponse"
  66472. // },
  66473. // "scopes": [
  66474. // "https://www.googleapis.com/auth/cloud-platform",
  66475. // "https://www.googleapis.com/auth/compute",
  66476. // "https://www.googleapis.com/auth/compute.readonly"
  66477. // ]
  66478. // }
  66479. }
  66480. // method id "compute.nodeTemplates.aggregatedList":
  66481. type NodeTemplatesAggregatedListCall struct {
  66482. s *Service
  66483. project string
  66484. urlParams_ gensupport.URLParams
  66485. ifNoneMatch_ string
  66486. ctx_ context.Context
  66487. header_ http.Header
  66488. }
  66489. // AggregatedList: Retrieves an aggregated list of node templates.
  66490. func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall {
  66491. c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66492. c.project = project
  66493. return c
  66494. }
  66495. // Filter sets the optional parameter "filter": A filter expression that
  66496. // filters resources listed in the response. The expression must specify
  66497. // the field name, a comparison operator, and the value that you want to
  66498. // use for filtering. The value must be a string, a number, or a
  66499. // boolean. The comparison operator must be either =, !=, >, or <.
  66500. //
  66501. // For example, if you are filtering Compute Engine instances, you can
  66502. // exclude instances named example-instance by specifying name !=
  66503. // example-instance.
  66504. //
  66505. // You can also filter nested fields. For example, you could specify
  66506. // scheduling.automaticRestart = false to include instances only if they
  66507. // are not scheduled for automatic restarts. You can use filtering on
  66508. // nested fields to filter based on resource labels.
  66509. //
  66510. // To filter on multiple expressions, provide each separate expression
  66511. // within parentheses. For example, (scheduling.automaticRestart = true)
  66512. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  66513. // AND expression. However, you can include AND and OR expressions
  66514. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  66515. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  66516. // true).
  66517. func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall {
  66518. c.urlParams_.Set("filter", filter)
  66519. return c
  66520. }
  66521. // MaxResults sets the optional parameter "maxResults": The maximum
  66522. // number of results per page that should be returned. If the number of
  66523. // available results is larger than maxResults, Compute Engine returns a
  66524. // nextPageToken that can be used to get the next page of results in
  66525. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  66526. // (Default: 500)
  66527. func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall {
  66528. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  66529. return c
  66530. }
  66531. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  66532. // a certain order. By default, results are returned in alphanumerical
  66533. // order based on the resource name.
  66534. //
  66535. // You can also sort results in descending order based on the creation
  66536. // timestamp using orderBy="creationTimestamp desc". This sorts results
  66537. // based on the creationTimestamp field in reverse chronological order
  66538. // (newest result first). Use this to sort resources like operations so
  66539. // that the newest operation is returned first.
  66540. //
  66541. // Currently, only sorting by name or creationTimestamp desc is
  66542. // supported.
  66543. func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall {
  66544. c.urlParams_.Set("orderBy", orderBy)
  66545. return c
  66546. }
  66547. // PageToken sets the optional parameter "pageToken": Specifies a page
  66548. // token to use. Set pageToken to the nextPageToken returned by a
  66549. // previous list request to get the next page of results.
  66550. func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall {
  66551. c.urlParams_.Set("pageToken", pageToken)
  66552. return c
  66553. }
  66554. // Fields allows partial responses to be retrieved. See
  66555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66556. // for more information.
  66557. func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall {
  66558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66559. return c
  66560. }
  66561. // IfNoneMatch sets the optional parameter which makes the operation
  66562. // fail if the object's ETag matches the given value. This is useful for
  66563. // getting updates only after the object has changed since the last
  66564. // request. Use googleapi.IsNotModified to check whether the response
  66565. // error from Do is the result of In-None-Match.
  66566. func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall {
  66567. c.ifNoneMatch_ = entityTag
  66568. return c
  66569. }
  66570. // Context sets the context to be used in this call's Do method. Any
  66571. // pending HTTP request will be aborted if the provided context is
  66572. // canceled.
  66573. func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall {
  66574. c.ctx_ = ctx
  66575. return c
  66576. }
  66577. // Header returns an http.Header that can be modified by the caller to
  66578. // add HTTP headers to the request.
  66579. func (c *NodeTemplatesAggregatedListCall) Header() http.Header {
  66580. if c.header_ == nil {
  66581. c.header_ = make(http.Header)
  66582. }
  66583. return c.header_
  66584. }
  66585. func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  66586. reqHeaders := make(http.Header)
  66587. for k, v := range c.header_ {
  66588. reqHeaders[k] = v
  66589. }
  66590. reqHeaders.Set("User-Agent", c.s.userAgent())
  66591. if c.ifNoneMatch_ != "" {
  66592. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66593. }
  66594. var body io.Reader = nil
  66595. c.urlParams_.Set("alt", alt)
  66596. c.urlParams_.Set("prettyPrint", "false")
  66597. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTemplates")
  66598. urls += "?" + c.urlParams_.Encode()
  66599. req, err := http.NewRequest("GET", urls, body)
  66600. if err != nil {
  66601. return nil, err
  66602. }
  66603. req.Header = reqHeaders
  66604. googleapi.Expand(req.URL, map[string]string{
  66605. "project": c.project,
  66606. })
  66607. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66608. }
  66609. // Do executes the "compute.nodeTemplates.aggregatedList" call.
  66610. // Exactly one of *NodeTemplateAggregatedList or error will be non-nil.
  66611. // Any non-2xx status code is an error. Response headers are in either
  66612. // *NodeTemplateAggregatedList.ServerResponse.Header or (if a response
  66613. // was returned at all) in error.(*googleapi.Error).Header. Use
  66614. // googleapi.IsNotModified to check whether the returned error was
  66615. // because http.StatusNotModified was returned.
  66616. func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) {
  66617. gensupport.SetOptions(c.urlParams_, opts...)
  66618. res, err := c.doRequest("json")
  66619. if res != nil && res.StatusCode == http.StatusNotModified {
  66620. if res.Body != nil {
  66621. res.Body.Close()
  66622. }
  66623. return nil, &googleapi.Error{
  66624. Code: res.StatusCode,
  66625. Header: res.Header,
  66626. }
  66627. }
  66628. if err != nil {
  66629. return nil, err
  66630. }
  66631. defer googleapi.CloseBody(res)
  66632. if err := googleapi.CheckResponse(res); err != nil {
  66633. return nil, err
  66634. }
  66635. ret := &NodeTemplateAggregatedList{
  66636. ServerResponse: googleapi.ServerResponse{
  66637. Header: res.Header,
  66638. HTTPStatusCode: res.StatusCode,
  66639. },
  66640. }
  66641. target := &ret
  66642. if err := gensupport.DecodeResponse(target, res); err != nil {
  66643. return nil, err
  66644. }
  66645. return ret, nil
  66646. // {
  66647. // "description": "Retrieves an aggregated list of node templates.",
  66648. // "httpMethod": "GET",
  66649. // "id": "compute.nodeTemplates.aggregatedList",
  66650. // "parameterOrder": [
  66651. // "project"
  66652. // ],
  66653. // "parameters": {
  66654. // "filter": {
  66655. // "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).",
  66656. // "location": "query",
  66657. // "type": "string"
  66658. // },
  66659. // "maxResults": {
  66660. // "default": "500",
  66661. // "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)",
  66662. // "format": "uint32",
  66663. // "location": "query",
  66664. // "minimum": "0",
  66665. // "type": "integer"
  66666. // },
  66667. // "orderBy": {
  66668. // "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.",
  66669. // "location": "query",
  66670. // "type": "string"
  66671. // },
  66672. // "pageToken": {
  66673. // "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.",
  66674. // "location": "query",
  66675. // "type": "string"
  66676. // },
  66677. // "project": {
  66678. // "description": "Project ID for this request.",
  66679. // "location": "path",
  66680. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66681. // "required": true,
  66682. // "type": "string"
  66683. // }
  66684. // },
  66685. // "path": "{project}/aggregated/nodeTemplates",
  66686. // "response": {
  66687. // "$ref": "NodeTemplateAggregatedList"
  66688. // },
  66689. // "scopes": [
  66690. // "https://www.googleapis.com/auth/cloud-platform",
  66691. // "https://www.googleapis.com/auth/compute",
  66692. // "https://www.googleapis.com/auth/compute.readonly"
  66693. // ]
  66694. // }
  66695. }
  66696. // Pages invokes f for each page of results.
  66697. // A non-nil error returned from f will halt the iteration.
  66698. // The provided context supersedes any context provided to the Context method.
  66699. func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error {
  66700. c.ctx_ = ctx
  66701. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  66702. for {
  66703. x, err := c.Do()
  66704. if err != nil {
  66705. return err
  66706. }
  66707. if err := f(x); err != nil {
  66708. return err
  66709. }
  66710. if x.NextPageToken == "" {
  66711. return nil
  66712. }
  66713. c.PageToken(x.NextPageToken)
  66714. }
  66715. }
  66716. // method id "compute.nodeTemplates.delete":
  66717. type NodeTemplatesDeleteCall struct {
  66718. s *Service
  66719. project string
  66720. region string
  66721. nodeTemplate string
  66722. urlParams_ gensupport.URLParams
  66723. ctx_ context.Context
  66724. header_ http.Header
  66725. }
  66726. // Delete: Deletes the specified NodeTemplate resource.
  66727. func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall {
  66728. c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66729. c.project = project
  66730. c.region = region
  66731. c.nodeTemplate = nodeTemplate
  66732. return c
  66733. }
  66734. // RequestId sets the optional parameter "requestId": An optional
  66735. // request ID to identify requests. Specify a unique request ID so that
  66736. // if you must retry your request, the server will know to ignore the
  66737. // request if it has already been completed.
  66738. //
  66739. // For example, consider a situation where you make an initial request
  66740. // and the request times out. If you make the request again with the
  66741. // same request ID, the server can check if original operation with the
  66742. // same request ID was received, and if so, will ignore the second
  66743. // request. This prevents clients from accidentally creating duplicate
  66744. // commitments.
  66745. //
  66746. // The request ID must be a valid UUID with the exception that zero UUID
  66747. // is not supported (00000000-0000-0000-0000-000000000000).
  66748. func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall {
  66749. c.urlParams_.Set("requestId", requestId)
  66750. return c
  66751. }
  66752. // Fields allows partial responses to be retrieved. See
  66753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66754. // for more information.
  66755. func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall {
  66756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66757. return c
  66758. }
  66759. // Context sets the context to be used in this call's Do method. Any
  66760. // pending HTTP request will be aborted if the provided context is
  66761. // canceled.
  66762. func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall {
  66763. c.ctx_ = ctx
  66764. return c
  66765. }
  66766. // Header returns an http.Header that can be modified by the caller to
  66767. // add HTTP headers to the request.
  66768. func (c *NodeTemplatesDeleteCall) Header() http.Header {
  66769. if c.header_ == nil {
  66770. c.header_ = make(http.Header)
  66771. }
  66772. return c.header_
  66773. }
  66774. func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  66775. reqHeaders := make(http.Header)
  66776. for k, v := range c.header_ {
  66777. reqHeaders[k] = v
  66778. }
  66779. reqHeaders.Set("User-Agent", c.s.userAgent())
  66780. var body io.Reader = nil
  66781. c.urlParams_.Set("alt", alt)
  66782. c.urlParams_.Set("prettyPrint", "false")
  66783. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  66784. urls += "?" + c.urlParams_.Encode()
  66785. req, err := http.NewRequest("DELETE", urls, body)
  66786. if err != nil {
  66787. return nil, err
  66788. }
  66789. req.Header = reqHeaders
  66790. googleapi.Expand(req.URL, map[string]string{
  66791. "project": c.project,
  66792. "region": c.region,
  66793. "nodeTemplate": c.nodeTemplate,
  66794. })
  66795. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66796. }
  66797. // Do executes the "compute.nodeTemplates.delete" call.
  66798. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  66799. // status code is an error. Response headers are in either
  66800. // *Operation.ServerResponse.Header or (if a response was returned at
  66801. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66802. // to check whether the returned error was because
  66803. // http.StatusNotModified was returned.
  66804. func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  66805. gensupport.SetOptions(c.urlParams_, opts...)
  66806. res, err := c.doRequest("json")
  66807. if res != nil && res.StatusCode == http.StatusNotModified {
  66808. if res.Body != nil {
  66809. res.Body.Close()
  66810. }
  66811. return nil, &googleapi.Error{
  66812. Code: res.StatusCode,
  66813. Header: res.Header,
  66814. }
  66815. }
  66816. if err != nil {
  66817. return nil, err
  66818. }
  66819. defer googleapi.CloseBody(res)
  66820. if err := googleapi.CheckResponse(res); err != nil {
  66821. return nil, err
  66822. }
  66823. ret := &Operation{
  66824. ServerResponse: googleapi.ServerResponse{
  66825. Header: res.Header,
  66826. HTTPStatusCode: res.StatusCode,
  66827. },
  66828. }
  66829. target := &ret
  66830. if err := gensupport.DecodeResponse(target, res); err != nil {
  66831. return nil, err
  66832. }
  66833. return ret, nil
  66834. // {
  66835. // "description": "Deletes the specified NodeTemplate resource.",
  66836. // "httpMethod": "DELETE",
  66837. // "id": "compute.nodeTemplates.delete",
  66838. // "parameterOrder": [
  66839. // "project",
  66840. // "region",
  66841. // "nodeTemplate"
  66842. // ],
  66843. // "parameters": {
  66844. // "nodeTemplate": {
  66845. // "description": "Name of the NodeTemplate resource to delete.",
  66846. // "location": "path",
  66847. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  66848. // "required": true,
  66849. // "type": "string"
  66850. // },
  66851. // "project": {
  66852. // "description": "Project ID for this request.",
  66853. // "location": "path",
  66854. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  66855. // "required": true,
  66856. // "type": "string"
  66857. // },
  66858. // "region": {
  66859. // "description": "The name of the region for this request.",
  66860. // "location": "path",
  66861. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  66862. // "required": true,
  66863. // "type": "string"
  66864. // },
  66865. // "requestId": {
  66866. // "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).",
  66867. // "location": "query",
  66868. // "type": "string"
  66869. // }
  66870. // },
  66871. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  66872. // "response": {
  66873. // "$ref": "Operation"
  66874. // },
  66875. // "scopes": [
  66876. // "https://www.googleapis.com/auth/cloud-platform",
  66877. // "https://www.googleapis.com/auth/compute"
  66878. // ]
  66879. // }
  66880. }
  66881. // method id "compute.nodeTemplates.get":
  66882. type NodeTemplatesGetCall struct {
  66883. s *Service
  66884. project string
  66885. region string
  66886. nodeTemplate string
  66887. urlParams_ gensupport.URLParams
  66888. ifNoneMatch_ string
  66889. ctx_ context.Context
  66890. header_ http.Header
  66891. }
  66892. // Get: Returns the specified node template. Gets a list of available
  66893. // node templates by making a list() request.
  66894. func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall {
  66895. c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  66896. c.project = project
  66897. c.region = region
  66898. c.nodeTemplate = nodeTemplate
  66899. return c
  66900. }
  66901. // Fields allows partial responses to be retrieved. See
  66902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  66903. // for more information.
  66904. func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall {
  66905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  66906. return c
  66907. }
  66908. // IfNoneMatch sets the optional parameter which makes the operation
  66909. // fail if the object's ETag matches the given value. This is useful for
  66910. // getting updates only after the object has changed since the last
  66911. // request. Use googleapi.IsNotModified to check whether the response
  66912. // error from Do is the result of In-None-Match.
  66913. func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall {
  66914. c.ifNoneMatch_ = entityTag
  66915. return c
  66916. }
  66917. // Context sets the context to be used in this call's Do method. Any
  66918. // pending HTTP request will be aborted if the provided context is
  66919. // canceled.
  66920. func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall {
  66921. c.ctx_ = ctx
  66922. return c
  66923. }
  66924. // Header returns an http.Header that can be modified by the caller to
  66925. // add HTTP headers to the request.
  66926. func (c *NodeTemplatesGetCall) Header() http.Header {
  66927. if c.header_ == nil {
  66928. c.header_ = make(http.Header)
  66929. }
  66930. return c.header_
  66931. }
  66932. func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  66933. reqHeaders := make(http.Header)
  66934. for k, v := range c.header_ {
  66935. reqHeaders[k] = v
  66936. }
  66937. reqHeaders.Set("User-Agent", c.s.userAgent())
  66938. if c.ifNoneMatch_ != "" {
  66939. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  66940. }
  66941. var body io.Reader = nil
  66942. c.urlParams_.Set("alt", alt)
  66943. c.urlParams_.Set("prettyPrint", "false")
  66944. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{nodeTemplate}")
  66945. urls += "?" + c.urlParams_.Encode()
  66946. req, err := http.NewRequest("GET", urls, body)
  66947. if err != nil {
  66948. return nil, err
  66949. }
  66950. req.Header = reqHeaders
  66951. googleapi.Expand(req.URL, map[string]string{
  66952. "project": c.project,
  66953. "region": c.region,
  66954. "nodeTemplate": c.nodeTemplate,
  66955. })
  66956. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  66957. }
  66958. // Do executes the "compute.nodeTemplates.get" call.
  66959. // Exactly one of *NodeTemplate or error will be non-nil. Any non-2xx
  66960. // status code is an error. Response headers are in either
  66961. // *NodeTemplate.ServerResponse.Header or (if a response was returned at
  66962. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  66963. // to check whether the returned error was because
  66964. // http.StatusNotModified was returned.
  66965. func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) {
  66966. gensupport.SetOptions(c.urlParams_, opts...)
  66967. res, err := c.doRequest("json")
  66968. if res != nil && res.StatusCode == http.StatusNotModified {
  66969. if res.Body != nil {
  66970. res.Body.Close()
  66971. }
  66972. return nil, &googleapi.Error{
  66973. Code: res.StatusCode,
  66974. Header: res.Header,
  66975. }
  66976. }
  66977. if err != nil {
  66978. return nil, err
  66979. }
  66980. defer googleapi.CloseBody(res)
  66981. if err := googleapi.CheckResponse(res); err != nil {
  66982. return nil, err
  66983. }
  66984. ret := &NodeTemplate{
  66985. ServerResponse: googleapi.ServerResponse{
  66986. Header: res.Header,
  66987. HTTPStatusCode: res.StatusCode,
  66988. },
  66989. }
  66990. target := &ret
  66991. if err := gensupport.DecodeResponse(target, res); err != nil {
  66992. return nil, err
  66993. }
  66994. return ret, nil
  66995. // {
  66996. // "description": "Returns the specified node template. Gets a list of available node templates by making a list() request.",
  66997. // "httpMethod": "GET",
  66998. // "id": "compute.nodeTemplates.get",
  66999. // "parameterOrder": [
  67000. // "project",
  67001. // "region",
  67002. // "nodeTemplate"
  67003. // ],
  67004. // "parameters": {
  67005. // "nodeTemplate": {
  67006. // "description": "Name of the node template to return.",
  67007. // "location": "path",
  67008. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67009. // "required": true,
  67010. // "type": "string"
  67011. // },
  67012. // "project": {
  67013. // "description": "Project ID for this request.",
  67014. // "location": "path",
  67015. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67016. // "required": true,
  67017. // "type": "string"
  67018. // },
  67019. // "region": {
  67020. // "description": "The name of the region for this request.",
  67021. // "location": "path",
  67022. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67023. // "required": true,
  67024. // "type": "string"
  67025. // }
  67026. // },
  67027. // "path": "{project}/regions/{region}/nodeTemplates/{nodeTemplate}",
  67028. // "response": {
  67029. // "$ref": "NodeTemplate"
  67030. // },
  67031. // "scopes": [
  67032. // "https://www.googleapis.com/auth/cloud-platform",
  67033. // "https://www.googleapis.com/auth/compute",
  67034. // "https://www.googleapis.com/auth/compute.readonly"
  67035. // ]
  67036. // }
  67037. }
  67038. // method id "compute.nodeTemplates.getIamPolicy":
  67039. type NodeTemplatesGetIamPolicyCall struct {
  67040. s *Service
  67041. project string
  67042. region string
  67043. resource string
  67044. urlParams_ gensupport.URLParams
  67045. ifNoneMatch_ string
  67046. ctx_ context.Context
  67047. header_ http.Header
  67048. }
  67049. // GetIamPolicy: Gets the access control policy for a resource. May be
  67050. // empty if no such policy or resource exists.
  67051. func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall {
  67052. c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67053. c.project = project
  67054. c.region = region
  67055. c.resource = resource
  67056. return c
  67057. }
  67058. // Fields allows partial responses to be retrieved. See
  67059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67060. // for more information.
  67061. func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall {
  67062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67063. return c
  67064. }
  67065. // IfNoneMatch sets the optional parameter which makes the operation
  67066. // fail if the object's ETag matches the given value. This is useful for
  67067. // getting updates only after the object has changed since the last
  67068. // request. Use googleapi.IsNotModified to check whether the response
  67069. // error from Do is the result of In-None-Match.
  67070. func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall {
  67071. c.ifNoneMatch_ = entityTag
  67072. return c
  67073. }
  67074. // Context sets the context to be used in this call's Do method. Any
  67075. // pending HTTP request will be aborted if the provided context is
  67076. // canceled.
  67077. func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall {
  67078. c.ctx_ = ctx
  67079. return c
  67080. }
  67081. // Header returns an http.Header that can be modified by the caller to
  67082. // add HTTP headers to the request.
  67083. func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header {
  67084. if c.header_ == nil {
  67085. c.header_ = make(http.Header)
  67086. }
  67087. return c.header_
  67088. }
  67089. func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  67090. reqHeaders := make(http.Header)
  67091. for k, v := range c.header_ {
  67092. reqHeaders[k] = v
  67093. }
  67094. reqHeaders.Set("User-Agent", c.s.userAgent())
  67095. if c.ifNoneMatch_ != "" {
  67096. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67097. }
  67098. var body io.Reader = nil
  67099. c.urlParams_.Set("alt", alt)
  67100. c.urlParams_.Set("prettyPrint", "false")
  67101. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy")
  67102. urls += "?" + c.urlParams_.Encode()
  67103. req, err := http.NewRequest("GET", urls, body)
  67104. if err != nil {
  67105. return nil, err
  67106. }
  67107. req.Header = reqHeaders
  67108. googleapi.Expand(req.URL, map[string]string{
  67109. "project": c.project,
  67110. "region": c.region,
  67111. "resource": c.resource,
  67112. })
  67113. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67114. }
  67115. // Do executes the "compute.nodeTemplates.getIamPolicy" call.
  67116. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  67117. // code is an error. Response headers are in either
  67118. // *Policy.ServerResponse.Header or (if a response was returned at all)
  67119. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  67120. // check whether the returned error was because http.StatusNotModified
  67121. // was returned.
  67122. func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  67123. gensupport.SetOptions(c.urlParams_, opts...)
  67124. res, err := c.doRequest("json")
  67125. if res != nil && res.StatusCode == http.StatusNotModified {
  67126. if res.Body != nil {
  67127. res.Body.Close()
  67128. }
  67129. return nil, &googleapi.Error{
  67130. Code: res.StatusCode,
  67131. Header: res.Header,
  67132. }
  67133. }
  67134. if err != nil {
  67135. return nil, err
  67136. }
  67137. defer googleapi.CloseBody(res)
  67138. if err := googleapi.CheckResponse(res); err != nil {
  67139. return nil, err
  67140. }
  67141. ret := &Policy{
  67142. ServerResponse: googleapi.ServerResponse{
  67143. Header: res.Header,
  67144. HTTPStatusCode: res.StatusCode,
  67145. },
  67146. }
  67147. target := &ret
  67148. if err := gensupport.DecodeResponse(target, res); err != nil {
  67149. return nil, err
  67150. }
  67151. return ret, nil
  67152. // {
  67153. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  67154. // "httpMethod": "GET",
  67155. // "id": "compute.nodeTemplates.getIamPolicy",
  67156. // "parameterOrder": [
  67157. // "project",
  67158. // "region",
  67159. // "resource"
  67160. // ],
  67161. // "parameters": {
  67162. // "project": {
  67163. // "description": "Project ID for this request.",
  67164. // "location": "path",
  67165. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67166. // "required": true,
  67167. // "type": "string"
  67168. // },
  67169. // "region": {
  67170. // "description": "The name of the region for this request.",
  67171. // "location": "path",
  67172. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67173. // "required": true,
  67174. // "type": "string"
  67175. // },
  67176. // "resource": {
  67177. // "description": "Name or id of the resource for this request.",
  67178. // "location": "path",
  67179. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67180. // "required": true,
  67181. // "type": "string"
  67182. // }
  67183. // },
  67184. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy",
  67185. // "response": {
  67186. // "$ref": "Policy"
  67187. // },
  67188. // "scopes": [
  67189. // "https://www.googleapis.com/auth/cloud-platform",
  67190. // "https://www.googleapis.com/auth/compute",
  67191. // "https://www.googleapis.com/auth/compute.readonly"
  67192. // ]
  67193. // }
  67194. }
  67195. // method id "compute.nodeTemplates.insert":
  67196. type NodeTemplatesInsertCall struct {
  67197. s *Service
  67198. project string
  67199. region string
  67200. nodetemplate *NodeTemplate
  67201. urlParams_ gensupport.URLParams
  67202. ctx_ context.Context
  67203. header_ http.Header
  67204. }
  67205. // Insert: Creates a NodeTemplate resource in the specified project
  67206. // using the data included in the request.
  67207. func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall {
  67208. c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67209. c.project = project
  67210. c.region = region
  67211. c.nodetemplate = nodetemplate
  67212. return c
  67213. }
  67214. // RequestId sets the optional parameter "requestId": An optional
  67215. // request ID to identify requests. Specify a unique request ID so that
  67216. // if you must retry your request, the server will know to ignore the
  67217. // request if it has already been completed.
  67218. //
  67219. // For example, consider a situation where you make an initial request
  67220. // and the request times out. If you make the request again with the
  67221. // same request ID, the server can check if original operation with the
  67222. // same request ID was received, and if so, will ignore the second
  67223. // request. This prevents clients from accidentally creating duplicate
  67224. // commitments.
  67225. //
  67226. // The request ID must be a valid UUID with the exception that zero UUID
  67227. // is not supported (00000000-0000-0000-0000-000000000000).
  67228. func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall {
  67229. c.urlParams_.Set("requestId", requestId)
  67230. return c
  67231. }
  67232. // Fields allows partial responses to be retrieved. See
  67233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67234. // for more information.
  67235. func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall {
  67236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67237. return c
  67238. }
  67239. // Context sets the context to be used in this call's Do method. Any
  67240. // pending HTTP request will be aborted if the provided context is
  67241. // canceled.
  67242. func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall {
  67243. c.ctx_ = ctx
  67244. return c
  67245. }
  67246. // Header returns an http.Header that can be modified by the caller to
  67247. // add HTTP headers to the request.
  67248. func (c *NodeTemplatesInsertCall) Header() http.Header {
  67249. if c.header_ == nil {
  67250. c.header_ = make(http.Header)
  67251. }
  67252. return c.header_
  67253. }
  67254. func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  67255. reqHeaders := make(http.Header)
  67256. for k, v := range c.header_ {
  67257. reqHeaders[k] = v
  67258. }
  67259. reqHeaders.Set("User-Agent", c.s.userAgent())
  67260. var body io.Reader = nil
  67261. body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate)
  67262. if err != nil {
  67263. return nil, err
  67264. }
  67265. reqHeaders.Set("Content-Type", "application/json")
  67266. c.urlParams_.Set("alt", alt)
  67267. c.urlParams_.Set("prettyPrint", "false")
  67268. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  67269. urls += "?" + c.urlParams_.Encode()
  67270. req, err := http.NewRequest("POST", urls, body)
  67271. if err != nil {
  67272. return nil, err
  67273. }
  67274. req.Header = reqHeaders
  67275. googleapi.Expand(req.URL, map[string]string{
  67276. "project": c.project,
  67277. "region": c.region,
  67278. })
  67279. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67280. }
  67281. // Do executes the "compute.nodeTemplates.insert" call.
  67282. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  67283. // status code is an error. Response headers are in either
  67284. // *Operation.ServerResponse.Header or (if a response was returned at
  67285. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  67286. // to check whether the returned error was because
  67287. // http.StatusNotModified was returned.
  67288. func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  67289. gensupport.SetOptions(c.urlParams_, opts...)
  67290. res, err := c.doRequest("json")
  67291. if res != nil && res.StatusCode == http.StatusNotModified {
  67292. if res.Body != nil {
  67293. res.Body.Close()
  67294. }
  67295. return nil, &googleapi.Error{
  67296. Code: res.StatusCode,
  67297. Header: res.Header,
  67298. }
  67299. }
  67300. if err != nil {
  67301. return nil, err
  67302. }
  67303. defer googleapi.CloseBody(res)
  67304. if err := googleapi.CheckResponse(res); err != nil {
  67305. return nil, err
  67306. }
  67307. ret := &Operation{
  67308. ServerResponse: googleapi.ServerResponse{
  67309. Header: res.Header,
  67310. HTTPStatusCode: res.StatusCode,
  67311. },
  67312. }
  67313. target := &ret
  67314. if err := gensupport.DecodeResponse(target, res); err != nil {
  67315. return nil, err
  67316. }
  67317. return ret, nil
  67318. // {
  67319. // "description": "Creates a NodeTemplate resource in the specified project using the data included in the request.",
  67320. // "httpMethod": "POST",
  67321. // "id": "compute.nodeTemplates.insert",
  67322. // "parameterOrder": [
  67323. // "project",
  67324. // "region"
  67325. // ],
  67326. // "parameters": {
  67327. // "project": {
  67328. // "description": "Project ID for this request.",
  67329. // "location": "path",
  67330. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67331. // "required": true,
  67332. // "type": "string"
  67333. // },
  67334. // "region": {
  67335. // "description": "The name of the region for this request.",
  67336. // "location": "path",
  67337. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67338. // "required": true,
  67339. // "type": "string"
  67340. // },
  67341. // "requestId": {
  67342. // "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).",
  67343. // "location": "query",
  67344. // "type": "string"
  67345. // }
  67346. // },
  67347. // "path": "{project}/regions/{region}/nodeTemplates",
  67348. // "request": {
  67349. // "$ref": "NodeTemplate"
  67350. // },
  67351. // "response": {
  67352. // "$ref": "Operation"
  67353. // },
  67354. // "scopes": [
  67355. // "https://www.googleapis.com/auth/cloud-platform",
  67356. // "https://www.googleapis.com/auth/compute"
  67357. // ]
  67358. // }
  67359. }
  67360. // method id "compute.nodeTemplates.list":
  67361. type NodeTemplatesListCall struct {
  67362. s *Service
  67363. project string
  67364. region string
  67365. urlParams_ gensupport.URLParams
  67366. ifNoneMatch_ string
  67367. ctx_ context.Context
  67368. header_ http.Header
  67369. }
  67370. // List: Retrieves a list of node templates available to the specified
  67371. // project.
  67372. func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall {
  67373. c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67374. c.project = project
  67375. c.region = region
  67376. return c
  67377. }
  67378. // Filter sets the optional parameter "filter": A filter expression that
  67379. // filters resources listed in the response. The expression must specify
  67380. // the field name, a comparison operator, and the value that you want to
  67381. // use for filtering. The value must be a string, a number, or a
  67382. // boolean. The comparison operator must be either =, !=, >, or <.
  67383. //
  67384. // For example, if you are filtering Compute Engine instances, you can
  67385. // exclude instances named example-instance by specifying name !=
  67386. // example-instance.
  67387. //
  67388. // You can also filter nested fields. For example, you could specify
  67389. // scheduling.automaticRestart = false to include instances only if they
  67390. // are not scheduled for automatic restarts. You can use filtering on
  67391. // nested fields to filter based on resource labels.
  67392. //
  67393. // To filter on multiple expressions, provide each separate expression
  67394. // within parentheses. For example, (scheduling.automaticRestart = true)
  67395. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67396. // AND expression. However, you can include AND and OR expressions
  67397. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67398. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67399. // true).
  67400. func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall {
  67401. c.urlParams_.Set("filter", filter)
  67402. return c
  67403. }
  67404. // MaxResults sets the optional parameter "maxResults": The maximum
  67405. // number of results per page that should be returned. If the number of
  67406. // available results is larger than maxResults, Compute Engine returns a
  67407. // nextPageToken that can be used to get the next page of results in
  67408. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67409. // (Default: 500)
  67410. func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall {
  67411. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67412. return c
  67413. }
  67414. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67415. // a certain order. By default, results are returned in alphanumerical
  67416. // order based on the resource name.
  67417. //
  67418. // You can also sort results in descending order based on the creation
  67419. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67420. // based on the creationTimestamp field in reverse chronological order
  67421. // (newest result first). Use this to sort resources like operations so
  67422. // that the newest operation is returned first.
  67423. //
  67424. // Currently, only sorting by name or creationTimestamp desc is
  67425. // supported.
  67426. func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall {
  67427. c.urlParams_.Set("orderBy", orderBy)
  67428. return c
  67429. }
  67430. // PageToken sets the optional parameter "pageToken": Specifies a page
  67431. // token to use. Set pageToken to the nextPageToken returned by a
  67432. // previous list request to get the next page of results.
  67433. func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall {
  67434. c.urlParams_.Set("pageToken", pageToken)
  67435. return c
  67436. }
  67437. // Fields allows partial responses to be retrieved. See
  67438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67439. // for more information.
  67440. func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall {
  67441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67442. return c
  67443. }
  67444. // IfNoneMatch sets the optional parameter which makes the operation
  67445. // fail if the object's ETag matches the given value. This is useful for
  67446. // getting updates only after the object has changed since the last
  67447. // request. Use googleapi.IsNotModified to check whether the response
  67448. // error from Do is the result of In-None-Match.
  67449. func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall {
  67450. c.ifNoneMatch_ = entityTag
  67451. return c
  67452. }
  67453. // Context sets the context to be used in this call's Do method. Any
  67454. // pending HTTP request will be aborted if the provided context is
  67455. // canceled.
  67456. func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall {
  67457. c.ctx_ = ctx
  67458. return c
  67459. }
  67460. // Header returns an http.Header that can be modified by the caller to
  67461. // add HTTP headers to the request.
  67462. func (c *NodeTemplatesListCall) Header() http.Header {
  67463. if c.header_ == nil {
  67464. c.header_ = make(http.Header)
  67465. }
  67466. return c.header_
  67467. }
  67468. func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  67469. reqHeaders := make(http.Header)
  67470. for k, v := range c.header_ {
  67471. reqHeaders[k] = v
  67472. }
  67473. reqHeaders.Set("User-Agent", c.s.userAgent())
  67474. if c.ifNoneMatch_ != "" {
  67475. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  67476. }
  67477. var body io.Reader = nil
  67478. c.urlParams_.Set("alt", alt)
  67479. c.urlParams_.Set("prettyPrint", "false")
  67480. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates")
  67481. urls += "?" + c.urlParams_.Encode()
  67482. req, err := http.NewRequest("GET", urls, body)
  67483. if err != nil {
  67484. return nil, err
  67485. }
  67486. req.Header = reqHeaders
  67487. googleapi.Expand(req.URL, map[string]string{
  67488. "project": c.project,
  67489. "region": c.region,
  67490. })
  67491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67492. }
  67493. // Do executes the "compute.nodeTemplates.list" call.
  67494. // Exactly one of *NodeTemplateList or error will be non-nil. Any
  67495. // non-2xx status code is an error. Response headers are in either
  67496. // *NodeTemplateList.ServerResponse.Header or (if a response was
  67497. // returned at all) in error.(*googleapi.Error).Header. Use
  67498. // googleapi.IsNotModified to check whether the returned error was
  67499. // because http.StatusNotModified was returned.
  67500. func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) {
  67501. gensupport.SetOptions(c.urlParams_, opts...)
  67502. res, err := c.doRequest("json")
  67503. if res != nil && res.StatusCode == http.StatusNotModified {
  67504. if res.Body != nil {
  67505. res.Body.Close()
  67506. }
  67507. return nil, &googleapi.Error{
  67508. Code: res.StatusCode,
  67509. Header: res.Header,
  67510. }
  67511. }
  67512. if err != nil {
  67513. return nil, err
  67514. }
  67515. defer googleapi.CloseBody(res)
  67516. if err := googleapi.CheckResponse(res); err != nil {
  67517. return nil, err
  67518. }
  67519. ret := &NodeTemplateList{
  67520. ServerResponse: googleapi.ServerResponse{
  67521. Header: res.Header,
  67522. HTTPStatusCode: res.StatusCode,
  67523. },
  67524. }
  67525. target := &ret
  67526. if err := gensupport.DecodeResponse(target, res); err != nil {
  67527. return nil, err
  67528. }
  67529. return ret, nil
  67530. // {
  67531. // "description": "Retrieves a list of node templates available to the specified project.",
  67532. // "httpMethod": "GET",
  67533. // "id": "compute.nodeTemplates.list",
  67534. // "parameterOrder": [
  67535. // "project",
  67536. // "region"
  67537. // ],
  67538. // "parameters": {
  67539. // "filter": {
  67540. // "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).",
  67541. // "location": "query",
  67542. // "type": "string"
  67543. // },
  67544. // "maxResults": {
  67545. // "default": "500",
  67546. // "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)",
  67547. // "format": "uint32",
  67548. // "location": "query",
  67549. // "minimum": "0",
  67550. // "type": "integer"
  67551. // },
  67552. // "orderBy": {
  67553. // "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.",
  67554. // "location": "query",
  67555. // "type": "string"
  67556. // },
  67557. // "pageToken": {
  67558. // "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.",
  67559. // "location": "query",
  67560. // "type": "string"
  67561. // },
  67562. // "project": {
  67563. // "description": "Project ID for this request.",
  67564. // "location": "path",
  67565. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67566. // "required": true,
  67567. // "type": "string"
  67568. // },
  67569. // "region": {
  67570. // "description": "The name of the region for this request.",
  67571. // "location": "path",
  67572. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67573. // "required": true,
  67574. // "type": "string"
  67575. // }
  67576. // },
  67577. // "path": "{project}/regions/{region}/nodeTemplates",
  67578. // "response": {
  67579. // "$ref": "NodeTemplateList"
  67580. // },
  67581. // "scopes": [
  67582. // "https://www.googleapis.com/auth/cloud-platform",
  67583. // "https://www.googleapis.com/auth/compute",
  67584. // "https://www.googleapis.com/auth/compute.readonly"
  67585. // ]
  67586. // }
  67587. }
  67588. // Pages invokes f for each page of results.
  67589. // A non-nil error returned from f will halt the iteration.
  67590. // The provided context supersedes any context provided to the Context method.
  67591. func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error {
  67592. c.ctx_ = ctx
  67593. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  67594. for {
  67595. x, err := c.Do()
  67596. if err != nil {
  67597. return err
  67598. }
  67599. if err := f(x); err != nil {
  67600. return err
  67601. }
  67602. if x.NextPageToken == "" {
  67603. return nil
  67604. }
  67605. c.PageToken(x.NextPageToken)
  67606. }
  67607. }
  67608. // method id "compute.nodeTemplates.setIamPolicy":
  67609. type NodeTemplatesSetIamPolicyCall struct {
  67610. s *Service
  67611. project string
  67612. region string
  67613. resource string
  67614. regionsetpolicyrequest *RegionSetPolicyRequest
  67615. urlParams_ gensupport.URLParams
  67616. ctx_ context.Context
  67617. header_ http.Header
  67618. }
  67619. // SetIamPolicy: Sets the access control policy on the specified
  67620. // resource. Replaces any existing policy.
  67621. func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall {
  67622. c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67623. c.project = project
  67624. c.region = region
  67625. c.resource = resource
  67626. c.regionsetpolicyrequest = regionsetpolicyrequest
  67627. return c
  67628. }
  67629. // Fields allows partial responses to be retrieved. See
  67630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67631. // for more information.
  67632. func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall {
  67633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67634. return c
  67635. }
  67636. // Context sets the context to be used in this call's Do method. Any
  67637. // pending HTTP request will be aborted if the provided context is
  67638. // canceled.
  67639. func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall {
  67640. c.ctx_ = ctx
  67641. return c
  67642. }
  67643. // Header returns an http.Header that can be modified by the caller to
  67644. // add HTTP headers to the request.
  67645. func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header {
  67646. if c.header_ == nil {
  67647. c.header_ = make(http.Header)
  67648. }
  67649. return c.header_
  67650. }
  67651. func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  67652. reqHeaders := make(http.Header)
  67653. for k, v := range c.header_ {
  67654. reqHeaders[k] = v
  67655. }
  67656. reqHeaders.Set("User-Agent", c.s.userAgent())
  67657. var body io.Reader = nil
  67658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  67659. if err != nil {
  67660. return nil, err
  67661. }
  67662. reqHeaders.Set("Content-Type", "application/json")
  67663. c.urlParams_.Set("alt", alt)
  67664. c.urlParams_.Set("prettyPrint", "false")
  67665. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy")
  67666. urls += "?" + c.urlParams_.Encode()
  67667. req, err := http.NewRequest("POST", urls, body)
  67668. if err != nil {
  67669. return nil, err
  67670. }
  67671. req.Header = reqHeaders
  67672. googleapi.Expand(req.URL, map[string]string{
  67673. "project": c.project,
  67674. "region": c.region,
  67675. "resource": c.resource,
  67676. })
  67677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67678. }
  67679. // Do executes the "compute.nodeTemplates.setIamPolicy" call.
  67680. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  67681. // code is an error. Response headers are in either
  67682. // *Policy.ServerResponse.Header or (if a response was returned at all)
  67683. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  67684. // check whether the returned error was because http.StatusNotModified
  67685. // was returned.
  67686. func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  67687. gensupport.SetOptions(c.urlParams_, opts...)
  67688. res, err := c.doRequest("json")
  67689. if res != nil && res.StatusCode == http.StatusNotModified {
  67690. if res.Body != nil {
  67691. res.Body.Close()
  67692. }
  67693. return nil, &googleapi.Error{
  67694. Code: res.StatusCode,
  67695. Header: res.Header,
  67696. }
  67697. }
  67698. if err != nil {
  67699. return nil, err
  67700. }
  67701. defer googleapi.CloseBody(res)
  67702. if err := googleapi.CheckResponse(res); err != nil {
  67703. return nil, err
  67704. }
  67705. ret := &Policy{
  67706. ServerResponse: googleapi.ServerResponse{
  67707. Header: res.Header,
  67708. HTTPStatusCode: res.StatusCode,
  67709. },
  67710. }
  67711. target := &ret
  67712. if err := gensupport.DecodeResponse(target, res); err != nil {
  67713. return nil, err
  67714. }
  67715. return ret, nil
  67716. // {
  67717. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  67718. // "httpMethod": "POST",
  67719. // "id": "compute.nodeTemplates.setIamPolicy",
  67720. // "parameterOrder": [
  67721. // "project",
  67722. // "region",
  67723. // "resource"
  67724. // ],
  67725. // "parameters": {
  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": "The name of the region for 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. // "resource": {
  67741. // "description": "Name or id of the resource for this request.",
  67742. // "location": "path",
  67743. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67744. // "required": true,
  67745. // "type": "string"
  67746. // }
  67747. // },
  67748. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy",
  67749. // "request": {
  67750. // "$ref": "RegionSetPolicyRequest"
  67751. // },
  67752. // "response": {
  67753. // "$ref": "Policy"
  67754. // },
  67755. // "scopes": [
  67756. // "https://www.googleapis.com/auth/cloud-platform",
  67757. // "https://www.googleapis.com/auth/compute"
  67758. // ]
  67759. // }
  67760. }
  67761. // method id "compute.nodeTemplates.testIamPermissions":
  67762. type NodeTemplatesTestIamPermissionsCall struct {
  67763. s *Service
  67764. project string
  67765. region string
  67766. resource string
  67767. testpermissionsrequest *TestPermissionsRequest
  67768. urlParams_ gensupport.URLParams
  67769. ctx_ context.Context
  67770. header_ http.Header
  67771. }
  67772. // TestIamPermissions: Returns permissions that a caller has on the
  67773. // specified resource.
  67774. func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall {
  67775. c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67776. c.project = project
  67777. c.region = region
  67778. c.resource = resource
  67779. c.testpermissionsrequest = testpermissionsrequest
  67780. return c
  67781. }
  67782. // Fields allows partial responses to be retrieved. See
  67783. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67784. // for more information.
  67785. func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall {
  67786. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67787. return c
  67788. }
  67789. // Context sets the context to be used in this call's Do method. Any
  67790. // pending HTTP request will be aborted if the provided context is
  67791. // canceled.
  67792. func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall {
  67793. c.ctx_ = ctx
  67794. return c
  67795. }
  67796. // Header returns an http.Header that can be modified by the caller to
  67797. // add HTTP headers to the request.
  67798. func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header {
  67799. if c.header_ == nil {
  67800. c.header_ = make(http.Header)
  67801. }
  67802. return c.header_
  67803. }
  67804. func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  67805. reqHeaders := make(http.Header)
  67806. for k, v := range c.header_ {
  67807. reqHeaders[k] = v
  67808. }
  67809. reqHeaders.Set("User-Agent", c.s.userAgent())
  67810. var body io.Reader = nil
  67811. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  67812. if err != nil {
  67813. return nil, err
  67814. }
  67815. reqHeaders.Set("Content-Type", "application/json")
  67816. c.urlParams_.Set("alt", alt)
  67817. c.urlParams_.Set("prettyPrint", "false")
  67818. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions")
  67819. urls += "?" + c.urlParams_.Encode()
  67820. req, err := http.NewRequest("POST", urls, body)
  67821. if err != nil {
  67822. return nil, err
  67823. }
  67824. req.Header = reqHeaders
  67825. googleapi.Expand(req.URL, map[string]string{
  67826. "project": c.project,
  67827. "region": c.region,
  67828. "resource": c.resource,
  67829. })
  67830. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  67831. }
  67832. // Do executes the "compute.nodeTemplates.testIamPermissions" call.
  67833. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  67834. // non-2xx status code is an error. Response headers are in either
  67835. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  67836. // returned at all) in error.(*googleapi.Error).Header. Use
  67837. // googleapi.IsNotModified to check whether the returned error was
  67838. // because http.StatusNotModified was returned.
  67839. func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  67840. gensupport.SetOptions(c.urlParams_, opts...)
  67841. res, err := c.doRequest("json")
  67842. if res != nil && res.StatusCode == http.StatusNotModified {
  67843. if res.Body != nil {
  67844. res.Body.Close()
  67845. }
  67846. return nil, &googleapi.Error{
  67847. Code: res.StatusCode,
  67848. Header: res.Header,
  67849. }
  67850. }
  67851. if err != nil {
  67852. return nil, err
  67853. }
  67854. defer googleapi.CloseBody(res)
  67855. if err := googleapi.CheckResponse(res); err != nil {
  67856. return nil, err
  67857. }
  67858. ret := &TestPermissionsResponse{
  67859. ServerResponse: googleapi.ServerResponse{
  67860. Header: res.Header,
  67861. HTTPStatusCode: res.StatusCode,
  67862. },
  67863. }
  67864. target := &ret
  67865. if err := gensupport.DecodeResponse(target, res); err != nil {
  67866. return nil, err
  67867. }
  67868. return ret, nil
  67869. // {
  67870. // "description": "Returns permissions that a caller has on the specified resource.",
  67871. // "httpMethod": "POST",
  67872. // "id": "compute.nodeTemplates.testIamPermissions",
  67873. // "parameterOrder": [
  67874. // "project",
  67875. // "region",
  67876. // "resource"
  67877. // ],
  67878. // "parameters": {
  67879. // "project": {
  67880. // "description": "Project ID for this request.",
  67881. // "location": "path",
  67882. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  67883. // "required": true,
  67884. // "type": "string"
  67885. // },
  67886. // "region": {
  67887. // "description": "The name of the region for this request.",
  67888. // "location": "path",
  67889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  67890. // "required": true,
  67891. // "type": "string"
  67892. // },
  67893. // "resource": {
  67894. // "description": "Name or id of the resource for this request.",
  67895. // "location": "path",
  67896. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  67897. // "required": true,
  67898. // "type": "string"
  67899. // }
  67900. // },
  67901. // "path": "{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions",
  67902. // "request": {
  67903. // "$ref": "TestPermissionsRequest"
  67904. // },
  67905. // "response": {
  67906. // "$ref": "TestPermissionsResponse"
  67907. // },
  67908. // "scopes": [
  67909. // "https://www.googleapis.com/auth/cloud-platform",
  67910. // "https://www.googleapis.com/auth/compute",
  67911. // "https://www.googleapis.com/auth/compute.readonly"
  67912. // ]
  67913. // }
  67914. }
  67915. // method id "compute.nodeTypes.aggregatedList":
  67916. type NodeTypesAggregatedListCall struct {
  67917. s *Service
  67918. project string
  67919. urlParams_ gensupport.URLParams
  67920. ifNoneMatch_ string
  67921. ctx_ context.Context
  67922. header_ http.Header
  67923. }
  67924. // AggregatedList: Retrieves an aggregated list of node types.
  67925. func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall {
  67926. c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  67927. c.project = project
  67928. return c
  67929. }
  67930. // Filter sets the optional parameter "filter": A filter expression that
  67931. // filters resources listed in the response. The expression must specify
  67932. // the field name, a comparison operator, and the value that you want to
  67933. // use for filtering. The value must be a string, a number, or a
  67934. // boolean. The comparison operator must be either =, !=, >, or <.
  67935. //
  67936. // For example, if you are filtering Compute Engine instances, you can
  67937. // exclude instances named example-instance by specifying name !=
  67938. // example-instance.
  67939. //
  67940. // You can also filter nested fields. For example, you could specify
  67941. // scheduling.automaticRestart = false to include instances only if they
  67942. // are not scheduled for automatic restarts. You can use filtering on
  67943. // nested fields to filter based on resource labels.
  67944. //
  67945. // To filter on multiple expressions, provide each separate expression
  67946. // within parentheses. For example, (scheduling.automaticRestart = true)
  67947. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  67948. // AND expression. However, you can include AND and OR expressions
  67949. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  67950. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  67951. // true).
  67952. func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall {
  67953. c.urlParams_.Set("filter", filter)
  67954. return c
  67955. }
  67956. // MaxResults sets the optional parameter "maxResults": The maximum
  67957. // number of results per page that should be returned. If the number of
  67958. // available results is larger than maxResults, Compute Engine returns a
  67959. // nextPageToken that can be used to get the next page of results in
  67960. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  67961. // (Default: 500)
  67962. func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall {
  67963. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  67964. return c
  67965. }
  67966. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  67967. // a certain order. By default, results are returned in alphanumerical
  67968. // order based on the resource name.
  67969. //
  67970. // You can also sort results in descending order based on the creation
  67971. // timestamp using orderBy="creationTimestamp desc". This sorts results
  67972. // based on the creationTimestamp field in reverse chronological order
  67973. // (newest result first). Use this to sort resources like operations so
  67974. // that the newest operation is returned first.
  67975. //
  67976. // Currently, only sorting by name or creationTimestamp desc is
  67977. // supported.
  67978. func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall {
  67979. c.urlParams_.Set("orderBy", orderBy)
  67980. return c
  67981. }
  67982. // PageToken sets the optional parameter "pageToken": Specifies a page
  67983. // token to use. Set pageToken to the nextPageToken returned by a
  67984. // previous list request to get the next page of results.
  67985. func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall {
  67986. c.urlParams_.Set("pageToken", pageToken)
  67987. return c
  67988. }
  67989. // Fields allows partial responses to be retrieved. See
  67990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  67991. // for more information.
  67992. func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall {
  67993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  67994. return c
  67995. }
  67996. // IfNoneMatch sets the optional parameter which makes the operation
  67997. // fail if the object's ETag matches the given value. This is useful for
  67998. // getting updates only after the object has changed since the last
  67999. // request. Use googleapi.IsNotModified to check whether the response
  68000. // error from Do is the result of In-None-Match.
  68001. func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall {
  68002. c.ifNoneMatch_ = entityTag
  68003. return c
  68004. }
  68005. // Context sets the context to be used in this call's Do method. Any
  68006. // pending HTTP request will be aborted if the provided context is
  68007. // canceled.
  68008. func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall {
  68009. c.ctx_ = ctx
  68010. return c
  68011. }
  68012. // Header returns an http.Header that can be modified by the caller to
  68013. // add HTTP headers to the request.
  68014. func (c *NodeTypesAggregatedListCall) Header() http.Header {
  68015. if c.header_ == nil {
  68016. c.header_ = make(http.Header)
  68017. }
  68018. return c.header_
  68019. }
  68020. func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  68021. reqHeaders := make(http.Header)
  68022. for k, v := range c.header_ {
  68023. reqHeaders[k] = v
  68024. }
  68025. reqHeaders.Set("User-Agent", c.s.userAgent())
  68026. if c.ifNoneMatch_ != "" {
  68027. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68028. }
  68029. var body io.Reader = nil
  68030. c.urlParams_.Set("alt", alt)
  68031. c.urlParams_.Set("prettyPrint", "false")
  68032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/nodeTypes")
  68033. urls += "?" + c.urlParams_.Encode()
  68034. req, err := http.NewRequest("GET", urls, body)
  68035. if err != nil {
  68036. return nil, err
  68037. }
  68038. req.Header = reqHeaders
  68039. googleapi.Expand(req.URL, map[string]string{
  68040. "project": c.project,
  68041. })
  68042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68043. }
  68044. // Do executes the "compute.nodeTypes.aggregatedList" call.
  68045. // Exactly one of *NodeTypeAggregatedList or error will be non-nil. Any
  68046. // non-2xx status code is an error. Response headers are in either
  68047. // *NodeTypeAggregatedList.ServerResponse.Header or (if a response was
  68048. // returned at all) in error.(*googleapi.Error).Header. Use
  68049. // googleapi.IsNotModified to check whether the returned error was
  68050. // because http.StatusNotModified was returned.
  68051. func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) {
  68052. gensupport.SetOptions(c.urlParams_, opts...)
  68053. res, err := c.doRequest("json")
  68054. if res != nil && res.StatusCode == http.StatusNotModified {
  68055. if res.Body != nil {
  68056. res.Body.Close()
  68057. }
  68058. return nil, &googleapi.Error{
  68059. Code: res.StatusCode,
  68060. Header: res.Header,
  68061. }
  68062. }
  68063. if err != nil {
  68064. return nil, err
  68065. }
  68066. defer googleapi.CloseBody(res)
  68067. if err := googleapi.CheckResponse(res); err != nil {
  68068. return nil, err
  68069. }
  68070. ret := &NodeTypeAggregatedList{
  68071. ServerResponse: googleapi.ServerResponse{
  68072. Header: res.Header,
  68073. HTTPStatusCode: res.StatusCode,
  68074. },
  68075. }
  68076. target := &ret
  68077. if err := gensupport.DecodeResponse(target, res); err != nil {
  68078. return nil, err
  68079. }
  68080. return ret, nil
  68081. // {
  68082. // "description": "Retrieves an aggregated list of node types.",
  68083. // "httpMethod": "GET",
  68084. // "id": "compute.nodeTypes.aggregatedList",
  68085. // "parameterOrder": [
  68086. // "project"
  68087. // ],
  68088. // "parameters": {
  68089. // "filter": {
  68090. // "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).",
  68091. // "location": "query",
  68092. // "type": "string"
  68093. // },
  68094. // "maxResults": {
  68095. // "default": "500",
  68096. // "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)",
  68097. // "format": "uint32",
  68098. // "location": "query",
  68099. // "minimum": "0",
  68100. // "type": "integer"
  68101. // },
  68102. // "orderBy": {
  68103. // "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.",
  68104. // "location": "query",
  68105. // "type": "string"
  68106. // },
  68107. // "pageToken": {
  68108. // "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.",
  68109. // "location": "query",
  68110. // "type": "string"
  68111. // },
  68112. // "project": {
  68113. // "description": "Project ID for this request.",
  68114. // "location": "path",
  68115. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68116. // "required": true,
  68117. // "type": "string"
  68118. // }
  68119. // },
  68120. // "path": "{project}/aggregated/nodeTypes",
  68121. // "response": {
  68122. // "$ref": "NodeTypeAggregatedList"
  68123. // },
  68124. // "scopes": [
  68125. // "https://www.googleapis.com/auth/cloud-platform",
  68126. // "https://www.googleapis.com/auth/compute",
  68127. // "https://www.googleapis.com/auth/compute.readonly"
  68128. // ]
  68129. // }
  68130. }
  68131. // Pages invokes f for each page of results.
  68132. // A non-nil error returned from f will halt the iteration.
  68133. // The provided context supersedes any context provided to the Context method.
  68134. func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error {
  68135. c.ctx_ = ctx
  68136. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68137. for {
  68138. x, err := c.Do()
  68139. if err != nil {
  68140. return err
  68141. }
  68142. if err := f(x); err != nil {
  68143. return err
  68144. }
  68145. if x.NextPageToken == "" {
  68146. return nil
  68147. }
  68148. c.PageToken(x.NextPageToken)
  68149. }
  68150. }
  68151. // method id "compute.nodeTypes.get":
  68152. type NodeTypesGetCall struct {
  68153. s *Service
  68154. project string
  68155. zone string
  68156. nodeType string
  68157. urlParams_ gensupport.URLParams
  68158. ifNoneMatch_ string
  68159. ctx_ context.Context
  68160. header_ http.Header
  68161. }
  68162. // Get: Returns the specified node type. Gets a list of available node
  68163. // types by making a list() request.
  68164. func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall {
  68165. c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68166. c.project = project
  68167. c.zone = zone
  68168. c.nodeType = nodeType
  68169. return c
  68170. }
  68171. // Fields allows partial responses to be retrieved. See
  68172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68173. // for more information.
  68174. func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall {
  68175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68176. return c
  68177. }
  68178. // IfNoneMatch sets the optional parameter which makes the operation
  68179. // fail if the object's ETag matches the given value. This is useful for
  68180. // getting updates only after the object has changed since the last
  68181. // request. Use googleapi.IsNotModified to check whether the response
  68182. // error from Do is the result of In-None-Match.
  68183. func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall {
  68184. c.ifNoneMatch_ = entityTag
  68185. return c
  68186. }
  68187. // Context sets the context to be used in this call's Do method. Any
  68188. // pending HTTP request will be aborted if the provided context is
  68189. // canceled.
  68190. func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall {
  68191. c.ctx_ = ctx
  68192. return c
  68193. }
  68194. // Header returns an http.Header that can be modified by the caller to
  68195. // add HTTP headers to the request.
  68196. func (c *NodeTypesGetCall) Header() http.Header {
  68197. if c.header_ == nil {
  68198. c.header_ = make(http.Header)
  68199. }
  68200. return c.header_
  68201. }
  68202. func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  68203. reqHeaders := make(http.Header)
  68204. for k, v := range c.header_ {
  68205. reqHeaders[k] = v
  68206. }
  68207. reqHeaders.Set("User-Agent", c.s.userAgent())
  68208. if c.ifNoneMatch_ != "" {
  68209. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68210. }
  68211. var body io.Reader = nil
  68212. c.urlParams_.Set("alt", alt)
  68213. c.urlParams_.Set("prettyPrint", "false")
  68214. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes/{nodeType}")
  68215. urls += "?" + c.urlParams_.Encode()
  68216. req, err := http.NewRequest("GET", urls, body)
  68217. if err != nil {
  68218. return nil, err
  68219. }
  68220. req.Header = reqHeaders
  68221. googleapi.Expand(req.URL, map[string]string{
  68222. "project": c.project,
  68223. "zone": c.zone,
  68224. "nodeType": c.nodeType,
  68225. })
  68226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68227. }
  68228. // Do executes the "compute.nodeTypes.get" call.
  68229. // Exactly one of *NodeType or error will be non-nil. Any non-2xx status
  68230. // code is an error. Response headers are in either
  68231. // *NodeType.ServerResponse.Header or (if a response was returned at
  68232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68233. // to check whether the returned error was because
  68234. // http.StatusNotModified was returned.
  68235. func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) {
  68236. gensupport.SetOptions(c.urlParams_, opts...)
  68237. res, err := c.doRequest("json")
  68238. if res != nil && res.StatusCode == http.StatusNotModified {
  68239. if res.Body != nil {
  68240. res.Body.Close()
  68241. }
  68242. return nil, &googleapi.Error{
  68243. Code: res.StatusCode,
  68244. Header: res.Header,
  68245. }
  68246. }
  68247. if err != nil {
  68248. return nil, err
  68249. }
  68250. defer googleapi.CloseBody(res)
  68251. if err := googleapi.CheckResponse(res); err != nil {
  68252. return nil, err
  68253. }
  68254. ret := &NodeType{
  68255. ServerResponse: googleapi.ServerResponse{
  68256. Header: res.Header,
  68257. HTTPStatusCode: res.StatusCode,
  68258. },
  68259. }
  68260. target := &ret
  68261. if err := gensupport.DecodeResponse(target, res); err != nil {
  68262. return nil, err
  68263. }
  68264. return ret, nil
  68265. // {
  68266. // "description": "Returns the specified node type. Gets a list of available node types by making a list() request.",
  68267. // "httpMethod": "GET",
  68268. // "id": "compute.nodeTypes.get",
  68269. // "parameterOrder": [
  68270. // "project",
  68271. // "zone",
  68272. // "nodeType"
  68273. // ],
  68274. // "parameters": {
  68275. // "nodeType": {
  68276. // "description": "Name of the node type to return.",
  68277. // "location": "path",
  68278. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  68279. // "required": true,
  68280. // "type": "string"
  68281. // },
  68282. // "project": {
  68283. // "description": "Project ID for this request.",
  68284. // "location": "path",
  68285. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68286. // "required": true,
  68287. // "type": "string"
  68288. // },
  68289. // "zone": {
  68290. // "description": "The name of the zone for this request.",
  68291. // "location": "path",
  68292. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68293. // "required": true,
  68294. // "type": "string"
  68295. // }
  68296. // },
  68297. // "path": "{project}/zones/{zone}/nodeTypes/{nodeType}",
  68298. // "response": {
  68299. // "$ref": "NodeType"
  68300. // },
  68301. // "scopes": [
  68302. // "https://www.googleapis.com/auth/cloud-platform",
  68303. // "https://www.googleapis.com/auth/compute",
  68304. // "https://www.googleapis.com/auth/compute.readonly"
  68305. // ]
  68306. // }
  68307. }
  68308. // method id "compute.nodeTypes.list":
  68309. type NodeTypesListCall struct {
  68310. s *Service
  68311. project string
  68312. zone string
  68313. urlParams_ gensupport.URLParams
  68314. ifNoneMatch_ string
  68315. ctx_ context.Context
  68316. header_ http.Header
  68317. }
  68318. // List: Retrieves a list of node types available to the specified
  68319. // project.
  68320. func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall {
  68321. c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68322. c.project = project
  68323. c.zone = zone
  68324. return c
  68325. }
  68326. // Filter sets the optional parameter "filter": A filter expression that
  68327. // filters resources listed in the response. The expression must specify
  68328. // the field name, a comparison operator, and the value that you want to
  68329. // use for filtering. The value must be a string, a number, or a
  68330. // boolean. The comparison operator must be either =, !=, >, or <.
  68331. //
  68332. // For example, if you are filtering Compute Engine instances, you can
  68333. // exclude instances named example-instance by specifying name !=
  68334. // example-instance.
  68335. //
  68336. // You can also filter nested fields. For example, you could specify
  68337. // scheduling.automaticRestart = false to include instances only if they
  68338. // are not scheduled for automatic restarts. You can use filtering on
  68339. // nested fields to filter based on resource labels.
  68340. //
  68341. // To filter on multiple expressions, provide each separate expression
  68342. // within parentheses. For example, (scheduling.automaticRestart = true)
  68343. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  68344. // AND expression. However, you can include AND and OR expressions
  68345. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  68346. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  68347. // true).
  68348. func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall {
  68349. c.urlParams_.Set("filter", filter)
  68350. return c
  68351. }
  68352. // MaxResults sets the optional parameter "maxResults": The maximum
  68353. // number of results per page that should be returned. If the number of
  68354. // available results is larger than maxResults, Compute Engine returns a
  68355. // nextPageToken that can be used to get the next page of results in
  68356. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  68357. // (Default: 500)
  68358. func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall {
  68359. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  68360. return c
  68361. }
  68362. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  68363. // a certain order. By default, results are returned in alphanumerical
  68364. // order based on the resource name.
  68365. //
  68366. // You can also sort results in descending order based on the creation
  68367. // timestamp using orderBy="creationTimestamp desc". This sorts results
  68368. // based on the creationTimestamp field in reverse chronological order
  68369. // (newest result first). Use this to sort resources like operations so
  68370. // that the newest operation is returned first.
  68371. //
  68372. // Currently, only sorting by name or creationTimestamp desc is
  68373. // supported.
  68374. func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall {
  68375. c.urlParams_.Set("orderBy", orderBy)
  68376. return c
  68377. }
  68378. // PageToken sets the optional parameter "pageToken": Specifies a page
  68379. // token to use. Set pageToken to the nextPageToken returned by a
  68380. // previous list request to get the next page of results.
  68381. func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall {
  68382. c.urlParams_.Set("pageToken", pageToken)
  68383. return c
  68384. }
  68385. // Fields allows partial responses to be retrieved. See
  68386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68387. // for more information.
  68388. func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall {
  68389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68390. return c
  68391. }
  68392. // IfNoneMatch sets the optional parameter which makes the operation
  68393. // fail if the object's ETag matches the given value. This is useful for
  68394. // getting updates only after the object has changed since the last
  68395. // request. Use googleapi.IsNotModified to check whether the response
  68396. // error from Do is the result of In-None-Match.
  68397. func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall {
  68398. c.ifNoneMatch_ = entityTag
  68399. return c
  68400. }
  68401. // Context sets the context to be used in this call's Do method. Any
  68402. // pending HTTP request will be aborted if the provided context is
  68403. // canceled.
  68404. func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall {
  68405. c.ctx_ = ctx
  68406. return c
  68407. }
  68408. // Header returns an http.Header that can be modified by the caller to
  68409. // add HTTP headers to the request.
  68410. func (c *NodeTypesListCall) Header() http.Header {
  68411. if c.header_ == nil {
  68412. c.header_ = make(http.Header)
  68413. }
  68414. return c.header_
  68415. }
  68416. func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) {
  68417. reqHeaders := make(http.Header)
  68418. for k, v := range c.header_ {
  68419. reqHeaders[k] = v
  68420. }
  68421. reqHeaders.Set("User-Agent", c.s.userAgent())
  68422. if c.ifNoneMatch_ != "" {
  68423. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  68424. }
  68425. var body io.Reader = nil
  68426. c.urlParams_.Set("alt", alt)
  68427. c.urlParams_.Set("prettyPrint", "false")
  68428. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/nodeTypes")
  68429. urls += "?" + c.urlParams_.Encode()
  68430. req, err := http.NewRequest("GET", urls, body)
  68431. if err != nil {
  68432. return nil, err
  68433. }
  68434. req.Header = reqHeaders
  68435. googleapi.Expand(req.URL, map[string]string{
  68436. "project": c.project,
  68437. "zone": c.zone,
  68438. })
  68439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68440. }
  68441. // Do executes the "compute.nodeTypes.list" call.
  68442. // Exactly one of *NodeTypeList or error will be non-nil. Any non-2xx
  68443. // status code is an error. Response headers are in either
  68444. // *NodeTypeList.ServerResponse.Header or (if a response was returned at
  68445. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68446. // to check whether the returned error was because
  68447. // http.StatusNotModified was returned.
  68448. func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) {
  68449. gensupport.SetOptions(c.urlParams_, opts...)
  68450. res, err := c.doRequest("json")
  68451. if res != nil && res.StatusCode == http.StatusNotModified {
  68452. if res.Body != nil {
  68453. res.Body.Close()
  68454. }
  68455. return nil, &googleapi.Error{
  68456. Code: res.StatusCode,
  68457. Header: res.Header,
  68458. }
  68459. }
  68460. if err != nil {
  68461. return nil, err
  68462. }
  68463. defer googleapi.CloseBody(res)
  68464. if err := googleapi.CheckResponse(res); err != nil {
  68465. return nil, err
  68466. }
  68467. ret := &NodeTypeList{
  68468. ServerResponse: googleapi.ServerResponse{
  68469. Header: res.Header,
  68470. HTTPStatusCode: res.StatusCode,
  68471. },
  68472. }
  68473. target := &ret
  68474. if err := gensupport.DecodeResponse(target, res); err != nil {
  68475. return nil, err
  68476. }
  68477. return ret, nil
  68478. // {
  68479. // "description": "Retrieves a list of node types available to the specified project.",
  68480. // "httpMethod": "GET",
  68481. // "id": "compute.nodeTypes.list",
  68482. // "parameterOrder": [
  68483. // "project",
  68484. // "zone"
  68485. // ],
  68486. // "parameters": {
  68487. // "filter": {
  68488. // "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).",
  68489. // "location": "query",
  68490. // "type": "string"
  68491. // },
  68492. // "maxResults": {
  68493. // "default": "500",
  68494. // "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)",
  68495. // "format": "uint32",
  68496. // "location": "query",
  68497. // "minimum": "0",
  68498. // "type": "integer"
  68499. // },
  68500. // "orderBy": {
  68501. // "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.",
  68502. // "location": "query",
  68503. // "type": "string"
  68504. // },
  68505. // "pageToken": {
  68506. // "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.",
  68507. // "location": "query",
  68508. // "type": "string"
  68509. // },
  68510. // "project": {
  68511. // "description": "Project ID for this request.",
  68512. // "location": "path",
  68513. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68514. // "required": true,
  68515. // "type": "string"
  68516. // },
  68517. // "zone": {
  68518. // "description": "The name of the zone for this request.",
  68519. // "location": "path",
  68520. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  68521. // "required": true,
  68522. // "type": "string"
  68523. // }
  68524. // },
  68525. // "path": "{project}/zones/{zone}/nodeTypes",
  68526. // "response": {
  68527. // "$ref": "NodeTypeList"
  68528. // },
  68529. // "scopes": [
  68530. // "https://www.googleapis.com/auth/cloud-platform",
  68531. // "https://www.googleapis.com/auth/compute",
  68532. // "https://www.googleapis.com/auth/compute.readonly"
  68533. // ]
  68534. // }
  68535. }
  68536. // Pages invokes f for each page of results.
  68537. // A non-nil error returned from f will halt the iteration.
  68538. // The provided context supersedes any context provided to the Context method.
  68539. func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error {
  68540. c.ctx_ = ctx
  68541. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  68542. for {
  68543. x, err := c.Do()
  68544. if err != nil {
  68545. return err
  68546. }
  68547. if err := f(x); err != nil {
  68548. return err
  68549. }
  68550. if x.NextPageToken == "" {
  68551. return nil
  68552. }
  68553. c.PageToken(x.NextPageToken)
  68554. }
  68555. }
  68556. // method id "compute.projects.disableXpnHost":
  68557. type ProjectsDisableXpnHostCall struct {
  68558. s *Service
  68559. project string
  68560. urlParams_ gensupport.URLParams
  68561. ctx_ context.Context
  68562. header_ http.Header
  68563. }
  68564. // DisableXpnHost: Disable this project as a shared VPC host project.
  68565. func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall {
  68566. c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68567. c.project = project
  68568. return c
  68569. }
  68570. // RequestId sets the optional parameter "requestId": An optional
  68571. // request ID to identify requests. Specify a unique request ID so that
  68572. // if you must retry your request, the server will know to ignore the
  68573. // request if it has already been completed.
  68574. //
  68575. // For example, consider a situation where you make an initial request
  68576. // and the request times out. If you make the request again with the
  68577. // same request ID, the server can check if original operation with the
  68578. // same request ID was received, and if so, will ignore the second
  68579. // request. This prevents clients from accidentally creating duplicate
  68580. // commitments.
  68581. //
  68582. // The request ID must be a valid UUID with the exception that zero UUID
  68583. // is not supported (00000000-0000-0000-0000-000000000000).
  68584. func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall {
  68585. c.urlParams_.Set("requestId", requestId)
  68586. return c
  68587. }
  68588. // Fields allows partial responses to be retrieved. See
  68589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68590. // for more information.
  68591. func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall {
  68592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68593. return c
  68594. }
  68595. // Context sets the context to be used in this call's Do method. Any
  68596. // pending HTTP request will be aborted if the provided context is
  68597. // canceled.
  68598. func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall {
  68599. c.ctx_ = ctx
  68600. return c
  68601. }
  68602. // Header returns an http.Header that can be modified by the caller to
  68603. // add HTTP headers to the request.
  68604. func (c *ProjectsDisableXpnHostCall) Header() http.Header {
  68605. if c.header_ == nil {
  68606. c.header_ = make(http.Header)
  68607. }
  68608. return c.header_
  68609. }
  68610. func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  68611. reqHeaders := make(http.Header)
  68612. for k, v := range c.header_ {
  68613. reqHeaders[k] = v
  68614. }
  68615. reqHeaders.Set("User-Agent", c.s.userAgent())
  68616. var body io.Reader = nil
  68617. c.urlParams_.Set("alt", alt)
  68618. c.urlParams_.Set("prettyPrint", "false")
  68619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnHost")
  68620. urls += "?" + c.urlParams_.Encode()
  68621. req, err := http.NewRequest("POST", urls, body)
  68622. if err != nil {
  68623. return nil, err
  68624. }
  68625. req.Header = reqHeaders
  68626. googleapi.Expand(req.URL, map[string]string{
  68627. "project": c.project,
  68628. })
  68629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68630. }
  68631. // Do executes the "compute.projects.disableXpnHost" call.
  68632. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68633. // status code is an error. Response headers are in either
  68634. // *Operation.ServerResponse.Header or (if a response was returned at
  68635. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68636. // to check whether the returned error was because
  68637. // http.StatusNotModified was returned.
  68638. func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68639. gensupport.SetOptions(c.urlParams_, opts...)
  68640. res, err := c.doRequest("json")
  68641. if res != nil && res.StatusCode == http.StatusNotModified {
  68642. if res.Body != nil {
  68643. res.Body.Close()
  68644. }
  68645. return nil, &googleapi.Error{
  68646. Code: res.StatusCode,
  68647. Header: res.Header,
  68648. }
  68649. }
  68650. if err != nil {
  68651. return nil, err
  68652. }
  68653. defer googleapi.CloseBody(res)
  68654. if err := googleapi.CheckResponse(res); err != nil {
  68655. return nil, err
  68656. }
  68657. ret := &Operation{
  68658. ServerResponse: googleapi.ServerResponse{
  68659. Header: res.Header,
  68660. HTTPStatusCode: res.StatusCode,
  68661. },
  68662. }
  68663. target := &ret
  68664. if err := gensupport.DecodeResponse(target, res); err != nil {
  68665. return nil, err
  68666. }
  68667. return ret, nil
  68668. // {
  68669. // "description": "Disable this project as a shared VPC host project.",
  68670. // "httpMethod": "POST",
  68671. // "id": "compute.projects.disableXpnHost",
  68672. // "parameterOrder": [
  68673. // "project"
  68674. // ],
  68675. // "parameters": {
  68676. // "project": {
  68677. // "description": "Project ID for this request.",
  68678. // "location": "path",
  68679. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68680. // "required": true,
  68681. // "type": "string"
  68682. // },
  68683. // "requestId": {
  68684. // "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).",
  68685. // "location": "query",
  68686. // "type": "string"
  68687. // }
  68688. // },
  68689. // "path": "{project}/disableXpnHost",
  68690. // "response": {
  68691. // "$ref": "Operation"
  68692. // },
  68693. // "scopes": [
  68694. // "https://www.googleapis.com/auth/cloud-platform",
  68695. // "https://www.googleapis.com/auth/compute"
  68696. // ]
  68697. // }
  68698. }
  68699. // method id "compute.projects.disableXpnResource":
  68700. type ProjectsDisableXpnResourceCall struct {
  68701. s *Service
  68702. project string
  68703. projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest
  68704. urlParams_ gensupport.URLParams
  68705. ctx_ context.Context
  68706. header_ http.Header
  68707. }
  68708. // DisableXpnResource: Disable a serivce resource (a.k.a service
  68709. // project) associated with this host project.
  68710. func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall {
  68711. c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68712. c.project = project
  68713. c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest
  68714. return c
  68715. }
  68716. // RequestId sets the optional parameter "requestId": An optional
  68717. // request ID to identify requests. Specify a unique request ID so that
  68718. // if you must retry your request, the server will know to ignore the
  68719. // request if it has already been completed.
  68720. //
  68721. // For example, consider a situation where you make an initial request
  68722. // and the request times out. If you make the request again with the
  68723. // same request ID, the server can check if original operation with the
  68724. // same request ID was received, and if so, will ignore the second
  68725. // request. This prevents clients from accidentally creating duplicate
  68726. // commitments.
  68727. //
  68728. // The request ID must be a valid UUID with the exception that zero UUID
  68729. // is not supported (00000000-0000-0000-0000-000000000000).
  68730. func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall {
  68731. c.urlParams_.Set("requestId", requestId)
  68732. return c
  68733. }
  68734. // Fields allows partial responses to be retrieved. See
  68735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68736. // for more information.
  68737. func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall {
  68738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68739. return c
  68740. }
  68741. // Context sets the context to be used in this call's Do method. Any
  68742. // pending HTTP request will be aborted if the provided context is
  68743. // canceled.
  68744. func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall {
  68745. c.ctx_ = ctx
  68746. return c
  68747. }
  68748. // Header returns an http.Header that can be modified by the caller to
  68749. // add HTTP headers to the request.
  68750. func (c *ProjectsDisableXpnResourceCall) Header() http.Header {
  68751. if c.header_ == nil {
  68752. c.header_ = make(http.Header)
  68753. }
  68754. return c.header_
  68755. }
  68756. func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  68757. reqHeaders := make(http.Header)
  68758. for k, v := range c.header_ {
  68759. reqHeaders[k] = v
  68760. }
  68761. reqHeaders.Set("User-Agent", c.s.userAgent())
  68762. var body io.Reader = nil
  68763. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest)
  68764. if err != nil {
  68765. return nil, err
  68766. }
  68767. reqHeaders.Set("Content-Type", "application/json")
  68768. c.urlParams_.Set("alt", alt)
  68769. c.urlParams_.Set("prettyPrint", "false")
  68770. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/disableXpnResource")
  68771. urls += "?" + c.urlParams_.Encode()
  68772. req, err := http.NewRequest("POST", urls, body)
  68773. if err != nil {
  68774. return nil, err
  68775. }
  68776. req.Header = reqHeaders
  68777. googleapi.Expand(req.URL, map[string]string{
  68778. "project": c.project,
  68779. })
  68780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68781. }
  68782. // Do executes the "compute.projects.disableXpnResource" call.
  68783. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68784. // status code is an error. Response headers are in either
  68785. // *Operation.ServerResponse.Header or (if a response was returned at
  68786. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68787. // to check whether the returned error was because
  68788. // http.StatusNotModified was returned.
  68789. func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68790. gensupport.SetOptions(c.urlParams_, opts...)
  68791. res, err := c.doRequest("json")
  68792. if res != nil && res.StatusCode == http.StatusNotModified {
  68793. if res.Body != nil {
  68794. res.Body.Close()
  68795. }
  68796. return nil, &googleapi.Error{
  68797. Code: res.StatusCode,
  68798. Header: res.Header,
  68799. }
  68800. }
  68801. if err != nil {
  68802. return nil, err
  68803. }
  68804. defer googleapi.CloseBody(res)
  68805. if err := googleapi.CheckResponse(res); err != nil {
  68806. return nil, err
  68807. }
  68808. ret := &Operation{
  68809. ServerResponse: googleapi.ServerResponse{
  68810. Header: res.Header,
  68811. HTTPStatusCode: res.StatusCode,
  68812. },
  68813. }
  68814. target := &ret
  68815. if err := gensupport.DecodeResponse(target, res); err != nil {
  68816. return nil, err
  68817. }
  68818. return ret, nil
  68819. // {
  68820. // "description": "Disable a serivce resource (a.k.a service project) associated with this host project.",
  68821. // "httpMethod": "POST",
  68822. // "id": "compute.projects.disableXpnResource",
  68823. // "parameterOrder": [
  68824. // "project"
  68825. // ],
  68826. // "parameters": {
  68827. // "project": {
  68828. // "description": "Project ID for this request.",
  68829. // "location": "path",
  68830. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68831. // "required": true,
  68832. // "type": "string"
  68833. // },
  68834. // "requestId": {
  68835. // "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).",
  68836. // "location": "query",
  68837. // "type": "string"
  68838. // }
  68839. // },
  68840. // "path": "{project}/disableXpnResource",
  68841. // "request": {
  68842. // "$ref": "ProjectsDisableXpnResourceRequest"
  68843. // },
  68844. // "response": {
  68845. // "$ref": "Operation"
  68846. // },
  68847. // "scopes": [
  68848. // "https://www.googleapis.com/auth/cloud-platform",
  68849. // "https://www.googleapis.com/auth/compute"
  68850. // ]
  68851. // }
  68852. }
  68853. // method id "compute.projects.enableXpnHost":
  68854. type ProjectsEnableXpnHostCall struct {
  68855. s *Service
  68856. project string
  68857. urlParams_ gensupport.URLParams
  68858. ctx_ context.Context
  68859. header_ http.Header
  68860. }
  68861. // EnableXpnHost: Enable this project as a shared VPC host project.
  68862. func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall {
  68863. c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  68864. c.project = project
  68865. return c
  68866. }
  68867. // RequestId sets the optional parameter "requestId": An optional
  68868. // request ID to identify requests. Specify a unique request ID so that
  68869. // if you must retry your request, the server will know to ignore the
  68870. // request if it has already been completed.
  68871. //
  68872. // For example, consider a situation where you make an initial request
  68873. // and the request times out. If you make the request again with the
  68874. // same request ID, the server can check if original operation with the
  68875. // same request ID was received, and if so, will ignore the second
  68876. // request. This prevents clients from accidentally creating duplicate
  68877. // commitments.
  68878. //
  68879. // The request ID must be a valid UUID with the exception that zero UUID
  68880. // is not supported (00000000-0000-0000-0000-000000000000).
  68881. func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall {
  68882. c.urlParams_.Set("requestId", requestId)
  68883. return c
  68884. }
  68885. // Fields allows partial responses to be retrieved. See
  68886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  68887. // for more information.
  68888. func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall {
  68889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  68890. return c
  68891. }
  68892. // Context sets the context to be used in this call's Do method. Any
  68893. // pending HTTP request will be aborted if the provided context is
  68894. // canceled.
  68895. func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall {
  68896. c.ctx_ = ctx
  68897. return c
  68898. }
  68899. // Header returns an http.Header that can be modified by the caller to
  68900. // add HTTP headers to the request.
  68901. func (c *ProjectsEnableXpnHostCall) Header() http.Header {
  68902. if c.header_ == nil {
  68903. c.header_ = make(http.Header)
  68904. }
  68905. return c.header_
  68906. }
  68907. func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) {
  68908. reqHeaders := make(http.Header)
  68909. for k, v := range c.header_ {
  68910. reqHeaders[k] = v
  68911. }
  68912. reqHeaders.Set("User-Agent", c.s.userAgent())
  68913. var body io.Reader = nil
  68914. c.urlParams_.Set("alt", alt)
  68915. c.urlParams_.Set("prettyPrint", "false")
  68916. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnHost")
  68917. urls += "?" + c.urlParams_.Encode()
  68918. req, err := http.NewRequest("POST", urls, body)
  68919. if err != nil {
  68920. return nil, err
  68921. }
  68922. req.Header = reqHeaders
  68923. googleapi.Expand(req.URL, map[string]string{
  68924. "project": c.project,
  68925. })
  68926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  68927. }
  68928. // Do executes the "compute.projects.enableXpnHost" call.
  68929. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  68930. // status code is an error. Response headers are in either
  68931. // *Operation.ServerResponse.Header or (if a response was returned at
  68932. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  68933. // to check whether the returned error was because
  68934. // http.StatusNotModified was returned.
  68935. func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  68936. gensupport.SetOptions(c.urlParams_, opts...)
  68937. res, err := c.doRequest("json")
  68938. if res != nil && res.StatusCode == http.StatusNotModified {
  68939. if res.Body != nil {
  68940. res.Body.Close()
  68941. }
  68942. return nil, &googleapi.Error{
  68943. Code: res.StatusCode,
  68944. Header: res.Header,
  68945. }
  68946. }
  68947. if err != nil {
  68948. return nil, err
  68949. }
  68950. defer googleapi.CloseBody(res)
  68951. if err := googleapi.CheckResponse(res); err != nil {
  68952. return nil, err
  68953. }
  68954. ret := &Operation{
  68955. ServerResponse: googleapi.ServerResponse{
  68956. Header: res.Header,
  68957. HTTPStatusCode: res.StatusCode,
  68958. },
  68959. }
  68960. target := &ret
  68961. if err := gensupport.DecodeResponse(target, res); err != nil {
  68962. return nil, err
  68963. }
  68964. return ret, nil
  68965. // {
  68966. // "description": "Enable this project as a shared VPC host project.",
  68967. // "httpMethod": "POST",
  68968. // "id": "compute.projects.enableXpnHost",
  68969. // "parameterOrder": [
  68970. // "project"
  68971. // ],
  68972. // "parameters": {
  68973. // "project": {
  68974. // "description": "Project ID for this request.",
  68975. // "location": "path",
  68976. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  68977. // "required": true,
  68978. // "type": "string"
  68979. // },
  68980. // "requestId": {
  68981. // "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).",
  68982. // "location": "query",
  68983. // "type": "string"
  68984. // }
  68985. // },
  68986. // "path": "{project}/enableXpnHost",
  68987. // "response": {
  68988. // "$ref": "Operation"
  68989. // },
  68990. // "scopes": [
  68991. // "https://www.googleapis.com/auth/cloud-platform",
  68992. // "https://www.googleapis.com/auth/compute"
  68993. // ]
  68994. // }
  68995. }
  68996. // method id "compute.projects.enableXpnResource":
  68997. type ProjectsEnableXpnResourceCall struct {
  68998. s *Service
  68999. project string
  69000. projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest
  69001. urlParams_ gensupport.URLParams
  69002. ctx_ context.Context
  69003. header_ http.Header
  69004. }
  69005. // EnableXpnResource: Enable service resource (a.k.a service project)
  69006. // for a host project, so that subnets in the host project can be used
  69007. // by instances in the service project.
  69008. func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall {
  69009. c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69010. c.project = project
  69011. c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest
  69012. return c
  69013. }
  69014. // RequestId sets the optional parameter "requestId": An optional
  69015. // request ID to identify requests. Specify a unique request ID so that
  69016. // if you must retry your request, the server will know to ignore the
  69017. // request if it has already been completed.
  69018. //
  69019. // For example, consider a situation where you make an initial request
  69020. // and the request times out. If you make the request again with the
  69021. // same request ID, the server can check if original operation with the
  69022. // same request ID was received, and if so, will ignore the second
  69023. // request. This prevents clients from accidentally creating duplicate
  69024. // commitments.
  69025. //
  69026. // The request ID must be a valid UUID with the exception that zero UUID
  69027. // is not supported (00000000-0000-0000-0000-000000000000).
  69028. func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall {
  69029. c.urlParams_.Set("requestId", requestId)
  69030. return c
  69031. }
  69032. // Fields allows partial responses to be retrieved. See
  69033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69034. // for more information.
  69035. func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall {
  69036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69037. return c
  69038. }
  69039. // Context sets the context to be used in this call's Do method. Any
  69040. // pending HTTP request will be aborted if the provided context is
  69041. // canceled.
  69042. func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall {
  69043. c.ctx_ = ctx
  69044. return c
  69045. }
  69046. // Header returns an http.Header that can be modified by the caller to
  69047. // add HTTP headers to the request.
  69048. func (c *ProjectsEnableXpnResourceCall) Header() http.Header {
  69049. if c.header_ == nil {
  69050. c.header_ = make(http.Header)
  69051. }
  69052. return c.header_
  69053. }
  69054. func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) {
  69055. reqHeaders := make(http.Header)
  69056. for k, v := range c.header_ {
  69057. reqHeaders[k] = v
  69058. }
  69059. reqHeaders.Set("User-Agent", c.s.userAgent())
  69060. var body io.Reader = nil
  69061. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest)
  69062. if err != nil {
  69063. return nil, err
  69064. }
  69065. reqHeaders.Set("Content-Type", "application/json")
  69066. c.urlParams_.Set("alt", alt)
  69067. c.urlParams_.Set("prettyPrint", "false")
  69068. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/enableXpnResource")
  69069. urls += "?" + c.urlParams_.Encode()
  69070. req, err := http.NewRequest("POST", urls, body)
  69071. if err != nil {
  69072. return nil, err
  69073. }
  69074. req.Header = reqHeaders
  69075. googleapi.Expand(req.URL, map[string]string{
  69076. "project": c.project,
  69077. })
  69078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69079. }
  69080. // Do executes the "compute.projects.enableXpnResource" call.
  69081. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69082. // status code is an error. Response headers are in either
  69083. // *Operation.ServerResponse.Header or (if a response was returned at
  69084. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69085. // to check whether the returned error was because
  69086. // http.StatusNotModified was returned.
  69087. func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69088. gensupport.SetOptions(c.urlParams_, opts...)
  69089. res, err := c.doRequest("json")
  69090. if res != nil && res.StatusCode == http.StatusNotModified {
  69091. if res.Body != nil {
  69092. res.Body.Close()
  69093. }
  69094. return nil, &googleapi.Error{
  69095. Code: res.StatusCode,
  69096. Header: res.Header,
  69097. }
  69098. }
  69099. if err != nil {
  69100. return nil, err
  69101. }
  69102. defer googleapi.CloseBody(res)
  69103. if err := googleapi.CheckResponse(res); err != nil {
  69104. return nil, err
  69105. }
  69106. ret := &Operation{
  69107. ServerResponse: googleapi.ServerResponse{
  69108. Header: res.Header,
  69109. HTTPStatusCode: res.StatusCode,
  69110. },
  69111. }
  69112. target := &ret
  69113. if err := gensupport.DecodeResponse(target, res); err != nil {
  69114. return nil, err
  69115. }
  69116. return ret, nil
  69117. // {
  69118. // "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.",
  69119. // "httpMethod": "POST",
  69120. // "id": "compute.projects.enableXpnResource",
  69121. // "parameterOrder": [
  69122. // "project"
  69123. // ],
  69124. // "parameters": {
  69125. // "project": {
  69126. // "description": "Project ID for this request.",
  69127. // "location": "path",
  69128. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69129. // "required": true,
  69130. // "type": "string"
  69131. // },
  69132. // "requestId": {
  69133. // "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).",
  69134. // "location": "query",
  69135. // "type": "string"
  69136. // }
  69137. // },
  69138. // "path": "{project}/enableXpnResource",
  69139. // "request": {
  69140. // "$ref": "ProjectsEnableXpnResourceRequest"
  69141. // },
  69142. // "response": {
  69143. // "$ref": "Operation"
  69144. // },
  69145. // "scopes": [
  69146. // "https://www.googleapis.com/auth/cloud-platform",
  69147. // "https://www.googleapis.com/auth/compute"
  69148. // ]
  69149. // }
  69150. }
  69151. // method id "compute.projects.get":
  69152. type ProjectsGetCall struct {
  69153. s *Service
  69154. project string
  69155. urlParams_ gensupport.URLParams
  69156. ifNoneMatch_ string
  69157. ctx_ context.Context
  69158. header_ http.Header
  69159. }
  69160. // Get: Returns the specified Project resource.
  69161. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get
  69162. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  69163. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69164. c.project = project
  69165. return c
  69166. }
  69167. // Fields allows partial responses to be retrieved. See
  69168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69169. // for more information.
  69170. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  69171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69172. return c
  69173. }
  69174. // IfNoneMatch sets the optional parameter which makes the operation
  69175. // fail if the object's ETag matches the given value. This is useful for
  69176. // getting updates only after the object has changed since the last
  69177. // request. Use googleapi.IsNotModified to check whether the response
  69178. // error from Do is the result of In-None-Match.
  69179. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  69180. c.ifNoneMatch_ = entityTag
  69181. return c
  69182. }
  69183. // Context sets the context to be used in this call's Do method. Any
  69184. // pending HTTP request will be aborted if the provided context is
  69185. // canceled.
  69186. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  69187. c.ctx_ = ctx
  69188. return c
  69189. }
  69190. // Header returns an http.Header that can be modified by the caller to
  69191. // add HTTP headers to the request.
  69192. func (c *ProjectsGetCall) Header() http.Header {
  69193. if c.header_ == nil {
  69194. c.header_ = make(http.Header)
  69195. }
  69196. return c.header_
  69197. }
  69198. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  69199. reqHeaders := make(http.Header)
  69200. for k, v := range c.header_ {
  69201. reqHeaders[k] = v
  69202. }
  69203. reqHeaders.Set("User-Agent", c.s.userAgent())
  69204. if c.ifNoneMatch_ != "" {
  69205. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69206. }
  69207. var body io.Reader = nil
  69208. c.urlParams_.Set("alt", alt)
  69209. c.urlParams_.Set("prettyPrint", "false")
  69210. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  69211. urls += "?" + c.urlParams_.Encode()
  69212. req, err := http.NewRequest("GET", urls, body)
  69213. if err != nil {
  69214. return nil, err
  69215. }
  69216. req.Header = reqHeaders
  69217. googleapi.Expand(req.URL, map[string]string{
  69218. "project": c.project,
  69219. })
  69220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69221. }
  69222. // Do executes the "compute.projects.get" call.
  69223. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  69224. // code is an error. Response headers are in either
  69225. // *Project.ServerResponse.Header or (if a response was returned at all)
  69226. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  69227. // check whether the returned error was because http.StatusNotModified
  69228. // was returned.
  69229. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  69230. gensupport.SetOptions(c.urlParams_, opts...)
  69231. res, err := c.doRequest("json")
  69232. if res != nil && res.StatusCode == http.StatusNotModified {
  69233. if res.Body != nil {
  69234. res.Body.Close()
  69235. }
  69236. return nil, &googleapi.Error{
  69237. Code: res.StatusCode,
  69238. Header: res.Header,
  69239. }
  69240. }
  69241. if err != nil {
  69242. return nil, err
  69243. }
  69244. defer googleapi.CloseBody(res)
  69245. if err := googleapi.CheckResponse(res); err != nil {
  69246. return nil, err
  69247. }
  69248. ret := &Project{
  69249. ServerResponse: googleapi.ServerResponse{
  69250. Header: res.Header,
  69251. HTTPStatusCode: res.StatusCode,
  69252. },
  69253. }
  69254. target := &ret
  69255. if err := gensupport.DecodeResponse(target, res); err != nil {
  69256. return nil, err
  69257. }
  69258. return ret, nil
  69259. // {
  69260. // "description": "Returns the specified Project resource.",
  69261. // "httpMethod": "GET",
  69262. // "id": "compute.projects.get",
  69263. // "parameterOrder": [
  69264. // "project"
  69265. // ],
  69266. // "parameters": {
  69267. // "project": {
  69268. // "description": "Project ID for this request.",
  69269. // "location": "path",
  69270. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69271. // "required": true,
  69272. // "type": "string"
  69273. // }
  69274. // },
  69275. // "path": "{project}",
  69276. // "response": {
  69277. // "$ref": "Project"
  69278. // },
  69279. // "scopes": [
  69280. // "https://www.googleapis.com/auth/cloud-platform",
  69281. // "https://www.googleapis.com/auth/compute",
  69282. // "https://www.googleapis.com/auth/compute.readonly"
  69283. // ]
  69284. // }
  69285. }
  69286. // method id "compute.projects.getXpnHost":
  69287. type ProjectsGetXpnHostCall struct {
  69288. s *Service
  69289. project string
  69290. urlParams_ gensupport.URLParams
  69291. ifNoneMatch_ string
  69292. ctx_ context.Context
  69293. header_ http.Header
  69294. }
  69295. // GetXpnHost: Gets the shared VPC host project that this project links
  69296. // to. May be empty if no link exists.
  69297. func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall {
  69298. c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69299. c.project = project
  69300. return c
  69301. }
  69302. // Fields allows partial responses to be retrieved. See
  69303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69304. // for more information.
  69305. func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall {
  69306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69307. return c
  69308. }
  69309. // IfNoneMatch sets the optional parameter which makes the operation
  69310. // fail if the object's ETag matches the given value. This is useful for
  69311. // getting updates only after the object has changed since the last
  69312. // request. Use googleapi.IsNotModified to check whether the response
  69313. // error from Do is the result of In-None-Match.
  69314. func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall {
  69315. c.ifNoneMatch_ = entityTag
  69316. return c
  69317. }
  69318. // Context sets the context to be used in this call's Do method. Any
  69319. // pending HTTP request will be aborted if the provided context is
  69320. // canceled.
  69321. func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall {
  69322. c.ctx_ = ctx
  69323. return c
  69324. }
  69325. // Header returns an http.Header that can be modified by the caller to
  69326. // add HTTP headers to the request.
  69327. func (c *ProjectsGetXpnHostCall) Header() http.Header {
  69328. if c.header_ == nil {
  69329. c.header_ = make(http.Header)
  69330. }
  69331. return c.header_
  69332. }
  69333. func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) {
  69334. reqHeaders := make(http.Header)
  69335. for k, v := range c.header_ {
  69336. reqHeaders[k] = v
  69337. }
  69338. reqHeaders.Set("User-Agent", c.s.userAgent())
  69339. if c.ifNoneMatch_ != "" {
  69340. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69341. }
  69342. var body io.Reader = nil
  69343. c.urlParams_.Set("alt", alt)
  69344. c.urlParams_.Set("prettyPrint", "false")
  69345. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnHost")
  69346. urls += "?" + c.urlParams_.Encode()
  69347. req, err := http.NewRequest("GET", urls, body)
  69348. if err != nil {
  69349. return nil, err
  69350. }
  69351. req.Header = reqHeaders
  69352. googleapi.Expand(req.URL, map[string]string{
  69353. "project": c.project,
  69354. })
  69355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69356. }
  69357. // Do executes the "compute.projects.getXpnHost" call.
  69358. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  69359. // code is an error. Response headers are in either
  69360. // *Project.ServerResponse.Header or (if a response was returned at all)
  69361. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  69362. // check whether the returned error was because http.StatusNotModified
  69363. // was returned.
  69364. func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  69365. gensupport.SetOptions(c.urlParams_, opts...)
  69366. res, err := c.doRequest("json")
  69367. if res != nil && res.StatusCode == http.StatusNotModified {
  69368. if res.Body != nil {
  69369. res.Body.Close()
  69370. }
  69371. return nil, &googleapi.Error{
  69372. Code: res.StatusCode,
  69373. Header: res.Header,
  69374. }
  69375. }
  69376. if err != nil {
  69377. return nil, err
  69378. }
  69379. defer googleapi.CloseBody(res)
  69380. if err := googleapi.CheckResponse(res); err != nil {
  69381. return nil, err
  69382. }
  69383. ret := &Project{
  69384. ServerResponse: googleapi.ServerResponse{
  69385. Header: res.Header,
  69386. HTTPStatusCode: res.StatusCode,
  69387. },
  69388. }
  69389. target := &ret
  69390. if err := gensupport.DecodeResponse(target, res); err != nil {
  69391. return nil, err
  69392. }
  69393. return ret, nil
  69394. // {
  69395. // "description": "Gets the shared VPC host project that this project links to. May be empty if no link exists.",
  69396. // "httpMethod": "GET",
  69397. // "id": "compute.projects.getXpnHost",
  69398. // "parameterOrder": [
  69399. // "project"
  69400. // ],
  69401. // "parameters": {
  69402. // "project": {
  69403. // "description": "Project ID for this request.",
  69404. // "location": "path",
  69405. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69406. // "required": true,
  69407. // "type": "string"
  69408. // }
  69409. // },
  69410. // "path": "{project}/getXpnHost",
  69411. // "response": {
  69412. // "$ref": "Project"
  69413. // },
  69414. // "scopes": [
  69415. // "https://www.googleapis.com/auth/cloud-platform",
  69416. // "https://www.googleapis.com/auth/compute"
  69417. // ]
  69418. // }
  69419. }
  69420. // method id "compute.projects.getXpnResources":
  69421. type ProjectsGetXpnResourcesCall struct {
  69422. s *Service
  69423. project string
  69424. urlParams_ gensupport.URLParams
  69425. ifNoneMatch_ string
  69426. ctx_ context.Context
  69427. header_ http.Header
  69428. }
  69429. // GetXpnResources: Gets service resources (a.k.a service project)
  69430. // associated with this host project.
  69431. func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall {
  69432. c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69433. c.project = project
  69434. return c
  69435. }
  69436. // Filter sets the optional parameter "filter": A filter expression that
  69437. // filters resources listed in the response. The expression must specify
  69438. // the field name, a comparison operator, and the value that you want to
  69439. // use for filtering. The value must be a string, a number, or a
  69440. // boolean. The comparison operator must be either =, !=, >, or <.
  69441. //
  69442. // For example, if you are filtering Compute Engine instances, you can
  69443. // exclude instances named example-instance by specifying name !=
  69444. // example-instance.
  69445. //
  69446. // You can also filter nested fields. For example, you could specify
  69447. // scheduling.automaticRestart = false to include instances only if they
  69448. // are not scheduled for automatic restarts. You can use filtering on
  69449. // nested fields to filter based on resource labels.
  69450. //
  69451. // To filter on multiple expressions, provide each separate expression
  69452. // within parentheses. For example, (scheduling.automaticRestart = true)
  69453. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69454. // AND expression. However, you can include AND and OR expressions
  69455. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69456. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69457. // true).
  69458. func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall {
  69459. c.urlParams_.Set("filter", filter)
  69460. return c
  69461. }
  69462. // MaxResults sets the optional parameter "maxResults": The maximum
  69463. // number of results per page that should be returned. If the number of
  69464. // available results is larger than maxResults, Compute Engine returns a
  69465. // nextPageToken that can be used to get the next page of results in
  69466. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69467. // (Default: 500)
  69468. func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall {
  69469. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69470. return c
  69471. }
  69472. // OrderBy sets the optional parameter "order_by": Sorts list results by
  69473. // a certain order. By default, results are returned in alphanumerical
  69474. // order based on the resource name.
  69475. //
  69476. // You can also sort results in descending order based on the creation
  69477. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69478. // based on the creationTimestamp field in reverse chronological order
  69479. // (newest result first). Use this to sort resources like operations so
  69480. // that the newest operation is returned first.
  69481. //
  69482. // Currently, only sorting by name or creationTimestamp desc is
  69483. // supported.
  69484. func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall {
  69485. c.urlParams_.Set("order_by", orderBy)
  69486. return c
  69487. }
  69488. // PageToken sets the optional parameter "pageToken": Specifies a page
  69489. // token to use. Set pageToken to the nextPageToken returned by a
  69490. // previous list request to get the next page of results.
  69491. func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall {
  69492. c.urlParams_.Set("pageToken", pageToken)
  69493. return c
  69494. }
  69495. // Fields allows partial responses to be retrieved. See
  69496. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69497. // for more information.
  69498. func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall {
  69499. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69500. return c
  69501. }
  69502. // IfNoneMatch sets the optional parameter which makes the operation
  69503. // fail if the object's ETag matches the given value. This is useful for
  69504. // getting updates only after the object has changed since the last
  69505. // request. Use googleapi.IsNotModified to check whether the response
  69506. // error from Do is the result of In-None-Match.
  69507. func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall {
  69508. c.ifNoneMatch_ = entityTag
  69509. return c
  69510. }
  69511. // Context sets the context to be used in this call's Do method. Any
  69512. // pending HTTP request will be aborted if the provided context is
  69513. // canceled.
  69514. func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall {
  69515. c.ctx_ = ctx
  69516. return c
  69517. }
  69518. // Header returns an http.Header that can be modified by the caller to
  69519. // add HTTP headers to the request.
  69520. func (c *ProjectsGetXpnResourcesCall) Header() http.Header {
  69521. if c.header_ == nil {
  69522. c.header_ = make(http.Header)
  69523. }
  69524. return c.header_
  69525. }
  69526. func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) {
  69527. reqHeaders := make(http.Header)
  69528. for k, v := range c.header_ {
  69529. reqHeaders[k] = v
  69530. }
  69531. reqHeaders.Set("User-Agent", c.s.userAgent())
  69532. if c.ifNoneMatch_ != "" {
  69533. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  69534. }
  69535. var body io.Reader = nil
  69536. c.urlParams_.Set("alt", alt)
  69537. c.urlParams_.Set("prettyPrint", "false")
  69538. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/getXpnResources")
  69539. urls += "?" + c.urlParams_.Encode()
  69540. req, err := http.NewRequest("GET", urls, body)
  69541. if err != nil {
  69542. return nil, err
  69543. }
  69544. req.Header = reqHeaders
  69545. googleapi.Expand(req.URL, map[string]string{
  69546. "project": c.project,
  69547. })
  69548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69549. }
  69550. // Do executes the "compute.projects.getXpnResources" call.
  69551. // Exactly one of *ProjectsGetXpnResources or error will be non-nil. Any
  69552. // non-2xx status code is an error. Response headers are in either
  69553. // *ProjectsGetXpnResources.ServerResponse.Header or (if a response was
  69554. // returned at all) in error.(*googleapi.Error).Header. Use
  69555. // googleapi.IsNotModified to check whether the returned error was
  69556. // because http.StatusNotModified was returned.
  69557. func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) {
  69558. gensupport.SetOptions(c.urlParams_, opts...)
  69559. res, err := c.doRequest("json")
  69560. if res != nil && res.StatusCode == http.StatusNotModified {
  69561. if res.Body != nil {
  69562. res.Body.Close()
  69563. }
  69564. return nil, &googleapi.Error{
  69565. Code: res.StatusCode,
  69566. Header: res.Header,
  69567. }
  69568. }
  69569. if err != nil {
  69570. return nil, err
  69571. }
  69572. defer googleapi.CloseBody(res)
  69573. if err := googleapi.CheckResponse(res); err != nil {
  69574. return nil, err
  69575. }
  69576. ret := &ProjectsGetXpnResources{
  69577. ServerResponse: googleapi.ServerResponse{
  69578. Header: res.Header,
  69579. HTTPStatusCode: res.StatusCode,
  69580. },
  69581. }
  69582. target := &ret
  69583. if err := gensupport.DecodeResponse(target, res); err != nil {
  69584. return nil, err
  69585. }
  69586. return ret, nil
  69587. // {
  69588. // "description": "Gets service resources (a.k.a service project) associated with this host project.",
  69589. // "httpMethod": "GET",
  69590. // "id": "compute.projects.getXpnResources",
  69591. // "parameterOrder": [
  69592. // "project"
  69593. // ],
  69594. // "parameters": {
  69595. // "filter": {
  69596. // "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).",
  69597. // "location": "query",
  69598. // "type": "string"
  69599. // },
  69600. // "maxResults": {
  69601. // "default": "500",
  69602. // "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)",
  69603. // "format": "uint32",
  69604. // "location": "query",
  69605. // "minimum": "0",
  69606. // "type": "integer"
  69607. // },
  69608. // "order_by": {
  69609. // "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.",
  69610. // "location": "query",
  69611. // "type": "string"
  69612. // },
  69613. // "pageToken": {
  69614. // "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.",
  69615. // "location": "query",
  69616. // "type": "string"
  69617. // },
  69618. // "project": {
  69619. // "description": "Project ID for this request.",
  69620. // "location": "path",
  69621. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69622. // "required": true,
  69623. // "type": "string"
  69624. // }
  69625. // },
  69626. // "path": "{project}/getXpnResources",
  69627. // "response": {
  69628. // "$ref": "ProjectsGetXpnResources"
  69629. // },
  69630. // "scopes": [
  69631. // "https://www.googleapis.com/auth/cloud-platform",
  69632. // "https://www.googleapis.com/auth/compute"
  69633. // ]
  69634. // }
  69635. }
  69636. // Pages invokes f for each page of results.
  69637. // A non-nil error returned from f will halt the iteration.
  69638. // The provided context supersedes any context provided to the Context method.
  69639. func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error {
  69640. c.ctx_ = ctx
  69641. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69642. for {
  69643. x, err := c.Do()
  69644. if err != nil {
  69645. return err
  69646. }
  69647. if err := f(x); err != nil {
  69648. return err
  69649. }
  69650. if x.NextPageToken == "" {
  69651. return nil
  69652. }
  69653. c.PageToken(x.NextPageToken)
  69654. }
  69655. }
  69656. // method id "compute.projects.listXpnHosts":
  69657. type ProjectsListXpnHostsCall struct {
  69658. s *Service
  69659. project string
  69660. projectslistxpnhostsrequest *ProjectsListXpnHostsRequest
  69661. urlParams_ gensupport.URLParams
  69662. ctx_ context.Context
  69663. header_ http.Header
  69664. }
  69665. // ListXpnHosts: Lists all shared VPC host projects visible to the user
  69666. // in an organization.
  69667. func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall {
  69668. c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69669. c.project = project
  69670. c.projectslistxpnhostsrequest = projectslistxpnhostsrequest
  69671. return c
  69672. }
  69673. // Filter sets the optional parameter "filter": A filter expression that
  69674. // filters resources listed in the response. The expression must specify
  69675. // the field name, a comparison operator, and the value that you want to
  69676. // use for filtering. The value must be a string, a number, or a
  69677. // boolean. The comparison operator must be either =, !=, >, or <.
  69678. //
  69679. // For example, if you are filtering Compute Engine instances, you can
  69680. // exclude instances named example-instance by specifying name !=
  69681. // example-instance.
  69682. //
  69683. // You can also filter nested fields. For example, you could specify
  69684. // scheduling.automaticRestart = false to include instances only if they
  69685. // are not scheduled for automatic restarts. You can use filtering on
  69686. // nested fields to filter based on resource labels.
  69687. //
  69688. // To filter on multiple expressions, provide each separate expression
  69689. // within parentheses. For example, (scheduling.automaticRestart = true)
  69690. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  69691. // AND expression. However, you can include AND and OR expressions
  69692. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  69693. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  69694. // true).
  69695. func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall {
  69696. c.urlParams_.Set("filter", filter)
  69697. return c
  69698. }
  69699. // MaxResults sets the optional parameter "maxResults": The maximum
  69700. // number of results per page that should be returned. If the number of
  69701. // available results is larger than maxResults, Compute Engine returns a
  69702. // nextPageToken that can be used to get the next page of results in
  69703. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  69704. // (Default: 500)
  69705. func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall {
  69706. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  69707. return c
  69708. }
  69709. // OrderBy sets the optional parameter "order_by": Sorts list results by
  69710. // a certain order. By default, results are returned in alphanumerical
  69711. // order based on the resource name.
  69712. //
  69713. // You can also sort results in descending order based on the creation
  69714. // timestamp using orderBy="creationTimestamp desc". This sorts results
  69715. // based on the creationTimestamp field in reverse chronological order
  69716. // (newest result first). Use this to sort resources like operations so
  69717. // that the newest operation is returned first.
  69718. //
  69719. // Currently, only sorting by name or creationTimestamp desc is
  69720. // supported.
  69721. func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall {
  69722. c.urlParams_.Set("order_by", orderBy)
  69723. return c
  69724. }
  69725. // PageToken sets the optional parameter "pageToken": Specifies a page
  69726. // token to use. Set pageToken to the nextPageToken returned by a
  69727. // previous list request to get the next page of results.
  69728. func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall {
  69729. c.urlParams_.Set("pageToken", pageToken)
  69730. return c
  69731. }
  69732. // Fields allows partial responses to be retrieved. See
  69733. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69734. // for more information.
  69735. func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall {
  69736. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69737. return c
  69738. }
  69739. // Context sets the context to be used in this call's Do method. Any
  69740. // pending HTTP request will be aborted if the provided context is
  69741. // canceled.
  69742. func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall {
  69743. c.ctx_ = ctx
  69744. return c
  69745. }
  69746. // Header returns an http.Header that can be modified by the caller to
  69747. // add HTTP headers to the request.
  69748. func (c *ProjectsListXpnHostsCall) Header() http.Header {
  69749. if c.header_ == nil {
  69750. c.header_ = make(http.Header)
  69751. }
  69752. return c.header_
  69753. }
  69754. func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) {
  69755. reqHeaders := make(http.Header)
  69756. for k, v := range c.header_ {
  69757. reqHeaders[k] = v
  69758. }
  69759. reqHeaders.Set("User-Agent", c.s.userAgent())
  69760. var body io.Reader = nil
  69761. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest)
  69762. if err != nil {
  69763. return nil, err
  69764. }
  69765. reqHeaders.Set("Content-Type", "application/json")
  69766. c.urlParams_.Set("alt", alt)
  69767. c.urlParams_.Set("prettyPrint", "false")
  69768. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/listXpnHosts")
  69769. urls += "?" + c.urlParams_.Encode()
  69770. req, err := http.NewRequest("POST", urls, body)
  69771. if err != nil {
  69772. return nil, err
  69773. }
  69774. req.Header = reqHeaders
  69775. googleapi.Expand(req.URL, map[string]string{
  69776. "project": c.project,
  69777. })
  69778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69779. }
  69780. // Do executes the "compute.projects.listXpnHosts" call.
  69781. // Exactly one of *XpnHostList or error will be non-nil. Any non-2xx
  69782. // status code is an error. Response headers are in either
  69783. // *XpnHostList.ServerResponse.Header or (if a response was returned at
  69784. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69785. // to check whether the returned error was because
  69786. // http.StatusNotModified was returned.
  69787. func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) {
  69788. gensupport.SetOptions(c.urlParams_, opts...)
  69789. res, err := c.doRequest("json")
  69790. if res != nil && res.StatusCode == http.StatusNotModified {
  69791. if res.Body != nil {
  69792. res.Body.Close()
  69793. }
  69794. return nil, &googleapi.Error{
  69795. Code: res.StatusCode,
  69796. Header: res.Header,
  69797. }
  69798. }
  69799. if err != nil {
  69800. return nil, err
  69801. }
  69802. defer googleapi.CloseBody(res)
  69803. if err := googleapi.CheckResponse(res); err != nil {
  69804. return nil, err
  69805. }
  69806. ret := &XpnHostList{
  69807. ServerResponse: googleapi.ServerResponse{
  69808. Header: res.Header,
  69809. HTTPStatusCode: res.StatusCode,
  69810. },
  69811. }
  69812. target := &ret
  69813. if err := gensupport.DecodeResponse(target, res); err != nil {
  69814. return nil, err
  69815. }
  69816. return ret, nil
  69817. // {
  69818. // "description": "Lists all shared VPC host projects visible to the user in an organization.",
  69819. // "httpMethod": "POST",
  69820. // "id": "compute.projects.listXpnHosts",
  69821. // "parameterOrder": [
  69822. // "project"
  69823. // ],
  69824. // "parameters": {
  69825. // "filter": {
  69826. // "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).",
  69827. // "location": "query",
  69828. // "type": "string"
  69829. // },
  69830. // "maxResults": {
  69831. // "default": "500",
  69832. // "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)",
  69833. // "format": "uint32",
  69834. // "location": "query",
  69835. // "minimum": "0",
  69836. // "type": "integer"
  69837. // },
  69838. // "order_by": {
  69839. // "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.",
  69840. // "location": "query",
  69841. // "type": "string"
  69842. // },
  69843. // "pageToken": {
  69844. // "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.",
  69845. // "location": "query",
  69846. // "type": "string"
  69847. // },
  69848. // "project": {
  69849. // "description": "Project ID for this request.",
  69850. // "location": "path",
  69851. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  69852. // "required": true,
  69853. // "type": "string"
  69854. // }
  69855. // },
  69856. // "path": "{project}/listXpnHosts",
  69857. // "request": {
  69858. // "$ref": "ProjectsListXpnHostsRequest"
  69859. // },
  69860. // "response": {
  69861. // "$ref": "XpnHostList"
  69862. // },
  69863. // "scopes": [
  69864. // "https://www.googleapis.com/auth/cloud-platform",
  69865. // "https://www.googleapis.com/auth/compute"
  69866. // ]
  69867. // }
  69868. }
  69869. // Pages invokes f for each page of results.
  69870. // A non-nil error returned from f will halt the iteration.
  69871. // The provided context supersedes any context provided to the Context method.
  69872. func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error {
  69873. c.ctx_ = ctx
  69874. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  69875. for {
  69876. x, err := c.Do()
  69877. if err != nil {
  69878. return err
  69879. }
  69880. if err := f(x); err != nil {
  69881. return err
  69882. }
  69883. if x.NextPageToken == "" {
  69884. return nil
  69885. }
  69886. c.PageToken(x.NextPageToken)
  69887. }
  69888. }
  69889. // method id "compute.projects.moveDisk":
  69890. type ProjectsMoveDiskCall struct {
  69891. s *Service
  69892. project string
  69893. diskmoverequest *DiskMoveRequest
  69894. urlParams_ gensupport.URLParams
  69895. ctx_ context.Context
  69896. header_ http.Header
  69897. }
  69898. // MoveDisk: Moves a persistent disk from one zone to another.
  69899. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall {
  69900. c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  69901. c.project = project
  69902. c.diskmoverequest = diskmoverequest
  69903. return c
  69904. }
  69905. // RequestId sets the optional parameter "requestId": An optional
  69906. // request ID to identify requests. Specify a unique request ID so that
  69907. // if you must retry your request, the server will know to ignore the
  69908. // request if it has already been completed.
  69909. //
  69910. // For example, consider a situation where you make an initial request
  69911. // and the request times out. If you make the request again with the
  69912. // same request ID, the server can check if original operation with the
  69913. // same request ID was received, and if so, will ignore the second
  69914. // request. This prevents clients from accidentally creating duplicate
  69915. // commitments.
  69916. //
  69917. // The request ID must be a valid UUID with the exception that zero UUID
  69918. // is not supported (00000000-0000-0000-0000-000000000000).
  69919. func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall {
  69920. c.urlParams_.Set("requestId", requestId)
  69921. return c
  69922. }
  69923. // Fields allows partial responses to be retrieved. See
  69924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  69925. // for more information.
  69926. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall {
  69927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  69928. return c
  69929. }
  69930. // Context sets the context to be used in this call's Do method. Any
  69931. // pending HTTP request will be aborted if the provided context is
  69932. // canceled.
  69933. func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall {
  69934. c.ctx_ = ctx
  69935. return c
  69936. }
  69937. // Header returns an http.Header that can be modified by the caller to
  69938. // add HTTP headers to the request.
  69939. func (c *ProjectsMoveDiskCall) Header() http.Header {
  69940. if c.header_ == nil {
  69941. c.header_ = make(http.Header)
  69942. }
  69943. return c.header_
  69944. }
  69945. func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) {
  69946. reqHeaders := make(http.Header)
  69947. for k, v := range c.header_ {
  69948. reqHeaders[k] = v
  69949. }
  69950. reqHeaders.Set("User-Agent", c.s.userAgent())
  69951. var body io.Reader = nil
  69952. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest)
  69953. if err != nil {
  69954. return nil, err
  69955. }
  69956. reqHeaders.Set("Content-Type", "application/json")
  69957. c.urlParams_.Set("alt", alt)
  69958. c.urlParams_.Set("prettyPrint", "false")
  69959. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk")
  69960. urls += "?" + c.urlParams_.Encode()
  69961. req, err := http.NewRequest("POST", urls, body)
  69962. if err != nil {
  69963. return nil, err
  69964. }
  69965. req.Header = reqHeaders
  69966. googleapi.Expand(req.URL, map[string]string{
  69967. "project": c.project,
  69968. })
  69969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  69970. }
  69971. // Do executes the "compute.projects.moveDisk" call.
  69972. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  69973. // status code is an error. Response headers are in either
  69974. // *Operation.ServerResponse.Header or (if a response was returned at
  69975. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  69976. // to check whether the returned error was because
  69977. // http.StatusNotModified was returned.
  69978. func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  69979. gensupport.SetOptions(c.urlParams_, opts...)
  69980. res, err := c.doRequest("json")
  69981. if res != nil && res.StatusCode == http.StatusNotModified {
  69982. if res.Body != nil {
  69983. res.Body.Close()
  69984. }
  69985. return nil, &googleapi.Error{
  69986. Code: res.StatusCode,
  69987. Header: res.Header,
  69988. }
  69989. }
  69990. if err != nil {
  69991. return nil, err
  69992. }
  69993. defer googleapi.CloseBody(res)
  69994. if err := googleapi.CheckResponse(res); err != nil {
  69995. return nil, err
  69996. }
  69997. ret := &Operation{
  69998. ServerResponse: googleapi.ServerResponse{
  69999. Header: res.Header,
  70000. HTTPStatusCode: res.StatusCode,
  70001. },
  70002. }
  70003. target := &ret
  70004. if err := gensupport.DecodeResponse(target, res); err != nil {
  70005. return nil, err
  70006. }
  70007. return ret, nil
  70008. // {
  70009. // "description": "Moves a persistent disk from one zone to another.",
  70010. // "httpMethod": "POST",
  70011. // "id": "compute.projects.moveDisk",
  70012. // "parameterOrder": [
  70013. // "project"
  70014. // ],
  70015. // "parameters": {
  70016. // "project": {
  70017. // "description": "Project ID for this request.",
  70018. // "location": "path",
  70019. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70020. // "required": true,
  70021. // "type": "string"
  70022. // },
  70023. // "requestId": {
  70024. // "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).",
  70025. // "location": "query",
  70026. // "type": "string"
  70027. // }
  70028. // },
  70029. // "path": "{project}/moveDisk",
  70030. // "request": {
  70031. // "$ref": "DiskMoveRequest"
  70032. // },
  70033. // "response": {
  70034. // "$ref": "Operation"
  70035. // },
  70036. // "scopes": [
  70037. // "https://www.googleapis.com/auth/cloud-platform",
  70038. // "https://www.googleapis.com/auth/compute"
  70039. // ]
  70040. // }
  70041. }
  70042. // method id "compute.projects.moveInstance":
  70043. type ProjectsMoveInstanceCall struct {
  70044. s *Service
  70045. project string
  70046. instancemoverequest *InstanceMoveRequest
  70047. urlParams_ gensupport.URLParams
  70048. ctx_ context.Context
  70049. header_ http.Header
  70050. }
  70051. // MoveInstance: Moves an instance and its attached persistent disks
  70052. // from one zone to another.
  70053. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall {
  70054. c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70055. c.project = project
  70056. c.instancemoverequest = instancemoverequest
  70057. return c
  70058. }
  70059. // RequestId sets the optional parameter "requestId": An optional
  70060. // request ID to identify requests. Specify a unique request ID so that
  70061. // if you must retry your request, the server will know to ignore the
  70062. // request if it has already been completed.
  70063. //
  70064. // For example, consider a situation where you make an initial request
  70065. // and the request times out. If you make the request again with the
  70066. // same request ID, the server can check if original operation with the
  70067. // same request ID was received, and if so, will ignore the second
  70068. // request. This prevents clients from accidentally creating duplicate
  70069. // commitments.
  70070. //
  70071. // The request ID must be a valid UUID with the exception that zero UUID
  70072. // is not supported (00000000-0000-0000-0000-000000000000).
  70073. func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall {
  70074. c.urlParams_.Set("requestId", requestId)
  70075. return c
  70076. }
  70077. // Fields allows partial responses to be retrieved. See
  70078. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70079. // for more information.
  70080. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall {
  70081. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70082. return c
  70083. }
  70084. // Context sets the context to be used in this call's Do method. Any
  70085. // pending HTTP request will be aborted if the provided context is
  70086. // canceled.
  70087. func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall {
  70088. c.ctx_ = ctx
  70089. return c
  70090. }
  70091. // Header returns an http.Header that can be modified by the caller to
  70092. // add HTTP headers to the request.
  70093. func (c *ProjectsMoveInstanceCall) Header() http.Header {
  70094. if c.header_ == nil {
  70095. c.header_ = make(http.Header)
  70096. }
  70097. return c.header_
  70098. }
  70099. func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  70100. reqHeaders := make(http.Header)
  70101. for k, v := range c.header_ {
  70102. reqHeaders[k] = v
  70103. }
  70104. reqHeaders.Set("User-Agent", c.s.userAgent())
  70105. var body io.Reader = nil
  70106. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest)
  70107. if err != nil {
  70108. return nil, err
  70109. }
  70110. reqHeaders.Set("Content-Type", "application/json")
  70111. c.urlParams_.Set("alt", alt)
  70112. c.urlParams_.Set("prettyPrint", "false")
  70113. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance")
  70114. urls += "?" + c.urlParams_.Encode()
  70115. req, err := http.NewRequest("POST", urls, body)
  70116. if err != nil {
  70117. return nil, err
  70118. }
  70119. req.Header = reqHeaders
  70120. googleapi.Expand(req.URL, map[string]string{
  70121. "project": c.project,
  70122. })
  70123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70124. }
  70125. // Do executes the "compute.projects.moveInstance" call.
  70126. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70127. // status code is an error. Response headers are in either
  70128. // *Operation.ServerResponse.Header or (if a response was returned at
  70129. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70130. // to check whether the returned error was because
  70131. // http.StatusNotModified was returned.
  70132. func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70133. gensupport.SetOptions(c.urlParams_, opts...)
  70134. res, err := c.doRequest("json")
  70135. if res != nil && res.StatusCode == http.StatusNotModified {
  70136. if res.Body != nil {
  70137. res.Body.Close()
  70138. }
  70139. return nil, &googleapi.Error{
  70140. Code: res.StatusCode,
  70141. Header: res.Header,
  70142. }
  70143. }
  70144. if err != nil {
  70145. return nil, err
  70146. }
  70147. defer googleapi.CloseBody(res)
  70148. if err := googleapi.CheckResponse(res); err != nil {
  70149. return nil, err
  70150. }
  70151. ret := &Operation{
  70152. ServerResponse: googleapi.ServerResponse{
  70153. Header: res.Header,
  70154. HTTPStatusCode: res.StatusCode,
  70155. },
  70156. }
  70157. target := &ret
  70158. if err := gensupport.DecodeResponse(target, res); err != nil {
  70159. return nil, err
  70160. }
  70161. return ret, nil
  70162. // {
  70163. // "description": "Moves an instance and its attached persistent disks from one zone to another.",
  70164. // "httpMethod": "POST",
  70165. // "id": "compute.projects.moveInstance",
  70166. // "parameterOrder": [
  70167. // "project"
  70168. // ],
  70169. // "parameters": {
  70170. // "project": {
  70171. // "description": "Project ID for this request.",
  70172. // "location": "path",
  70173. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70174. // "required": true,
  70175. // "type": "string"
  70176. // },
  70177. // "requestId": {
  70178. // "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).",
  70179. // "location": "query",
  70180. // "type": "string"
  70181. // }
  70182. // },
  70183. // "path": "{project}/moveInstance",
  70184. // "request": {
  70185. // "$ref": "InstanceMoveRequest"
  70186. // },
  70187. // "response": {
  70188. // "$ref": "Operation"
  70189. // },
  70190. // "scopes": [
  70191. // "https://www.googleapis.com/auth/cloud-platform",
  70192. // "https://www.googleapis.com/auth/compute"
  70193. // ]
  70194. // }
  70195. }
  70196. // method id "compute.projects.setCommonInstanceMetadata":
  70197. type ProjectsSetCommonInstanceMetadataCall struct {
  70198. s *Service
  70199. project string
  70200. metadata *Metadata
  70201. urlParams_ gensupport.URLParams
  70202. ctx_ context.Context
  70203. header_ http.Header
  70204. }
  70205. // SetCommonInstanceMetadata: Sets metadata common to all instances
  70206. // within the specified project using the data included in the request.
  70207. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata
  70208. func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall {
  70209. c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70210. c.project = project
  70211. c.metadata = metadata
  70212. return c
  70213. }
  70214. // RequestId sets the optional parameter "requestId": An optional
  70215. // request ID to identify requests. Specify a unique request ID so that
  70216. // if you must retry your request, the server will know to ignore the
  70217. // request if it has already been completed.
  70218. //
  70219. // For example, consider a situation where you make an initial request
  70220. // and the request times out. If you make the request again with the
  70221. // same request ID, the server can check if original operation with the
  70222. // same request ID was received, and if so, will ignore the second
  70223. // request. This prevents clients from accidentally creating duplicate
  70224. // commitments.
  70225. //
  70226. // The request ID must be a valid UUID with the exception that zero UUID
  70227. // is not supported (00000000-0000-0000-0000-000000000000).
  70228. func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall {
  70229. c.urlParams_.Set("requestId", requestId)
  70230. return c
  70231. }
  70232. // Fields allows partial responses to be retrieved. See
  70233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70234. // for more information.
  70235. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall {
  70236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70237. return c
  70238. }
  70239. // Context sets the context to be used in this call's Do method. Any
  70240. // pending HTTP request will be aborted if the provided context is
  70241. // canceled.
  70242. func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall {
  70243. c.ctx_ = ctx
  70244. return c
  70245. }
  70246. // Header returns an http.Header that can be modified by the caller to
  70247. // add HTTP headers to the request.
  70248. func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header {
  70249. if c.header_ == nil {
  70250. c.header_ = make(http.Header)
  70251. }
  70252. return c.header_
  70253. }
  70254. func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) {
  70255. reqHeaders := make(http.Header)
  70256. for k, v := range c.header_ {
  70257. reqHeaders[k] = v
  70258. }
  70259. reqHeaders.Set("User-Agent", c.s.userAgent())
  70260. var body io.Reader = nil
  70261. body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata)
  70262. if err != nil {
  70263. return nil, err
  70264. }
  70265. reqHeaders.Set("Content-Type", "application/json")
  70266. c.urlParams_.Set("alt", alt)
  70267. c.urlParams_.Set("prettyPrint", "false")
  70268. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata")
  70269. urls += "?" + c.urlParams_.Encode()
  70270. req, err := http.NewRequest("POST", urls, body)
  70271. if err != nil {
  70272. return nil, err
  70273. }
  70274. req.Header = reqHeaders
  70275. googleapi.Expand(req.URL, map[string]string{
  70276. "project": c.project,
  70277. })
  70278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70279. }
  70280. // Do executes the "compute.projects.setCommonInstanceMetadata" call.
  70281. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70282. // status code is an error. Response headers are in either
  70283. // *Operation.ServerResponse.Header or (if a response was returned at
  70284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70285. // to check whether the returned error was because
  70286. // http.StatusNotModified was returned.
  70287. func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70288. gensupport.SetOptions(c.urlParams_, opts...)
  70289. res, err := c.doRequest("json")
  70290. if res != nil && res.StatusCode == http.StatusNotModified {
  70291. if res.Body != nil {
  70292. res.Body.Close()
  70293. }
  70294. return nil, &googleapi.Error{
  70295. Code: res.StatusCode,
  70296. Header: res.Header,
  70297. }
  70298. }
  70299. if err != nil {
  70300. return nil, err
  70301. }
  70302. defer googleapi.CloseBody(res)
  70303. if err := googleapi.CheckResponse(res); err != nil {
  70304. return nil, err
  70305. }
  70306. ret := &Operation{
  70307. ServerResponse: googleapi.ServerResponse{
  70308. Header: res.Header,
  70309. HTTPStatusCode: res.StatusCode,
  70310. },
  70311. }
  70312. target := &ret
  70313. if err := gensupport.DecodeResponse(target, res); err != nil {
  70314. return nil, err
  70315. }
  70316. return ret, nil
  70317. // {
  70318. // "description": "Sets metadata common to all instances within the specified project using the data included in the request.",
  70319. // "httpMethod": "POST",
  70320. // "id": "compute.projects.setCommonInstanceMetadata",
  70321. // "parameterOrder": [
  70322. // "project"
  70323. // ],
  70324. // "parameters": {
  70325. // "project": {
  70326. // "description": "Project ID for this request.",
  70327. // "location": "path",
  70328. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70329. // "required": true,
  70330. // "type": "string"
  70331. // },
  70332. // "requestId": {
  70333. // "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).",
  70334. // "location": "query",
  70335. // "type": "string"
  70336. // }
  70337. // },
  70338. // "path": "{project}/setCommonInstanceMetadata",
  70339. // "request": {
  70340. // "$ref": "Metadata"
  70341. // },
  70342. // "response": {
  70343. // "$ref": "Operation"
  70344. // },
  70345. // "scopes": [
  70346. // "https://www.googleapis.com/auth/cloud-platform",
  70347. // "https://www.googleapis.com/auth/compute"
  70348. // ]
  70349. // }
  70350. }
  70351. // method id "compute.projects.setDefaultNetworkTier":
  70352. type ProjectsSetDefaultNetworkTierCall struct {
  70353. s *Service
  70354. project string
  70355. projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest
  70356. urlParams_ gensupport.URLParams
  70357. ctx_ context.Context
  70358. header_ http.Header
  70359. }
  70360. // SetDefaultNetworkTier: Sets the default network tier of the project.
  70361. // The default network tier is used when an
  70362. // address/forwardingRule/instance is created without specifying the
  70363. // network tier field.
  70364. func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall {
  70365. c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70366. c.project = project
  70367. c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest
  70368. return c
  70369. }
  70370. // RequestId sets the optional parameter "requestId": An optional
  70371. // request ID to identify requests. Specify a unique request ID so that
  70372. // if you must retry your request, the server will know to ignore the
  70373. // request if it has already been completed.
  70374. //
  70375. // For example, consider a situation where you make an initial request
  70376. // and the request times out. If you make the request again with the
  70377. // same request ID, the server can check if original operation with the
  70378. // same request ID was received, and if so, will ignore the second
  70379. // request. This prevents clients from accidentally creating duplicate
  70380. // commitments.
  70381. //
  70382. // The request ID must be a valid UUID with the exception that zero UUID
  70383. // is not supported (00000000-0000-0000-0000-000000000000).
  70384. func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall {
  70385. c.urlParams_.Set("requestId", requestId)
  70386. return c
  70387. }
  70388. // Fields allows partial responses to be retrieved. See
  70389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70390. // for more information.
  70391. func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall {
  70392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70393. return c
  70394. }
  70395. // Context sets the context to be used in this call's Do method. Any
  70396. // pending HTTP request will be aborted if the provided context is
  70397. // canceled.
  70398. func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall {
  70399. c.ctx_ = ctx
  70400. return c
  70401. }
  70402. // Header returns an http.Header that can be modified by the caller to
  70403. // add HTTP headers to the request.
  70404. func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header {
  70405. if c.header_ == nil {
  70406. c.header_ = make(http.Header)
  70407. }
  70408. return c.header_
  70409. }
  70410. func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) {
  70411. reqHeaders := make(http.Header)
  70412. for k, v := range c.header_ {
  70413. reqHeaders[k] = v
  70414. }
  70415. reqHeaders.Set("User-Agent", c.s.userAgent())
  70416. var body io.Reader = nil
  70417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest)
  70418. if err != nil {
  70419. return nil, err
  70420. }
  70421. reqHeaders.Set("Content-Type", "application/json")
  70422. c.urlParams_.Set("alt", alt)
  70423. c.urlParams_.Set("prettyPrint", "false")
  70424. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setDefaultNetworkTier")
  70425. urls += "?" + c.urlParams_.Encode()
  70426. req, err := http.NewRequest("POST", urls, body)
  70427. if err != nil {
  70428. return nil, err
  70429. }
  70430. req.Header = reqHeaders
  70431. googleapi.Expand(req.URL, map[string]string{
  70432. "project": c.project,
  70433. })
  70434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70435. }
  70436. // Do executes the "compute.projects.setDefaultNetworkTier" call.
  70437. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70438. // status code is an error. Response headers are in either
  70439. // *Operation.ServerResponse.Header or (if a response was returned at
  70440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70441. // to check whether the returned error was because
  70442. // http.StatusNotModified was returned.
  70443. func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70444. gensupport.SetOptions(c.urlParams_, opts...)
  70445. res, err := c.doRequest("json")
  70446. if res != nil && res.StatusCode == http.StatusNotModified {
  70447. if res.Body != nil {
  70448. res.Body.Close()
  70449. }
  70450. return nil, &googleapi.Error{
  70451. Code: res.StatusCode,
  70452. Header: res.Header,
  70453. }
  70454. }
  70455. if err != nil {
  70456. return nil, err
  70457. }
  70458. defer googleapi.CloseBody(res)
  70459. if err := googleapi.CheckResponse(res); err != nil {
  70460. return nil, err
  70461. }
  70462. ret := &Operation{
  70463. ServerResponse: googleapi.ServerResponse{
  70464. Header: res.Header,
  70465. HTTPStatusCode: res.StatusCode,
  70466. },
  70467. }
  70468. target := &ret
  70469. if err := gensupport.DecodeResponse(target, res); err != nil {
  70470. return nil, err
  70471. }
  70472. return ret, nil
  70473. // {
  70474. // "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.",
  70475. // "httpMethod": "POST",
  70476. // "id": "compute.projects.setDefaultNetworkTier",
  70477. // "parameterOrder": [
  70478. // "project"
  70479. // ],
  70480. // "parameters": {
  70481. // "project": {
  70482. // "description": "Project ID for this request.",
  70483. // "location": "path",
  70484. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70485. // "required": true,
  70486. // "type": "string"
  70487. // },
  70488. // "requestId": {
  70489. // "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).",
  70490. // "location": "query",
  70491. // "type": "string"
  70492. // }
  70493. // },
  70494. // "path": "{project}/setDefaultNetworkTier",
  70495. // "request": {
  70496. // "$ref": "ProjectsSetDefaultNetworkTierRequest"
  70497. // },
  70498. // "response": {
  70499. // "$ref": "Operation"
  70500. // },
  70501. // "scopes": [
  70502. // "https://www.googleapis.com/auth/cloud-platform",
  70503. // "https://www.googleapis.com/auth/compute"
  70504. // ]
  70505. // }
  70506. }
  70507. // method id "compute.projects.setUsageExportBucket":
  70508. type ProjectsSetUsageExportBucketCall struct {
  70509. s *Service
  70510. project string
  70511. usageexportlocation *UsageExportLocation
  70512. urlParams_ gensupport.URLParams
  70513. ctx_ context.Context
  70514. header_ http.Header
  70515. }
  70516. // SetUsageExportBucket: Enables the usage export feature and sets the
  70517. // usage export bucket where reports are stored. If you provide an empty
  70518. // request body using this method, the usage export feature will be
  70519. // disabled.
  70520. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket
  70521. func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall {
  70522. c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70523. c.project = project
  70524. c.usageexportlocation = usageexportlocation
  70525. return c
  70526. }
  70527. // RequestId sets the optional parameter "requestId": An optional
  70528. // request ID to identify requests. Specify a unique request ID so that
  70529. // if you must retry your request, the server will know to ignore the
  70530. // request if it has already been completed.
  70531. //
  70532. // For example, consider a situation where you make an initial request
  70533. // and the request times out. If you make the request again with the
  70534. // same request ID, the server can check if original operation with the
  70535. // same request ID was received, and if so, will ignore the second
  70536. // request. This prevents clients from accidentally creating duplicate
  70537. // commitments.
  70538. //
  70539. // The request ID must be a valid UUID with the exception that zero UUID
  70540. // is not supported (00000000-0000-0000-0000-000000000000).
  70541. func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall {
  70542. c.urlParams_.Set("requestId", requestId)
  70543. return c
  70544. }
  70545. // Fields allows partial responses to be retrieved. See
  70546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70547. // for more information.
  70548. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall {
  70549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70550. return c
  70551. }
  70552. // Context sets the context to be used in this call's Do method. Any
  70553. // pending HTTP request will be aborted if the provided context is
  70554. // canceled.
  70555. func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall {
  70556. c.ctx_ = ctx
  70557. return c
  70558. }
  70559. // Header returns an http.Header that can be modified by the caller to
  70560. // add HTTP headers to the request.
  70561. func (c *ProjectsSetUsageExportBucketCall) Header() http.Header {
  70562. if c.header_ == nil {
  70563. c.header_ = make(http.Header)
  70564. }
  70565. return c.header_
  70566. }
  70567. func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) {
  70568. reqHeaders := make(http.Header)
  70569. for k, v := range c.header_ {
  70570. reqHeaders[k] = v
  70571. }
  70572. reqHeaders.Set("User-Agent", c.s.userAgent())
  70573. var body io.Reader = nil
  70574. body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation)
  70575. if err != nil {
  70576. return nil, err
  70577. }
  70578. reqHeaders.Set("Content-Type", "application/json")
  70579. c.urlParams_.Set("alt", alt)
  70580. c.urlParams_.Set("prettyPrint", "false")
  70581. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket")
  70582. urls += "?" + c.urlParams_.Encode()
  70583. req, err := http.NewRequest("POST", urls, body)
  70584. if err != nil {
  70585. return nil, err
  70586. }
  70587. req.Header = reqHeaders
  70588. googleapi.Expand(req.URL, map[string]string{
  70589. "project": c.project,
  70590. })
  70591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70592. }
  70593. // Do executes the "compute.projects.setUsageExportBucket" call.
  70594. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70595. // status code is an error. Response headers are in either
  70596. // *Operation.ServerResponse.Header or (if a response was returned at
  70597. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70598. // to check whether the returned error was because
  70599. // http.StatusNotModified was returned.
  70600. func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70601. gensupport.SetOptions(c.urlParams_, opts...)
  70602. res, err := c.doRequest("json")
  70603. if res != nil && res.StatusCode == http.StatusNotModified {
  70604. if res.Body != nil {
  70605. res.Body.Close()
  70606. }
  70607. return nil, &googleapi.Error{
  70608. Code: res.StatusCode,
  70609. Header: res.Header,
  70610. }
  70611. }
  70612. if err != nil {
  70613. return nil, err
  70614. }
  70615. defer googleapi.CloseBody(res)
  70616. if err := googleapi.CheckResponse(res); err != nil {
  70617. return nil, err
  70618. }
  70619. ret := &Operation{
  70620. ServerResponse: googleapi.ServerResponse{
  70621. Header: res.Header,
  70622. HTTPStatusCode: res.StatusCode,
  70623. },
  70624. }
  70625. target := &ret
  70626. if err := gensupport.DecodeResponse(target, res); err != nil {
  70627. return nil, err
  70628. }
  70629. return ret, nil
  70630. // {
  70631. // "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.",
  70632. // "httpMethod": "POST",
  70633. // "id": "compute.projects.setUsageExportBucket",
  70634. // "parameterOrder": [
  70635. // "project"
  70636. // ],
  70637. // "parameters": {
  70638. // "project": {
  70639. // "description": "Project ID for this request.",
  70640. // "location": "path",
  70641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70642. // "required": true,
  70643. // "type": "string"
  70644. // },
  70645. // "requestId": {
  70646. // "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).",
  70647. // "location": "query",
  70648. // "type": "string"
  70649. // }
  70650. // },
  70651. // "path": "{project}/setUsageExportBucket",
  70652. // "request": {
  70653. // "$ref": "UsageExportLocation"
  70654. // },
  70655. // "response": {
  70656. // "$ref": "Operation"
  70657. // },
  70658. // "scopes": [
  70659. // "https://www.googleapis.com/auth/cloud-platform",
  70660. // "https://www.googleapis.com/auth/compute",
  70661. // "https://www.googleapis.com/auth/devstorage.full_control",
  70662. // "https://www.googleapis.com/auth/devstorage.read_only",
  70663. // "https://www.googleapis.com/auth/devstorage.read_write"
  70664. // ]
  70665. // }
  70666. }
  70667. // method id "compute.regionAutoscalers.delete":
  70668. type RegionAutoscalersDeleteCall struct {
  70669. s *Service
  70670. project string
  70671. region string
  70672. autoscaler string
  70673. urlParams_ gensupport.URLParams
  70674. ctx_ context.Context
  70675. header_ http.Header
  70676. }
  70677. // Delete: Deletes the specified autoscaler.
  70678. func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall {
  70679. c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70680. c.project = project
  70681. c.region = region
  70682. c.autoscaler = autoscaler
  70683. return c
  70684. }
  70685. // RequestId sets the optional parameter "requestId": An optional
  70686. // request ID to identify requests. Specify a unique request ID so that
  70687. // if you must retry your request, the server will know to ignore the
  70688. // request if it has already been completed.
  70689. //
  70690. // For example, consider a situation where you make an initial request
  70691. // and the request times out. If you make the request again with the
  70692. // same request ID, the server can check if original operation with the
  70693. // same request ID was received, and if so, will ignore the second
  70694. // request. This prevents clients from accidentally creating duplicate
  70695. // commitments.
  70696. //
  70697. // The request ID must be a valid UUID with the exception that zero UUID
  70698. // is not supported (00000000-0000-0000-0000-000000000000).
  70699. func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall {
  70700. c.urlParams_.Set("requestId", requestId)
  70701. return c
  70702. }
  70703. // Fields allows partial responses to be retrieved. See
  70704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70705. // for more information.
  70706. func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall {
  70707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70708. return c
  70709. }
  70710. // Context sets the context to be used in this call's Do method. Any
  70711. // pending HTTP request will be aborted if the provided context is
  70712. // canceled.
  70713. func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall {
  70714. c.ctx_ = ctx
  70715. return c
  70716. }
  70717. // Header returns an http.Header that can be modified by the caller to
  70718. // add HTTP headers to the request.
  70719. func (c *RegionAutoscalersDeleteCall) Header() http.Header {
  70720. if c.header_ == nil {
  70721. c.header_ = make(http.Header)
  70722. }
  70723. return c.header_
  70724. }
  70725. func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) {
  70726. reqHeaders := make(http.Header)
  70727. for k, v := range c.header_ {
  70728. reqHeaders[k] = v
  70729. }
  70730. reqHeaders.Set("User-Agent", c.s.userAgent())
  70731. var body io.Reader = nil
  70732. c.urlParams_.Set("alt", alt)
  70733. c.urlParams_.Set("prettyPrint", "false")
  70734. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  70735. urls += "?" + c.urlParams_.Encode()
  70736. req, err := http.NewRequest("DELETE", urls, body)
  70737. if err != nil {
  70738. return nil, err
  70739. }
  70740. req.Header = reqHeaders
  70741. googleapi.Expand(req.URL, map[string]string{
  70742. "project": c.project,
  70743. "region": c.region,
  70744. "autoscaler": c.autoscaler,
  70745. })
  70746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70747. }
  70748. // Do executes the "compute.regionAutoscalers.delete" call.
  70749. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  70750. // status code is an error. Response headers are in either
  70751. // *Operation.ServerResponse.Header or (if a response was returned at
  70752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70753. // to check whether the returned error was because
  70754. // http.StatusNotModified was returned.
  70755. func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  70756. gensupport.SetOptions(c.urlParams_, opts...)
  70757. res, err := c.doRequest("json")
  70758. if res != nil && res.StatusCode == http.StatusNotModified {
  70759. if res.Body != nil {
  70760. res.Body.Close()
  70761. }
  70762. return nil, &googleapi.Error{
  70763. Code: res.StatusCode,
  70764. Header: res.Header,
  70765. }
  70766. }
  70767. if err != nil {
  70768. return nil, err
  70769. }
  70770. defer googleapi.CloseBody(res)
  70771. if err := googleapi.CheckResponse(res); err != nil {
  70772. return nil, err
  70773. }
  70774. ret := &Operation{
  70775. ServerResponse: googleapi.ServerResponse{
  70776. Header: res.Header,
  70777. HTTPStatusCode: res.StatusCode,
  70778. },
  70779. }
  70780. target := &ret
  70781. if err := gensupport.DecodeResponse(target, res); err != nil {
  70782. return nil, err
  70783. }
  70784. return ret, nil
  70785. // {
  70786. // "description": "Deletes the specified autoscaler.",
  70787. // "httpMethod": "DELETE",
  70788. // "id": "compute.regionAutoscalers.delete",
  70789. // "parameterOrder": [
  70790. // "project",
  70791. // "region",
  70792. // "autoscaler"
  70793. // ],
  70794. // "parameters": {
  70795. // "autoscaler": {
  70796. // "description": "Name of the autoscaler to delete.",
  70797. // "location": "path",
  70798. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70799. // "required": true,
  70800. // "type": "string"
  70801. // },
  70802. // "project": {
  70803. // "description": "Project ID for this request.",
  70804. // "location": "path",
  70805. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70806. // "required": true,
  70807. // "type": "string"
  70808. // },
  70809. // "region": {
  70810. // "description": "Name of the region scoping this request.",
  70811. // "location": "path",
  70812. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70813. // "required": true,
  70814. // "type": "string"
  70815. // },
  70816. // "requestId": {
  70817. // "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).",
  70818. // "location": "query",
  70819. // "type": "string"
  70820. // }
  70821. // },
  70822. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  70823. // "response": {
  70824. // "$ref": "Operation"
  70825. // },
  70826. // "scopes": [
  70827. // "https://www.googleapis.com/auth/cloud-platform",
  70828. // "https://www.googleapis.com/auth/compute"
  70829. // ]
  70830. // }
  70831. }
  70832. // method id "compute.regionAutoscalers.get":
  70833. type RegionAutoscalersGetCall struct {
  70834. s *Service
  70835. project string
  70836. region string
  70837. autoscaler string
  70838. urlParams_ gensupport.URLParams
  70839. ifNoneMatch_ string
  70840. ctx_ context.Context
  70841. header_ http.Header
  70842. }
  70843. // Get: Returns the specified autoscaler.
  70844. func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall {
  70845. c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  70846. c.project = project
  70847. c.region = region
  70848. c.autoscaler = autoscaler
  70849. return c
  70850. }
  70851. // Fields allows partial responses to be retrieved. See
  70852. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  70853. // for more information.
  70854. func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall {
  70855. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  70856. return c
  70857. }
  70858. // IfNoneMatch sets the optional parameter which makes the operation
  70859. // fail if the object's ETag matches the given value. This is useful for
  70860. // getting updates only after the object has changed since the last
  70861. // request. Use googleapi.IsNotModified to check whether the response
  70862. // error from Do is the result of In-None-Match.
  70863. func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall {
  70864. c.ifNoneMatch_ = entityTag
  70865. return c
  70866. }
  70867. // Context sets the context to be used in this call's Do method. Any
  70868. // pending HTTP request will be aborted if the provided context is
  70869. // canceled.
  70870. func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall {
  70871. c.ctx_ = ctx
  70872. return c
  70873. }
  70874. // Header returns an http.Header that can be modified by the caller to
  70875. // add HTTP headers to the request.
  70876. func (c *RegionAutoscalersGetCall) Header() http.Header {
  70877. if c.header_ == nil {
  70878. c.header_ = make(http.Header)
  70879. }
  70880. return c.header_
  70881. }
  70882. func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) {
  70883. reqHeaders := make(http.Header)
  70884. for k, v := range c.header_ {
  70885. reqHeaders[k] = v
  70886. }
  70887. reqHeaders.Set("User-Agent", c.s.userAgent())
  70888. if c.ifNoneMatch_ != "" {
  70889. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  70890. }
  70891. var body io.Reader = nil
  70892. c.urlParams_.Set("alt", alt)
  70893. c.urlParams_.Set("prettyPrint", "false")
  70894. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers/{autoscaler}")
  70895. urls += "?" + c.urlParams_.Encode()
  70896. req, err := http.NewRequest("GET", urls, body)
  70897. if err != nil {
  70898. return nil, err
  70899. }
  70900. req.Header = reqHeaders
  70901. googleapi.Expand(req.URL, map[string]string{
  70902. "project": c.project,
  70903. "region": c.region,
  70904. "autoscaler": c.autoscaler,
  70905. })
  70906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  70907. }
  70908. // Do executes the "compute.regionAutoscalers.get" call.
  70909. // Exactly one of *Autoscaler or error will be non-nil. Any non-2xx
  70910. // status code is an error. Response headers are in either
  70911. // *Autoscaler.ServerResponse.Header or (if a response was returned at
  70912. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  70913. // to check whether the returned error was because
  70914. // http.StatusNotModified was returned.
  70915. func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) {
  70916. gensupport.SetOptions(c.urlParams_, opts...)
  70917. res, err := c.doRequest("json")
  70918. if res != nil && res.StatusCode == http.StatusNotModified {
  70919. if res.Body != nil {
  70920. res.Body.Close()
  70921. }
  70922. return nil, &googleapi.Error{
  70923. Code: res.StatusCode,
  70924. Header: res.Header,
  70925. }
  70926. }
  70927. if err != nil {
  70928. return nil, err
  70929. }
  70930. defer googleapi.CloseBody(res)
  70931. if err := googleapi.CheckResponse(res); err != nil {
  70932. return nil, err
  70933. }
  70934. ret := &Autoscaler{
  70935. ServerResponse: googleapi.ServerResponse{
  70936. Header: res.Header,
  70937. HTTPStatusCode: res.StatusCode,
  70938. },
  70939. }
  70940. target := &ret
  70941. if err := gensupport.DecodeResponse(target, res); err != nil {
  70942. return nil, err
  70943. }
  70944. return ret, nil
  70945. // {
  70946. // "description": "Returns the specified autoscaler.",
  70947. // "httpMethod": "GET",
  70948. // "id": "compute.regionAutoscalers.get",
  70949. // "parameterOrder": [
  70950. // "project",
  70951. // "region",
  70952. // "autoscaler"
  70953. // ],
  70954. // "parameters": {
  70955. // "autoscaler": {
  70956. // "description": "Name of the autoscaler to return.",
  70957. // "location": "path",
  70958. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  70959. // "required": true,
  70960. // "type": "string"
  70961. // },
  70962. // "project": {
  70963. // "description": "Project ID for this request.",
  70964. // "location": "path",
  70965. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  70966. // "required": true,
  70967. // "type": "string"
  70968. // },
  70969. // "region": {
  70970. // "description": "Name of the region scoping this request.",
  70971. // "location": "path",
  70972. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  70973. // "required": true,
  70974. // "type": "string"
  70975. // }
  70976. // },
  70977. // "path": "{project}/regions/{region}/autoscalers/{autoscaler}",
  70978. // "response": {
  70979. // "$ref": "Autoscaler"
  70980. // },
  70981. // "scopes": [
  70982. // "https://www.googleapis.com/auth/cloud-platform",
  70983. // "https://www.googleapis.com/auth/compute",
  70984. // "https://www.googleapis.com/auth/compute.readonly"
  70985. // ]
  70986. // }
  70987. }
  70988. // method id "compute.regionAutoscalers.insert":
  70989. type RegionAutoscalersInsertCall struct {
  70990. s *Service
  70991. project string
  70992. region string
  70993. autoscaler *Autoscaler
  70994. urlParams_ gensupport.URLParams
  70995. ctx_ context.Context
  70996. header_ http.Header
  70997. }
  70998. // Insert: Creates an autoscaler in the specified project using the data
  70999. // included in the request.
  71000. func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall {
  71001. c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71002. c.project = project
  71003. c.region = region
  71004. c.autoscaler = autoscaler
  71005. return c
  71006. }
  71007. // RequestId sets the optional parameter "requestId": An optional
  71008. // request ID to identify requests. Specify a unique request ID so that
  71009. // if you must retry your request, the server will know to ignore the
  71010. // request if it has already been completed.
  71011. //
  71012. // For example, consider a situation where you make an initial request
  71013. // and the request times out. If you make the request again with the
  71014. // same request ID, the server can check if original operation with the
  71015. // same request ID was received, and if so, will ignore the second
  71016. // request. This prevents clients from accidentally creating duplicate
  71017. // commitments.
  71018. //
  71019. // The request ID must be a valid UUID with the exception that zero UUID
  71020. // is not supported (00000000-0000-0000-0000-000000000000).
  71021. func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall {
  71022. c.urlParams_.Set("requestId", requestId)
  71023. return c
  71024. }
  71025. // Fields allows partial responses to be retrieved. See
  71026. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71027. // for more information.
  71028. func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall {
  71029. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71030. return c
  71031. }
  71032. // Context sets the context to be used in this call's Do method. Any
  71033. // pending HTTP request will be aborted if the provided context is
  71034. // canceled.
  71035. func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall {
  71036. c.ctx_ = ctx
  71037. return c
  71038. }
  71039. // Header returns an http.Header that can be modified by the caller to
  71040. // add HTTP headers to the request.
  71041. func (c *RegionAutoscalersInsertCall) Header() http.Header {
  71042. if c.header_ == nil {
  71043. c.header_ = make(http.Header)
  71044. }
  71045. return c.header_
  71046. }
  71047. func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) {
  71048. reqHeaders := make(http.Header)
  71049. for k, v := range c.header_ {
  71050. reqHeaders[k] = v
  71051. }
  71052. reqHeaders.Set("User-Agent", c.s.userAgent())
  71053. var body io.Reader = nil
  71054. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  71055. if err != nil {
  71056. return nil, err
  71057. }
  71058. reqHeaders.Set("Content-Type", "application/json")
  71059. c.urlParams_.Set("alt", alt)
  71060. c.urlParams_.Set("prettyPrint", "false")
  71061. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  71062. urls += "?" + c.urlParams_.Encode()
  71063. req, err := http.NewRequest("POST", urls, body)
  71064. if err != nil {
  71065. return nil, err
  71066. }
  71067. req.Header = reqHeaders
  71068. googleapi.Expand(req.URL, map[string]string{
  71069. "project": c.project,
  71070. "region": c.region,
  71071. })
  71072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71073. }
  71074. // Do executes the "compute.regionAutoscalers.insert" call.
  71075. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71076. // status code is an error. Response headers are in either
  71077. // *Operation.ServerResponse.Header or (if a response was returned at
  71078. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71079. // to check whether the returned error was because
  71080. // http.StatusNotModified was returned.
  71081. func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71082. gensupport.SetOptions(c.urlParams_, opts...)
  71083. res, err := c.doRequest("json")
  71084. if res != nil && res.StatusCode == http.StatusNotModified {
  71085. if res.Body != nil {
  71086. res.Body.Close()
  71087. }
  71088. return nil, &googleapi.Error{
  71089. Code: res.StatusCode,
  71090. Header: res.Header,
  71091. }
  71092. }
  71093. if err != nil {
  71094. return nil, err
  71095. }
  71096. defer googleapi.CloseBody(res)
  71097. if err := googleapi.CheckResponse(res); err != nil {
  71098. return nil, err
  71099. }
  71100. ret := &Operation{
  71101. ServerResponse: googleapi.ServerResponse{
  71102. Header: res.Header,
  71103. HTTPStatusCode: res.StatusCode,
  71104. },
  71105. }
  71106. target := &ret
  71107. if err := gensupport.DecodeResponse(target, res); err != nil {
  71108. return nil, err
  71109. }
  71110. return ret, nil
  71111. // {
  71112. // "description": "Creates an autoscaler in the specified project using the data included in the request.",
  71113. // "httpMethod": "POST",
  71114. // "id": "compute.regionAutoscalers.insert",
  71115. // "parameterOrder": [
  71116. // "project",
  71117. // "region"
  71118. // ],
  71119. // "parameters": {
  71120. // "project": {
  71121. // "description": "Project ID for this request.",
  71122. // "location": "path",
  71123. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71124. // "required": true,
  71125. // "type": "string"
  71126. // },
  71127. // "region": {
  71128. // "description": "Name of the region scoping this request.",
  71129. // "location": "path",
  71130. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71131. // "required": true,
  71132. // "type": "string"
  71133. // },
  71134. // "requestId": {
  71135. // "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).",
  71136. // "location": "query",
  71137. // "type": "string"
  71138. // }
  71139. // },
  71140. // "path": "{project}/regions/{region}/autoscalers",
  71141. // "request": {
  71142. // "$ref": "Autoscaler"
  71143. // },
  71144. // "response": {
  71145. // "$ref": "Operation"
  71146. // },
  71147. // "scopes": [
  71148. // "https://www.googleapis.com/auth/cloud-platform",
  71149. // "https://www.googleapis.com/auth/compute"
  71150. // ]
  71151. // }
  71152. }
  71153. // method id "compute.regionAutoscalers.list":
  71154. type RegionAutoscalersListCall struct {
  71155. s *Service
  71156. project string
  71157. region string
  71158. urlParams_ gensupport.URLParams
  71159. ifNoneMatch_ string
  71160. ctx_ context.Context
  71161. header_ http.Header
  71162. }
  71163. // List: Retrieves a list of autoscalers contained within the specified
  71164. // region.
  71165. func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall {
  71166. c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71167. c.project = project
  71168. c.region = region
  71169. return c
  71170. }
  71171. // Filter sets the optional parameter "filter": A filter expression that
  71172. // filters resources listed in the response. The expression must specify
  71173. // the field name, a comparison operator, and the value that you want to
  71174. // use for filtering. The value must be a string, a number, or a
  71175. // boolean. The comparison operator must be either =, !=, >, or <.
  71176. //
  71177. // For example, if you are filtering Compute Engine instances, you can
  71178. // exclude instances named example-instance by specifying name !=
  71179. // example-instance.
  71180. //
  71181. // You can also filter nested fields. For example, you could specify
  71182. // scheduling.automaticRestart = false to include instances only if they
  71183. // are not scheduled for automatic restarts. You can use filtering on
  71184. // nested fields to filter based on resource labels.
  71185. //
  71186. // To filter on multiple expressions, provide each separate expression
  71187. // within parentheses. For example, (scheduling.automaticRestart = true)
  71188. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  71189. // AND expression. However, you can include AND and OR expressions
  71190. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  71191. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  71192. // true).
  71193. func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall {
  71194. c.urlParams_.Set("filter", filter)
  71195. return c
  71196. }
  71197. // MaxResults sets the optional parameter "maxResults": The maximum
  71198. // number of results per page that should be returned. If the number of
  71199. // available results is larger than maxResults, Compute Engine returns a
  71200. // nextPageToken that can be used to get the next page of results in
  71201. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  71202. // (Default: 500)
  71203. func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall {
  71204. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  71205. return c
  71206. }
  71207. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  71208. // a certain order. By default, results are returned in alphanumerical
  71209. // order based on the resource name.
  71210. //
  71211. // You can also sort results in descending order based on the creation
  71212. // timestamp using orderBy="creationTimestamp desc". This sorts results
  71213. // based on the creationTimestamp field in reverse chronological order
  71214. // (newest result first). Use this to sort resources like operations so
  71215. // that the newest operation is returned first.
  71216. //
  71217. // Currently, only sorting by name or creationTimestamp desc is
  71218. // supported.
  71219. func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall {
  71220. c.urlParams_.Set("orderBy", orderBy)
  71221. return c
  71222. }
  71223. // PageToken sets the optional parameter "pageToken": Specifies a page
  71224. // token to use. Set pageToken to the nextPageToken returned by a
  71225. // previous list request to get the next page of results.
  71226. func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall {
  71227. c.urlParams_.Set("pageToken", pageToken)
  71228. return c
  71229. }
  71230. // Fields allows partial responses to be retrieved. See
  71231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71232. // for more information.
  71233. func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall {
  71234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71235. return c
  71236. }
  71237. // IfNoneMatch sets the optional parameter which makes the operation
  71238. // fail if the object's ETag matches the given value. This is useful for
  71239. // getting updates only after the object has changed since the last
  71240. // request. Use googleapi.IsNotModified to check whether the response
  71241. // error from Do is the result of In-None-Match.
  71242. func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall {
  71243. c.ifNoneMatch_ = entityTag
  71244. return c
  71245. }
  71246. // Context sets the context to be used in this call's Do method. Any
  71247. // pending HTTP request will be aborted if the provided context is
  71248. // canceled.
  71249. func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall {
  71250. c.ctx_ = ctx
  71251. return c
  71252. }
  71253. // Header returns an http.Header that can be modified by the caller to
  71254. // add HTTP headers to the request.
  71255. func (c *RegionAutoscalersListCall) Header() http.Header {
  71256. if c.header_ == nil {
  71257. c.header_ = make(http.Header)
  71258. }
  71259. return c.header_
  71260. }
  71261. func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) {
  71262. reqHeaders := make(http.Header)
  71263. for k, v := range c.header_ {
  71264. reqHeaders[k] = v
  71265. }
  71266. reqHeaders.Set("User-Agent", c.s.userAgent())
  71267. if c.ifNoneMatch_ != "" {
  71268. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71269. }
  71270. var body io.Reader = nil
  71271. c.urlParams_.Set("alt", alt)
  71272. c.urlParams_.Set("prettyPrint", "false")
  71273. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  71274. urls += "?" + c.urlParams_.Encode()
  71275. req, err := http.NewRequest("GET", urls, body)
  71276. if err != nil {
  71277. return nil, err
  71278. }
  71279. req.Header = reqHeaders
  71280. googleapi.Expand(req.URL, map[string]string{
  71281. "project": c.project,
  71282. "region": c.region,
  71283. })
  71284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71285. }
  71286. // Do executes the "compute.regionAutoscalers.list" call.
  71287. // Exactly one of *RegionAutoscalerList or error will be non-nil. Any
  71288. // non-2xx status code is an error. Response headers are in either
  71289. // *RegionAutoscalerList.ServerResponse.Header or (if a response was
  71290. // returned at all) in error.(*googleapi.Error).Header. Use
  71291. // googleapi.IsNotModified to check whether the returned error was
  71292. // because http.StatusNotModified was returned.
  71293. func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) {
  71294. gensupport.SetOptions(c.urlParams_, opts...)
  71295. res, err := c.doRequest("json")
  71296. if res != nil && res.StatusCode == http.StatusNotModified {
  71297. if res.Body != nil {
  71298. res.Body.Close()
  71299. }
  71300. return nil, &googleapi.Error{
  71301. Code: res.StatusCode,
  71302. Header: res.Header,
  71303. }
  71304. }
  71305. if err != nil {
  71306. return nil, err
  71307. }
  71308. defer googleapi.CloseBody(res)
  71309. if err := googleapi.CheckResponse(res); err != nil {
  71310. return nil, err
  71311. }
  71312. ret := &RegionAutoscalerList{
  71313. ServerResponse: googleapi.ServerResponse{
  71314. Header: res.Header,
  71315. HTTPStatusCode: res.StatusCode,
  71316. },
  71317. }
  71318. target := &ret
  71319. if err := gensupport.DecodeResponse(target, res); err != nil {
  71320. return nil, err
  71321. }
  71322. return ret, nil
  71323. // {
  71324. // "description": "Retrieves a list of autoscalers contained within the specified region.",
  71325. // "httpMethod": "GET",
  71326. // "id": "compute.regionAutoscalers.list",
  71327. // "parameterOrder": [
  71328. // "project",
  71329. // "region"
  71330. // ],
  71331. // "parameters": {
  71332. // "filter": {
  71333. // "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).",
  71334. // "location": "query",
  71335. // "type": "string"
  71336. // },
  71337. // "maxResults": {
  71338. // "default": "500",
  71339. // "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)",
  71340. // "format": "uint32",
  71341. // "location": "query",
  71342. // "minimum": "0",
  71343. // "type": "integer"
  71344. // },
  71345. // "orderBy": {
  71346. // "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.",
  71347. // "location": "query",
  71348. // "type": "string"
  71349. // },
  71350. // "pageToken": {
  71351. // "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.",
  71352. // "location": "query",
  71353. // "type": "string"
  71354. // },
  71355. // "project": {
  71356. // "description": "Project ID for this request.",
  71357. // "location": "path",
  71358. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71359. // "required": true,
  71360. // "type": "string"
  71361. // },
  71362. // "region": {
  71363. // "description": "Name of the region scoping this request.",
  71364. // "location": "path",
  71365. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71366. // "required": true,
  71367. // "type": "string"
  71368. // }
  71369. // },
  71370. // "path": "{project}/regions/{region}/autoscalers",
  71371. // "response": {
  71372. // "$ref": "RegionAutoscalerList"
  71373. // },
  71374. // "scopes": [
  71375. // "https://www.googleapis.com/auth/cloud-platform",
  71376. // "https://www.googleapis.com/auth/compute",
  71377. // "https://www.googleapis.com/auth/compute.readonly"
  71378. // ]
  71379. // }
  71380. }
  71381. // Pages invokes f for each page of results.
  71382. // A non-nil error returned from f will halt the iteration.
  71383. // The provided context supersedes any context provided to the Context method.
  71384. func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error {
  71385. c.ctx_ = ctx
  71386. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  71387. for {
  71388. x, err := c.Do()
  71389. if err != nil {
  71390. return err
  71391. }
  71392. if err := f(x); err != nil {
  71393. return err
  71394. }
  71395. if x.NextPageToken == "" {
  71396. return nil
  71397. }
  71398. c.PageToken(x.NextPageToken)
  71399. }
  71400. }
  71401. // method id "compute.regionAutoscalers.patch":
  71402. type RegionAutoscalersPatchCall struct {
  71403. s *Service
  71404. project string
  71405. region string
  71406. autoscaler *Autoscaler
  71407. urlParams_ gensupport.URLParams
  71408. ctx_ context.Context
  71409. header_ http.Header
  71410. }
  71411. // Patch: Updates an autoscaler in the specified project using the data
  71412. // included in the request. This method supports PATCH semantics and
  71413. // uses the JSON merge patch format and processing rules.
  71414. func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall {
  71415. c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71416. c.project = project
  71417. c.region = region
  71418. c.autoscaler = autoscaler
  71419. return c
  71420. }
  71421. // Autoscaler sets the optional parameter "autoscaler": Name of the
  71422. // autoscaler to patch.
  71423. func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall {
  71424. c.urlParams_.Set("autoscaler", autoscaler)
  71425. return c
  71426. }
  71427. // RequestId sets the optional parameter "requestId": An optional
  71428. // request ID to identify requests. Specify a unique request ID so that
  71429. // if you must retry your request, the server will know to ignore the
  71430. // request if it has already been completed.
  71431. //
  71432. // For example, consider a situation where you make an initial request
  71433. // and the request times out. If you make the request again with the
  71434. // same request ID, the server can check if original operation with the
  71435. // same request ID was received, and if so, will ignore the second
  71436. // request. This prevents clients from accidentally creating duplicate
  71437. // commitments.
  71438. //
  71439. // The request ID must be a valid UUID with the exception that zero UUID
  71440. // is not supported (00000000-0000-0000-0000-000000000000).
  71441. func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall {
  71442. c.urlParams_.Set("requestId", requestId)
  71443. return c
  71444. }
  71445. // Fields allows partial responses to be retrieved. See
  71446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71447. // for more information.
  71448. func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall {
  71449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71450. return c
  71451. }
  71452. // Context sets the context to be used in this call's Do method. Any
  71453. // pending HTTP request will be aborted if the provided context is
  71454. // canceled.
  71455. func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall {
  71456. c.ctx_ = ctx
  71457. return c
  71458. }
  71459. // Header returns an http.Header that can be modified by the caller to
  71460. // add HTTP headers to the request.
  71461. func (c *RegionAutoscalersPatchCall) Header() http.Header {
  71462. if c.header_ == nil {
  71463. c.header_ = make(http.Header)
  71464. }
  71465. return c.header_
  71466. }
  71467. func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) {
  71468. reqHeaders := make(http.Header)
  71469. for k, v := range c.header_ {
  71470. reqHeaders[k] = v
  71471. }
  71472. reqHeaders.Set("User-Agent", c.s.userAgent())
  71473. var body io.Reader = nil
  71474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  71475. if err != nil {
  71476. return nil, err
  71477. }
  71478. reqHeaders.Set("Content-Type", "application/json")
  71479. c.urlParams_.Set("alt", alt)
  71480. c.urlParams_.Set("prettyPrint", "false")
  71481. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  71482. urls += "?" + c.urlParams_.Encode()
  71483. req, err := http.NewRequest("PATCH", urls, body)
  71484. if err != nil {
  71485. return nil, err
  71486. }
  71487. req.Header = reqHeaders
  71488. googleapi.Expand(req.URL, map[string]string{
  71489. "project": c.project,
  71490. "region": c.region,
  71491. })
  71492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71493. }
  71494. // Do executes the "compute.regionAutoscalers.patch" call.
  71495. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71496. // status code is an error. Response headers are in either
  71497. // *Operation.ServerResponse.Header or (if a response was returned at
  71498. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71499. // to check whether the returned error was because
  71500. // http.StatusNotModified was returned.
  71501. func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71502. gensupport.SetOptions(c.urlParams_, opts...)
  71503. res, err := c.doRequest("json")
  71504. if res != nil && res.StatusCode == http.StatusNotModified {
  71505. if res.Body != nil {
  71506. res.Body.Close()
  71507. }
  71508. return nil, &googleapi.Error{
  71509. Code: res.StatusCode,
  71510. Header: res.Header,
  71511. }
  71512. }
  71513. if err != nil {
  71514. return nil, err
  71515. }
  71516. defer googleapi.CloseBody(res)
  71517. if err := googleapi.CheckResponse(res); err != nil {
  71518. return nil, err
  71519. }
  71520. ret := &Operation{
  71521. ServerResponse: googleapi.ServerResponse{
  71522. Header: res.Header,
  71523. HTTPStatusCode: res.StatusCode,
  71524. },
  71525. }
  71526. target := &ret
  71527. if err := gensupport.DecodeResponse(target, res); err != nil {
  71528. return nil, err
  71529. }
  71530. return ret, nil
  71531. // {
  71532. // "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.",
  71533. // "httpMethod": "PATCH",
  71534. // "id": "compute.regionAutoscalers.patch",
  71535. // "parameterOrder": [
  71536. // "project",
  71537. // "region"
  71538. // ],
  71539. // "parameters": {
  71540. // "autoscaler": {
  71541. // "description": "Name of the autoscaler to patch.",
  71542. // "location": "query",
  71543. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71544. // "type": "string"
  71545. // },
  71546. // "project": {
  71547. // "description": "Project ID for this request.",
  71548. // "location": "path",
  71549. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71550. // "required": true,
  71551. // "type": "string"
  71552. // },
  71553. // "region": {
  71554. // "description": "Name of the region scoping this request.",
  71555. // "location": "path",
  71556. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71557. // "required": true,
  71558. // "type": "string"
  71559. // },
  71560. // "requestId": {
  71561. // "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).",
  71562. // "location": "query",
  71563. // "type": "string"
  71564. // }
  71565. // },
  71566. // "path": "{project}/regions/{region}/autoscalers",
  71567. // "request": {
  71568. // "$ref": "Autoscaler"
  71569. // },
  71570. // "response": {
  71571. // "$ref": "Operation"
  71572. // },
  71573. // "scopes": [
  71574. // "https://www.googleapis.com/auth/cloud-platform",
  71575. // "https://www.googleapis.com/auth/compute"
  71576. // ]
  71577. // }
  71578. }
  71579. // method id "compute.regionAutoscalers.update":
  71580. type RegionAutoscalersUpdateCall struct {
  71581. s *Service
  71582. project string
  71583. region string
  71584. autoscaler *Autoscaler
  71585. urlParams_ gensupport.URLParams
  71586. ctx_ context.Context
  71587. header_ http.Header
  71588. }
  71589. // Update: Updates an autoscaler in the specified project using the data
  71590. // included in the request.
  71591. func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall {
  71592. c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71593. c.project = project
  71594. c.region = region
  71595. c.autoscaler = autoscaler
  71596. return c
  71597. }
  71598. // Autoscaler sets the optional parameter "autoscaler": Name of the
  71599. // autoscaler to update.
  71600. func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall {
  71601. c.urlParams_.Set("autoscaler", autoscaler)
  71602. return c
  71603. }
  71604. // RequestId sets the optional parameter "requestId": An optional
  71605. // request ID to identify requests. Specify a unique request ID so that
  71606. // if you must retry your request, the server will know to ignore the
  71607. // request if it has already been completed.
  71608. //
  71609. // For example, consider a situation where you make an initial request
  71610. // and the request times out. If you make the request again with the
  71611. // same request ID, the server can check if original operation with the
  71612. // same request ID was received, and if so, will ignore the second
  71613. // request. This prevents clients from accidentally creating duplicate
  71614. // commitments.
  71615. //
  71616. // The request ID must be a valid UUID with the exception that zero UUID
  71617. // is not supported (00000000-0000-0000-0000-000000000000).
  71618. func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall {
  71619. c.urlParams_.Set("requestId", requestId)
  71620. return c
  71621. }
  71622. // Fields allows partial responses to be retrieved. See
  71623. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71624. // for more information.
  71625. func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall {
  71626. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71627. return c
  71628. }
  71629. // Context sets the context to be used in this call's Do method. Any
  71630. // pending HTTP request will be aborted if the provided context is
  71631. // canceled.
  71632. func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall {
  71633. c.ctx_ = ctx
  71634. return c
  71635. }
  71636. // Header returns an http.Header that can be modified by the caller to
  71637. // add HTTP headers to the request.
  71638. func (c *RegionAutoscalersUpdateCall) Header() http.Header {
  71639. if c.header_ == nil {
  71640. c.header_ = make(http.Header)
  71641. }
  71642. return c.header_
  71643. }
  71644. func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) {
  71645. reqHeaders := make(http.Header)
  71646. for k, v := range c.header_ {
  71647. reqHeaders[k] = v
  71648. }
  71649. reqHeaders.Set("User-Agent", c.s.userAgent())
  71650. var body io.Reader = nil
  71651. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler)
  71652. if err != nil {
  71653. return nil, err
  71654. }
  71655. reqHeaders.Set("Content-Type", "application/json")
  71656. c.urlParams_.Set("alt", alt)
  71657. c.urlParams_.Set("prettyPrint", "false")
  71658. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/autoscalers")
  71659. urls += "?" + c.urlParams_.Encode()
  71660. req, err := http.NewRequest("PUT", urls, body)
  71661. if err != nil {
  71662. return nil, err
  71663. }
  71664. req.Header = reqHeaders
  71665. googleapi.Expand(req.URL, map[string]string{
  71666. "project": c.project,
  71667. "region": c.region,
  71668. })
  71669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71670. }
  71671. // Do executes the "compute.regionAutoscalers.update" call.
  71672. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71673. // status code is an error. Response headers are in either
  71674. // *Operation.ServerResponse.Header or (if a response was returned at
  71675. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71676. // to check whether the returned error was because
  71677. // http.StatusNotModified was returned.
  71678. func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71679. gensupport.SetOptions(c.urlParams_, opts...)
  71680. res, err := c.doRequest("json")
  71681. if res != nil && res.StatusCode == http.StatusNotModified {
  71682. if res.Body != nil {
  71683. res.Body.Close()
  71684. }
  71685. return nil, &googleapi.Error{
  71686. Code: res.StatusCode,
  71687. Header: res.Header,
  71688. }
  71689. }
  71690. if err != nil {
  71691. return nil, err
  71692. }
  71693. defer googleapi.CloseBody(res)
  71694. if err := googleapi.CheckResponse(res); err != nil {
  71695. return nil, err
  71696. }
  71697. ret := &Operation{
  71698. ServerResponse: googleapi.ServerResponse{
  71699. Header: res.Header,
  71700. HTTPStatusCode: res.StatusCode,
  71701. },
  71702. }
  71703. target := &ret
  71704. if err := gensupport.DecodeResponse(target, res); err != nil {
  71705. return nil, err
  71706. }
  71707. return ret, nil
  71708. // {
  71709. // "description": "Updates an autoscaler in the specified project using the data included in the request.",
  71710. // "httpMethod": "PUT",
  71711. // "id": "compute.regionAutoscalers.update",
  71712. // "parameterOrder": [
  71713. // "project",
  71714. // "region"
  71715. // ],
  71716. // "parameters": {
  71717. // "autoscaler": {
  71718. // "description": "Name of the autoscaler to update.",
  71719. // "location": "query",
  71720. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71721. // "type": "string"
  71722. // },
  71723. // "project": {
  71724. // "description": "Project ID for this request.",
  71725. // "location": "path",
  71726. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71727. // "required": true,
  71728. // "type": "string"
  71729. // },
  71730. // "region": {
  71731. // "description": "Name of the region scoping this request.",
  71732. // "location": "path",
  71733. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71734. // "required": true,
  71735. // "type": "string"
  71736. // },
  71737. // "requestId": {
  71738. // "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).",
  71739. // "location": "query",
  71740. // "type": "string"
  71741. // }
  71742. // },
  71743. // "path": "{project}/regions/{region}/autoscalers",
  71744. // "request": {
  71745. // "$ref": "Autoscaler"
  71746. // },
  71747. // "response": {
  71748. // "$ref": "Operation"
  71749. // },
  71750. // "scopes": [
  71751. // "https://www.googleapis.com/auth/cloud-platform",
  71752. // "https://www.googleapis.com/auth/compute"
  71753. // ]
  71754. // }
  71755. }
  71756. // method id "compute.regionBackendServices.delete":
  71757. type RegionBackendServicesDeleteCall struct {
  71758. s *Service
  71759. project string
  71760. region string
  71761. backendService string
  71762. urlParams_ gensupport.URLParams
  71763. ctx_ context.Context
  71764. header_ http.Header
  71765. }
  71766. // Delete: Deletes the specified regional BackendService resource.
  71767. func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall {
  71768. c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71769. c.project = project
  71770. c.region = region
  71771. c.backendService = backendService
  71772. return c
  71773. }
  71774. // RequestId sets the optional parameter "requestId": An optional
  71775. // request ID to identify requests. Specify a unique request ID so that
  71776. // if you must retry your request, the server will know to ignore the
  71777. // request if it has already been completed.
  71778. //
  71779. // For example, consider a situation where you make an initial request
  71780. // and the request times out. If you make the request again with the
  71781. // same request ID, the server can check if original operation with the
  71782. // same request ID was received, and if so, will ignore the second
  71783. // request. This prevents clients from accidentally creating duplicate
  71784. // commitments.
  71785. //
  71786. // The request ID must be a valid UUID with the exception that zero UUID
  71787. // is not supported (00000000-0000-0000-0000-000000000000).
  71788. func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall {
  71789. c.urlParams_.Set("requestId", requestId)
  71790. return c
  71791. }
  71792. // Fields allows partial responses to be retrieved. See
  71793. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71794. // for more information.
  71795. func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall {
  71796. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71797. return c
  71798. }
  71799. // Context sets the context to be used in this call's Do method. Any
  71800. // pending HTTP request will be aborted if the provided context is
  71801. // canceled.
  71802. func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall {
  71803. c.ctx_ = ctx
  71804. return c
  71805. }
  71806. // Header returns an http.Header that can be modified by the caller to
  71807. // add HTTP headers to the request.
  71808. func (c *RegionBackendServicesDeleteCall) Header() http.Header {
  71809. if c.header_ == nil {
  71810. c.header_ = make(http.Header)
  71811. }
  71812. return c.header_
  71813. }
  71814. func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  71815. reqHeaders := make(http.Header)
  71816. for k, v := range c.header_ {
  71817. reqHeaders[k] = v
  71818. }
  71819. reqHeaders.Set("User-Agent", c.s.userAgent())
  71820. var body io.Reader = nil
  71821. c.urlParams_.Set("alt", alt)
  71822. c.urlParams_.Set("prettyPrint", "false")
  71823. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  71824. urls += "?" + c.urlParams_.Encode()
  71825. req, err := http.NewRequest("DELETE", urls, body)
  71826. if err != nil {
  71827. return nil, err
  71828. }
  71829. req.Header = reqHeaders
  71830. googleapi.Expand(req.URL, map[string]string{
  71831. "project": c.project,
  71832. "region": c.region,
  71833. "backendService": c.backendService,
  71834. })
  71835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71836. }
  71837. // Do executes the "compute.regionBackendServices.delete" call.
  71838. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  71839. // status code is an error. Response headers are in either
  71840. // *Operation.ServerResponse.Header or (if a response was returned at
  71841. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  71842. // to check whether the returned error was because
  71843. // http.StatusNotModified was returned.
  71844. func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  71845. gensupport.SetOptions(c.urlParams_, opts...)
  71846. res, err := c.doRequest("json")
  71847. if res != nil && res.StatusCode == http.StatusNotModified {
  71848. if res.Body != nil {
  71849. res.Body.Close()
  71850. }
  71851. return nil, &googleapi.Error{
  71852. Code: res.StatusCode,
  71853. Header: res.Header,
  71854. }
  71855. }
  71856. if err != nil {
  71857. return nil, err
  71858. }
  71859. defer googleapi.CloseBody(res)
  71860. if err := googleapi.CheckResponse(res); err != nil {
  71861. return nil, err
  71862. }
  71863. ret := &Operation{
  71864. ServerResponse: googleapi.ServerResponse{
  71865. Header: res.Header,
  71866. HTTPStatusCode: res.StatusCode,
  71867. },
  71868. }
  71869. target := &ret
  71870. if err := gensupport.DecodeResponse(target, res); err != nil {
  71871. return nil, err
  71872. }
  71873. return ret, nil
  71874. // {
  71875. // "description": "Deletes the specified regional BackendService resource.",
  71876. // "httpMethod": "DELETE",
  71877. // "id": "compute.regionBackendServices.delete",
  71878. // "parameterOrder": [
  71879. // "project",
  71880. // "region",
  71881. // "backendService"
  71882. // ],
  71883. // "parameters": {
  71884. // "backendService": {
  71885. // "description": "Name of the BackendService resource to delete.",
  71886. // "location": "path",
  71887. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  71888. // "required": true,
  71889. // "type": "string"
  71890. // },
  71891. // "project": {
  71892. // "description": "Project ID for this request.",
  71893. // "location": "path",
  71894. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  71895. // "required": true,
  71896. // "type": "string"
  71897. // },
  71898. // "region": {
  71899. // "description": "Name of the region scoping this request.",
  71900. // "location": "path",
  71901. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  71902. // "required": true,
  71903. // "type": "string"
  71904. // },
  71905. // "requestId": {
  71906. // "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).",
  71907. // "location": "query",
  71908. // "type": "string"
  71909. // }
  71910. // },
  71911. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  71912. // "response": {
  71913. // "$ref": "Operation"
  71914. // },
  71915. // "scopes": [
  71916. // "https://www.googleapis.com/auth/cloud-platform",
  71917. // "https://www.googleapis.com/auth/compute"
  71918. // ]
  71919. // }
  71920. }
  71921. // method id "compute.regionBackendServices.get":
  71922. type RegionBackendServicesGetCall struct {
  71923. s *Service
  71924. project string
  71925. region string
  71926. backendService string
  71927. urlParams_ gensupport.URLParams
  71928. ifNoneMatch_ string
  71929. ctx_ context.Context
  71930. header_ http.Header
  71931. }
  71932. // Get: Returns the specified regional BackendService resource.
  71933. func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall {
  71934. c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  71935. c.project = project
  71936. c.region = region
  71937. c.backendService = backendService
  71938. return c
  71939. }
  71940. // Fields allows partial responses to be retrieved. See
  71941. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  71942. // for more information.
  71943. func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall {
  71944. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  71945. return c
  71946. }
  71947. // IfNoneMatch sets the optional parameter which makes the operation
  71948. // fail if the object's ETag matches the given value. This is useful for
  71949. // getting updates only after the object has changed since the last
  71950. // request. Use googleapi.IsNotModified to check whether the response
  71951. // error from Do is the result of In-None-Match.
  71952. func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall {
  71953. c.ifNoneMatch_ = entityTag
  71954. return c
  71955. }
  71956. // Context sets the context to be used in this call's Do method. Any
  71957. // pending HTTP request will be aborted if the provided context is
  71958. // canceled.
  71959. func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall {
  71960. c.ctx_ = ctx
  71961. return c
  71962. }
  71963. // Header returns an http.Header that can be modified by the caller to
  71964. // add HTTP headers to the request.
  71965. func (c *RegionBackendServicesGetCall) Header() http.Header {
  71966. if c.header_ == nil {
  71967. c.header_ = make(http.Header)
  71968. }
  71969. return c.header_
  71970. }
  71971. func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) {
  71972. reqHeaders := make(http.Header)
  71973. for k, v := range c.header_ {
  71974. reqHeaders[k] = v
  71975. }
  71976. reqHeaders.Set("User-Agent", c.s.userAgent())
  71977. if c.ifNoneMatch_ != "" {
  71978. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  71979. }
  71980. var body io.Reader = nil
  71981. c.urlParams_.Set("alt", alt)
  71982. c.urlParams_.Set("prettyPrint", "false")
  71983. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  71984. urls += "?" + c.urlParams_.Encode()
  71985. req, err := http.NewRequest("GET", urls, body)
  71986. if err != nil {
  71987. return nil, err
  71988. }
  71989. req.Header = reqHeaders
  71990. googleapi.Expand(req.URL, map[string]string{
  71991. "project": c.project,
  71992. "region": c.region,
  71993. "backendService": c.backendService,
  71994. })
  71995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  71996. }
  71997. // Do executes the "compute.regionBackendServices.get" call.
  71998. // Exactly one of *BackendService or error will be non-nil. Any non-2xx
  71999. // status code is an error. Response headers are in either
  72000. // *BackendService.ServerResponse.Header or (if a response was returned
  72001. // at all) in error.(*googleapi.Error).Header. Use
  72002. // googleapi.IsNotModified to check whether the returned error was
  72003. // because http.StatusNotModified was returned.
  72004. func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) {
  72005. gensupport.SetOptions(c.urlParams_, opts...)
  72006. res, err := c.doRequest("json")
  72007. if res != nil && res.StatusCode == http.StatusNotModified {
  72008. if res.Body != nil {
  72009. res.Body.Close()
  72010. }
  72011. return nil, &googleapi.Error{
  72012. Code: res.StatusCode,
  72013. Header: res.Header,
  72014. }
  72015. }
  72016. if err != nil {
  72017. return nil, err
  72018. }
  72019. defer googleapi.CloseBody(res)
  72020. if err := googleapi.CheckResponse(res); err != nil {
  72021. return nil, err
  72022. }
  72023. ret := &BackendService{
  72024. ServerResponse: googleapi.ServerResponse{
  72025. Header: res.Header,
  72026. HTTPStatusCode: res.StatusCode,
  72027. },
  72028. }
  72029. target := &ret
  72030. if err := gensupport.DecodeResponse(target, res); err != nil {
  72031. return nil, err
  72032. }
  72033. return ret, nil
  72034. // {
  72035. // "description": "Returns the specified regional BackendService resource.",
  72036. // "httpMethod": "GET",
  72037. // "id": "compute.regionBackendServices.get",
  72038. // "parameterOrder": [
  72039. // "project",
  72040. // "region",
  72041. // "backendService"
  72042. // ],
  72043. // "parameters": {
  72044. // "backendService": {
  72045. // "description": "Name of the BackendService resource to return.",
  72046. // "location": "path",
  72047. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72048. // "required": true,
  72049. // "type": "string"
  72050. // },
  72051. // "project": {
  72052. // "description": "Project ID for this request.",
  72053. // "location": "path",
  72054. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72055. // "required": true,
  72056. // "type": "string"
  72057. // },
  72058. // "region": {
  72059. // "description": "Name of the region scoping this request.",
  72060. // "location": "path",
  72061. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72062. // "required": true,
  72063. // "type": "string"
  72064. // }
  72065. // },
  72066. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  72067. // "response": {
  72068. // "$ref": "BackendService"
  72069. // },
  72070. // "scopes": [
  72071. // "https://www.googleapis.com/auth/cloud-platform",
  72072. // "https://www.googleapis.com/auth/compute",
  72073. // "https://www.googleapis.com/auth/compute.readonly"
  72074. // ]
  72075. // }
  72076. }
  72077. // method id "compute.regionBackendServices.getHealth":
  72078. type RegionBackendServicesGetHealthCall struct {
  72079. s *Service
  72080. project string
  72081. region string
  72082. backendService string
  72083. resourcegroupreference *ResourceGroupReference
  72084. urlParams_ gensupport.URLParams
  72085. ctx_ context.Context
  72086. header_ http.Header
  72087. }
  72088. // GetHealth: Gets the most recent health check results for this
  72089. // regional BackendService.
  72090. func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall {
  72091. c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72092. c.project = project
  72093. c.region = region
  72094. c.backendService = backendService
  72095. c.resourcegroupreference = resourcegroupreference
  72096. return c
  72097. }
  72098. // Fields allows partial responses to be retrieved. See
  72099. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72100. // for more information.
  72101. func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall {
  72102. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72103. return c
  72104. }
  72105. // Context sets the context to be used in this call's Do method. Any
  72106. // pending HTTP request will be aborted if the provided context is
  72107. // canceled.
  72108. func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall {
  72109. c.ctx_ = ctx
  72110. return c
  72111. }
  72112. // Header returns an http.Header that can be modified by the caller to
  72113. // add HTTP headers to the request.
  72114. func (c *RegionBackendServicesGetHealthCall) Header() http.Header {
  72115. if c.header_ == nil {
  72116. c.header_ = make(http.Header)
  72117. }
  72118. return c.header_
  72119. }
  72120. func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) {
  72121. reqHeaders := make(http.Header)
  72122. for k, v := range c.header_ {
  72123. reqHeaders[k] = v
  72124. }
  72125. reqHeaders.Set("User-Agent", c.s.userAgent())
  72126. var body io.Reader = nil
  72127. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference)
  72128. if err != nil {
  72129. return nil, err
  72130. }
  72131. reqHeaders.Set("Content-Type", "application/json")
  72132. c.urlParams_.Set("alt", alt)
  72133. c.urlParams_.Set("prettyPrint", "false")
  72134. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}/getHealth")
  72135. urls += "?" + c.urlParams_.Encode()
  72136. req, err := http.NewRequest("POST", urls, body)
  72137. if err != nil {
  72138. return nil, err
  72139. }
  72140. req.Header = reqHeaders
  72141. googleapi.Expand(req.URL, map[string]string{
  72142. "project": c.project,
  72143. "region": c.region,
  72144. "backendService": c.backendService,
  72145. })
  72146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72147. }
  72148. // Do executes the "compute.regionBackendServices.getHealth" call.
  72149. // Exactly one of *BackendServiceGroupHealth or error will be non-nil.
  72150. // Any non-2xx status code is an error. Response headers are in either
  72151. // *BackendServiceGroupHealth.ServerResponse.Header or (if a response
  72152. // was returned at all) in error.(*googleapi.Error).Header. Use
  72153. // googleapi.IsNotModified to check whether the returned error was
  72154. // because http.StatusNotModified was returned.
  72155. func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) {
  72156. gensupport.SetOptions(c.urlParams_, opts...)
  72157. res, err := c.doRequest("json")
  72158. if res != nil && res.StatusCode == http.StatusNotModified {
  72159. if res.Body != nil {
  72160. res.Body.Close()
  72161. }
  72162. return nil, &googleapi.Error{
  72163. Code: res.StatusCode,
  72164. Header: res.Header,
  72165. }
  72166. }
  72167. if err != nil {
  72168. return nil, err
  72169. }
  72170. defer googleapi.CloseBody(res)
  72171. if err := googleapi.CheckResponse(res); err != nil {
  72172. return nil, err
  72173. }
  72174. ret := &BackendServiceGroupHealth{
  72175. ServerResponse: googleapi.ServerResponse{
  72176. Header: res.Header,
  72177. HTTPStatusCode: res.StatusCode,
  72178. },
  72179. }
  72180. target := &ret
  72181. if err := gensupport.DecodeResponse(target, res); err != nil {
  72182. return nil, err
  72183. }
  72184. return ret, nil
  72185. // {
  72186. // "description": "Gets the most recent health check results for this regional BackendService.",
  72187. // "httpMethod": "POST",
  72188. // "id": "compute.regionBackendServices.getHealth",
  72189. // "parameterOrder": [
  72190. // "project",
  72191. // "region",
  72192. // "backendService"
  72193. // ],
  72194. // "parameters": {
  72195. // "backendService": {
  72196. // "description": "Name of the BackendService resource for which to get health.",
  72197. // "location": "path",
  72198. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72199. // "required": true,
  72200. // "type": "string"
  72201. // },
  72202. // "project": {
  72203. // "location": "path",
  72204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72205. // "required": true,
  72206. // "type": "string"
  72207. // },
  72208. // "region": {
  72209. // "description": "Name of the region scoping this request.",
  72210. // "location": "path",
  72211. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72212. // "required": true,
  72213. // "type": "string"
  72214. // }
  72215. // },
  72216. // "path": "{project}/regions/{region}/backendServices/{backendService}/getHealth",
  72217. // "request": {
  72218. // "$ref": "ResourceGroupReference"
  72219. // },
  72220. // "response": {
  72221. // "$ref": "BackendServiceGroupHealth"
  72222. // },
  72223. // "scopes": [
  72224. // "https://www.googleapis.com/auth/cloud-platform",
  72225. // "https://www.googleapis.com/auth/compute",
  72226. // "https://www.googleapis.com/auth/compute.readonly"
  72227. // ]
  72228. // }
  72229. }
  72230. // method id "compute.regionBackendServices.insert":
  72231. type RegionBackendServicesInsertCall struct {
  72232. s *Service
  72233. project string
  72234. region string
  72235. backendservice *BackendService
  72236. urlParams_ gensupport.URLParams
  72237. ctx_ context.Context
  72238. header_ http.Header
  72239. }
  72240. // Insert: Creates a regional BackendService resource in the specified
  72241. // project using the data included in the request. There are several
  72242. // restrictions and guidelines to keep in mind when creating a regional
  72243. // backend service. Read Restrictions and Guidelines for more
  72244. // information.
  72245. func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall {
  72246. c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72247. c.project = project
  72248. c.region = region
  72249. c.backendservice = backendservice
  72250. return c
  72251. }
  72252. // RequestId sets the optional parameter "requestId": An optional
  72253. // request ID to identify requests. Specify a unique request ID so that
  72254. // if you must retry your request, the server will know to ignore the
  72255. // request if it has already been completed.
  72256. //
  72257. // For example, consider a situation where you make an initial request
  72258. // and the request times out. If you make the request again with the
  72259. // same request ID, the server can check if original operation with the
  72260. // same request ID was received, and if so, will ignore the second
  72261. // request. This prevents clients from accidentally creating duplicate
  72262. // commitments.
  72263. //
  72264. // The request ID must be a valid UUID with the exception that zero UUID
  72265. // is not supported (00000000-0000-0000-0000-000000000000).
  72266. func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall {
  72267. c.urlParams_.Set("requestId", requestId)
  72268. return c
  72269. }
  72270. // Fields allows partial responses to be retrieved. See
  72271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72272. // for more information.
  72273. func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall {
  72274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72275. return c
  72276. }
  72277. // Context sets the context to be used in this call's Do method. Any
  72278. // pending HTTP request will be aborted if the provided context is
  72279. // canceled.
  72280. func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall {
  72281. c.ctx_ = ctx
  72282. return c
  72283. }
  72284. // Header returns an http.Header that can be modified by the caller to
  72285. // add HTTP headers to the request.
  72286. func (c *RegionBackendServicesInsertCall) Header() http.Header {
  72287. if c.header_ == nil {
  72288. c.header_ = make(http.Header)
  72289. }
  72290. return c.header_
  72291. }
  72292. func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) {
  72293. reqHeaders := make(http.Header)
  72294. for k, v := range c.header_ {
  72295. reqHeaders[k] = v
  72296. }
  72297. reqHeaders.Set("User-Agent", c.s.userAgent())
  72298. var body io.Reader = nil
  72299. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  72300. if err != nil {
  72301. return nil, err
  72302. }
  72303. reqHeaders.Set("Content-Type", "application/json")
  72304. c.urlParams_.Set("alt", alt)
  72305. c.urlParams_.Set("prettyPrint", "false")
  72306. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  72307. urls += "?" + c.urlParams_.Encode()
  72308. req, err := http.NewRequest("POST", urls, body)
  72309. if err != nil {
  72310. return nil, err
  72311. }
  72312. req.Header = reqHeaders
  72313. googleapi.Expand(req.URL, map[string]string{
  72314. "project": c.project,
  72315. "region": c.region,
  72316. })
  72317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72318. }
  72319. // Do executes the "compute.regionBackendServices.insert" call.
  72320. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72321. // status code is an error. Response headers are in either
  72322. // *Operation.ServerResponse.Header or (if a response was returned at
  72323. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72324. // to check whether the returned error was because
  72325. // http.StatusNotModified was returned.
  72326. func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72327. gensupport.SetOptions(c.urlParams_, opts...)
  72328. res, err := c.doRequest("json")
  72329. if res != nil && res.StatusCode == http.StatusNotModified {
  72330. if res.Body != nil {
  72331. res.Body.Close()
  72332. }
  72333. return nil, &googleapi.Error{
  72334. Code: res.StatusCode,
  72335. Header: res.Header,
  72336. }
  72337. }
  72338. if err != nil {
  72339. return nil, err
  72340. }
  72341. defer googleapi.CloseBody(res)
  72342. if err := googleapi.CheckResponse(res); err != nil {
  72343. return nil, err
  72344. }
  72345. ret := &Operation{
  72346. ServerResponse: googleapi.ServerResponse{
  72347. Header: res.Header,
  72348. HTTPStatusCode: res.StatusCode,
  72349. },
  72350. }
  72351. target := &ret
  72352. if err := gensupport.DecodeResponse(target, res); err != nil {
  72353. return nil, err
  72354. }
  72355. return ret, nil
  72356. // {
  72357. // "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.",
  72358. // "httpMethod": "POST",
  72359. // "id": "compute.regionBackendServices.insert",
  72360. // "parameterOrder": [
  72361. // "project",
  72362. // "region"
  72363. // ],
  72364. // "parameters": {
  72365. // "project": {
  72366. // "description": "Project ID for this request.",
  72367. // "location": "path",
  72368. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72369. // "required": true,
  72370. // "type": "string"
  72371. // },
  72372. // "region": {
  72373. // "description": "Name of the region scoping this request.",
  72374. // "location": "path",
  72375. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72376. // "required": true,
  72377. // "type": "string"
  72378. // },
  72379. // "requestId": {
  72380. // "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).",
  72381. // "location": "query",
  72382. // "type": "string"
  72383. // }
  72384. // },
  72385. // "path": "{project}/regions/{region}/backendServices",
  72386. // "request": {
  72387. // "$ref": "BackendService"
  72388. // },
  72389. // "response": {
  72390. // "$ref": "Operation"
  72391. // },
  72392. // "scopes": [
  72393. // "https://www.googleapis.com/auth/cloud-platform",
  72394. // "https://www.googleapis.com/auth/compute"
  72395. // ]
  72396. // }
  72397. }
  72398. // method id "compute.regionBackendServices.list":
  72399. type RegionBackendServicesListCall struct {
  72400. s *Service
  72401. project string
  72402. region string
  72403. urlParams_ gensupport.URLParams
  72404. ifNoneMatch_ string
  72405. ctx_ context.Context
  72406. header_ http.Header
  72407. }
  72408. // List: Retrieves the list of regional BackendService resources
  72409. // available to the specified project in the given region.
  72410. func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall {
  72411. c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72412. c.project = project
  72413. c.region = region
  72414. return c
  72415. }
  72416. // Filter sets the optional parameter "filter": A filter expression that
  72417. // filters resources listed in the response. The expression must specify
  72418. // the field name, a comparison operator, and the value that you want to
  72419. // use for filtering. The value must be a string, a number, or a
  72420. // boolean. The comparison operator must be either =, !=, >, or <.
  72421. //
  72422. // For example, if you are filtering Compute Engine instances, you can
  72423. // exclude instances named example-instance by specifying name !=
  72424. // example-instance.
  72425. //
  72426. // You can also filter nested fields. For example, you could specify
  72427. // scheduling.automaticRestart = false to include instances only if they
  72428. // are not scheduled for automatic restarts. You can use filtering on
  72429. // nested fields to filter based on resource labels.
  72430. //
  72431. // To filter on multiple expressions, provide each separate expression
  72432. // within parentheses. For example, (scheduling.automaticRestart = true)
  72433. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  72434. // AND expression. However, you can include AND and OR expressions
  72435. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  72436. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  72437. // true).
  72438. func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall {
  72439. c.urlParams_.Set("filter", filter)
  72440. return c
  72441. }
  72442. // MaxResults sets the optional parameter "maxResults": The maximum
  72443. // number of results per page that should be returned. If the number of
  72444. // available results is larger than maxResults, Compute Engine returns a
  72445. // nextPageToken that can be used to get the next page of results in
  72446. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  72447. // (Default: 500)
  72448. func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall {
  72449. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  72450. return c
  72451. }
  72452. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  72453. // a certain order. By default, results are returned in alphanumerical
  72454. // order based on the resource name.
  72455. //
  72456. // You can also sort results in descending order based on the creation
  72457. // timestamp using orderBy="creationTimestamp desc". This sorts results
  72458. // based on the creationTimestamp field in reverse chronological order
  72459. // (newest result first). Use this to sort resources like operations so
  72460. // that the newest operation is returned first.
  72461. //
  72462. // Currently, only sorting by name or creationTimestamp desc is
  72463. // supported.
  72464. func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall {
  72465. c.urlParams_.Set("orderBy", orderBy)
  72466. return c
  72467. }
  72468. // PageToken sets the optional parameter "pageToken": Specifies a page
  72469. // token to use. Set pageToken to the nextPageToken returned by a
  72470. // previous list request to get the next page of results.
  72471. func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall {
  72472. c.urlParams_.Set("pageToken", pageToken)
  72473. return c
  72474. }
  72475. // Fields allows partial responses to be retrieved. See
  72476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72477. // for more information.
  72478. func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall {
  72479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72480. return c
  72481. }
  72482. // IfNoneMatch sets the optional parameter which makes the operation
  72483. // fail if the object's ETag matches the given value. This is useful for
  72484. // getting updates only after the object has changed since the last
  72485. // request. Use googleapi.IsNotModified to check whether the response
  72486. // error from Do is the result of In-None-Match.
  72487. func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall {
  72488. c.ifNoneMatch_ = entityTag
  72489. return c
  72490. }
  72491. // Context sets the context to be used in this call's Do method. Any
  72492. // pending HTTP request will be aborted if the provided context is
  72493. // canceled.
  72494. func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall {
  72495. c.ctx_ = ctx
  72496. return c
  72497. }
  72498. // Header returns an http.Header that can be modified by the caller to
  72499. // add HTTP headers to the request.
  72500. func (c *RegionBackendServicesListCall) Header() http.Header {
  72501. if c.header_ == nil {
  72502. c.header_ = make(http.Header)
  72503. }
  72504. return c.header_
  72505. }
  72506. func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) {
  72507. reqHeaders := make(http.Header)
  72508. for k, v := range c.header_ {
  72509. reqHeaders[k] = v
  72510. }
  72511. reqHeaders.Set("User-Agent", c.s.userAgent())
  72512. if c.ifNoneMatch_ != "" {
  72513. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  72514. }
  72515. var body io.Reader = nil
  72516. c.urlParams_.Set("alt", alt)
  72517. c.urlParams_.Set("prettyPrint", "false")
  72518. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices")
  72519. urls += "?" + c.urlParams_.Encode()
  72520. req, err := http.NewRequest("GET", urls, body)
  72521. if err != nil {
  72522. return nil, err
  72523. }
  72524. req.Header = reqHeaders
  72525. googleapi.Expand(req.URL, map[string]string{
  72526. "project": c.project,
  72527. "region": c.region,
  72528. })
  72529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72530. }
  72531. // Do executes the "compute.regionBackendServices.list" call.
  72532. // Exactly one of *BackendServiceList or error will be non-nil. Any
  72533. // non-2xx status code is an error. Response headers are in either
  72534. // *BackendServiceList.ServerResponse.Header or (if a response was
  72535. // returned at all) in error.(*googleapi.Error).Header. Use
  72536. // googleapi.IsNotModified to check whether the returned error was
  72537. // because http.StatusNotModified was returned.
  72538. func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) {
  72539. gensupport.SetOptions(c.urlParams_, opts...)
  72540. res, err := c.doRequest("json")
  72541. if res != nil && res.StatusCode == http.StatusNotModified {
  72542. if res.Body != nil {
  72543. res.Body.Close()
  72544. }
  72545. return nil, &googleapi.Error{
  72546. Code: res.StatusCode,
  72547. Header: res.Header,
  72548. }
  72549. }
  72550. if err != nil {
  72551. return nil, err
  72552. }
  72553. defer googleapi.CloseBody(res)
  72554. if err := googleapi.CheckResponse(res); err != nil {
  72555. return nil, err
  72556. }
  72557. ret := &BackendServiceList{
  72558. ServerResponse: googleapi.ServerResponse{
  72559. Header: res.Header,
  72560. HTTPStatusCode: res.StatusCode,
  72561. },
  72562. }
  72563. target := &ret
  72564. if err := gensupport.DecodeResponse(target, res); err != nil {
  72565. return nil, err
  72566. }
  72567. return ret, nil
  72568. // {
  72569. // "description": "Retrieves the list of regional BackendService resources available to the specified project in the given region.",
  72570. // "httpMethod": "GET",
  72571. // "id": "compute.regionBackendServices.list",
  72572. // "parameterOrder": [
  72573. // "project",
  72574. // "region"
  72575. // ],
  72576. // "parameters": {
  72577. // "filter": {
  72578. // "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).",
  72579. // "location": "query",
  72580. // "type": "string"
  72581. // },
  72582. // "maxResults": {
  72583. // "default": "500",
  72584. // "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)",
  72585. // "format": "uint32",
  72586. // "location": "query",
  72587. // "minimum": "0",
  72588. // "type": "integer"
  72589. // },
  72590. // "orderBy": {
  72591. // "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.",
  72592. // "location": "query",
  72593. // "type": "string"
  72594. // },
  72595. // "pageToken": {
  72596. // "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.",
  72597. // "location": "query",
  72598. // "type": "string"
  72599. // },
  72600. // "project": {
  72601. // "description": "Project ID for this request.",
  72602. // "location": "path",
  72603. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72604. // "required": true,
  72605. // "type": "string"
  72606. // },
  72607. // "region": {
  72608. // "description": "Name of the region scoping this request.",
  72609. // "location": "path",
  72610. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72611. // "required": true,
  72612. // "type": "string"
  72613. // }
  72614. // },
  72615. // "path": "{project}/regions/{region}/backendServices",
  72616. // "response": {
  72617. // "$ref": "BackendServiceList"
  72618. // },
  72619. // "scopes": [
  72620. // "https://www.googleapis.com/auth/cloud-platform",
  72621. // "https://www.googleapis.com/auth/compute",
  72622. // "https://www.googleapis.com/auth/compute.readonly"
  72623. // ]
  72624. // }
  72625. }
  72626. // Pages invokes f for each page of results.
  72627. // A non-nil error returned from f will halt the iteration.
  72628. // The provided context supersedes any context provided to the Context method.
  72629. func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error {
  72630. c.ctx_ = ctx
  72631. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  72632. for {
  72633. x, err := c.Do()
  72634. if err != nil {
  72635. return err
  72636. }
  72637. if err := f(x); err != nil {
  72638. return err
  72639. }
  72640. if x.NextPageToken == "" {
  72641. return nil
  72642. }
  72643. c.PageToken(x.NextPageToken)
  72644. }
  72645. }
  72646. // method id "compute.regionBackendServices.patch":
  72647. type RegionBackendServicesPatchCall struct {
  72648. s *Service
  72649. project string
  72650. region string
  72651. backendService string
  72652. backendservice *BackendService
  72653. urlParams_ gensupport.URLParams
  72654. ctx_ context.Context
  72655. header_ http.Header
  72656. }
  72657. // Patch: Updates the specified regional BackendService resource with
  72658. // the data included in the request. There are several restrictions and
  72659. // guidelines to keep in mind when updating a backend service. Read
  72660. // Restrictions and Guidelines for more information. This method
  72661. // supports PATCH semantics and uses the JSON merge patch format and
  72662. // processing rules.
  72663. func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall {
  72664. c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72665. c.project = project
  72666. c.region = region
  72667. c.backendService = backendService
  72668. c.backendservice = backendservice
  72669. return c
  72670. }
  72671. // RequestId sets the optional parameter "requestId": An optional
  72672. // request ID to identify requests. Specify a unique request ID so that
  72673. // if you must retry your request, the server will know to ignore the
  72674. // request if it has already been completed.
  72675. //
  72676. // For example, consider a situation where you make an initial request
  72677. // and the request times out. If you make the request again with the
  72678. // same request ID, the server can check if original operation with the
  72679. // same request ID was received, and if so, will ignore the second
  72680. // request. This prevents clients from accidentally creating duplicate
  72681. // commitments.
  72682. //
  72683. // The request ID must be a valid UUID with the exception that zero UUID
  72684. // is not supported (00000000-0000-0000-0000-000000000000).
  72685. func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall {
  72686. c.urlParams_.Set("requestId", requestId)
  72687. return c
  72688. }
  72689. // Fields allows partial responses to be retrieved. See
  72690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72691. // for more information.
  72692. func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall {
  72693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72694. return c
  72695. }
  72696. // Context sets the context to be used in this call's Do method. Any
  72697. // pending HTTP request will be aborted if the provided context is
  72698. // canceled.
  72699. func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall {
  72700. c.ctx_ = ctx
  72701. return c
  72702. }
  72703. // Header returns an http.Header that can be modified by the caller to
  72704. // add HTTP headers to the request.
  72705. func (c *RegionBackendServicesPatchCall) Header() http.Header {
  72706. if c.header_ == nil {
  72707. c.header_ = make(http.Header)
  72708. }
  72709. return c.header_
  72710. }
  72711. func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  72712. reqHeaders := make(http.Header)
  72713. for k, v := range c.header_ {
  72714. reqHeaders[k] = v
  72715. }
  72716. reqHeaders.Set("User-Agent", c.s.userAgent())
  72717. var body io.Reader = nil
  72718. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  72719. if err != nil {
  72720. return nil, err
  72721. }
  72722. reqHeaders.Set("Content-Type", "application/json")
  72723. c.urlParams_.Set("alt", alt)
  72724. c.urlParams_.Set("prettyPrint", "false")
  72725. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  72726. urls += "?" + c.urlParams_.Encode()
  72727. req, err := http.NewRequest("PATCH", urls, body)
  72728. if err != nil {
  72729. return nil, err
  72730. }
  72731. req.Header = reqHeaders
  72732. googleapi.Expand(req.URL, map[string]string{
  72733. "project": c.project,
  72734. "region": c.region,
  72735. "backendService": c.backendService,
  72736. })
  72737. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72738. }
  72739. // Do executes the "compute.regionBackendServices.patch" call.
  72740. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72741. // status code is an error. Response headers are in either
  72742. // *Operation.ServerResponse.Header or (if a response was returned at
  72743. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72744. // to check whether the returned error was because
  72745. // http.StatusNotModified was returned.
  72746. func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72747. gensupport.SetOptions(c.urlParams_, opts...)
  72748. res, err := c.doRequest("json")
  72749. if res != nil && res.StatusCode == http.StatusNotModified {
  72750. if res.Body != nil {
  72751. res.Body.Close()
  72752. }
  72753. return nil, &googleapi.Error{
  72754. Code: res.StatusCode,
  72755. Header: res.Header,
  72756. }
  72757. }
  72758. if err != nil {
  72759. return nil, err
  72760. }
  72761. defer googleapi.CloseBody(res)
  72762. if err := googleapi.CheckResponse(res); err != nil {
  72763. return nil, err
  72764. }
  72765. ret := &Operation{
  72766. ServerResponse: googleapi.ServerResponse{
  72767. Header: res.Header,
  72768. HTTPStatusCode: res.StatusCode,
  72769. },
  72770. }
  72771. target := &ret
  72772. if err := gensupport.DecodeResponse(target, res); err != nil {
  72773. return nil, err
  72774. }
  72775. return ret, nil
  72776. // {
  72777. // "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.",
  72778. // "httpMethod": "PATCH",
  72779. // "id": "compute.regionBackendServices.patch",
  72780. // "parameterOrder": [
  72781. // "project",
  72782. // "region",
  72783. // "backendService"
  72784. // ],
  72785. // "parameters": {
  72786. // "backendService": {
  72787. // "description": "Name of the BackendService resource to patch.",
  72788. // "location": "path",
  72789. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72790. // "required": true,
  72791. // "type": "string"
  72792. // },
  72793. // "project": {
  72794. // "description": "Project ID for this request.",
  72795. // "location": "path",
  72796. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72797. // "required": true,
  72798. // "type": "string"
  72799. // },
  72800. // "region": {
  72801. // "description": "Name of the region scoping this request.",
  72802. // "location": "path",
  72803. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72804. // "required": true,
  72805. // "type": "string"
  72806. // },
  72807. // "requestId": {
  72808. // "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).",
  72809. // "location": "query",
  72810. // "type": "string"
  72811. // }
  72812. // },
  72813. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  72814. // "request": {
  72815. // "$ref": "BackendService"
  72816. // },
  72817. // "response": {
  72818. // "$ref": "Operation"
  72819. // },
  72820. // "scopes": [
  72821. // "https://www.googleapis.com/auth/cloud-platform",
  72822. // "https://www.googleapis.com/auth/compute"
  72823. // ]
  72824. // }
  72825. }
  72826. // method id "compute.regionBackendServices.update":
  72827. type RegionBackendServicesUpdateCall struct {
  72828. s *Service
  72829. project string
  72830. region string
  72831. backendService string
  72832. backendservice *BackendService
  72833. urlParams_ gensupport.URLParams
  72834. ctx_ context.Context
  72835. header_ http.Header
  72836. }
  72837. // Update: Updates the specified regional BackendService resource with
  72838. // the data included in the request. There are several restrictions and
  72839. // guidelines to keep in mind when updating a backend service. Read
  72840. // Restrictions and Guidelines for more information.
  72841. func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall {
  72842. c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  72843. c.project = project
  72844. c.region = region
  72845. c.backendService = backendService
  72846. c.backendservice = backendservice
  72847. return c
  72848. }
  72849. // RequestId sets the optional parameter "requestId": An optional
  72850. // request ID to identify requests. Specify a unique request ID so that
  72851. // if you must retry your request, the server will know to ignore the
  72852. // request if it has already been completed.
  72853. //
  72854. // For example, consider a situation where you make an initial request
  72855. // and the request times out. If you make the request again with the
  72856. // same request ID, the server can check if original operation with the
  72857. // same request ID was received, and if so, will ignore the second
  72858. // request. This prevents clients from accidentally creating duplicate
  72859. // commitments.
  72860. //
  72861. // The request ID must be a valid UUID with the exception that zero UUID
  72862. // is not supported (00000000-0000-0000-0000-000000000000).
  72863. func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall {
  72864. c.urlParams_.Set("requestId", requestId)
  72865. return c
  72866. }
  72867. // Fields allows partial responses to be retrieved. See
  72868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  72869. // for more information.
  72870. func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall {
  72871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  72872. return c
  72873. }
  72874. // Context sets the context to be used in this call's Do method. Any
  72875. // pending HTTP request will be aborted if the provided context is
  72876. // canceled.
  72877. func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall {
  72878. c.ctx_ = ctx
  72879. return c
  72880. }
  72881. // Header returns an http.Header that can be modified by the caller to
  72882. // add HTTP headers to the request.
  72883. func (c *RegionBackendServicesUpdateCall) Header() http.Header {
  72884. if c.header_ == nil {
  72885. c.header_ = make(http.Header)
  72886. }
  72887. return c.header_
  72888. }
  72889. func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) {
  72890. reqHeaders := make(http.Header)
  72891. for k, v := range c.header_ {
  72892. reqHeaders[k] = v
  72893. }
  72894. reqHeaders.Set("User-Agent", c.s.userAgent())
  72895. var body io.Reader = nil
  72896. body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice)
  72897. if err != nil {
  72898. return nil, err
  72899. }
  72900. reqHeaders.Set("Content-Type", "application/json")
  72901. c.urlParams_.Set("alt", alt)
  72902. c.urlParams_.Set("prettyPrint", "false")
  72903. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/backendServices/{backendService}")
  72904. urls += "?" + c.urlParams_.Encode()
  72905. req, err := http.NewRequest("PUT", urls, body)
  72906. if err != nil {
  72907. return nil, err
  72908. }
  72909. req.Header = reqHeaders
  72910. googleapi.Expand(req.URL, map[string]string{
  72911. "project": c.project,
  72912. "region": c.region,
  72913. "backendService": c.backendService,
  72914. })
  72915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  72916. }
  72917. // Do executes the "compute.regionBackendServices.update" call.
  72918. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  72919. // status code is an error. Response headers are in either
  72920. // *Operation.ServerResponse.Header or (if a response was returned at
  72921. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  72922. // to check whether the returned error was because
  72923. // http.StatusNotModified was returned.
  72924. func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  72925. gensupport.SetOptions(c.urlParams_, opts...)
  72926. res, err := c.doRequest("json")
  72927. if res != nil && res.StatusCode == http.StatusNotModified {
  72928. if res.Body != nil {
  72929. res.Body.Close()
  72930. }
  72931. return nil, &googleapi.Error{
  72932. Code: res.StatusCode,
  72933. Header: res.Header,
  72934. }
  72935. }
  72936. if err != nil {
  72937. return nil, err
  72938. }
  72939. defer googleapi.CloseBody(res)
  72940. if err := googleapi.CheckResponse(res); err != nil {
  72941. return nil, err
  72942. }
  72943. ret := &Operation{
  72944. ServerResponse: googleapi.ServerResponse{
  72945. Header: res.Header,
  72946. HTTPStatusCode: res.StatusCode,
  72947. },
  72948. }
  72949. target := &ret
  72950. if err := gensupport.DecodeResponse(target, res); err != nil {
  72951. return nil, err
  72952. }
  72953. return ret, nil
  72954. // {
  72955. // "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.",
  72956. // "httpMethod": "PUT",
  72957. // "id": "compute.regionBackendServices.update",
  72958. // "parameterOrder": [
  72959. // "project",
  72960. // "region",
  72961. // "backendService"
  72962. // ],
  72963. // "parameters": {
  72964. // "backendService": {
  72965. // "description": "Name of the BackendService resource to update.",
  72966. // "location": "path",
  72967. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  72968. // "required": true,
  72969. // "type": "string"
  72970. // },
  72971. // "project": {
  72972. // "description": "Project ID for this request.",
  72973. // "location": "path",
  72974. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  72975. // "required": true,
  72976. // "type": "string"
  72977. // },
  72978. // "region": {
  72979. // "description": "Name of the region scoping this request.",
  72980. // "location": "path",
  72981. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  72982. // "required": true,
  72983. // "type": "string"
  72984. // },
  72985. // "requestId": {
  72986. // "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).",
  72987. // "location": "query",
  72988. // "type": "string"
  72989. // }
  72990. // },
  72991. // "path": "{project}/regions/{region}/backendServices/{backendService}",
  72992. // "request": {
  72993. // "$ref": "BackendService"
  72994. // },
  72995. // "response": {
  72996. // "$ref": "Operation"
  72997. // },
  72998. // "scopes": [
  72999. // "https://www.googleapis.com/auth/cloud-platform",
  73000. // "https://www.googleapis.com/auth/compute"
  73001. // ]
  73002. // }
  73003. }
  73004. // method id "compute.regionCommitments.aggregatedList":
  73005. type RegionCommitmentsAggregatedListCall struct {
  73006. s *Service
  73007. project string
  73008. urlParams_ gensupport.URLParams
  73009. ifNoneMatch_ string
  73010. ctx_ context.Context
  73011. header_ http.Header
  73012. }
  73013. // AggregatedList: Retrieves an aggregated list of commitments.
  73014. func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall {
  73015. c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73016. c.project = project
  73017. return c
  73018. }
  73019. // Filter sets the optional parameter "filter": A filter expression that
  73020. // filters resources listed in the response. The expression must specify
  73021. // the field name, a comparison operator, and the value that you want to
  73022. // use for filtering. The value must be a string, a number, or a
  73023. // boolean. The comparison operator must be either =, !=, >, or <.
  73024. //
  73025. // For example, if you are filtering Compute Engine instances, you can
  73026. // exclude instances named example-instance by specifying name !=
  73027. // example-instance.
  73028. //
  73029. // You can also filter nested fields. For example, you could specify
  73030. // scheduling.automaticRestart = false to include instances only if they
  73031. // are not scheduled for automatic restarts. You can use filtering on
  73032. // nested fields to filter based on resource labels.
  73033. //
  73034. // To filter on multiple expressions, provide each separate expression
  73035. // within parentheses. For example, (scheduling.automaticRestart = true)
  73036. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73037. // AND expression. However, you can include AND and OR expressions
  73038. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73039. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73040. // true).
  73041. func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall {
  73042. c.urlParams_.Set("filter", filter)
  73043. return c
  73044. }
  73045. // MaxResults sets the optional parameter "maxResults": The maximum
  73046. // number of results per page that should be returned. If the number of
  73047. // available results is larger than maxResults, Compute Engine returns a
  73048. // nextPageToken that can be used to get the next page of results in
  73049. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73050. // (Default: 500)
  73051. func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall {
  73052. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73053. return c
  73054. }
  73055. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73056. // a certain order. By default, results are returned in alphanumerical
  73057. // order based on the resource name.
  73058. //
  73059. // You can also sort results in descending order based on the creation
  73060. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73061. // based on the creationTimestamp field in reverse chronological order
  73062. // (newest result first). Use this to sort resources like operations so
  73063. // that the newest operation is returned first.
  73064. //
  73065. // Currently, only sorting by name or creationTimestamp desc is
  73066. // supported.
  73067. func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall {
  73068. c.urlParams_.Set("orderBy", orderBy)
  73069. return c
  73070. }
  73071. // PageToken sets the optional parameter "pageToken": Specifies a page
  73072. // token to use. Set pageToken to the nextPageToken returned by a
  73073. // previous list request to get the next page of results.
  73074. func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall {
  73075. c.urlParams_.Set("pageToken", pageToken)
  73076. return c
  73077. }
  73078. // Fields allows partial responses to be retrieved. See
  73079. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73080. // for more information.
  73081. func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall {
  73082. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73083. return c
  73084. }
  73085. // IfNoneMatch sets the optional parameter which makes the operation
  73086. // fail if the object's ETag matches the given value. This is useful for
  73087. // getting updates only after the object has changed since the last
  73088. // request. Use googleapi.IsNotModified to check whether the response
  73089. // error from Do is the result of In-None-Match.
  73090. func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall {
  73091. c.ifNoneMatch_ = entityTag
  73092. return c
  73093. }
  73094. // Context sets the context to be used in this call's Do method. Any
  73095. // pending HTTP request will be aborted if the provided context is
  73096. // canceled.
  73097. func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall {
  73098. c.ctx_ = ctx
  73099. return c
  73100. }
  73101. // Header returns an http.Header that can be modified by the caller to
  73102. // add HTTP headers to the request.
  73103. func (c *RegionCommitmentsAggregatedListCall) Header() http.Header {
  73104. if c.header_ == nil {
  73105. c.header_ = make(http.Header)
  73106. }
  73107. return c.header_
  73108. }
  73109. func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  73110. reqHeaders := make(http.Header)
  73111. for k, v := range c.header_ {
  73112. reqHeaders[k] = v
  73113. }
  73114. reqHeaders.Set("User-Agent", c.s.userAgent())
  73115. if c.ifNoneMatch_ != "" {
  73116. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73117. }
  73118. var body io.Reader = nil
  73119. c.urlParams_.Set("alt", alt)
  73120. c.urlParams_.Set("prettyPrint", "false")
  73121. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/commitments")
  73122. urls += "?" + c.urlParams_.Encode()
  73123. req, err := http.NewRequest("GET", urls, body)
  73124. if err != nil {
  73125. return nil, err
  73126. }
  73127. req.Header = reqHeaders
  73128. googleapi.Expand(req.URL, map[string]string{
  73129. "project": c.project,
  73130. })
  73131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73132. }
  73133. // Do executes the "compute.regionCommitments.aggregatedList" call.
  73134. // Exactly one of *CommitmentAggregatedList or error will be non-nil.
  73135. // Any non-2xx status code is an error. Response headers are in either
  73136. // *CommitmentAggregatedList.ServerResponse.Header or (if a response was
  73137. // returned at all) in error.(*googleapi.Error).Header. Use
  73138. // googleapi.IsNotModified to check whether the returned error was
  73139. // because http.StatusNotModified was returned.
  73140. func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) {
  73141. gensupport.SetOptions(c.urlParams_, opts...)
  73142. res, err := c.doRequest("json")
  73143. if res != nil && res.StatusCode == http.StatusNotModified {
  73144. if res.Body != nil {
  73145. res.Body.Close()
  73146. }
  73147. return nil, &googleapi.Error{
  73148. Code: res.StatusCode,
  73149. Header: res.Header,
  73150. }
  73151. }
  73152. if err != nil {
  73153. return nil, err
  73154. }
  73155. defer googleapi.CloseBody(res)
  73156. if err := googleapi.CheckResponse(res); err != nil {
  73157. return nil, err
  73158. }
  73159. ret := &CommitmentAggregatedList{
  73160. ServerResponse: googleapi.ServerResponse{
  73161. Header: res.Header,
  73162. HTTPStatusCode: res.StatusCode,
  73163. },
  73164. }
  73165. target := &ret
  73166. if err := gensupport.DecodeResponse(target, res); err != nil {
  73167. return nil, err
  73168. }
  73169. return ret, nil
  73170. // {
  73171. // "description": "Retrieves an aggregated list of commitments.",
  73172. // "httpMethod": "GET",
  73173. // "id": "compute.regionCommitments.aggregatedList",
  73174. // "parameterOrder": [
  73175. // "project"
  73176. // ],
  73177. // "parameters": {
  73178. // "filter": {
  73179. // "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).",
  73180. // "location": "query",
  73181. // "type": "string"
  73182. // },
  73183. // "maxResults": {
  73184. // "default": "500",
  73185. // "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)",
  73186. // "format": "uint32",
  73187. // "location": "query",
  73188. // "minimum": "0",
  73189. // "type": "integer"
  73190. // },
  73191. // "orderBy": {
  73192. // "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.",
  73193. // "location": "query",
  73194. // "type": "string"
  73195. // },
  73196. // "pageToken": {
  73197. // "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.",
  73198. // "location": "query",
  73199. // "type": "string"
  73200. // },
  73201. // "project": {
  73202. // "description": "Project ID for this request.",
  73203. // "location": "path",
  73204. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73205. // "required": true,
  73206. // "type": "string"
  73207. // }
  73208. // },
  73209. // "path": "{project}/aggregated/commitments",
  73210. // "response": {
  73211. // "$ref": "CommitmentAggregatedList"
  73212. // },
  73213. // "scopes": [
  73214. // "https://www.googleapis.com/auth/cloud-platform",
  73215. // "https://www.googleapis.com/auth/compute",
  73216. // "https://www.googleapis.com/auth/compute.readonly"
  73217. // ]
  73218. // }
  73219. }
  73220. // Pages invokes f for each page of results.
  73221. // A non-nil error returned from f will halt the iteration.
  73222. // The provided context supersedes any context provided to the Context method.
  73223. func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error {
  73224. c.ctx_ = ctx
  73225. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73226. for {
  73227. x, err := c.Do()
  73228. if err != nil {
  73229. return err
  73230. }
  73231. if err := f(x); err != nil {
  73232. return err
  73233. }
  73234. if x.NextPageToken == "" {
  73235. return nil
  73236. }
  73237. c.PageToken(x.NextPageToken)
  73238. }
  73239. }
  73240. // method id "compute.regionCommitments.get":
  73241. type RegionCommitmentsGetCall struct {
  73242. s *Service
  73243. project string
  73244. region string
  73245. commitment string
  73246. urlParams_ gensupport.URLParams
  73247. ifNoneMatch_ string
  73248. ctx_ context.Context
  73249. header_ http.Header
  73250. }
  73251. // Get: Returns the specified commitment resource. Gets a list of
  73252. // available commitments by making a list() request.
  73253. func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall {
  73254. c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73255. c.project = project
  73256. c.region = region
  73257. c.commitment = commitment
  73258. return c
  73259. }
  73260. // Fields allows partial responses to be retrieved. See
  73261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73262. // for more information.
  73263. func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall {
  73264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73265. return c
  73266. }
  73267. // IfNoneMatch sets the optional parameter which makes the operation
  73268. // fail if the object's ETag matches the given value. This is useful for
  73269. // getting updates only after the object has changed since the last
  73270. // request. Use googleapi.IsNotModified to check whether the response
  73271. // error from Do is the result of In-None-Match.
  73272. func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall {
  73273. c.ifNoneMatch_ = entityTag
  73274. return c
  73275. }
  73276. // Context sets the context to be used in this call's Do method. Any
  73277. // pending HTTP request will be aborted if the provided context is
  73278. // canceled.
  73279. func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall {
  73280. c.ctx_ = ctx
  73281. return c
  73282. }
  73283. // Header returns an http.Header that can be modified by the caller to
  73284. // add HTTP headers to the request.
  73285. func (c *RegionCommitmentsGetCall) Header() http.Header {
  73286. if c.header_ == nil {
  73287. c.header_ = make(http.Header)
  73288. }
  73289. return c.header_
  73290. }
  73291. func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) {
  73292. reqHeaders := make(http.Header)
  73293. for k, v := range c.header_ {
  73294. reqHeaders[k] = v
  73295. }
  73296. reqHeaders.Set("User-Agent", c.s.userAgent())
  73297. if c.ifNoneMatch_ != "" {
  73298. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73299. }
  73300. var body io.Reader = nil
  73301. c.urlParams_.Set("alt", alt)
  73302. c.urlParams_.Set("prettyPrint", "false")
  73303. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments/{commitment}")
  73304. urls += "?" + c.urlParams_.Encode()
  73305. req, err := http.NewRequest("GET", urls, body)
  73306. if err != nil {
  73307. return nil, err
  73308. }
  73309. req.Header = reqHeaders
  73310. googleapi.Expand(req.URL, map[string]string{
  73311. "project": c.project,
  73312. "region": c.region,
  73313. "commitment": c.commitment,
  73314. })
  73315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73316. }
  73317. // Do executes the "compute.regionCommitments.get" call.
  73318. // Exactly one of *Commitment or error will be non-nil. Any non-2xx
  73319. // status code is an error. Response headers are in either
  73320. // *Commitment.ServerResponse.Header or (if a response was returned at
  73321. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73322. // to check whether the returned error was because
  73323. // http.StatusNotModified was returned.
  73324. func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) {
  73325. gensupport.SetOptions(c.urlParams_, opts...)
  73326. res, err := c.doRequest("json")
  73327. if res != nil && res.StatusCode == http.StatusNotModified {
  73328. if res.Body != nil {
  73329. res.Body.Close()
  73330. }
  73331. return nil, &googleapi.Error{
  73332. Code: res.StatusCode,
  73333. Header: res.Header,
  73334. }
  73335. }
  73336. if err != nil {
  73337. return nil, err
  73338. }
  73339. defer googleapi.CloseBody(res)
  73340. if err := googleapi.CheckResponse(res); err != nil {
  73341. return nil, err
  73342. }
  73343. ret := &Commitment{
  73344. ServerResponse: googleapi.ServerResponse{
  73345. Header: res.Header,
  73346. HTTPStatusCode: res.StatusCode,
  73347. },
  73348. }
  73349. target := &ret
  73350. if err := gensupport.DecodeResponse(target, res); err != nil {
  73351. return nil, err
  73352. }
  73353. return ret, nil
  73354. // {
  73355. // "description": "Returns the specified commitment resource. Gets a list of available commitments by making a list() request.",
  73356. // "httpMethod": "GET",
  73357. // "id": "compute.regionCommitments.get",
  73358. // "parameterOrder": [
  73359. // "project",
  73360. // "region",
  73361. // "commitment"
  73362. // ],
  73363. // "parameters": {
  73364. // "commitment": {
  73365. // "description": "Name of the commitment to return.",
  73366. // "location": "path",
  73367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73368. // "required": true,
  73369. // "type": "string"
  73370. // },
  73371. // "project": {
  73372. // "description": "Project ID for this request.",
  73373. // "location": "path",
  73374. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73375. // "required": true,
  73376. // "type": "string"
  73377. // },
  73378. // "region": {
  73379. // "description": "Name of the region for this request.",
  73380. // "location": "path",
  73381. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73382. // "required": true,
  73383. // "type": "string"
  73384. // }
  73385. // },
  73386. // "path": "{project}/regions/{region}/commitments/{commitment}",
  73387. // "response": {
  73388. // "$ref": "Commitment"
  73389. // },
  73390. // "scopes": [
  73391. // "https://www.googleapis.com/auth/cloud-platform",
  73392. // "https://www.googleapis.com/auth/compute",
  73393. // "https://www.googleapis.com/auth/compute.readonly"
  73394. // ]
  73395. // }
  73396. }
  73397. // method id "compute.regionCommitments.insert":
  73398. type RegionCommitmentsInsertCall struct {
  73399. s *Service
  73400. project string
  73401. region string
  73402. commitment *Commitment
  73403. urlParams_ gensupport.URLParams
  73404. ctx_ context.Context
  73405. header_ http.Header
  73406. }
  73407. // Insert: Creates a commitment in the specified project using the data
  73408. // included in the request.
  73409. func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall {
  73410. c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73411. c.project = project
  73412. c.region = region
  73413. c.commitment = commitment
  73414. return c
  73415. }
  73416. // RequestId sets the optional parameter "requestId": An optional
  73417. // request ID to identify requests. Specify a unique request ID so that
  73418. // if you must retry your request, the server will know to ignore the
  73419. // request if it has already been completed.
  73420. //
  73421. // For example, consider a situation where you make an initial request
  73422. // and the request times out. If you make the request again with the
  73423. // same request ID, the server can check if original operation with the
  73424. // same request ID was received, and if so, will ignore the second
  73425. // request. This prevents clients from accidentally creating duplicate
  73426. // commitments.
  73427. //
  73428. // The request ID must be a valid UUID with the exception that zero UUID
  73429. // is not supported (00000000-0000-0000-0000-000000000000).
  73430. func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall {
  73431. c.urlParams_.Set("requestId", requestId)
  73432. return c
  73433. }
  73434. // Fields allows partial responses to be retrieved. See
  73435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73436. // for more information.
  73437. func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall {
  73438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73439. return c
  73440. }
  73441. // Context sets the context to be used in this call's Do method. Any
  73442. // pending HTTP request will be aborted if the provided context is
  73443. // canceled.
  73444. func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall {
  73445. c.ctx_ = ctx
  73446. return c
  73447. }
  73448. // Header returns an http.Header that can be modified by the caller to
  73449. // add HTTP headers to the request.
  73450. func (c *RegionCommitmentsInsertCall) Header() http.Header {
  73451. if c.header_ == nil {
  73452. c.header_ = make(http.Header)
  73453. }
  73454. return c.header_
  73455. }
  73456. func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  73457. reqHeaders := make(http.Header)
  73458. for k, v := range c.header_ {
  73459. reqHeaders[k] = v
  73460. }
  73461. reqHeaders.Set("User-Agent", c.s.userAgent())
  73462. var body io.Reader = nil
  73463. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment)
  73464. if err != nil {
  73465. return nil, err
  73466. }
  73467. reqHeaders.Set("Content-Type", "application/json")
  73468. c.urlParams_.Set("alt", alt)
  73469. c.urlParams_.Set("prettyPrint", "false")
  73470. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  73471. urls += "?" + c.urlParams_.Encode()
  73472. req, err := http.NewRequest("POST", urls, body)
  73473. if err != nil {
  73474. return nil, err
  73475. }
  73476. req.Header = reqHeaders
  73477. googleapi.Expand(req.URL, map[string]string{
  73478. "project": c.project,
  73479. "region": c.region,
  73480. })
  73481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73482. }
  73483. // Do executes the "compute.regionCommitments.insert" call.
  73484. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  73485. // status code is an error. Response headers are in either
  73486. // *Operation.ServerResponse.Header or (if a response was returned at
  73487. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73488. // to check whether the returned error was because
  73489. // http.StatusNotModified was returned.
  73490. func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  73491. gensupport.SetOptions(c.urlParams_, opts...)
  73492. res, err := c.doRequest("json")
  73493. if res != nil && res.StatusCode == http.StatusNotModified {
  73494. if res.Body != nil {
  73495. res.Body.Close()
  73496. }
  73497. return nil, &googleapi.Error{
  73498. Code: res.StatusCode,
  73499. Header: res.Header,
  73500. }
  73501. }
  73502. if err != nil {
  73503. return nil, err
  73504. }
  73505. defer googleapi.CloseBody(res)
  73506. if err := googleapi.CheckResponse(res); err != nil {
  73507. return nil, err
  73508. }
  73509. ret := &Operation{
  73510. ServerResponse: googleapi.ServerResponse{
  73511. Header: res.Header,
  73512. HTTPStatusCode: res.StatusCode,
  73513. },
  73514. }
  73515. target := &ret
  73516. if err := gensupport.DecodeResponse(target, res); err != nil {
  73517. return nil, err
  73518. }
  73519. return ret, nil
  73520. // {
  73521. // "description": "Creates a commitment in the specified project using the data included in the request.",
  73522. // "httpMethod": "POST",
  73523. // "id": "compute.regionCommitments.insert",
  73524. // "parameterOrder": [
  73525. // "project",
  73526. // "region"
  73527. // ],
  73528. // "parameters": {
  73529. // "project": {
  73530. // "description": "Project ID for this request.",
  73531. // "location": "path",
  73532. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73533. // "required": true,
  73534. // "type": "string"
  73535. // },
  73536. // "region": {
  73537. // "description": "Name of the region for this request.",
  73538. // "location": "path",
  73539. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73540. // "required": true,
  73541. // "type": "string"
  73542. // },
  73543. // "requestId": {
  73544. // "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).",
  73545. // "location": "query",
  73546. // "type": "string"
  73547. // }
  73548. // },
  73549. // "path": "{project}/regions/{region}/commitments",
  73550. // "request": {
  73551. // "$ref": "Commitment"
  73552. // },
  73553. // "response": {
  73554. // "$ref": "Operation"
  73555. // },
  73556. // "scopes": [
  73557. // "https://www.googleapis.com/auth/cloud-platform",
  73558. // "https://www.googleapis.com/auth/compute"
  73559. // ]
  73560. // }
  73561. }
  73562. // method id "compute.regionCommitments.list":
  73563. type RegionCommitmentsListCall struct {
  73564. s *Service
  73565. project string
  73566. region string
  73567. urlParams_ gensupport.URLParams
  73568. ifNoneMatch_ string
  73569. ctx_ context.Context
  73570. header_ http.Header
  73571. }
  73572. // List: Retrieves a list of commitments contained within the specified
  73573. // region.
  73574. func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall {
  73575. c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73576. c.project = project
  73577. c.region = region
  73578. return c
  73579. }
  73580. // Filter sets the optional parameter "filter": A filter expression that
  73581. // filters resources listed in the response. The expression must specify
  73582. // the field name, a comparison operator, and the value that you want to
  73583. // use for filtering. The value must be a string, a number, or a
  73584. // boolean. The comparison operator must be either =, !=, >, or <.
  73585. //
  73586. // For example, if you are filtering Compute Engine instances, you can
  73587. // exclude instances named example-instance by specifying name !=
  73588. // example-instance.
  73589. //
  73590. // You can also filter nested fields. For example, you could specify
  73591. // scheduling.automaticRestart = false to include instances only if they
  73592. // are not scheduled for automatic restarts. You can use filtering on
  73593. // nested fields to filter based on resource labels.
  73594. //
  73595. // To filter on multiple expressions, provide each separate expression
  73596. // within parentheses. For example, (scheduling.automaticRestart = true)
  73597. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  73598. // AND expression. However, you can include AND and OR expressions
  73599. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  73600. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  73601. // true).
  73602. func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall {
  73603. c.urlParams_.Set("filter", filter)
  73604. return c
  73605. }
  73606. // MaxResults sets the optional parameter "maxResults": The maximum
  73607. // number of results per page that should be returned. If the number of
  73608. // available results is larger than maxResults, Compute Engine returns a
  73609. // nextPageToken that can be used to get the next page of results in
  73610. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  73611. // (Default: 500)
  73612. func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall {
  73613. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  73614. return c
  73615. }
  73616. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  73617. // a certain order. By default, results are returned in alphanumerical
  73618. // order based on the resource name.
  73619. //
  73620. // You can also sort results in descending order based on the creation
  73621. // timestamp using orderBy="creationTimestamp desc". This sorts results
  73622. // based on the creationTimestamp field in reverse chronological order
  73623. // (newest result first). Use this to sort resources like operations so
  73624. // that the newest operation is returned first.
  73625. //
  73626. // Currently, only sorting by name or creationTimestamp desc is
  73627. // supported.
  73628. func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall {
  73629. c.urlParams_.Set("orderBy", orderBy)
  73630. return c
  73631. }
  73632. // PageToken sets the optional parameter "pageToken": Specifies a page
  73633. // token to use. Set pageToken to the nextPageToken returned by a
  73634. // previous list request to get the next page of results.
  73635. func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall {
  73636. c.urlParams_.Set("pageToken", pageToken)
  73637. return c
  73638. }
  73639. // Fields allows partial responses to be retrieved. See
  73640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73641. // for more information.
  73642. func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall {
  73643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73644. return c
  73645. }
  73646. // IfNoneMatch sets the optional parameter which makes the operation
  73647. // fail if the object's ETag matches the given value. This is useful for
  73648. // getting updates only after the object has changed since the last
  73649. // request. Use googleapi.IsNotModified to check whether the response
  73650. // error from Do is the result of In-None-Match.
  73651. func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall {
  73652. c.ifNoneMatch_ = entityTag
  73653. return c
  73654. }
  73655. // Context sets the context to be used in this call's Do method. Any
  73656. // pending HTTP request will be aborted if the provided context is
  73657. // canceled.
  73658. func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall {
  73659. c.ctx_ = ctx
  73660. return c
  73661. }
  73662. // Header returns an http.Header that can be modified by the caller to
  73663. // add HTTP headers to the request.
  73664. func (c *RegionCommitmentsListCall) Header() http.Header {
  73665. if c.header_ == nil {
  73666. c.header_ = make(http.Header)
  73667. }
  73668. return c.header_
  73669. }
  73670. func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) {
  73671. reqHeaders := make(http.Header)
  73672. for k, v := range c.header_ {
  73673. reqHeaders[k] = v
  73674. }
  73675. reqHeaders.Set("User-Agent", c.s.userAgent())
  73676. if c.ifNoneMatch_ != "" {
  73677. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73678. }
  73679. var body io.Reader = nil
  73680. c.urlParams_.Set("alt", alt)
  73681. c.urlParams_.Set("prettyPrint", "false")
  73682. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/commitments")
  73683. urls += "?" + c.urlParams_.Encode()
  73684. req, err := http.NewRequest("GET", urls, body)
  73685. if err != nil {
  73686. return nil, err
  73687. }
  73688. req.Header = reqHeaders
  73689. googleapi.Expand(req.URL, map[string]string{
  73690. "project": c.project,
  73691. "region": c.region,
  73692. })
  73693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73694. }
  73695. // Do executes the "compute.regionCommitments.list" call.
  73696. // Exactly one of *CommitmentList or error will be non-nil. Any non-2xx
  73697. // status code is an error. Response headers are in either
  73698. // *CommitmentList.ServerResponse.Header or (if a response was returned
  73699. // at all) in error.(*googleapi.Error).Header. Use
  73700. // googleapi.IsNotModified to check whether the returned error was
  73701. // because http.StatusNotModified was returned.
  73702. func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) {
  73703. gensupport.SetOptions(c.urlParams_, opts...)
  73704. res, err := c.doRequest("json")
  73705. if res != nil && res.StatusCode == http.StatusNotModified {
  73706. if res.Body != nil {
  73707. res.Body.Close()
  73708. }
  73709. return nil, &googleapi.Error{
  73710. Code: res.StatusCode,
  73711. Header: res.Header,
  73712. }
  73713. }
  73714. if err != nil {
  73715. return nil, err
  73716. }
  73717. defer googleapi.CloseBody(res)
  73718. if err := googleapi.CheckResponse(res); err != nil {
  73719. return nil, err
  73720. }
  73721. ret := &CommitmentList{
  73722. ServerResponse: googleapi.ServerResponse{
  73723. Header: res.Header,
  73724. HTTPStatusCode: res.StatusCode,
  73725. },
  73726. }
  73727. target := &ret
  73728. if err := gensupport.DecodeResponse(target, res); err != nil {
  73729. return nil, err
  73730. }
  73731. return ret, nil
  73732. // {
  73733. // "description": "Retrieves a list of commitments contained within the specified region.",
  73734. // "httpMethod": "GET",
  73735. // "id": "compute.regionCommitments.list",
  73736. // "parameterOrder": [
  73737. // "project",
  73738. // "region"
  73739. // ],
  73740. // "parameters": {
  73741. // "filter": {
  73742. // "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).",
  73743. // "location": "query",
  73744. // "type": "string"
  73745. // },
  73746. // "maxResults": {
  73747. // "default": "500",
  73748. // "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)",
  73749. // "format": "uint32",
  73750. // "location": "query",
  73751. // "minimum": "0",
  73752. // "type": "integer"
  73753. // },
  73754. // "orderBy": {
  73755. // "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.",
  73756. // "location": "query",
  73757. // "type": "string"
  73758. // },
  73759. // "pageToken": {
  73760. // "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.",
  73761. // "location": "query",
  73762. // "type": "string"
  73763. // },
  73764. // "project": {
  73765. // "description": "Project ID for this request.",
  73766. // "location": "path",
  73767. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73768. // "required": true,
  73769. // "type": "string"
  73770. // },
  73771. // "region": {
  73772. // "description": "Name of the region for this request.",
  73773. // "location": "path",
  73774. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73775. // "required": true,
  73776. // "type": "string"
  73777. // }
  73778. // },
  73779. // "path": "{project}/regions/{region}/commitments",
  73780. // "response": {
  73781. // "$ref": "CommitmentList"
  73782. // },
  73783. // "scopes": [
  73784. // "https://www.googleapis.com/auth/cloud-platform",
  73785. // "https://www.googleapis.com/auth/compute",
  73786. // "https://www.googleapis.com/auth/compute.readonly"
  73787. // ]
  73788. // }
  73789. }
  73790. // Pages invokes f for each page of results.
  73791. // A non-nil error returned from f will halt the iteration.
  73792. // The provided context supersedes any context provided to the Context method.
  73793. func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error {
  73794. c.ctx_ = ctx
  73795. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  73796. for {
  73797. x, err := c.Do()
  73798. if err != nil {
  73799. return err
  73800. }
  73801. if err := f(x); err != nil {
  73802. return err
  73803. }
  73804. if x.NextPageToken == "" {
  73805. return nil
  73806. }
  73807. c.PageToken(x.NextPageToken)
  73808. }
  73809. }
  73810. // method id "compute.regionDiskTypes.get":
  73811. type RegionDiskTypesGetCall struct {
  73812. s *Service
  73813. project string
  73814. region string
  73815. diskType string
  73816. urlParams_ gensupport.URLParams
  73817. ifNoneMatch_ string
  73818. ctx_ context.Context
  73819. header_ http.Header
  73820. }
  73821. // Get: Returns the specified regional disk type. Gets a list of
  73822. // available disk types by making a list() request.
  73823. func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall {
  73824. c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73825. c.project = project
  73826. c.region = region
  73827. c.diskType = diskType
  73828. return c
  73829. }
  73830. // Fields allows partial responses to be retrieved. See
  73831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  73832. // for more information.
  73833. func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall {
  73834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  73835. return c
  73836. }
  73837. // IfNoneMatch sets the optional parameter which makes the operation
  73838. // fail if the object's ETag matches the given value. This is useful for
  73839. // getting updates only after the object has changed since the last
  73840. // request. Use googleapi.IsNotModified to check whether the response
  73841. // error from Do is the result of In-None-Match.
  73842. func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall {
  73843. c.ifNoneMatch_ = entityTag
  73844. return c
  73845. }
  73846. // Context sets the context to be used in this call's Do method. Any
  73847. // pending HTTP request will be aborted if the provided context is
  73848. // canceled.
  73849. func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall {
  73850. c.ctx_ = ctx
  73851. return c
  73852. }
  73853. // Header returns an http.Header that can be modified by the caller to
  73854. // add HTTP headers to the request.
  73855. func (c *RegionDiskTypesGetCall) Header() http.Header {
  73856. if c.header_ == nil {
  73857. c.header_ = make(http.Header)
  73858. }
  73859. return c.header_
  73860. }
  73861. func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) {
  73862. reqHeaders := make(http.Header)
  73863. for k, v := range c.header_ {
  73864. reqHeaders[k] = v
  73865. }
  73866. reqHeaders.Set("User-Agent", c.s.userAgent())
  73867. if c.ifNoneMatch_ != "" {
  73868. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  73869. }
  73870. var body io.Reader = nil
  73871. c.urlParams_.Set("alt", alt)
  73872. c.urlParams_.Set("prettyPrint", "false")
  73873. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes/{diskType}")
  73874. urls += "?" + c.urlParams_.Encode()
  73875. req, err := http.NewRequest("GET", urls, body)
  73876. if err != nil {
  73877. return nil, err
  73878. }
  73879. req.Header = reqHeaders
  73880. googleapi.Expand(req.URL, map[string]string{
  73881. "project": c.project,
  73882. "region": c.region,
  73883. "diskType": c.diskType,
  73884. })
  73885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  73886. }
  73887. // Do executes the "compute.regionDiskTypes.get" call.
  73888. // Exactly one of *DiskType or error will be non-nil. Any non-2xx status
  73889. // code is an error. Response headers are in either
  73890. // *DiskType.ServerResponse.Header or (if a response was returned at
  73891. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  73892. // to check whether the returned error was because
  73893. // http.StatusNotModified was returned.
  73894. func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) {
  73895. gensupport.SetOptions(c.urlParams_, opts...)
  73896. res, err := c.doRequest("json")
  73897. if res != nil && res.StatusCode == http.StatusNotModified {
  73898. if res.Body != nil {
  73899. res.Body.Close()
  73900. }
  73901. return nil, &googleapi.Error{
  73902. Code: res.StatusCode,
  73903. Header: res.Header,
  73904. }
  73905. }
  73906. if err != nil {
  73907. return nil, err
  73908. }
  73909. defer googleapi.CloseBody(res)
  73910. if err := googleapi.CheckResponse(res); err != nil {
  73911. return nil, err
  73912. }
  73913. ret := &DiskType{
  73914. ServerResponse: googleapi.ServerResponse{
  73915. Header: res.Header,
  73916. HTTPStatusCode: res.StatusCode,
  73917. },
  73918. }
  73919. target := &ret
  73920. if err := gensupport.DecodeResponse(target, res); err != nil {
  73921. return nil, err
  73922. }
  73923. return ret, nil
  73924. // {
  73925. // "description": "Returns the specified regional disk type. Gets a list of available disk types by making a list() request.",
  73926. // "httpMethod": "GET",
  73927. // "id": "compute.regionDiskTypes.get",
  73928. // "parameterOrder": [
  73929. // "project",
  73930. // "region",
  73931. // "diskType"
  73932. // ],
  73933. // "parameters": {
  73934. // "diskType": {
  73935. // "description": "Name of the disk type to return.",
  73936. // "location": "path",
  73937. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  73938. // "required": true,
  73939. // "type": "string"
  73940. // },
  73941. // "project": {
  73942. // "description": "Project ID for this request.",
  73943. // "location": "path",
  73944. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  73945. // "required": true,
  73946. // "type": "string"
  73947. // },
  73948. // "region": {
  73949. // "description": "The name of the region for this request.",
  73950. // "location": "path",
  73951. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  73952. // "required": true,
  73953. // "type": "string"
  73954. // }
  73955. // },
  73956. // "path": "{project}/regions/{region}/diskTypes/{diskType}",
  73957. // "response": {
  73958. // "$ref": "DiskType"
  73959. // },
  73960. // "scopes": [
  73961. // "https://www.googleapis.com/auth/cloud-platform",
  73962. // "https://www.googleapis.com/auth/compute",
  73963. // "https://www.googleapis.com/auth/compute.readonly"
  73964. // ]
  73965. // }
  73966. }
  73967. // method id "compute.regionDiskTypes.list":
  73968. type RegionDiskTypesListCall struct {
  73969. s *Service
  73970. project string
  73971. region string
  73972. urlParams_ gensupport.URLParams
  73973. ifNoneMatch_ string
  73974. ctx_ context.Context
  73975. header_ http.Header
  73976. }
  73977. // List: Retrieves a list of regional disk types available to the
  73978. // specified project.
  73979. func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall {
  73980. c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  73981. c.project = project
  73982. c.region = region
  73983. return c
  73984. }
  73985. // Filter sets the optional parameter "filter": A filter expression that
  73986. // filters resources listed in the response. The expression must specify
  73987. // the field name, a comparison operator, and the value that you want to
  73988. // use for filtering. The value must be a string, a number, or a
  73989. // boolean. The comparison operator must be either =, !=, >, or <.
  73990. //
  73991. // For example, if you are filtering Compute Engine instances, you can
  73992. // exclude instances named example-instance by specifying name !=
  73993. // example-instance.
  73994. //
  73995. // You can also filter nested fields. For example, you could specify
  73996. // scheduling.automaticRestart = false to include instances only if they
  73997. // are not scheduled for automatic restarts. You can use filtering on
  73998. // nested fields to filter based on resource labels.
  73999. //
  74000. // To filter on multiple expressions, provide each separate expression
  74001. // within parentheses. For example, (scheduling.automaticRestart = true)
  74002. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74003. // AND expression. However, you can include AND and OR expressions
  74004. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74005. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74006. // true).
  74007. func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall {
  74008. c.urlParams_.Set("filter", filter)
  74009. return c
  74010. }
  74011. // MaxResults sets the optional parameter "maxResults": The maximum
  74012. // number of results per page that should be returned. If the number of
  74013. // available results is larger than maxResults, Compute Engine returns a
  74014. // nextPageToken that can be used to get the next page of results in
  74015. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74016. // (Default: 500)
  74017. func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall {
  74018. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74019. return c
  74020. }
  74021. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74022. // a certain order. By default, results are returned in alphanumerical
  74023. // order based on the resource name.
  74024. //
  74025. // You can also sort results in descending order based on the creation
  74026. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74027. // based on the creationTimestamp field in reverse chronological order
  74028. // (newest result first). Use this to sort resources like operations so
  74029. // that the newest operation is returned first.
  74030. //
  74031. // Currently, only sorting by name or creationTimestamp desc is
  74032. // supported.
  74033. func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall {
  74034. c.urlParams_.Set("orderBy", orderBy)
  74035. return c
  74036. }
  74037. // PageToken sets the optional parameter "pageToken": Specifies a page
  74038. // token to use. Set pageToken to the nextPageToken returned by a
  74039. // previous list request to get the next page of results.
  74040. func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall {
  74041. c.urlParams_.Set("pageToken", pageToken)
  74042. return c
  74043. }
  74044. // Fields allows partial responses to be retrieved. See
  74045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74046. // for more information.
  74047. func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall {
  74048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74049. return c
  74050. }
  74051. // IfNoneMatch sets the optional parameter which makes the operation
  74052. // fail if the object's ETag matches the given value. This is useful for
  74053. // getting updates only after the object has changed since the last
  74054. // request. Use googleapi.IsNotModified to check whether the response
  74055. // error from Do is the result of In-None-Match.
  74056. func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall {
  74057. c.ifNoneMatch_ = entityTag
  74058. return c
  74059. }
  74060. // Context sets the context to be used in this call's Do method. Any
  74061. // pending HTTP request will be aborted if the provided context is
  74062. // canceled.
  74063. func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall {
  74064. c.ctx_ = ctx
  74065. return c
  74066. }
  74067. // Header returns an http.Header that can be modified by the caller to
  74068. // add HTTP headers to the request.
  74069. func (c *RegionDiskTypesListCall) Header() http.Header {
  74070. if c.header_ == nil {
  74071. c.header_ = make(http.Header)
  74072. }
  74073. return c.header_
  74074. }
  74075. func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) {
  74076. reqHeaders := make(http.Header)
  74077. for k, v := range c.header_ {
  74078. reqHeaders[k] = v
  74079. }
  74080. reqHeaders.Set("User-Agent", c.s.userAgent())
  74081. if c.ifNoneMatch_ != "" {
  74082. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74083. }
  74084. var body io.Reader = nil
  74085. c.urlParams_.Set("alt", alt)
  74086. c.urlParams_.Set("prettyPrint", "false")
  74087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/diskTypes")
  74088. urls += "?" + c.urlParams_.Encode()
  74089. req, err := http.NewRequest("GET", urls, body)
  74090. if err != nil {
  74091. return nil, err
  74092. }
  74093. req.Header = reqHeaders
  74094. googleapi.Expand(req.URL, map[string]string{
  74095. "project": c.project,
  74096. "region": c.region,
  74097. })
  74098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74099. }
  74100. // Do executes the "compute.regionDiskTypes.list" call.
  74101. // Exactly one of *RegionDiskTypeList or error will be non-nil. Any
  74102. // non-2xx status code is an error. Response headers are in either
  74103. // *RegionDiskTypeList.ServerResponse.Header or (if a response was
  74104. // returned at all) in error.(*googleapi.Error).Header. Use
  74105. // googleapi.IsNotModified to check whether the returned error was
  74106. // because http.StatusNotModified was returned.
  74107. func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) {
  74108. gensupport.SetOptions(c.urlParams_, opts...)
  74109. res, err := c.doRequest("json")
  74110. if res != nil && res.StatusCode == http.StatusNotModified {
  74111. if res.Body != nil {
  74112. res.Body.Close()
  74113. }
  74114. return nil, &googleapi.Error{
  74115. Code: res.StatusCode,
  74116. Header: res.Header,
  74117. }
  74118. }
  74119. if err != nil {
  74120. return nil, err
  74121. }
  74122. defer googleapi.CloseBody(res)
  74123. if err := googleapi.CheckResponse(res); err != nil {
  74124. return nil, err
  74125. }
  74126. ret := &RegionDiskTypeList{
  74127. ServerResponse: googleapi.ServerResponse{
  74128. Header: res.Header,
  74129. HTTPStatusCode: res.StatusCode,
  74130. },
  74131. }
  74132. target := &ret
  74133. if err := gensupport.DecodeResponse(target, res); err != nil {
  74134. return nil, err
  74135. }
  74136. return ret, nil
  74137. // {
  74138. // "description": "Retrieves a list of regional disk types available to the specified project.",
  74139. // "httpMethod": "GET",
  74140. // "id": "compute.regionDiskTypes.list",
  74141. // "parameterOrder": [
  74142. // "project",
  74143. // "region"
  74144. // ],
  74145. // "parameters": {
  74146. // "filter": {
  74147. // "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).",
  74148. // "location": "query",
  74149. // "type": "string"
  74150. // },
  74151. // "maxResults": {
  74152. // "default": "500",
  74153. // "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)",
  74154. // "format": "uint32",
  74155. // "location": "query",
  74156. // "minimum": "0",
  74157. // "type": "integer"
  74158. // },
  74159. // "orderBy": {
  74160. // "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.",
  74161. // "location": "query",
  74162. // "type": "string"
  74163. // },
  74164. // "pageToken": {
  74165. // "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.",
  74166. // "location": "query",
  74167. // "type": "string"
  74168. // },
  74169. // "project": {
  74170. // "description": "Project ID for this request.",
  74171. // "location": "path",
  74172. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74173. // "required": true,
  74174. // "type": "string"
  74175. // },
  74176. // "region": {
  74177. // "description": "The name of the region for this request.",
  74178. // "location": "path",
  74179. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74180. // "required": true,
  74181. // "type": "string"
  74182. // }
  74183. // },
  74184. // "path": "{project}/regions/{region}/diskTypes",
  74185. // "response": {
  74186. // "$ref": "RegionDiskTypeList"
  74187. // },
  74188. // "scopes": [
  74189. // "https://www.googleapis.com/auth/cloud-platform",
  74190. // "https://www.googleapis.com/auth/compute",
  74191. // "https://www.googleapis.com/auth/compute.readonly"
  74192. // ]
  74193. // }
  74194. }
  74195. // Pages invokes f for each page of results.
  74196. // A non-nil error returned from f will halt the iteration.
  74197. // The provided context supersedes any context provided to the Context method.
  74198. func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error {
  74199. c.ctx_ = ctx
  74200. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  74201. for {
  74202. x, err := c.Do()
  74203. if err != nil {
  74204. return err
  74205. }
  74206. if err := f(x); err != nil {
  74207. return err
  74208. }
  74209. if x.NextPageToken == "" {
  74210. return nil
  74211. }
  74212. c.PageToken(x.NextPageToken)
  74213. }
  74214. }
  74215. // method id "compute.regionDisks.createSnapshot":
  74216. type RegionDisksCreateSnapshotCall struct {
  74217. s *Service
  74218. project string
  74219. region string
  74220. disk string
  74221. snapshot *Snapshot
  74222. urlParams_ gensupport.URLParams
  74223. ctx_ context.Context
  74224. header_ http.Header
  74225. }
  74226. // CreateSnapshot: Creates a snapshot of this regional disk.
  74227. func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall {
  74228. c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74229. c.project = project
  74230. c.region = region
  74231. c.disk = disk
  74232. c.snapshot = snapshot
  74233. return c
  74234. }
  74235. // RequestId sets the optional parameter "requestId": An optional
  74236. // request ID to identify requests. Specify a unique request ID so that
  74237. // if you must retry your request, the server will know to ignore the
  74238. // request if it has already been completed.
  74239. //
  74240. // For example, consider a situation where you make an initial request
  74241. // and the request times out. If you make the request again with the
  74242. // same request ID, the server can check if original operation with the
  74243. // same request ID was received, and if so, will ignore the second
  74244. // request. This prevents clients from accidentally creating duplicate
  74245. // commitments.
  74246. //
  74247. // The request ID must be a valid UUID with the exception that zero UUID
  74248. // is not supported (00000000-0000-0000-0000-000000000000).
  74249. func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall {
  74250. c.urlParams_.Set("requestId", requestId)
  74251. return c
  74252. }
  74253. // Fields allows partial responses to be retrieved. See
  74254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74255. // for more information.
  74256. func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall {
  74257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74258. return c
  74259. }
  74260. // Context sets the context to be used in this call's Do method. Any
  74261. // pending HTTP request will be aborted if the provided context is
  74262. // canceled.
  74263. func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall {
  74264. c.ctx_ = ctx
  74265. return c
  74266. }
  74267. // Header returns an http.Header that can be modified by the caller to
  74268. // add HTTP headers to the request.
  74269. func (c *RegionDisksCreateSnapshotCall) Header() http.Header {
  74270. if c.header_ == nil {
  74271. c.header_ = make(http.Header)
  74272. }
  74273. return c.header_
  74274. }
  74275. func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) {
  74276. reqHeaders := make(http.Header)
  74277. for k, v := range c.header_ {
  74278. reqHeaders[k] = v
  74279. }
  74280. reqHeaders.Set("User-Agent", c.s.userAgent())
  74281. var body io.Reader = nil
  74282. body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot)
  74283. if err != nil {
  74284. return nil, err
  74285. }
  74286. reqHeaders.Set("Content-Type", "application/json")
  74287. c.urlParams_.Set("alt", alt)
  74288. c.urlParams_.Set("prettyPrint", "false")
  74289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/createSnapshot")
  74290. urls += "?" + c.urlParams_.Encode()
  74291. req, err := http.NewRequest("POST", urls, body)
  74292. if err != nil {
  74293. return nil, err
  74294. }
  74295. req.Header = reqHeaders
  74296. googleapi.Expand(req.URL, map[string]string{
  74297. "project": c.project,
  74298. "region": c.region,
  74299. "disk": c.disk,
  74300. })
  74301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74302. }
  74303. // Do executes the "compute.regionDisks.createSnapshot" call.
  74304. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74305. // status code is an error. Response headers are in either
  74306. // *Operation.ServerResponse.Header or (if a response was returned at
  74307. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74308. // to check whether the returned error was because
  74309. // http.StatusNotModified was returned.
  74310. func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74311. gensupport.SetOptions(c.urlParams_, opts...)
  74312. res, err := c.doRequest("json")
  74313. if res != nil && res.StatusCode == http.StatusNotModified {
  74314. if res.Body != nil {
  74315. res.Body.Close()
  74316. }
  74317. return nil, &googleapi.Error{
  74318. Code: res.StatusCode,
  74319. Header: res.Header,
  74320. }
  74321. }
  74322. if err != nil {
  74323. return nil, err
  74324. }
  74325. defer googleapi.CloseBody(res)
  74326. if err := googleapi.CheckResponse(res); err != nil {
  74327. return nil, err
  74328. }
  74329. ret := &Operation{
  74330. ServerResponse: googleapi.ServerResponse{
  74331. Header: res.Header,
  74332. HTTPStatusCode: res.StatusCode,
  74333. },
  74334. }
  74335. target := &ret
  74336. if err := gensupport.DecodeResponse(target, res); err != nil {
  74337. return nil, err
  74338. }
  74339. return ret, nil
  74340. // {
  74341. // "description": "Creates a snapshot of this regional disk.",
  74342. // "httpMethod": "POST",
  74343. // "id": "compute.regionDisks.createSnapshot",
  74344. // "parameterOrder": [
  74345. // "project",
  74346. // "region",
  74347. // "disk"
  74348. // ],
  74349. // "parameters": {
  74350. // "disk": {
  74351. // "description": "Name of the regional persistent disk to snapshot.",
  74352. // "location": "path",
  74353. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74354. // "required": true,
  74355. // "type": "string"
  74356. // },
  74357. // "project": {
  74358. // "description": "Project ID for this request.",
  74359. // "location": "path",
  74360. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74361. // "required": true,
  74362. // "type": "string"
  74363. // },
  74364. // "region": {
  74365. // "description": "Name of the region for this request.",
  74366. // "location": "path",
  74367. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74368. // "required": true,
  74369. // "type": "string"
  74370. // },
  74371. // "requestId": {
  74372. // "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).",
  74373. // "location": "query",
  74374. // "type": "string"
  74375. // }
  74376. // },
  74377. // "path": "{project}/regions/{region}/disks/{disk}/createSnapshot",
  74378. // "request": {
  74379. // "$ref": "Snapshot"
  74380. // },
  74381. // "response": {
  74382. // "$ref": "Operation"
  74383. // },
  74384. // "scopes": [
  74385. // "https://www.googleapis.com/auth/cloud-platform",
  74386. // "https://www.googleapis.com/auth/compute"
  74387. // ]
  74388. // }
  74389. }
  74390. // method id "compute.regionDisks.delete":
  74391. type RegionDisksDeleteCall struct {
  74392. s *Service
  74393. project string
  74394. region string
  74395. disk string
  74396. urlParams_ gensupport.URLParams
  74397. ctx_ context.Context
  74398. header_ http.Header
  74399. }
  74400. // Delete: Deletes the specified regional persistent disk. Deleting a
  74401. // regional disk removes all the replicas of its data permanently and is
  74402. // irreversible. However, deleting a disk does not delete any snapshots
  74403. // previously made from the disk. You must separately delete snapshots.
  74404. func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall {
  74405. c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74406. c.project = project
  74407. c.region = region
  74408. c.disk = disk
  74409. return c
  74410. }
  74411. // RequestId sets the optional parameter "requestId": An optional
  74412. // request ID to identify requests. Specify a unique request ID so that
  74413. // if you must retry your request, the server will know to ignore the
  74414. // request if it has already been completed.
  74415. //
  74416. // For example, consider a situation where you make an initial request
  74417. // and the request times out. If you make the request again with the
  74418. // same request ID, the server can check if original operation with the
  74419. // same request ID was received, and if so, will ignore the second
  74420. // request. This prevents clients from accidentally creating duplicate
  74421. // commitments.
  74422. //
  74423. // The request ID must be a valid UUID with the exception that zero UUID
  74424. // is not supported (00000000-0000-0000-0000-000000000000).
  74425. func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall {
  74426. c.urlParams_.Set("requestId", requestId)
  74427. return c
  74428. }
  74429. // Fields allows partial responses to be retrieved. See
  74430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74431. // for more information.
  74432. func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall {
  74433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74434. return c
  74435. }
  74436. // Context sets the context to be used in this call's Do method. Any
  74437. // pending HTTP request will be aborted if the provided context is
  74438. // canceled.
  74439. func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall {
  74440. c.ctx_ = ctx
  74441. return c
  74442. }
  74443. // Header returns an http.Header that can be modified by the caller to
  74444. // add HTTP headers to the request.
  74445. func (c *RegionDisksDeleteCall) Header() http.Header {
  74446. if c.header_ == nil {
  74447. c.header_ = make(http.Header)
  74448. }
  74449. return c.header_
  74450. }
  74451. func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) {
  74452. reqHeaders := make(http.Header)
  74453. for k, v := range c.header_ {
  74454. reqHeaders[k] = v
  74455. }
  74456. reqHeaders.Set("User-Agent", c.s.userAgent())
  74457. var body io.Reader = nil
  74458. c.urlParams_.Set("alt", alt)
  74459. c.urlParams_.Set("prettyPrint", "false")
  74460. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  74461. urls += "?" + c.urlParams_.Encode()
  74462. req, err := http.NewRequest("DELETE", urls, body)
  74463. if err != nil {
  74464. return nil, err
  74465. }
  74466. req.Header = reqHeaders
  74467. googleapi.Expand(req.URL, map[string]string{
  74468. "project": c.project,
  74469. "region": c.region,
  74470. "disk": c.disk,
  74471. })
  74472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74473. }
  74474. // Do executes the "compute.regionDisks.delete" call.
  74475. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74476. // status code is an error. Response headers are in either
  74477. // *Operation.ServerResponse.Header or (if a response was returned at
  74478. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74479. // to check whether the returned error was because
  74480. // http.StatusNotModified was returned.
  74481. func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74482. gensupport.SetOptions(c.urlParams_, opts...)
  74483. res, err := c.doRequest("json")
  74484. if res != nil && res.StatusCode == http.StatusNotModified {
  74485. if res.Body != nil {
  74486. res.Body.Close()
  74487. }
  74488. return nil, &googleapi.Error{
  74489. Code: res.StatusCode,
  74490. Header: res.Header,
  74491. }
  74492. }
  74493. if err != nil {
  74494. return nil, err
  74495. }
  74496. defer googleapi.CloseBody(res)
  74497. if err := googleapi.CheckResponse(res); err != nil {
  74498. return nil, err
  74499. }
  74500. ret := &Operation{
  74501. ServerResponse: googleapi.ServerResponse{
  74502. Header: res.Header,
  74503. HTTPStatusCode: res.StatusCode,
  74504. },
  74505. }
  74506. target := &ret
  74507. if err := gensupport.DecodeResponse(target, res); err != nil {
  74508. return nil, err
  74509. }
  74510. return ret, nil
  74511. // {
  74512. // "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.",
  74513. // "httpMethod": "DELETE",
  74514. // "id": "compute.regionDisks.delete",
  74515. // "parameterOrder": [
  74516. // "project",
  74517. // "region",
  74518. // "disk"
  74519. // ],
  74520. // "parameters": {
  74521. // "disk": {
  74522. // "description": "Name of the regional persistent disk to delete.",
  74523. // "location": "path",
  74524. // "required": true,
  74525. // "type": "string"
  74526. // },
  74527. // "project": {
  74528. // "description": "Project ID for this request.",
  74529. // "location": "path",
  74530. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74531. // "required": true,
  74532. // "type": "string"
  74533. // },
  74534. // "region": {
  74535. // "description": "Name of the region for this request.",
  74536. // "location": "path",
  74537. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74538. // "required": true,
  74539. // "type": "string"
  74540. // },
  74541. // "requestId": {
  74542. // "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).",
  74543. // "location": "query",
  74544. // "type": "string"
  74545. // }
  74546. // },
  74547. // "path": "{project}/regions/{region}/disks/{disk}",
  74548. // "response": {
  74549. // "$ref": "Operation"
  74550. // },
  74551. // "scopes": [
  74552. // "https://www.googleapis.com/auth/cloud-platform",
  74553. // "https://www.googleapis.com/auth/compute"
  74554. // ]
  74555. // }
  74556. }
  74557. // method id "compute.regionDisks.get":
  74558. type RegionDisksGetCall struct {
  74559. s *Service
  74560. project string
  74561. region string
  74562. disk string
  74563. urlParams_ gensupport.URLParams
  74564. ifNoneMatch_ string
  74565. ctx_ context.Context
  74566. header_ http.Header
  74567. }
  74568. // Get: Returns a specified regional persistent disk.
  74569. func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall {
  74570. c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74571. c.project = project
  74572. c.region = region
  74573. c.disk = disk
  74574. return c
  74575. }
  74576. // Fields allows partial responses to be retrieved. See
  74577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74578. // for more information.
  74579. func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall {
  74580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74581. return c
  74582. }
  74583. // IfNoneMatch sets the optional parameter which makes the operation
  74584. // fail if the object's ETag matches the given value. This is useful for
  74585. // getting updates only after the object has changed since the last
  74586. // request. Use googleapi.IsNotModified to check whether the response
  74587. // error from Do is the result of In-None-Match.
  74588. func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall {
  74589. c.ifNoneMatch_ = entityTag
  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 *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall {
  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 *RegionDisksGetCall) Header() http.Header {
  74602. if c.header_ == nil {
  74603. c.header_ = make(http.Header)
  74604. }
  74605. return c.header_
  74606. }
  74607. func (c *RegionDisksGetCall) 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. if c.ifNoneMatch_ != "" {
  74614. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  74615. }
  74616. var body io.Reader = nil
  74617. c.urlParams_.Set("alt", alt)
  74618. c.urlParams_.Set("prettyPrint", "false")
  74619. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}")
  74620. urls += "?" + c.urlParams_.Encode()
  74621. req, err := http.NewRequest("GET", urls, body)
  74622. if err != nil {
  74623. return nil, err
  74624. }
  74625. req.Header = reqHeaders
  74626. googleapi.Expand(req.URL, map[string]string{
  74627. "project": c.project,
  74628. "region": c.region,
  74629. "disk": c.disk,
  74630. })
  74631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74632. }
  74633. // Do executes the "compute.regionDisks.get" call.
  74634. // Exactly one of *Disk or error will be non-nil. Any non-2xx status
  74635. // code is an error. Response headers are in either
  74636. // *Disk.ServerResponse.Header or (if a response was returned at all) in
  74637. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  74638. // whether the returned error was because http.StatusNotModified was
  74639. // returned.
  74640. func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) {
  74641. gensupport.SetOptions(c.urlParams_, opts...)
  74642. res, err := c.doRequest("json")
  74643. if res != nil && res.StatusCode == http.StatusNotModified {
  74644. if res.Body != nil {
  74645. res.Body.Close()
  74646. }
  74647. return nil, &googleapi.Error{
  74648. Code: res.StatusCode,
  74649. Header: res.Header,
  74650. }
  74651. }
  74652. if err != nil {
  74653. return nil, err
  74654. }
  74655. defer googleapi.CloseBody(res)
  74656. if err := googleapi.CheckResponse(res); err != nil {
  74657. return nil, err
  74658. }
  74659. ret := &Disk{
  74660. ServerResponse: googleapi.ServerResponse{
  74661. Header: res.Header,
  74662. HTTPStatusCode: res.StatusCode,
  74663. },
  74664. }
  74665. target := &ret
  74666. if err := gensupport.DecodeResponse(target, res); err != nil {
  74667. return nil, err
  74668. }
  74669. return ret, nil
  74670. // {
  74671. // "description": "Returns a specified regional persistent disk.",
  74672. // "httpMethod": "GET",
  74673. // "id": "compute.regionDisks.get",
  74674. // "parameterOrder": [
  74675. // "project",
  74676. // "region",
  74677. // "disk"
  74678. // ],
  74679. // "parameters": {
  74680. // "disk": {
  74681. // "description": "Name of the regional persistent disk to return.",
  74682. // "location": "path",
  74683. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  74684. // "required": true,
  74685. // "type": "string"
  74686. // },
  74687. // "project": {
  74688. // "description": "Project ID for this request.",
  74689. // "location": "path",
  74690. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74691. // "required": true,
  74692. // "type": "string"
  74693. // },
  74694. // "region": {
  74695. // "description": "Name of the region for this request.",
  74696. // "location": "path",
  74697. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74698. // "required": true,
  74699. // "type": "string"
  74700. // }
  74701. // },
  74702. // "path": "{project}/regions/{region}/disks/{disk}",
  74703. // "response": {
  74704. // "$ref": "Disk"
  74705. // },
  74706. // "scopes": [
  74707. // "https://www.googleapis.com/auth/cloud-platform",
  74708. // "https://www.googleapis.com/auth/compute",
  74709. // "https://www.googleapis.com/auth/compute.readonly"
  74710. // ]
  74711. // }
  74712. }
  74713. // method id "compute.regionDisks.insert":
  74714. type RegionDisksInsertCall struct {
  74715. s *Service
  74716. project string
  74717. region string
  74718. disk *Disk
  74719. urlParams_ gensupport.URLParams
  74720. ctx_ context.Context
  74721. header_ http.Header
  74722. }
  74723. // Insert: Creates a persistent regional disk in the specified project
  74724. // using the data included in the request.
  74725. func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall {
  74726. c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74727. c.project = project
  74728. c.region = region
  74729. c.disk = disk
  74730. return c
  74731. }
  74732. // RequestId sets the optional parameter "requestId": An optional
  74733. // request ID to identify requests. Specify a unique request ID so that
  74734. // if you must retry your request, the server will know to ignore the
  74735. // request if it has already been completed.
  74736. //
  74737. // For example, consider a situation where you make an initial request
  74738. // and the request times out. If you make the request again with the
  74739. // same request ID, the server can check if original operation with the
  74740. // same request ID was received, and if so, will ignore the second
  74741. // request. This prevents clients from accidentally creating duplicate
  74742. // commitments.
  74743. //
  74744. // The request ID must be a valid UUID with the exception that zero UUID
  74745. // is not supported (00000000-0000-0000-0000-000000000000).
  74746. func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall {
  74747. c.urlParams_.Set("requestId", requestId)
  74748. return c
  74749. }
  74750. // SourceImage sets the optional parameter "sourceImage": Source image
  74751. // to restore onto a disk.
  74752. func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall {
  74753. c.urlParams_.Set("sourceImage", sourceImage)
  74754. return c
  74755. }
  74756. // Fields allows partial responses to be retrieved. See
  74757. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74758. // for more information.
  74759. func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall {
  74760. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74761. return c
  74762. }
  74763. // Context sets the context to be used in this call's Do method. Any
  74764. // pending HTTP request will be aborted if the provided context is
  74765. // canceled.
  74766. func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall {
  74767. c.ctx_ = ctx
  74768. return c
  74769. }
  74770. // Header returns an http.Header that can be modified by the caller to
  74771. // add HTTP headers to the request.
  74772. func (c *RegionDisksInsertCall) Header() http.Header {
  74773. if c.header_ == nil {
  74774. c.header_ = make(http.Header)
  74775. }
  74776. return c.header_
  74777. }
  74778. func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) {
  74779. reqHeaders := make(http.Header)
  74780. for k, v := range c.header_ {
  74781. reqHeaders[k] = v
  74782. }
  74783. reqHeaders.Set("User-Agent", c.s.userAgent())
  74784. var body io.Reader = nil
  74785. body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk)
  74786. if err != nil {
  74787. return nil, err
  74788. }
  74789. reqHeaders.Set("Content-Type", "application/json")
  74790. c.urlParams_.Set("alt", alt)
  74791. c.urlParams_.Set("prettyPrint", "false")
  74792. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  74793. urls += "?" + c.urlParams_.Encode()
  74794. req, err := http.NewRequest("POST", urls, body)
  74795. if err != nil {
  74796. return nil, err
  74797. }
  74798. req.Header = reqHeaders
  74799. googleapi.Expand(req.URL, map[string]string{
  74800. "project": c.project,
  74801. "region": c.region,
  74802. })
  74803. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  74804. }
  74805. // Do executes the "compute.regionDisks.insert" call.
  74806. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  74807. // status code is an error. Response headers are in either
  74808. // *Operation.ServerResponse.Header or (if a response was returned at
  74809. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  74810. // to check whether the returned error was because
  74811. // http.StatusNotModified was returned.
  74812. func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  74813. gensupport.SetOptions(c.urlParams_, opts...)
  74814. res, err := c.doRequest("json")
  74815. if res != nil && res.StatusCode == http.StatusNotModified {
  74816. if res.Body != nil {
  74817. res.Body.Close()
  74818. }
  74819. return nil, &googleapi.Error{
  74820. Code: res.StatusCode,
  74821. Header: res.Header,
  74822. }
  74823. }
  74824. if err != nil {
  74825. return nil, err
  74826. }
  74827. defer googleapi.CloseBody(res)
  74828. if err := googleapi.CheckResponse(res); err != nil {
  74829. return nil, err
  74830. }
  74831. ret := &Operation{
  74832. ServerResponse: googleapi.ServerResponse{
  74833. Header: res.Header,
  74834. HTTPStatusCode: res.StatusCode,
  74835. },
  74836. }
  74837. target := &ret
  74838. if err := gensupport.DecodeResponse(target, res); err != nil {
  74839. return nil, err
  74840. }
  74841. return ret, nil
  74842. // {
  74843. // "description": "Creates a persistent regional disk in the specified project using the data included in the request.",
  74844. // "httpMethod": "POST",
  74845. // "id": "compute.regionDisks.insert",
  74846. // "parameterOrder": [
  74847. // "project",
  74848. // "region"
  74849. // ],
  74850. // "parameters": {
  74851. // "project": {
  74852. // "description": "Project ID for this request.",
  74853. // "location": "path",
  74854. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  74855. // "required": true,
  74856. // "type": "string"
  74857. // },
  74858. // "region": {
  74859. // "description": "Name of the region for this request.",
  74860. // "location": "path",
  74861. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  74862. // "required": true,
  74863. // "type": "string"
  74864. // },
  74865. // "requestId": {
  74866. // "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).",
  74867. // "location": "query",
  74868. // "type": "string"
  74869. // },
  74870. // "sourceImage": {
  74871. // "description": "Optional. Source image to restore onto a disk.",
  74872. // "location": "query",
  74873. // "type": "string"
  74874. // }
  74875. // },
  74876. // "path": "{project}/regions/{region}/disks",
  74877. // "request": {
  74878. // "$ref": "Disk"
  74879. // },
  74880. // "response": {
  74881. // "$ref": "Operation"
  74882. // },
  74883. // "scopes": [
  74884. // "https://www.googleapis.com/auth/cloud-platform",
  74885. // "https://www.googleapis.com/auth/compute"
  74886. // ]
  74887. // }
  74888. }
  74889. // method id "compute.regionDisks.list":
  74890. type RegionDisksListCall struct {
  74891. s *Service
  74892. project string
  74893. region string
  74894. urlParams_ gensupport.URLParams
  74895. ifNoneMatch_ string
  74896. ctx_ context.Context
  74897. header_ http.Header
  74898. }
  74899. // List: Retrieves the list of persistent disks contained within the
  74900. // specified region.
  74901. func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall {
  74902. c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  74903. c.project = project
  74904. c.region = region
  74905. return c
  74906. }
  74907. // Filter sets the optional parameter "filter": A filter expression that
  74908. // filters resources listed in the response. The expression must specify
  74909. // the field name, a comparison operator, and the value that you want to
  74910. // use for filtering. The value must be a string, a number, or a
  74911. // boolean. The comparison operator must be either =, !=, >, or <.
  74912. //
  74913. // For example, if you are filtering Compute Engine instances, you can
  74914. // exclude instances named example-instance by specifying name !=
  74915. // example-instance.
  74916. //
  74917. // You can also filter nested fields. For example, you could specify
  74918. // scheduling.automaticRestart = false to include instances only if they
  74919. // are not scheduled for automatic restarts. You can use filtering on
  74920. // nested fields to filter based on resource labels.
  74921. //
  74922. // To filter on multiple expressions, provide each separate expression
  74923. // within parentheses. For example, (scheduling.automaticRestart = true)
  74924. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  74925. // AND expression. However, you can include AND and OR expressions
  74926. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  74927. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  74928. // true).
  74929. func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall {
  74930. c.urlParams_.Set("filter", filter)
  74931. return c
  74932. }
  74933. // MaxResults sets the optional parameter "maxResults": The maximum
  74934. // number of results per page that should be returned. If the number of
  74935. // available results is larger than maxResults, Compute Engine returns a
  74936. // nextPageToken that can be used to get the next page of results in
  74937. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  74938. // (Default: 500)
  74939. func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall {
  74940. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  74941. return c
  74942. }
  74943. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  74944. // a certain order. By default, results are returned in alphanumerical
  74945. // order based on the resource name.
  74946. //
  74947. // You can also sort results in descending order based on the creation
  74948. // timestamp using orderBy="creationTimestamp desc". This sorts results
  74949. // based on the creationTimestamp field in reverse chronological order
  74950. // (newest result first). Use this to sort resources like operations so
  74951. // that the newest operation is returned first.
  74952. //
  74953. // Currently, only sorting by name or creationTimestamp desc is
  74954. // supported.
  74955. func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall {
  74956. c.urlParams_.Set("orderBy", orderBy)
  74957. return c
  74958. }
  74959. // PageToken sets the optional parameter "pageToken": Specifies a page
  74960. // token to use. Set pageToken to the nextPageToken returned by a
  74961. // previous list request to get the next page of results.
  74962. func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall {
  74963. c.urlParams_.Set("pageToken", pageToken)
  74964. return c
  74965. }
  74966. // Fields allows partial responses to be retrieved. See
  74967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  74968. // for more information.
  74969. func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall {
  74970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  74971. return c
  74972. }
  74973. // IfNoneMatch sets the optional parameter which makes the operation
  74974. // fail if the object's ETag matches the given value. This is useful for
  74975. // getting updates only after the object has changed since the last
  74976. // request. Use googleapi.IsNotModified to check whether the response
  74977. // error from Do is the result of In-None-Match.
  74978. func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall {
  74979. c.ifNoneMatch_ = entityTag
  74980. return c
  74981. }
  74982. // Context sets the context to be used in this call's Do method. Any
  74983. // pending HTTP request will be aborted if the provided context is
  74984. // canceled.
  74985. func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall {
  74986. c.ctx_ = ctx
  74987. return c
  74988. }
  74989. // Header returns an http.Header that can be modified by the caller to
  74990. // add HTTP headers to the request.
  74991. func (c *RegionDisksListCall) Header() http.Header {
  74992. if c.header_ == nil {
  74993. c.header_ = make(http.Header)
  74994. }
  74995. return c.header_
  74996. }
  74997. func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) {
  74998. reqHeaders := make(http.Header)
  74999. for k, v := range c.header_ {
  75000. reqHeaders[k] = v
  75001. }
  75002. reqHeaders.Set("User-Agent", c.s.userAgent())
  75003. if c.ifNoneMatch_ != "" {
  75004. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  75005. }
  75006. var body io.Reader = nil
  75007. c.urlParams_.Set("alt", alt)
  75008. c.urlParams_.Set("prettyPrint", "false")
  75009. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks")
  75010. urls += "?" + c.urlParams_.Encode()
  75011. req, err := http.NewRequest("GET", urls, body)
  75012. if err != nil {
  75013. return nil, err
  75014. }
  75015. req.Header = reqHeaders
  75016. googleapi.Expand(req.URL, map[string]string{
  75017. "project": c.project,
  75018. "region": c.region,
  75019. })
  75020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75021. }
  75022. // Do executes the "compute.regionDisks.list" call.
  75023. // Exactly one of *DiskList or error will be non-nil. Any non-2xx status
  75024. // code is an error. Response headers are in either
  75025. // *DiskList.ServerResponse.Header or (if a response was returned at
  75026. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75027. // to check whether the returned error was because
  75028. // http.StatusNotModified was returned.
  75029. func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) {
  75030. gensupport.SetOptions(c.urlParams_, opts...)
  75031. res, err := c.doRequest("json")
  75032. if res != nil && res.StatusCode == http.StatusNotModified {
  75033. if res.Body != nil {
  75034. res.Body.Close()
  75035. }
  75036. return nil, &googleapi.Error{
  75037. Code: res.StatusCode,
  75038. Header: res.Header,
  75039. }
  75040. }
  75041. if err != nil {
  75042. return nil, err
  75043. }
  75044. defer googleapi.CloseBody(res)
  75045. if err := googleapi.CheckResponse(res); err != nil {
  75046. return nil, err
  75047. }
  75048. ret := &DiskList{
  75049. ServerResponse: googleapi.ServerResponse{
  75050. Header: res.Header,
  75051. HTTPStatusCode: res.StatusCode,
  75052. },
  75053. }
  75054. target := &ret
  75055. if err := gensupport.DecodeResponse(target, res); err != nil {
  75056. return nil, err
  75057. }
  75058. return ret, nil
  75059. // {
  75060. // "description": "Retrieves the list of persistent disks contained within the specified region.",
  75061. // "httpMethod": "GET",
  75062. // "id": "compute.regionDisks.list",
  75063. // "parameterOrder": [
  75064. // "project",
  75065. // "region"
  75066. // ],
  75067. // "parameters": {
  75068. // "filter": {
  75069. // "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).",
  75070. // "location": "query",
  75071. // "type": "string"
  75072. // },
  75073. // "maxResults": {
  75074. // "default": "500",
  75075. // "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)",
  75076. // "format": "uint32",
  75077. // "location": "query",
  75078. // "minimum": "0",
  75079. // "type": "integer"
  75080. // },
  75081. // "orderBy": {
  75082. // "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.",
  75083. // "location": "query",
  75084. // "type": "string"
  75085. // },
  75086. // "pageToken": {
  75087. // "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.",
  75088. // "location": "query",
  75089. // "type": "string"
  75090. // },
  75091. // "project": {
  75092. // "description": "Project ID for this request.",
  75093. // "location": "path",
  75094. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75095. // "required": true,
  75096. // "type": "string"
  75097. // },
  75098. // "region": {
  75099. // "description": "Name of the region for this request.",
  75100. // "location": "path",
  75101. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75102. // "required": true,
  75103. // "type": "string"
  75104. // }
  75105. // },
  75106. // "path": "{project}/regions/{region}/disks",
  75107. // "response": {
  75108. // "$ref": "DiskList"
  75109. // },
  75110. // "scopes": [
  75111. // "https://www.googleapis.com/auth/cloud-platform",
  75112. // "https://www.googleapis.com/auth/compute",
  75113. // "https://www.googleapis.com/auth/compute.readonly"
  75114. // ]
  75115. // }
  75116. }
  75117. // Pages invokes f for each page of results.
  75118. // A non-nil error returned from f will halt the iteration.
  75119. // The provided context supersedes any context provided to the Context method.
  75120. func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error {
  75121. c.ctx_ = ctx
  75122. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  75123. for {
  75124. x, err := c.Do()
  75125. if err != nil {
  75126. return err
  75127. }
  75128. if err := f(x); err != nil {
  75129. return err
  75130. }
  75131. if x.NextPageToken == "" {
  75132. return nil
  75133. }
  75134. c.PageToken(x.NextPageToken)
  75135. }
  75136. }
  75137. // method id "compute.regionDisks.resize":
  75138. type RegionDisksResizeCall struct {
  75139. s *Service
  75140. project string
  75141. region string
  75142. disk string
  75143. regiondisksresizerequest *RegionDisksResizeRequest
  75144. urlParams_ gensupport.URLParams
  75145. ctx_ context.Context
  75146. header_ http.Header
  75147. }
  75148. // Resize: Resizes the specified regional persistent disk.
  75149. func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall {
  75150. c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75151. c.project = project
  75152. c.region = region
  75153. c.disk = disk
  75154. c.regiondisksresizerequest = regiondisksresizerequest
  75155. return c
  75156. }
  75157. // RequestId sets the optional parameter "requestId": An optional
  75158. // request ID to identify requests. Specify a unique request ID so that
  75159. // if you must retry your request, the server will know to ignore the
  75160. // request if it has already been completed.
  75161. //
  75162. // For example, consider a situation where you make an initial request
  75163. // and the request times out. If you make the request again with the
  75164. // same request ID, the server can check if original operation with the
  75165. // same request ID was received, and if so, will ignore the second
  75166. // request. This prevents clients from accidentally creating duplicate
  75167. // commitments.
  75168. //
  75169. // The request ID must be a valid UUID with the exception that zero UUID
  75170. // is not supported (00000000-0000-0000-0000-000000000000).
  75171. func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall {
  75172. c.urlParams_.Set("requestId", requestId)
  75173. return c
  75174. }
  75175. // Fields allows partial responses to be retrieved. See
  75176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75177. // for more information.
  75178. func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall {
  75179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75180. return c
  75181. }
  75182. // Context sets the context to be used in this call's Do method. Any
  75183. // pending HTTP request will be aborted if the provided context is
  75184. // canceled.
  75185. func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall {
  75186. c.ctx_ = ctx
  75187. return c
  75188. }
  75189. // Header returns an http.Header that can be modified by the caller to
  75190. // add HTTP headers to the request.
  75191. func (c *RegionDisksResizeCall) Header() http.Header {
  75192. if c.header_ == nil {
  75193. c.header_ = make(http.Header)
  75194. }
  75195. return c.header_
  75196. }
  75197. func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) {
  75198. reqHeaders := make(http.Header)
  75199. for k, v := range c.header_ {
  75200. reqHeaders[k] = v
  75201. }
  75202. reqHeaders.Set("User-Agent", c.s.userAgent())
  75203. var body io.Reader = nil
  75204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest)
  75205. if err != nil {
  75206. return nil, err
  75207. }
  75208. reqHeaders.Set("Content-Type", "application/json")
  75209. c.urlParams_.Set("alt", alt)
  75210. c.urlParams_.Set("prettyPrint", "false")
  75211. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{disk}/resize")
  75212. urls += "?" + c.urlParams_.Encode()
  75213. req, err := http.NewRequest("POST", urls, body)
  75214. if err != nil {
  75215. return nil, err
  75216. }
  75217. req.Header = reqHeaders
  75218. googleapi.Expand(req.URL, map[string]string{
  75219. "project": c.project,
  75220. "region": c.region,
  75221. "disk": c.disk,
  75222. })
  75223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75224. }
  75225. // Do executes the "compute.regionDisks.resize" call.
  75226. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75227. // status code is an error. Response headers are in either
  75228. // *Operation.ServerResponse.Header or (if a response was returned at
  75229. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75230. // to check whether the returned error was because
  75231. // http.StatusNotModified was returned.
  75232. func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75233. gensupport.SetOptions(c.urlParams_, opts...)
  75234. res, err := c.doRequest("json")
  75235. if res != nil && res.StatusCode == http.StatusNotModified {
  75236. if res.Body != nil {
  75237. res.Body.Close()
  75238. }
  75239. return nil, &googleapi.Error{
  75240. Code: res.StatusCode,
  75241. Header: res.Header,
  75242. }
  75243. }
  75244. if err != nil {
  75245. return nil, err
  75246. }
  75247. defer googleapi.CloseBody(res)
  75248. if err := googleapi.CheckResponse(res); err != nil {
  75249. return nil, err
  75250. }
  75251. ret := &Operation{
  75252. ServerResponse: googleapi.ServerResponse{
  75253. Header: res.Header,
  75254. HTTPStatusCode: res.StatusCode,
  75255. },
  75256. }
  75257. target := &ret
  75258. if err := gensupport.DecodeResponse(target, res); err != nil {
  75259. return nil, err
  75260. }
  75261. return ret, nil
  75262. // {
  75263. // "description": "Resizes the specified regional persistent disk.",
  75264. // "httpMethod": "POST",
  75265. // "id": "compute.regionDisks.resize",
  75266. // "parameterOrder": [
  75267. // "project",
  75268. // "region",
  75269. // "disk"
  75270. // ],
  75271. // "parameters": {
  75272. // "disk": {
  75273. // "description": "Name of the regional persistent disk.",
  75274. // "location": "path",
  75275. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75276. // "required": true,
  75277. // "type": "string"
  75278. // },
  75279. // "project": {
  75280. // "description": "The project ID for this request.",
  75281. // "location": "path",
  75282. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75283. // "required": true,
  75284. // "type": "string"
  75285. // },
  75286. // "region": {
  75287. // "description": "Name of the region for this request.",
  75288. // "location": "path",
  75289. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75290. // "required": true,
  75291. // "type": "string"
  75292. // },
  75293. // "requestId": {
  75294. // "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).",
  75295. // "location": "query",
  75296. // "type": "string"
  75297. // }
  75298. // },
  75299. // "path": "{project}/regions/{region}/disks/{disk}/resize",
  75300. // "request": {
  75301. // "$ref": "RegionDisksResizeRequest"
  75302. // },
  75303. // "response": {
  75304. // "$ref": "Operation"
  75305. // },
  75306. // "scopes": [
  75307. // "https://www.googleapis.com/auth/cloud-platform",
  75308. // "https://www.googleapis.com/auth/compute"
  75309. // ]
  75310. // }
  75311. }
  75312. // method id "compute.regionDisks.setLabels":
  75313. type RegionDisksSetLabelsCall struct {
  75314. s *Service
  75315. project string
  75316. region string
  75317. resource string
  75318. regionsetlabelsrequest *RegionSetLabelsRequest
  75319. urlParams_ gensupport.URLParams
  75320. ctx_ context.Context
  75321. header_ http.Header
  75322. }
  75323. // SetLabels: Sets the labels on the target regional disk.
  75324. func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall {
  75325. c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75326. c.project = project
  75327. c.region = region
  75328. c.resource = resource
  75329. c.regionsetlabelsrequest = regionsetlabelsrequest
  75330. return c
  75331. }
  75332. // RequestId sets the optional parameter "requestId": An optional
  75333. // request ID to identify requests. Specify a unique request ID so that
  75334. // if you must retry your request, the server will know to ignore the
  75335. // request if it has already been completed.
  75336. //
  75337. // For example, consider a situation where you make an initial request
  75338. // and the request times out. If you make the request again with the
  75339. // same request ID, the server can check if original operation with the
  75340. // same request ID was received, and if so, will ignore the second
  75341. // request. This prevents clients from accidentally creating duplicate
  75342. // commitments.
  75343. //
  75344. // The request ID must be a valid UUID with the exception that zero UUID
  75345. // is not supported (00000000-0000-0000-0000-000000000000).
  75346. func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall {
  75347. c.urlParams_.Set("requestId", requestId)
  75348. return c
  75349. }
  75350. // Fields allows partial responses to be retrieved. See
  75351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75352. // for more information.
  75353. func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall {
  75354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75355. return c
  75356. }
  75357. // Context sets the context to be used in this call's Do method. Any
  75358. // pending HTTP request will be aborted if the provided context is
  75359. // canceled.
  75360. func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall {
  75361. c.ctx_ = ctx
  75362. return c
  75363. }
  75364. // Header returns an http.Header that can be modified by the caller to
  75365. // add HTTP headers to the request.
  75366. func (c *RegionDisksSetLabelsCall) Header() http.Header {
  75367. if c.header_ == nil {
  75368. c.header_ = make(http.Header)
  75369. }
  75370. return c.header_
  75371. }
  75372. func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  75373. reqHeaders := make(http.Header)
  75374. for k, v := range c.header_ {
  75375. reqHeaders[k] = v
  75376. }
  75377. reqHeaders.Set("User-Agent", c.s.userAgent())
  75378. var body io.Reader = nil
  75379. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest)
  75380. if err != nil {
  75381. return nil, err
  75382. }
  75383. reqHeaders.Set("Content-Type", "application/json")
  75384. c.urlParams_.Set("alt", alt)
  75385. c.urlParams_.Set("prettyPrint", "false")
  75386. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/setLabels")
  75387. urls += "?" + c.urlParams_.Encode()
  75388. req, err := http.NewRequest("POST", urls, body)
  75389. if err != nil {
  75390. return nil, err
  75391. }
  75392. req.Header = reqHeaders
  75393. googleapi.Expand(req.URL, map[string]string{
  75394. "project": c.project,
  75395. "region": c.region,
  75396. "resource": c.resource,
  75397. })
  75398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75399. }
  75400. // Do executes the "compute.regionDisks.setLabels" call.
  75401. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75402. // status code is an error. Response headers are in either
  75403. // *Operation.ServerResponse.Header or (if a response was returned at
  75404. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75405. // to check whether the returned error was because
  75406. // http.StatusNotModified was returned.
  75407. func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75408. gensupport.SetOptions(c.urlParams_, opts...)
  75409. res, err := c.doRequest("json")
  75410. if res != nil && res.StatusCode == http.StatusNotModified {
  75411. if res.Body != nil {
  75412. res.Body.Close()
  75413. }
  75414. return nil, &googleapi.Error{
  75415. Code: res.StatusCode,
  75416. Header: res.Header,
  75417. }
  75418. }
  75419. if err != nil {
  75420. return nil, err
  75421. }
  75422. defer googleapi.CloseBody(res)
  75423. if err := googleapi.CheckResponse(res); err != nil {
  75424. return nil, err
  75425. }
  75426. ret := &Operation{
  75427. ServerResponse: googleapi.ServerResponse{
  75428. Header: res.Header,
  75429. HTTPStatusCode: res.StatusCode,
  75430. },
  75431. }
  75432. target := &ret
  75433. if err := gensupport.DecodeResponse(target, res); err != nil {
  75434. return nil, err
  75435. }
  75436. return ret, nil
  75437. // {
  75438. // "description": "Sets the labels on the target regional disk.",
  75439. // "httpMethod": "POST",
  75440. // "id": "compute.regionDisks.setLabels",
  75441. // "parameterOrder": [
  75442. // "project",
  75443. // "region",
  75444. // "resource"
  75445. // ],
  75446. // "parameters": {
  75447. // "project": {
  75448. // "description": "Project ID for this request.",
  75449. // "location": "path",
  75450. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75451. // "required": true,
  75452. // "type": "string"
  75453. // },
  75454. // "region": {
  75455. // "description": "The region for this request.",
  75456. // "location": "path",
  75457. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75458. // "required": true,
  75459. // "type": "string"
  75460. // },
  75461. // "requestId": {
  75462. // "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).",
  75463. // "location": "query",
  75464. // "type": "string"
  75465. // },
  75466. // "resource": {
  75467. // "description": "Name or id of the resource for this request.",
  75468. // "location": "path",
  75469. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75470. // "required": true,
  75471. // "type": "string"
  75472. // }
  75473. // },
  75474. // "path": "{project}/regions/{region}/disks/{resource}/setLabels",
  75475. // "request": {
  75476. // "$ref": "RegionSetLabelsRequest"
  75477. // },
  75478. // "response": {
  75479. // "$ref": "Operation"
  75480. // },
  75481. // "scopes": [
  75482. // "https://www.googleapis.com/auth/cloud-platform",
  75483. // "https://www.googleapis.com/auth/compute"
  75484. // ]
  75485. // }
  75486. }
  75487. // method id "compute.regionDisks.testIamPermissions":
  75488. type RegionDisksTestIamPermissionsCall struct {
  75489. s *Service
  75490. project string
  75491. region string
  75492. resource string
  75493. testpermissionsrequest *TestPermissionsRequest
  75494. urlParams_ gensupport.URLParams
  75495. ctx_ context.Context
  75496. header_ http.Header
  75497. }
  75498. // TestIamPermissions: Returns permissions that a caller has on the
  75499. // specified resource.
  75500. func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall {
  75501. c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75502. c.project = project
  75503. c.region = region
  75504. c.resource = resource
  75505. c.testpermissionsrequest = testpermissionsrequest
  75506. return c
  75507. }
  75508. // Fields allows partial responses to be retrieved. See
  75509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75510. // for more information.
  75511. func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall {
  75512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75513. return c
  75514. }
  75515. // Context sets the context to be used in this call's Do method. Any
  75516. // pending HTTP request will be aborted if the provided context is
  75517. // canceled.
  75518. func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall {
  75519. c.ctx_ = ctx
  75520. return c
  75521. }
  75522. // Header returns an http.Header that can be modified by the caller to
  75523. // add HTTP headers to the request.
  75524. func (c *RegionDisksTestIamPermissionsCall) Header() http.Header {
  75525. if c.header_ == nil {
  75526. c.header_ = make(http.Header)
  75527. }
  75528. return c.header_
  75529. }
  75530. func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  75531. reqHeaders := make(http.Header)
  75532. for k, v := range c.header_ {
  75533. reqHeaders[k] = v
  75534. }
  75535. reqHeaders.Set("User-Agent", c.s.userAgent())
  75536. var body io.Reader = nil
  75537. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  75538. if err != nil {
  75539. return nil, err
  75540. }
  75541. reqHeaders.Set("Content-Type", "application/json")
  75542. c.urlParams_.Set("alt", alt)
  75543. c.urlParams_.Set("prettyPrint", "false")
  75544. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/disks/{resource}/testIamPermissions")
  75545. urls += "?" + c.urlParams_.Encode()
  75546. req, err := http.NewRequest("POST", urls, body)
  75547. if err != nil {
  75548. return nil, err
  75549. }
  75550. req.Header = reqHeaders
  75551. googleapi.Expand(req.URL, map[string]string{
  75552. "project": c.project,
  75553. "region": c.region,
  75554. "resource": c.resource,
  75555. })
  75556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75557. }
  75558. // Do executes the "compute.regionDisks.testIamPermissions" call.
  75559. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  75560. // non-2xx status code is an error. Response headers are in either
  75561. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  75562. // returned at all) in error.(*googleapi.Error).Header. Use
  75563. // googleapi.IsNotModified to check whether the returned error was
  75564. // because http.StatusNotModified was returned.
  75565. func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  75566. gensupport.SetOptions(c.urlParams_, opts...)
  75567. res, err := c.doRequest("json")
  75568. if res != nil && res.StatusCode == http.StatusNotModified {
  75569. if res.Body != nil {
  75570. res.Body.Close()
  75571. }
  75572. return nil, &googleapi.Error{
  75573. Code: res.StatusCode,
  75574. Header: res.Header,
  75575. }
  75576. }
  75577. if err != nil {
  75578. return nil, err
  75579. }
  75580. defer googleapi.CloseBody(res)
  75581. if err := googleapi.CheckResponse(res); err != nil {
  75582. return nil, err
  75583. }
  75584. ret := &TestPermissionsResponse{
  75585. ServerResponse: googleapi.ServerResponse{
  75586. Header: res.Header,
  75587. HTTPStatusCode: res.StatusCode,
  75588. },
  75589. }
  75590. target := &ret
  75591. if err := gensupport.DecodeResponse(target, res); err != nil {
  75592. return nil, err
  75593. }
  75594. return ret, nil
  75595. // {
  75596. // "description": "Returns permissions that a caller has on the specified resource.",
  75597. // "httpMethod": "POST",
  75598. // "id": "compute.regionDisks.testIamPermissions",
  75599. // "parameterOrder": [
  75600. // "project",
  75601. // "region",
  75602. // "resource"
  75603. // ],
  75604. // "parameters": {
  75605. // "project": {
  75606. // "description": "Project ID for this request.",
  75607. // "location": "path",
  75608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75609. // "required": true,
  75610. // "type": "string"
  75611. // },
  75612. // "region": {
  75613. // "description": "The name of the region for this request.",
  75614. // "location": "path",
  75615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  75616. // "required": true,
  75617. // "type": "string"
  75618. // },
  75619. // "resource": {
  75620. // "description": "Name or id of the resource for this request.",
  75621. // "location": "path",
  75622. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  75623. // "required": true,
  75624. // "type": "string"
  75625. // }
  75626. // },
  75627. // "path": "{project}/regions/{region}/disks/{resource}/testIamPermissions",
  75628. // "request": {
  75629. // "$ref": "TestPermissionsRequest"
  75630. // },
  75631. // "response": {
  75632. // "$ref": "TestPermissionsResponse"
  75633. // },
  75634. // "scopes": [
  75635. // "https://www.googleapis.com/auth/cloud-platform",
  75636. // "https://www.googleapis.com/auth/compute",
  75637. // "https://www.googleapis.com/auth/compute.readonly"
  75638. // ]
  75639. // }
  75640. }
  75641. // method id "compute.regionInstanceGroupManagers.abandonInstances":
  75642. type RegionInstanceGroupManagersAbandonInstancesCall struct {
  75643. s *Service
  75644. project string
  75645. region string
  75646. instanceGroupManager string
  75647. regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest
  75648. urlParams_ gensupport.URLParams
  75649. ctx_ context.Context
  75650. header_ http.Header
  75651. }
  75652. // AbandonInstances: Flags the specified instances to be immediately
  75653. // removed from the managed instance group. Abandoning an instance does
  75654. // not delete the instance, but it does remove the instance from any
  75655. // target pools that are applied by the managed instance group. This
  75656. // method reduces the targetSize of the managed instance group by the
  75657. // number of instances that you abandon. This operation is marked as
  75658. // DONE when the action is scheduled even if the instances have not yet
  75659. // been removed from the group. You must separately verify the status of
  75660. // the abandoning action with the listmanagedinstances method.
  75661. //
  75662. // If the group is part of a backend service that has enabled connection
  75663. // draining, it can take up to 60 seconds after the connection draining
  75664. // duration has elapsed before the VM instance is removed or
  75665. // deleted.
  75666. //
  75667. // You can specify a maximum of 1000 instances with this method per
  75668. // request.
  75669. func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall {
  75670. c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75671. c.project = project
  75672. c.region = region
  75673. c.instanceGroupManager = instanceGroupManager
  75674. c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest
  75675. return c
  75676. }
  75677. // RequestId sets the optional parameter "requestId": An optional
  75678. // request ID to identify requests. Specify a unique request ID so that
  75679. // if you must retry your request, the server will know to ignore the
  75680. // request if it has already been completed.
  75681. //
  75682. // For example, consider a situation where you make an initial request
  75683. // and the request times out. If you make the request again with the
  75684. // same request ID, the server can check if original operation with the
  75685. // same request ID was received, and if so, will ignore the second
  75686. // request. This prevents clients from accidentally creating duplicate
  75687. // commitments.
  75688. //
  75689. // The request ID must be a valid UUID with the exception that zero UUID
  75690. // is not supported (00000000-0000-0000-0000-000000000000).
  75691. func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall {
  75692. c.urlParams_.Set("requestId", requestId)
  75693. return c
  75694. }
  75695. // Fields allows partial responses to be retrieved. See
  75696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75697. // for more information.
  75698. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall {
  75699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75700. return c
  75701. }
  75702. // Context sets the context to be used in this call's Do method. Any
  75703. // pending HTTP request will be aborted if the provided context is
  75704. // canceled.
  75705. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall {
  75706. c.ctx_ = ctx
  75707. return c
  75708. }
  75709. // Header returns an http.Header that can be modified by the caller to
  75710. // add HTTP headers to the request.
  75711. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header {
  75712. if c.header_ == nil {
  75713. c.header_ = make(http.Header)
  75714. }
  75715. return c.header_
  75716. }
  75717. func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) {
  75718. reqHeaders := make(http.Header)
  75719. for k, v := range c.header_ {
  75720. reqHeaders[k] = v
  75721. }
  75722. reqHeaders.Set("User-Agent", c.s.userAgent())
  75723. var body io.Reader = nil
  75724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest)
  75725. if err != nil {
  75726. return nil, err
  75727. }
  75728. reqHeaders.Set("Content-Type", "application/json")
  75729. c.urlParams_.Set("alt", alt)
  75730. c.urlParams_.Set("prettyPrint", "false")
  75731. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances")
  75732. urls += "?" + c.urlParams_.Encode()
  75733. req, err := http.NewRequest("POST", urls, body)
  75734. if err != nil {
  75735. return nil, err
  75736. }
  75737. req.Header = reqHeaders
  75738. googleapi.Expand(req.URL, map[string]string{
  75739. "project": c.project,
  75740. "region": c.region,
  75741. "instanceGroupManager": c.instanceGroupManager,
  75742. })
  75743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75744. }
  75745. // Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call.
  75746. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75747. // status code is an error. Response headers are in either
  75748. // *Operation.ServerResponse.Header or (if a response was returned at
  75749. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75750. // to check whether the returned error was because
  75751. // http.StatusNotModified was returned.
  75752. func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75753. gensupport.SetOptions(c.urlParams_, opts...)
  75754. res, err := c.doRequest("json")
  75755. if res != nil && res.StatusCode == http.StatusNotModified {
  75756. if res.Body != nil {
  75757. res.Body.Close()
  75758. }
  75759. return nil, &googleapi.Error{
  75760. Code: res.StatusCode,
  75761. Header: res.Header,
  75762. }
  75763. }
  75764. if err != nil {
  75765. return nil, err
  75766. }
  75767. defer googleapi.CloseBody(res)
  75768. if err := googleapi.CheckResponse(res); err != nil {
  75769. return nil, err
  75770. }
  75771. ret := &Operation{
  75772. ServerResponse: googleapi.ServerResponse{
  75773. Header: res.Header,
  75774. HTTPStatusCode: res.StatusCode,
  75775. },
  75776. }
  75777. target := &ret
  75778. if err := gensupport.DecodeResponse(target, res); err != nil {
  75779. return nil, err
  75780. }
  75781. return ret, nil
  75782. // {
  75783. // "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.",
  75784. // "httpMethod": "POST",
  75785. // "id": "compute.regionInstanceGroupManagers.abandonInstances",
  75786. // "parameterOrder": [
  75787. // "project",
  75788. // "region",
  75789. // "instanceGroupManager"
  75790. // ],
  75791. // "parameters": {
  75792. // "instanceGroupManager": {
  75793. // "description": "Name of the managed instance group.",
  75794. // "location": "path",
  75795. // "required": true,
  75796. // "type": "string"
  75797. // },
  75798. // "project": {
  75799. // "description": "Project ID for this request.",
  75800. // "location": "path",
  75801. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75802. // "required": true,
  75803. // "type": "string"
  75804. // },
  75805. // "region": {
  75806. // "description": "Name of the region scoping this request.",
  75807. // "location": "path",
  75808. // "required": true,
  75809. // "type": "string"
  75810. // },
  75811. // "requestId": {
  75812. // "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).",
  75813. // "location": "query",
  75814. // "type": "string"
  75815. // }
  75816. // },
  75817. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances",
  75818. // "request": {
  75819. // "$ref": "RegionInstanceGroupManagersAbandonInstancesRequest"
  75820. // },
  75821. // "response": {
  75822. // "$ref": "Operation"
  75823. // },
  75824. // "scopes": [
  75825. // "https://www.googleapis.com/auth/cloud-platform",
  75826. // "https://www.googleapis.com/auth/compute"
  75827. // ]
  75828. // }
  75829. }
  75830. // method id "compute.regionInstanceGroupManagers.delete":
  75831. type RegionInstanceGroupManagersDeleteCall struct {
  75832. s *Service
  75833. project string
  75834. region string
  75835. instanceGroupManager string
  75836. urlParams_ gensupport.URLParams
  75837. ctx_ context.Context
  75838. header_ http.Header
  75839. }
  75840. // Delete: Deletes the specified managed instance group and all of the
  75841. // instances in that group.
  75842. func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall {
  75843. c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  75844. c.project = project
  75845. c.region = region
  75846. c.instanceGroupManager = instanceGroupManager
  75847. return c
  75848. }
  75849. // RequestId sets the optional parameter "requestId": An optional
  75850. // request ID to identify requests. Specify a unique request ID so that
  75851. // if you must retry your request, the server will know to ignore the
  75852. // request if it has already been completed.
  75853. //
  75854. // For example, consider a situation where you make an initial request
  75855. // and the request times out. If you make the request again with the
  75856. // same request ID, the server can check if original operation with the
  75857. // same request ID was received, and if so, will ignore the second
  75858. // request. This prevents clients from accidentally creating duplicate
  75859. // commitments.
  75860. //
  75861. // The request ID must be a valid UUID with the exception that zero UUID
  75862. // is not supported (00000000-0000-0000-0000-000000000000).
  75863. func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall {
  75864. c.urlParams_.Set("requestId", requestId)
  75865. return c
  75866. }
  75867. // Fields allows partial responses to be retrieved. See
  75868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  75869. // for more information.
  75870. func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall {
  75871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  75872. return c
  75873. }
  75874. // Context sets the context to be used in this call's Do method. Any
  75875. // pending HTTP request will be aborted if the provided context is
  75876. // canceled.
  75877. func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall {
  75878. c.ctx_ = ctx
  75879. return c
  75880. }
  75881. // Header returns an http.Header that can be modified by the caller to
  75882. // add HTTP headers to the request.
  75883. func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header {
  75884. if c.header_ == nil {
  75885. c.header_ = make(http.Header)
  75886. }
  75887. return c.header_
  75888. }
  75889. func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) {
  75890. reqHeaders := make(http.Header)
  75891. for k, v := range c.header_ {
  75892. reqHeaders[k] = v
  75893. }
  75894. reqHeaders.Set("User-Agent", c.s.userAgent())
  75895. var body io.Reader = nil
  75896. c.urlParams_.Set("alt", alt)
  75897. c.urlParams_.Set("prettyPrint", "false")
  75898. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  75899. urls += "?" + c.urlParams_.Encode()
  75900. req, err := http.NewRequest("DELETE", urls, body)
  75901. if err != nil {
  75902. return nil, err
  75903. }
  75904. req.Header = reqHeaders
  75905. googleapi.Expand(req.URL, map[string]string{
  75906. "project": c.project,
  75907. "region": c.region,
  75908. "instanceGroupManager": c.instanceGroupManager,
  75909. })
  75910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  75911. }
  75912. // Do executes the "compute.regionInstanceGroupManagers.delete" call.
  75913. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  75914. // status code is an error. Response headers are in either
  75915. // *Operation.ServerResponse.Header or (if a response was returned at
  75916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  75917. // to check whether the returned error was because
  75918. // http.StatusNotModified was returned.
  75919. func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  75920. gensupport.SetOptions(c.urlParams_, opts...)
  75921. res, err := c.doRequest("json")
  75922. if res != nil && res.StatusCode == http.StatusNotModified {
  75923. if res.Body != nil {
  75924. res.Body.Close()
  75925. }
  75926. return nil, &googleapi.Error{
  75927. Code: res.StatusCode,
  75928. Header: res.Header,
  75929. }
  75930. }
  75931. if err != nil {
  75932. return nil, err
  75933. }
  75934. defer googleapi.CloseBody(res)
  75935. if err := googleapi.CheckResponse(res); err != nil {
  75936. return nil, err
  75937. }
  75938. ret := &Operation{
  75939. ServerResponse: googleapi.ServerResponse{
  75940. Header: res.Header,
  75941. HTTPStatusCode: res.StatusCode,
  75942. },
  75943. }
  75944. target := &ret
  75945. if err := gensupport.DecodeResponse(target, res); err != nil {
  75946. return nil, err
  75947. }
  75948. return ret, nil
  75949. // {
  75950. // "description": "Deletes the specified managed instance group and all of the instances in that group.",
  75951. // "httpMethod": "DELETE",
  75952. // "id": "compute.regionInstanceGroupManagers.delete",
  75953. // "parameterOrder": [
  75954. // "project",
  75955. // "region",
  75956. // "instanceGroupManager"
  75957. // ],
  75958. // "parameters": {
  75959. // "instanceGroupManager": {
  75960. // "description": "Name of the managed instance group to delete.",
  75961. // "location": "path",
  75962. // "required": true,
  75963. // "type": "string"
  75964. // },
  75965. // "project": {
  75966. // "description": "Project ID for this request.",
  75967. // "location": "path",
  75968. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  75969. // "required": true,
  75970. // "type": "string"
  75971. // },
  75972. // "region": {
  75973. // "description": "Name of the region scoping this request.",
  75974. // "location": "path",
  75975. // "required": true,
  75976. // "type": "string"
  75977. // },
  75978. // "requestId": {
  75979. // "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).",
  75980. // "location": "query",
  75981. // "type": "string"
  75982. // }
  75983. // },
  75984. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  75985. // "response": {
  75986. // "$ref": "Operation"
  75987. // },
  75988. // "scopes": [
  75989. // "https://www.googleapis.com/auth/cloud-platform",
  75990. // "https://www.googleapis.com/auth/compute"
  75991. // ]
  75992. // }
  75993. }
  75994. // method id "compute.regionInstanceGroupManagers.deleteInstances":
  75995. type RegionInstanceGroupManagersDeleteInstancesCall struct {
  75996. s *Service
  75997. project string
  75998. region string
  75999. instanceGroupManager string
  76000. regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest
  76001. urlParams_ gensupport.URLParams
  76002. ctx_ context.Context
  76003. header_ http.Header
  76004. }
  76005. // DeleteInstances: Flags the specified instances in the managed
  76006. // instance group to be immediately deleted. The instances are also
  76007. // removed from any target pools of which they were a member. This
  76008. // method reduces the targetSize of the managed instance group by the
  76009. // number of instances that you delete. The deleteInstances operation is
  76010. // marked DONE if the deleteInstances request is successful. The
  76011. // underlying actions take additional time. You must separately verify
  76012. // the status of the deleting action with the listmanagedinstances
  76013. // method.
  76014. //
  76015. // If the group is part of a backend service that has enabled connection
  76016. // draining, it can take up to 60 seconds after the connection draining
  76017. // duration has elapsed before the VM instance is removed or
  76018. // deleted.
  76019. //
  76020. // You can specify a maximum of 1000 instances with this method per
  76021. // request.
  76022. func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall {
  76023. c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76024. c.project = project
  76025. c.region = region
  76026. c.instanceGroupManager = instanceGroupManager
  76027. c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest
  76028. return c
  76029. }
  76030. // RequestId sets the optional parameter "requestId": An optional
  76031. // request ID to identify requests. Specify a unique request ID so that
  76032. // if you must retry your request, the server will know to ignore the
  76033. // request if it has already been completed.
  76034. //
  76035. // For example, consider a situation where you make an initial request
  76036. // and the request times out. If you make the request again with the
  76037. // same request ID, the server can check if original operation with the
  76038. // same request ID was received, and if so, will ignore the second
  76039. // request. This prevents clients from accidentally creating duplicate
  76040. // commitments.
  76041. //
  76042. // The request ID must be a valid UUID with the exception that zero UUID
  76043. // is not supported (00000000-0000-0000-0000-000000000000).
  76044. func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall {
  76045. c.urlParams_.Set("requestId", requestId)
  76046. return c
  76047. }
  76048. // Fields allows partial responses to be retrieved. See
  76049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76050. // for more information.
  76051. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall {
  76052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76053. return c
  76054. }
  76055. // Context sets the context to be used in this call's Do method. Any
  76056. // pending HTTP request will be aborted if the provided context is
  76057. // canceled.
  76058. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall {
  76059. c.ctx_ = ctx
  76060. return c
  76061. }
  76062. // Header returns an http.Header that can be modified by the caller to
  76063. // add HTTP headers to the request.
  76064. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header {
  76065. if c.header_ == nil {
  76066. c.header_ = make(http.Header)
  76067. }
  76068. return c.header_
  76069. }
  76070. func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) {
  76071. reqHeaders := make(http.Header)
  76072. for k, v := range c.header_ {
  76073. reqHeaders[k] = v
  76074. }
  76075. reqHeaders.Set("User-Agent", c.s.userAgent())
  76076. var body io.Reader = nil
  76077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest)
  76078. if err != nil {
  76079. return nil, err
  76080. }
  76081. reqHeaders.Set("Content-Type", "application/json")
  76082. c.urlParams_.Set("alt", alt)
  76083. c.urlParams_.Set("prettyPrint", "false")
  76084. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances")
  76085. urls += "?" + c.urlParams_.Encode()
  76086. req, err := http.NewRequest("POST", urls, body)
  76087. if err != nil {
  76088. return nil, err
  76089. }
  76090. req.Header = reqHeaders
  76091. googleapi.Expand(req.URL, map[string]string{
  76092. "project": c.project,
  76093. "region": c.region,
  76094. "instanceGroupManager": c.instanceGroupManager,
  76095. })
  76096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76097. }
  76098. // Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call.
  76099. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76100. // status code is an error. Response headers are in either
  76101. // *Operation.ServerResponse.Header or (if a response was returned at
  76102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76103. // to check whether the returned error was because
  76104. // http.StatusNotModified was returned.
  76105. func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76106. gensupport.SetOptions(c.urlParams_, opts...)
  76107. res, err := c.doRequest("json")
  76108. if res != nil && res.StatusCode == http.StatusNotModified {
  76109. if res.Body != nil {
  76110. res.Body.Close()
  76111. }
  76112. return nil, &googleapi.Error{
  76113. Code: res.StatusCode,
  76114. Header: res.Header,
  76115. }
  76116. }
  76117. if err != nil {
  76118. return nil, err
  76119. }
  76120. defer googleapi.CloseBody(res)
  76121. if err := googleapi.CheckResponse(res); err != nil {
  76122. return nil, err
  76123. }
  76124. ret := &Operation{
  76125. ServerResponse: googleapi.ServerResponse{
  76126. Header: res.Header,
  76127. HTTPStatusCode: res.StatusCode,
  76128. },
  76129. }
  76130. target := &ret
  76131. if err := gensupport.DecodeResponse(target, res); err != nil {
  76132. return nil, err
  76133. }
  76134. return ret, nil
  76135. // {
  76136. // "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.",
  76137. // "httpMethod": "POST",
  76138. // "id": "compute.regionInstanceGroupManagers.deleteInstances",
  76139. // "parameterOrder": [
  76140. // "project",
  76141. // "region",
  76142. // "instanceGroupManager"
  76143. // ],
  76144. // "parameters": {
  76145. // "instanceGroupManager": {
  76146. // "description": "Name of the managed instance group.",
  76147. // "location": "path",
  76148. // "required": true,
  76149. // "type": "string"
  76150. // },
  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 scoping this request.",
  76160. // "location": "path",
  76161. // "required": true,
  76162. // "type": "string"
  76163. // },
  76164. // "requestId": {
  76165. // "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).",
  76166. // "location": "query",
  76167. // "type": "string"
  76168. // }
  76169. // },
  76170. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances",
  76171. // "request": {
  76172. // "$ref": "RegionInstanceGroupManagersDeleteInstancesRequest"
  76173. // },
  76174. // "response": {
  76175. // "$ref": "Operation"
  76176. // },
  76177. // "scopes": [
  76178. // "https://www.googleapis.com/auth/cloud-platform",
  76179. // "https://www.googleapis.com/auth/compute"
  76180. // ]
  76181. // }
  76182. }
  76183. // method id "compute.regionInstanceGroupManagers.get":
  76184. type RegionInstanceGroupManagersGetCall struct {
  76185. s *Service
  76186. project string
  76187. region string
  76188. instanceGroupManager string
  76189. urlParams_ gensupport.URLParams
  76190. ifNoneMatch_ string
  76191. ctx_ context.Context
  76192. header_ http.Header
  76193. }
  76194. // Get: Returns all of the details about the specified managed instance
  76195. // group.
  76196. func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall {
  76197. c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76198. c.project = project
  76199. c.region = region
  76200. c.instanceGroupManager = instanceGroupManager
  76201. return c
  76202. }
  76203. // Fields allows partial responses to be retrieved. See
  76204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76205. // for more information.
  76206. func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall {
  76207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76208. return c
  76209. }
  76210. // IfNoneMatch sets the optional parameter which makes the operation
  76211. // fail if the object's ETag matches the given value. This is useful for
  76212. // getting updates only after the object has changed since the last
  76213. // request. Use googleapi.IsNotModified to check whether the response
  76214. // error from Do is the result of In-None-Match.
  76215. func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall {
  76216. c.ifNoneMatch_ = entityTag
  76217. return c
  76218. }
  76219. // Context sets the context to be used in this call's Do method. Any
  76220. // pending HTTP request will be aborted if the provided context is
  76221. // canceled.
  76222. func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall {
  76223. c.ctx_ = ctx
  76224. return c
  76225. }
  76226. // Header returns an http.Header that can be modified by the caller to
  76227. // add HTTP headers to the request.
  76228. func (c *RegionInstanceGroupManagersGetCall) Header() http.Header {
  76229. if c.header_ == nil {
  76230. c.header_ = make(http.Header)
  76231. }
  76232. return c.header_
  76233. }
  76234. func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) {
  76235. reqHeaders := make(http.Header)
  76236. for k, v := range c.header_ {
  76237. reqHeaders[k] = v
  76238. }
  76239. reqHeaders.Set("User-Agent", c.s.userAgent())
  76240. if c.ifNoneMatch_ != "" {
  76241. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76242. }
  76243. var body io.Reader = nil
  76244. c.urlParams_.Set("alt", alt)
  76245. c.urlParams_.Set("prettyPrint", "false")
  76246. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  76247. urls += "?" + c.urlParams_.Encode()
  76248. req, err := http.NewRequest("GET", urls, body)
  76249. if err != nil {
  76250. return nil, err
  76251. }
  76252. req.Header = reqHeaders
  76253. googleapi.Expand(req.URL, map[string]string{
  76254. "project": c.project,
  76255. "region": c.region,
  76256. "instanceGroupManager": c.instanceGroupManager,
  76257. })
  76258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76259. }
  76260. // Do executes the "compute.regionInstanceGroupManagers.get" call.
  76261. // Exactly one of *InstanceGroupManager or error will be non-nil. Any
  76262. // non-2xx status code is an error. Response headers are in either
  76263. // *InstanceGroupManager.ServerResponse.Header or (if a response was
  76264. // returned at all) in error.(*googleapi.Error).Header. Use
  76265. // googleapi.IsNotModified to check whether the returned error was
  76266. // because http.StatusNotModified was returned.
  76267. func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) {
  76268. gensupport.SetOptions(c.urlParams_, opts...)
  76269. res, err := c.doRequest("json")
  76270. if res != nil && res.StatusCode == http.StatusNotModified {
  76271. if res.Body != nil {
  76272. res.Body.Close()
  76273. }
  76274. return nil, &googleapi.Error{
  76275. Code: res.StatusCode,
  76276. Header: res.Header,
  76277. }
  76278. }
  76279. if err != nil {
  76280. return nil, err
  76281. }
  76282. defer googleapi.CloseBody(res)
  76283. if err := googleapi.CheckResponse(res); err != nil {
  76284. return nil, err
  76285. }
  76286. ret := &InstanceGroupManager{
  76287. ServerResponse: googleapi.ServerResponse{
  76288. Header: res.Header,
  76289. HTTPStatusCode: res.StatusCode,
  76290. },
  76291. }
  76292. target := &ret
  76293. if err := gensupport.DecodeResponse(target, res); err != nil {
  76294. return nil, err
  76295. }
  76296. return ret, nil
  76297. // {
  76298. // "description": "Returns all of the details about the specified managed instance group.",
  76299. // "httpMethod": "GET",
  76300. // "id": "compute.regionInstanceGroupManagers.get",
  76301. // "parameterOrder": [
  76302. // "project",
  76303. // "region",
  76304. // "instanceGroupManager"
  76305. // ],
  76306. // "parameters": {
  76307. // "instanceGroupManager": {
  76308. // "description": "Name of the managed instance group to return.",
  76309. // "location": "path",
  76310. // "required": true,
  76311. // "type": "string"
  76312. // },
  76313. // "project": {
  76314. // "description": "Project ID for this request.",
  76315. // "location": "path",
  76316. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76317. // "required": true,
  76318. // "type": "string"
  76319. // },
  76320. // "region": {
  76321. // "description": "Name of the region scoping this request.",
  76322. // "location": "path",
  76323. // "required": true,
  76324. // "type": "string"
  76325. // }
  76326. // },
  76327. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  76328. // "response": {
  76329. // "$ref": "InstanceGroupManager"
  76330. // },
  76331. // "scopes": [
  76332. // "https://www.googleapis.com/auth/cloud-platform",
  76333. // "https://www.googleapis.com/auth/compute",
  76334. // "https://www.googleapis.com/auth/compute.readonly"
  76335. // ]
  76336. // }
  76337. }
  76338. // method id "compute.regionInstanceGroupManagers.insert":
  76339. type RegionInstanceGroupManagersInsertCall struct {
  76340. s *Service
  76341. project string
  76342. region string
  76343. instancegroupmanager *InstanceGroupManager
  76344. urlParams_ gensupport.URLParams
  76345. ctx_ context.Context
  76346. header_ http.Header
  76347. }
  76348. // Insert: Creates a managed instance group using the information that
  76349. // you specify in the request. After the group is created, instances in
  76350. // the group are created using the specified instance template. This
  76351. // operation is marked as DONE when the group is created even if the
  76352. // instances in the group have not yet been created. You must separately
  76353. // verify the status of the individual instances with the
  76354. // listmanagedinstances method.
  76355. //
  76356. // A regional managed instance group can contain up to 2000 instances.
  76357. func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall {
  76358. c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76359. c.project = project
  76360. c.region = region
  76361. c.instancegroupmanager = instancegroupmanager
  76362. return c
  76363. }
  76364. // RequestId sets the optional parameter "requestId": An optional
  76365. // request ID to identify requests. Specify a unique request ID so that
  76366. // if you must retry your request, the server will know to ignore the
  76367. // request if it has already been completed.
  76368. //
  76369. // For example, consider a situation where you make an initial request
  76370. // and the request times out. If you make the request again with the
  76371. // same request ID, the server can check if original operation with the
  76372. // same request ID was received, and if so, will ignore the second
  76373. // request. This prevents clients from accidentally creating duplicate
  76374. // commitments.
  76375. //
  76376. // The request ID must be a valid UUID with the exception that zero UUID
  76377. // is not supported (00000000-0000-0000-0000-000000000000).
  76378. func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall {
  76379. c.urlParams_.Set("requestId", requestId)
  76380. return c
  76381. }
  76382. // Fields allows partial responses to be retrieved. See
  76383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76384. // for more information.
  76385. func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall {
  76386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76387. return c
  76388. }
  76389. // Context sets the context to be used in this call's Do method. Any
  76390. // pending HTTP request will be aborted if the provided context is
  76391. // canceled.
  76392. func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall {
  76393. c.ctx_ = ctx
  76394. return c
  76395. }
  76396. // Header returns an http.Header that can be modified by the caller to
  76397. // add HTTP headers to the request.
  76398. func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header {
  76399. if c.header_ == nil {
  76400. c.header_ = make(http.Header)
  76401. }
  76402. return c.header_
  76403. }
  76404. func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) {
  76405. reqHeaders := make(http.Header)
  76406. for k, v := range c.header_ {
  76407. reqHeaders[k] = v
  76408. }
  76409. reqHeaders.Set("User-Agent", c.s.userAgent())
  76410. var body io.Reader = nil
  76411. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  76412. if err != nil {
  76413. return nil, err
  76414. }
  76415. reqHeaders.Set("Content-Type", "application/json")
  76416. c.urlParams_.Set("alt", alt)
  76417. c.urlParams_.Set("prettyPrint", "false")
  76418. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  76419. urls += "?" + c.urlParams_.Encode()
  76420. req, err := http.NewRequest("POST", urls, body)
  76421. if err != nil {
  76422. return nil, err
  76423. }
  76424. req.Header = reqHeaders
  76425. googleapi.Expand(req.URL, map[string]string{
  76426. "project": c.project,
  76427. "region": c.region,
  76428. })
  76429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76430. }
  76431. // Do executes the "compute.regionInstanceGroupManagers.insert" call.
  76432. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  76433. // status code is an error. Response headers are in either
  76434. // *Operation.ServerResponse.Header or (if a response was returned at
  76435. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  76436. // to check whether the returned error was because
  76437. // http.StatusNotModified was returned.
  76438. func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  76439. gensupport.SetOptions(c.urlParams_, opts...)
  76440. res, err := c.doRequest("json")
  76441. if res != nil && res.StatusCode == http.StatusNotModified {
  76442. if res.Body != nil {
  76443. res.Body.Close()
  76444. }
  76445. return nil, &googleapi.Error{
  76446. Code: res.StatusCode,
  76447. Header: res.Header,
  76448. }
  76449. }
  76450. if err != nil {
  76451. return nil, err
  76452. }
  76453. defer googleapi.CloseBody(res)
  76454. if err := googleapi.CheckResponse(res); err != nil {
  76455. return nil, err
  76456. }
  76457. ret := &Operation{
  76458. ServerResponse: googleapi.ServerResponse{
  76459. Header: res.Header,
  76460. HTTPStatusCode: res.StatusCode,
  76461. },
  76462. }
  76463. target := &ret
  76464. if err := gensupport.DecodeResponse(target, res); err != nil {
  76465. return nil, err
  76466. }
  76467. return ret, nil
  76468. // {
  76469. // "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.",
  76470. // "httpMethod": "POST",
  76471. // "id": "compute.regionInstanceGroupManagers.insert",
  76472. // "parameterOrder": [
  76473. // "project",
  76474. // "region"
  76475. // ],
  76476. // "parameters": {
  76477. // "project": {
  76478. // "description": "Project ID for this request.",
  76479. // "location": "path",
  76480. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76481. // "required": true,
  76482. // "type": "string"
  76483. // },
  76484. // "region": {
  76485. // "description": "Name of the region scoping this request.",
  76486. // "location": "path",
  76487. // "required": true,
  76488. // "type": "string"
  76489. // },
  76490. // "requestId": {
  76491. // "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).",
  76492. // "location": "query",
  76493. // "type": "string"
  76494. // }
  76495. // },
  76496. // "path": "{project}/regions/{region}/instanceGroupManagers",
  76497. // "request": {
  76498. // "$ref": "InstanceGroupManager"
  76499. // },
  76500. // "response": {
  76501. // "$ref": "Operation"
  76502. // },
  76503. // "scopes": [
  76504. // "https://www.googleapis.com/auth/cloud-platform",
  76505. // "https://www.googleapis.com/auth/compute"
  76506. // ]
  76507. // }
  76508. }
  76509. // method id "compute.regionInstanceGroupManagers.list":
  76510. type RegionInstanceGroupManagersListCall struct {
  76511. s *Service
  76512. project string
  76513. region string
  76514. urlParams_ gensupport.URLParams
  76515. ifNoneMatch_ string
  76516. ctx_ context.Context
  76517. header_ http.Header
  76518. }
  76519. // List: Retrieves the list of managed instance groups that are
  76520. // contained within the specified region.
  76521. func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall {
  76522. c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76523. c.project = project
  76524. c.region = region
  76525. return c
  76526. }
  76527. // Filter sets the optional parameter "filter": A filter expression that
  76528. // filters resources listed in the response. The expression must specify
  76529. // the field name, a comparison operator, and the value that you want to
  76530. // use for filtering. The value must be a string, a number, or a
  76531. // boolean. The comparison operator must be either =, !=, >, or <.
  76532. //
  76533. // For example, if you are filtering Compute Engine instances, you can
  76534. // exclude instances named example-instance by specifying name !=
  76535. // example-instance.
  76536. //
  76537. // You can also filter nested fields. For example, you could specify
  76538. // scheduling.automaticRestart = false to include instances only if they
  76539. // are not scheduled for automatic restarts. You can use filtering on
  76540. // nested fields to filter based on resource labels.
  76541. //
  76542. // To filter on multiple expressions, provide each separate expression
  76543. // within parentheses. For example, (scheduling.automaticRestart = true)
  76544. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76545. // AND expression. However, you can include AND and OR expressions
  76546. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76547. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76548. // true).
  76549. func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall {
  76550. c.urlParams_.Set("filter", filter)
  76551. return c
  76552. }
  76553. // MaxResults sets the optional parameter "maxResults": The maximum
  76554. // number of results per page that should be returned. If the number of
  76555. // available results is larger than maxResults, Compute Engine returns a
  76556. // nextPageToken that can be used to get the next page of results in
  76557. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76558. // (Default: 500)
  76559. func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall {
  76560. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76561. return c
  76562. }
  76563. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  76564. // a certain order. By default, results are returned in alphanumerical
  76565. // order based on the resource name.
  76566. //
  76567. // You can also sort results in descending order based on the creation
  76568. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76569. // based on the creationTimestamp field in reverse chronological order
  76570. // (newest result first). Use this to sort resources like operations so
  76571. // that the newest operation is returned first.
  76572. //
  76573. // Currently, only sorting by name or creationTimestamp desc is
  76574. // supported.
  76575. func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall {
  76576. c.urlParams_.Set("orderBy", orderBy)
  76577. return c
  76578. }
  76579. // PageToken sets the optional parameter "pageToken": Specifies a page
  76580. // token to use. Set pageToken to the nextPageToken returned by a
  76581. // previous list request to get the next page of results.
  76582. func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall {
  76583. c.urlParams_.Set("pageToken", pageToken)
  76584. return c
  76585. }
  76586. // Fields allows partial responses to be retrieved. See
  76587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76588. // for more information.
  76589. func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall {
  76590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76591. return c
  76592. }
  76593. // IfNoneMatch sets the optional parameter which makes the operation
  76594. // fail if the object's ETag matches the given value. This is useful for
  76595. // getting updates only after the object has changed since the last
  76596. // request. Use googleapi.IsNotModified to check whether the response
  76597. // error from Do is the result of In-None-Match.
  76598. func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall {
  76599. c.ifNoneMatch_ = entityTag
  76600. return c
  76601. }
  76602. // Context sets the context to be used in this call's Do method. Any
  76603. // pending HTTP request will be aborted if the provided context is
  76604. // canceled.
  76605. func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall {
  76606. c.ctx_ = ctx
  76607. return c
  76608. }
  76609. // Header returns an http.Header that can be modified by the caller to
  76610. // add HTTP headers to the request.
  76611. func (c *RegionInstanceGroupManagersListCall) Header() http.Header {
  76612. if c.header_ == nil {
  76613. c.header_ = make(http.Header)
  76614. }
  76615. return c.header_
  76616. }
  76617. func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) {
  76618. reqHeaders := make(http.Header)
  76619. for k, v := range c.header_ {
  76620. reqHeaders[k] = v
  76621. }
  76622. reqHeaders.Set("User-Agent", c.s.userAgent())
  76623. if c.ifNoneMatch_ != "" {
  76624. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  76625. }
  76626. var body io.Reader = nil
  76627. c.urlParams_.Set("alt", alt)
  76628. c.urlParams_.Set("prettyPrint", "false")
  76629. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers")
  76630. urls += "?" + c.urlParams_.Encode()
  76631. req, err := http.NewRequest("GET", urls, body)
  76632. if err != nil {
  76633. return nil, err
  76634. }
  76635. req.Header = reqHeaders
  76636. googleapi.Expand(req.URL, map[string]string{
  76637. "project": c.project,
  76638. "region": c.region,
  76639. })
  76640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76641. }
  76642. // Do executes the "compute.regionInstanceGroupManagers.list" call.
  76643. // Exactly one of *RegionInstanceGroupManagerList or error will be
  76644. // non-nil. Any non-2xx status code is an error. Response headers are in
  76645. // either *RegionInstanceGroupManagerList.ServerResponse.Header or (if a
  76646. // response was returned at all) in error.(*googleapi.Error).Header. Use
  76647. // googleapi.IsNotModified to check whether the returned error was
  76648. // because http.StatusNotModified was returned.
  76649. func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) {
  76650. gensupport.SetOptions(c.urlParams_, opts...)
  76651. res, err := c.doRequest("json")
  76652. if res != nil && res.StatusCode == http.StatusNotModified {
  76653. if res.Body != nil {
  76654. res.Body.Close()
  76655. }
  76656. return nil, &googleapi.Error{
  76657. Code: res.StatusCode,
  76658. Header: res.Header,
  76659. }
  76660. }
  76661. if err != nil {
  76662. return nil, err
  76663. }
  76664. defer googleapi.CloseBody(res)
  76665. if err := googleapi.CheckResponse(res); err != nil {
  76666. return nil, err
  76667. }
  76668. ret := &RegionInstanceGroupManagerList{
  76669. ServerResponse: googleapi.ServerResponse{
  76670. Header: res.Header,
  76671. HTTPStatusCode: res.StatusCode,
  76672. },
  76673. }
  76674. target := &ret
  76675. if err := gensupport.DecodeResponse(target, res); err != nil {
  76676. return nil, err
  76677. }
  76678. return ret, nil
  76679. // {
  76680. // "description": "Retrieves the list of managed instance groups that are contained within the specified region.",
  76681. // "httpMethod": "GET",
  76682. // "id": "compute.regionInstanceGroupManagers.list",
  76683. // "parameterOrder": [
  76684. // "project",
  76685. // "region"
  76686. // ],
  76687. // "parameters": {
  76688. // "filter": {
  76689. // "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).",
  76690. // "location": "query",
  76691. // "type": "string"
  76692. // },
  76693. // "maxResults": {
  76694. // "default": "500",
  76695. // "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)",
  76696. // "format": "uint32",
  76697. // "location": "query",
  76698. // "minimum": "0",
  76699. // "type": "integer"
  76700. // },
  76701. // "orderBy": {
  76702. // "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.",
  76703. // "location": "query",
  76704. // "type": "string"
  76705. // },
  76706. // "pageToken": {
  76707. // "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.",
  76708. // "location": "query",
  76709. // "type": "string"
  76710. // },
  76711. // "project": {
  76712. // "description": "Project ID for this request.",
  76713. // "location": "path",
  76714. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76715. // "required": true,
  76716. // "type": "string"
  76717. // },
  76718. // "region": {
  76719. // "description": "Name of the region scoping this request.",
  76720. // "location": "path",
  76721. // "required": true,
  76722. // "type": "string"
  76723. // }
  76724. // },
  76725. // "path": "{project}/regions/{region}/instanceGroupManagers",
  76726. // "response": {
  76727. // "$ref": "RegionInstanceGroupManagerList"
  76728. // },
  76729. // "scopes": [
  76730. // "https://www.googleapis.com/auth/cloud-platform",
  76731. // "https://www.googleapis.com/auth/compute",
  76732. // "https://www.googleapis.com/auth/compute.readonly"
  76733. // ]
  76734. // }
  76735. }
  76736. // Pages invokes f for each page of results.
  76737. // A non-nil error returned from f will halt the iteration.
  76738. // The provided context supersedes any context provided to the Context method.
  76739. func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error {
  76740. c.ctx_ = ctx
  76741. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  76742. for {
  76743. x, err := c.Do()
  76744. if err != nil {
  76745. return err
  76746. }
  76747. if err := f(x); err != nil {
  76748. return err
  76749. }
  76750. if x.NextPageToken == "" {
  76751. return nil
  76752. }
  76753. c.PageToken(x.NextPageToken)
  76754. }
  76755. }
  76756. // method id "compute.regionInstanceGroupManagers.listManagedInstances":
  76757. type RegionInstanceGroupManagersListManagedInstancesCall struct {
  76758. s *Service
  76759. project string
  76760. region string
  76761. instanceGroupManager string
  76762. urlParams_ gensupport.URLParams
  76763. ctx_ context.Context
  76764. header_ http.Header
  76765. }
  76766. // ListManagedInstances: Lists the instances in the managed instance
  76767. // group and instances that are scheduled to be created. The list
  76768. // includes any current actions that the group has scheduled for its
  76769. // instances.
  76770. func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76771. c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  76772. c.project = project
  76773. c.region = region
  76774. c.instanceGroupManager = instanceGroupManager
  76775. return c
  76776. }
  76777. // Filter sets the optional parameter "filter": A filter expression that
  76778. // filters resources listed in the response. The expression must specify
  76779. // the field name, a comparison operator, and the value that you want to
  76780. // use for filtering. The value must be a string, a number, or a
  76781. // boolean. The comparison operator must be either =, !=, >, or <.
  76782. //
  76783. // For example, if you are filtering Compute Engine instances, you can
  76784. // exclude instances named example-instance by specifying name !=
  76785. // example-instance.
  76786. //
  76787. // You can also filter nested fields. For example, you could specify
  76788. // scheduling.automaticRestart = false to include instances only if they
  76789. // are not scheduled for automatic restarts. You can use filtering on
  76790. // nested fields to filter based on resource labels.
  76791. //
  76792. // To filter on multiple expressions, provide each separate expression
  76793. // within parentheses. For example, (scheduling.automaticRestart = true)
  76794. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  76795. // AND expression. However, you can include AND and OR expressions
  76796. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  76797. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  76798. // true).
  76799. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76800. c.urlParams_.Set("filter", filter)
  76801. return c
  76802. }
  76803. // MaxResults sets the optional parameter "maxResults": The maximum
  76804. // number of results per page that should be returned. If the number of
  76805. // available results is larger than maxResults, Compute Engine returns a
  76806. // nextPageToken that can be used to get the next page of results in
  76807. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  76808. // (Default: 500)
  76809. func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall {
  76810. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  76811. return c
  76812. }
  76813. // OrderBy sets the optional parameter "order_by": Sorts list results by
  76814. // a certain order. By default, results are returned in alphanumerical
  76815. // order based on the resource name.
  76816. //
  76817. // You can also sort results in descending order based on the creation
  76818. // timestamp using orderBy="creationTimestamp desc". This sorts results
  76819. // based on the creationTimestamp field in reverse chronological order
  76820. // (newest result first). Use this to sort resources like operations so
  76821. // that the newest operation is returned first.
  76822. //
  76823. // Currently, only sorting by name or creationTimestamp desc is
  76824. // supported.
  76825. func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76826. c.urlParams_.Set("order_by", orderBy)
  76827. return c
  76828. }
  76829. // PageToken sets the optional parameter "pageToken": Specifies a page
  76830. // token to use. Set pageToken to the nextPageToken returned by a
  76831. // previous list request to get the next page of results.
  76832. func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall {
  76833. c.urlParams_.Set("pageToken", pageToken)
  76834. return c
  76835. }
  76836. // Fields allows partial responses to be retrieved. See
  76837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  76838. // for more information.
  76839. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall {
  76840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  76841. return c
  76842. }
  76843. // Context sets the context to be used in this call's Do method. Any
  76844. // pending HTTP request will be aborted if the provided context is
  76845. // canceled.
  76846. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall {
  76847. c.ctx_ = ctx
  76848. return c
  76849. }
  76850. // Header returns an http.Header that can be modified by the caller to
  76851. // add HTTP headers to the request.
  76852. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header {
  76853. if c.header_ == nil {
  76854. c.header_ = make(http.Header)
  76855. }
  76856. return c.header_
  76857. }
  76858. func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) {
  76859. reqHeaders := make(http.Header)
  76860. for k, v := range c.header_ {
  76861. reqHeaders[k] = v
  76862. }
  76863. reqHeaders.Set("User-Agent", c.s.userAgent())
  76864. var body io.Reader = nil
  76865. c.urlParams_.Set("alt", alt)
  76866. c.urlParams_.Set("prettyPrint", "false")
  76867. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances")
  76868. urls += "?" + c.urlParams_.Encode()
  76869. req, err := http.NewRequest("POST", urls, body)
  76870. if err != nil {
  76871. return nil, err
  76872. }
  76873. req.Header = reqHeaders
  76874. googleapi.Expand(req.URL, map[string]string{
  76875. "project": c.project,
  76876. "region": c.region,
  76877. "instanceGroupManager": c.instanceGroupManager,
  76878. })
  76879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  76880. }
  76881. // Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call.
  76882. // Exactly one of *RegionInstanceGroupManagersListInstancesResponse or
  76883. // error will be non-nil. Any non-2xx status code is an error. Response
  76884. // headers are in either
  76885. // *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Heade
  76886. // r or (if a response was returned at all) in
  76887. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  76888. // whether the returned error was because http.StatusNotModified was
  76889. // returned.
  76890. func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) {
  76891. gensupport.SetOptions(c.urlParams_, opts...)
  76892. res, err := c.doRequest("json")
  76893. if res != nil && res.StatusCode == http.StatusNotModified {
  76894. if res.Body != nil {
  76895. res.Body.Close()
  76896. }
  76897. return nil, &googleapi.Error{
  76898. Code: res.StatusCode,
  76899. Header: res.Header,
  76900. }
  76901. }
  76902. if err != nil {
  76903. return nil, err
  76904. }
  76905. defer googleapi.CloseBody(res)
  76906. if err := googleapi.CheckResponse(res); err != nil {
  76907. return nil, err
  76908. }
  76909. ret := &RegionInstanceGroupManagersListInstancesResponse{
  76910. ServerResponse: googleapi.ServerResponse{
  76911. Header: res.Header,
  76912. HTTPStatusCode: res.StatusCode,
  76913. },
  76914. }
  76915. target := &ret
  76916. if err := gensupport.DecodeResponse(target, res); err != nil {
  76917. return nil, err
  76918. }
  76919. return ret, nil
  76920. // {
  76921. // "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.",
  76922. // "httpMethod": "POST",
  76923. // "id": "compute.regionInstanceGroupManagers.listManagedInstances",
  76924. // "parameterOrder": [
  76925. // "project",
  76926. // "region",
  76927. // "instanceGroupManager"
  76928. // ],
  76929. // "parameters": {
  76930. // "filter": {
  76931. // "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).",
  76932. // "location": "query",
  76933. // "type": "string"
  76934. // },
  76935. // "instanceGroupManager": {
  76936. // "description": "The name of the managed instance group.",
  76937. // "location": "path",
  76938. // "required": true,
  76939. // "type": "string"
  76940. // },
  76941. // "maxResults": {
  76942. // "default": "500",
  76943. // "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)",
  76944. // "format": "uint32",
  76945. // "location": "query",
  76946. // "minimum": "0",
  76947. // "type": "integer"
  76948. // },
  76949. // "order_by": {
  76950. // "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.",
  76951. // "location": "query",
  76952. // "type": "string"
  76953. // },
  76954. // "pageToken": {
  76955. // "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.",
  76956. // "location": "query",
  76957. // "type": "string"
  76958. // },
  76959. // "project": {
  76960. // "description": "Project ID for this request.",
  76961. // "location": "path",
  76962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  76963. // "required": true,
  76964. // "type": "string"
  76965. // },
  76966. // "region": {
  76967. // "description": "Name of the region scoping this request.",
  76968. // "location": "path",
  76969. // "required": true,
  76970. // "type": "string"
  76971. // }
  76972. // },
  76973. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances",
  76974. // "response": {
  76975. // "$ref": "RegionInstanceGroupManagersListInstancesResponse"
  76976. // },
  76977. // "scopes": [
  76978. // "https://www.googleapis.com/auth/cloud-platform",
  76979. // "https://www.googleapis.com/auth/compute",
  76980. // "https://www.googleapis.com/auth/compute.readonly"
  76981. // ]
  76982. // }
  76983. }
  76984. // method id "compute.regionInstanceGroupManagers.patch":
  76985. type RegionInstanceGroupManagersPatchCall struct {
  76986. s *Service
  76987. project string
  76988. region string
  76989. instanceGroupManager string
  76990. instancegroupmanager *InstanceGroupManager
  76991. urlParams_ gensupport.URLParams
  76992. ctx_ context.Context
  76993. header_ http.Header
  76994. }
  76995. // Patch: Updates a managed instance group using the information that
  76996. // you specify in the request. This operation is marked as DONE when the
  76997. // group is patched even if the instances in the group are still in the
  76998. // process of being patched. You must separately verify the status of
  76999. // the individual instances with the listmanagedinstances method. This
  77000. // method supports PATCH semantics and uses the JSON merge patch format
  77001. // and processing rules.
  77002. func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall {
  77003. c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77004. c.project = project
  77005. c.region = region
  77006. c.instanceGroupManager = instanceGroupManager
  77007. c.instancegroupmanager = instancegroupmanager
  77008. return c
  77009. }
  77010. // RequestId sets the optional parameter "requestId": An optional
  77011. // request ID to identify requests. Specify a unique request ID so that
  77012. // if you must retry your request, the server will know to ignore the
  77013. // request if it has already been completed.
  77014. //
  77015. // For example, consider a situation where you make an initial request
  77016. // and the request times out. If you make the request again with the
  77017. // same request ID, the server can check if original operation with the
  77018. // same request ID was received, and if so, will ignore the second
  77019. // request. This prevents clients from accidentally creating duplicate
  77020. // commitments.
  77021. //
  77022. // The request ID must be a valid UUID with the exception that zero UUID
  77023. // is not supported (00000000-0000-0000-0000-000000000000).
  77024. func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall {
  77025. c.urlParams_.Set("requestId", requestId)
  77026. return c
  77027. }
  77028. // Fields allows partial responses to be retrieved. See
  77029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77030. // for more information.
  77031. func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall {
  77032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77033. return c
  77034. }
  77035. // Context sets the context to be used in this call's Do method. Any
  77036. // pending HTTP request will be aborted if the provided context is
  77037. // canceled.
  77038. func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall {
  77039. c.ctx_ = ctx
  77040. return c
  77041. }
  77042. // Header returns an http.Header that can be modified by the caller to
  77043. // add HTTP headers to the request.
  77044. func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header {
  77045. if c.header_ == nil {
  77046. c.header_ = make(http.Header)
  77047. }
  77048. return c.header_
  77049. }
  77050. func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) {
  77051. reqHeaders := make(http.Header)
  77052. for k, v := range c.header_ {
  77053. reqHeaders[k] = v
  77054. }
  77055. reqHeaders.Set("User-Agent", c.s.userAgent())
  77056. var body io.Reader = nil
  77057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager)
  77058. if err != nil {
  77059. return nil, err
  77060. }
  77061. reqHeaders.Set("Content-Type", "application/json")
  77062. c.urlParams_.Set("alt", alt)
  77063. c.urlParams_.Set("prettyPrint", "false")
  77064. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}")
  77065. urls += "?" + c.urlParams_.Encode()
  77066. req, err := http.NewRequest("PATCH", urls, body)
  77067. if err != nil {
  77068. return nil, err
  77069. }
  77070. req.Header = reqHeaders
  77071. googleapi.Expand(req.URL, map[string]string{
  77072. "project": c.project,
  77073. "region": c.region,
  77074. "instanceGroupManager": c.instanceGroupManager,
  77075. })
  77076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77077. }
  77078. // Do executes the "compute.regionInstanceGroupManagers.patch" call.
  77079. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77080. // status code is an error. Response headers are in either
  77081. // *Operation.ServerResponse.Header or (if a response was returned at
  77082. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77083. // to check whether the returned error was because
  77084. // http.StatusNotModified was returned.
  77085. func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77086. gensupport.SetOptions(c.urlParams_, opts...)
  77087. res, err := c.doRequest("json")
  77088. if res != nil && res.StatusCode == http.StatusNotModified {
  77089. if res.Body != nil {
  77090. res.Body.Close()
  77091. }
  77092. return nil, &googleapi.Error{
  77093. Code: res.StatusCode,
  77094. Header: res.Header,
  77095. }
  77096. }
  77097. if err != nil {
  77098. return nil, err
  77099. }
  77100. defer googleapi.CloseBody(res)
  77101. if err := googleapi.CheckResponse(res); err != nil {
  77102. return nil, err
  77103. }
  77104. ret := &Operation{
  77105. ServerResponse: googleapi.ServerResponse{
  77106. Header: res.Header,
  77107. HTTPStatusCode: res.StatusCode,
  77108. },
  77109. }
  77110. target := &ret
  77111. if err := gensupport.DecodeResponse(target, res); err != nil {
  77112. return nil, err
  77113. }
  77114. return ret, nil
  77115. // {
  77116. // "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.",
  77117. // "httpMethod": "PATCH",
  77118. // "id": "compute.regionInstanceGroupManagers.patch",
  77119. // "parameterOrder": [
  77120. // "project",
  77121. // "region",
  77122. // "instanceGroupManager"
  77123. // ],
  77124. // "parameters": {
  77125. // "instanceGroupManager": {
  77126. // "description": "The name of the instance group manager.",
  77127. // "location": "path",
  77128. // "required": true,
  77129. // "type": "string"
  77130. // },
  77131. // "project": {
  77132. // "description": "Project ID for this request.",
  77133. // "location": "path",
  77134. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77135. // "required": true,
  77136. // "type": "string"
  77137. // },
  77138. // "region": {
  77139. // "description": "Name of the region scoping this request.",
  77140. // "location": "path",
  77141. // "required": true,
  77142. // "type": "string"
  77143. // },
  77144. // "requestId": {
  77145. // "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).",
  77146. // "location": "query",
  77147. // "type": "string"
  77148. // }
  77149. // },
  77150. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}",
  77151. // "request": {
  77152. // "$ref": "InstanceGroupManager"
  77153. // },
  77154. // "response": {
  77155. // "$ref": "Operation"
  77156. // },
  77157. // "scopes": [
  77158. // "https://www.googleapis.com/auth/cloud-platform",
  77159. // "https://www.googleapis.com/auth/compute"
  77160. // ]
  77161. // }
  77162. }
  77163. // method id "compute.regionInstanceGroupManagers.recreateInstances":
  77164. type RegionInstanceGroupManagersRecreateInstancesCall struct {
  77165. s *Service
  77166. project string
  77167. region string
  77168. instanceGroupManager string
  77169. regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest
  77170. urlParams_ gensupport.URLParams
  77171. ctx_ context.Context
  77172. header_ http.Header
  77173. }
  77174. // RecreateInstances: Flags the specified instances in the managed
  77175. // instance group to be immediately recreated. The instances are deleted
  77176. // and recreated using the current instance template for the managed
  77177. // instance group. This operation is marked as DONE when the flag is set
  77178. // even if the instances have not yet been recreated. You must
  77179. // separately verify the status of the recreating action with the
  77180. // listmanagedinstances method.
  77181. //
  77182. // If the group is part of a backend service that has enabled connection
  77183. // draining, it can take up to 60 seconds after the connection draining
  77184. // duration has elapsed before the VM instance is removed or
  77185. // deleted.
  77186. //
  77187. // You can specify a maximum of 1000 instances with this method per
  77188. // request.
  77189. func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall {
  77190. c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77191. c.project = project
  77192. c.region = region
  77193. c.instanceGroupManager = instanceGroupManager
  77194. c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest
  77195. return c
  77196. }
  77197. // RequestId sets the optional parameter "requestId": An optional
  77198. // request ID to identify requests. Specify a unique request ID so that
  77199. // if you must retry your request, the server will know to ignore the
  77200. // request if it has already been completed.
  77201. //
  77202. // For example, consider a situation where you make an initial request
  77203. // and the request times out. If you make the request again with the
  77204. // same request ID, the server can check if original operation with the
  77205. // same request ID was received, and if so, will ignore the second
  77206. // request. This prevents clients from accidentally creating duplicate
  77207. // commitments.
  77208. //
  77209. // The request ID must be a valid UUID with the exception that zero UUID
  77210. // is not supported (00000000-0000-0000-0000-000000000000).
  77211. func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall {
  77212. c.urlParams_.Set("requestId", requestId)
  77213. return c
  77214. }
  77215. // Fields allows partial responses to be retrieved. See
  77216. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77217. // for more information.
  77218. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall {
  77219. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77220. return c
  77221. }
  77222. // Context sets the context to be used in this call's Do method. Any
  77223. // pending HTTP request will be aborted if the provided context is
  77224. // canceled.
  77225. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall {
  77226. c.ctx_ = ctx
  77227. return c
  77228. }
  77229. // Header returns an http.Header that can be modified by the caller to
  77230. // add HTTP headers to the request.
  77231. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header {
  77232. if c.header_ == nil {
  77233. c.header_ = make(http.Header)
  77234. }
  77235. return c.header_
  77236. }
  77237. func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) {
  77238. reqHeaders := make(http.Header)
  77239. for k, v := range c.header_ {
  77240. reqHeaders[k] = v
  77241. }
  77242. reqHeaders.Set("User-Agent", c.s.userAgent())
  77243. var body io.Reader = nil
  77244. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest)
  77245. if err != nil {
  77246. return nil, err
  77247. }
  77248. reqHeaders.Set("Content-Type", "application/json")
  77249. c.urlParams_.Set("alt", alt)
  77250. c.urlParams_.Set("prettyPrint", "false")
  77251. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances")
  77252. urls += "?" + c.urlParams_.Encode()
  77253. req, err := http.NewRequest("POST", urls, body)
  77254. if err != nil {
  77255. return nil, err
  77256. }
  77257. req.Header = reqHeaders
  77258. googleapi.Expand(req.URL, map[string]string{
  77259. "project": c.project,
  77260. "region": c.region,
  77261. "instanceGroupManager": c.instanceGroupManager,
  77262. })
  77263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77264. }
  77265. // Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call.
  77266. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77267. // status code is an error. Response headers are in either
  77268. // *Operation.ServerResponse.Header or (if a response was returned at
  77269. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77270. // to check whether the returned error was because
  77271. // http.StatusNotModified was returned.
  77272. func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77273. gensupport.SetOptions(c.urlParams_, opts...)
  77274. res, err := c.doRequest("json")
  77275. if res != nil && res.StatusCode == http.StatusNotModified {
  77276. if res.Body != nil {
  77277. res.Body.Close()
  77278. }
  77279. return nil, &googleapi.Error{
  77280. Code: res.StatusCode,
  77281. Header: res.Header,
  77282. }
  77283. }
  77284. if err != nil {
  77285. return nil, err
  77286. }
  77287. defer googleapi.CloseBody(res)
  77288. if err := googleapi.CheckResponse(res); err != nil {
  77289. return nil, err
  77290. }
  77291. ret := &Operation{
  77292. ServerResponse: googleapi.ServerResponse{
  77293. Header: res.Header,
  77294. HTTPStatusCode: res.StatusCode,
  77295. },
  77296. }
  77297. target := &ret
  77298. if err := gensupport.DecodeResponse(target, res); err != nil {
  77299. return nil, err
  77300. }
  77301. return ret, nil
  77302. // {
  77303. // "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.",
  77304. // "httpMethod": "POST",
  77305. // "id": "compute.regionInstanceGroupManagers.recreateInstances",
  77306. // "parameterOrder": [
  77307. // "project",
  77308. // "region",
  77309. // "instanceGroupManager"
  77310. // ],
  77311. // "parameters": {
  77312. // "instanceGroupManager": {
  77313. // "description": "Name of the managed instance group.",
  77314. // "location": "path",
  77315. // "required": true,
  77316. // "type": "string"
  77317. // },
  77318. // "project": {
  77319. // "description": "Project ID for this request.",
  77320. // "location": "path",
  77321. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77322. // "required": true,
  77323. // "type": "string"
  77324. // },
  77325. // "region": {
  77326. // "description": "Name of the region scoping this request.",
  77327. // "location": "path",
  77328. // "required": true,
  77329. // "type": "string"
  77330. // },
  77331. // "requestId": {
  77332. // "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).",
  77333. // "location": "query",
  77334. // "type": "string"
  77335. // }
  77336. // },
  77337. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances",
  77338. // "request": {
  77339. // "$ref": "RegionInstanceGroupManagersRecreateRequest"
  77340. // },
  77341. // "response": {
  77342. // "$ref": "Operation"
  77343. // },
  77344. // "scopes": [
  77345. // "https://www.googleapis.com/auth/cloud-platform",
  77346. // "https://www.googleapis.com/auth/compute"
  77347. // ]
  77348. // }
  77349. }
  77350. // method id "compute.regionInstanceGroupManagers.resize":
  77351. type RegionInstanceGroupManagersResizeCall struct {
  77352. s *Service
  77353. project string
  77354. region string
  77355. instanceGroupManager string
  77356. urlParams_ gensupport.URLParams
  77357. ctx_ context.Context
  77358. header_ http.Header
  77359. }
  77360. // Resize: Changes the intended size of the managed instance group. If
  77361. // you increase the size, the group creates new instances using the
  77362. // current instance template. If you decrease the size, the group
  77363. // deletes one or more instances.
  77364. //
  77365. // The resize operation is marked DONE if the resize request is
  77366. // successful. The underlying actions take additional time. You must
  77367. // separately verify the status of the creating or deleting actions with
  77368. // the listmanagedinstances method.
  77369. //
  77370. // If the group is part of a backend service that has enabled connection
  77371. // draining, it can take up to 60 seconds after the connection draining
  77372. // duration has elapsed before the VM instance is removed or deleted.
  77373. func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall {
  77374. c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77375. c.project = project
  77376. c.region = region
  77377. c.instanceGroupManager = instanceGroupManager
  77378. c.urlParams_.Set("size", fmt.Sprint(size))
  77379. return c
  77380. }
  77381. // RequestId sets the optional parameter "requestId": An optional
  77382. // request ID to identify requests. Specify a unique request ID so that
  77383. // if you must retry your request, the server will know to ignore the
  77384. // request if it has already been completed.
  77385. //
  77386. // For example, consider a situation where you make an initial request
  77387. // and the request times out. If you make the request again with the
  77388. // same request ID, the server can check if original operation with the
  77389. // same request ID was received, and if so, will ignore the second
  77390. // request. This prevents clients from accidentally creating duplicate
  77391. // commitments.
  77392. //
  77393. // The request ID must be a valid UUID with the exception that zero UUID
  77394. // is not supported (00000000-0000-0000-0000-000000000000).
  77395. func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall {
  77396. c.urlParams_.Set("requestId", requestId)
  77397. return c
  77398. }
  77399. // Fields allows partial responses to be retrieved. See
  77400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77401. // for more information.
  77402. func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall {
  77403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77404. return c
  77405. }
  77406. // Context sets the context to be used in this call's Do method. Any
  77407. // pending HTTP request will be aborted if the provided context is
  77408. // canceled.
  77409. func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall {
  77410. c.ctx_ = ctx
  77411. return c
  77412. }
  77413. // Header returns an http.Header that can be modified by the caller to
  77414. // add HTTP headers to the request.
  77415. func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header {
  77416. if c.header_ == nil {
  77417. c.header_ = make(http.Header)
  77418. }
  77419. return c.header_
  77420. }
  77421. func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) {
  77422. reqHeaders := make(http.Header)
  77423. for k, v := range c.header_ {
  77424. reqHeaders[k] = v
  77425. }
  77426. reqHeaders.Set("User-Agent", c.s.userAgent())
  77427. var body io.Reader = nil
  77428. c.urlParams_.Set("alt", alt)
  77429. c.urlParams_.Set("prettyPrint", "false")
  77430. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize")
  77431. urls += "?" + c.urlParams_.Encode()
  77432. req, err := http.NewRequest("POST", urls, body)
  77433. if err != nil {
  77434. return nil, err
  77435. }
  77436. req.Header = reqHeaders
  77437. googleapi.Expand(req.URL, map[string]string{
  77438. "project": c.project,
  77439. "region": c.region,
  77440. "instanceGroupManager": c.instanceGroupManager,
  77441. })
  77442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77443. }
  77444. // Do executes the "compute.regionInstanceGroupManagers.resize" call.
  77445. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77446. // status code is an error. Response headers are in either
  77447. // *Operation.ServerResponse.Header or (if a response was returned at
  77448. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77449. // to check whether the returned error was because
  77450. // http.StatusNotModified was returned.
  77451. func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77452. gensupport.SetOptions(c.urlParams_, opts...)
  77453. res, err := c.doRequest("json")
  77454. if res != nil && res.StatusCode == http.StatusNotModified {
  77455. if res.Body != nil {
  77456. res.Body.Close()
  77457. }
  77458. return nil, &googleapi.Error{
  77459. Code: res.StatusCode,
  77460. Header: res.Header,
  77461. }
  77462. }
  77463. if err != nil {
  77464. return nil, err
  77465. }
  77466. defer googleapi.CloseBody(res)
  77467. if err := googleapi.CheckResponse(res); err != nil {
  77468. return nil, err
  77469. }
  77470. ret := &Operation{
  77471. ServerResponse: googleapi.ServerResponse{
  77472. Header: res.Header,
  77473. HTTPStatusCode: res.StatusCode,
  77474. },
  77475. }
  77476. target := &ret
  77477. if err := gensupport.DecodeResponse(target, res); err != nil {
  77478. return nil, err
  77479. }
  77480. return ret, nil
  77481. // {
  77482. // "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.",
  77483. // "httpMethod": "POST",
  77484. // "id": "compute.regionInstanceGroupManagers.resize",
  77485. // "parameterOrder": [
  77486. // "project",
  77487. // "region",
  77488. // "instanceGroupManager",
  77489. // "size"
  77490. // ],
  77491. // "parameters": {
  77492. // "instanceGroupManager": {
  77493. // "description": "Name of the managed instance group.",
  77494. // "location": "path",
  77495. // "required": true,
  77496. // "type": "string"
  77497. // },
  77498. // "project": {
  77499. // "description": "Project ID for this request.",
  77500. // "location": "path",
  77501. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77502. // "required": true,
  77503. // "type": "string"
  77504. // },
  77505. // "region": {
  77506. // "description": "Name of the region scoping this request.",
  77507. // "location": "path",
  77508. // "required": true,
  77509. // "type": "string"
  77510. // },
  77511. // "requestId": {
  77512. // "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).",
  77513. // "location": "query",
  77514. // "type": "string"
  77515. // },
  77516. // "size": {
  77517. // "description": "Number of instances that should exist in this instance group manager.",
  77518. // "format": "int32",
  77519. // "location": "query",
  77520. // "minimum": "0",
  77521. // "required": true,
  77522. // "type": "integer"
  77523. // }
  77524. // },
  77525. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize",
  77526. // "response": {
  77527. // "$ref": "Operation"
  77528. // },
  77529. // "scopes": [
  77530. // "https://www.googleapis.com/auth/cloud-platform",
  77531. // "https://www.googleapis.com/auth/compute"
  77532. // ]
  77533. // }
  77534. }
  77535. // method id "compute.regionInstanceGroupManagers.setInstanceTemplate":
  77536. type RegionInstanceGroupManagersSetInstanceTemplateCall struct {
  77537. s *Service
  77538. project string
  77539. region string
  77540. instanceGroupManager string
  77541. regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest
  77542. urlParams_ gensupport.URLParams
  77543. ctx_ context.Context
  77544. header_ http.Header
  77545. }
  77546. // SetInstanceTemplate: Sets the instance template to use when creating
  77547. // new instances or recreating instances in this group. Existing
  77548. // instances are not affected.
  77549. func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77550. c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77551. c.project = project
  77552. c.region = region
  77553. c.instanceGroupManager = instanceGroupManager
  77554. c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest
  77555. return c
  77556. }
  77557. // RequestId sets the optional parameter "requestId": An optional
  77558. // request ID to identify requests. Specify a unique request ID so that
  77559. // if you must retry your request, the server will know to ignore the
  77560. // request if it has already been completed.
  77561. //
  77562. // For example, consider a situation where you make an initial request
  77563. // and the request times out. If you make the request again with the
  77564. // same request ID, the server can check if original operation with the
  77565. // same request ID was received, and if so, will ignore the second
  77566. // request. This prevents clients from accidentally creating duplicate
  77567. // commitments.
  77568. //
  77569. // The request ID must be a valid UUID with the exception that zero UUID
  77570. // is not supported (00000000-0000-0000-0000-000000000000).
  77571. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77572. c.urlParams_.Set("requestId", requestId)
  77573. return c
  77574. }
  77575. // Fields allows partial responses to be retrieved. See
  77576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77577. // for more information.
  77578. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77580. return c
  77581. }
  77582. // Context sets the context to be used in this call's Do method. Any
  77583. // pending HTTP request will be aborted if the provided context is
  77584. // canceled.
  77585. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall {
  77586. c.ctx_ = ctx
  77587. return c
  77588. }
  77589. // Header returns an http.Header that can be modified by the caller to
  77590. // add HTTP headers to the request.
  77591. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header {
  77592. if c.header_ == nil {
  77593. c.header_ = make(http.Header)
  77594. }
  77595. return c.header_
  77596. }
  77597. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) {
  77598. reqHeaders := make(http.Header)
  77599. for k, v := range c.header_ {
  77600. reqHeaders[k] = v
  77601. }
  77602. reqHeaders.Set("User-Agent", c.s.userAgent())
  77603. var body io.Reader = nil
  77604. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest)
  77605. if err != nil {
  77606. return nil, err
  77607. }
  77608. reqHeaders.Set("Content-Type", "application/json")
  77609. c.urlParams_.Set("alt", alt)
  77610. c.urlParams_.Set("prettyPrint", "false")
  77611. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate")
  77612. urls += "?" + c.urlParams_.Encode()
  77613. req, err := http.NewRequest("POST", urls, body)
  77614. if err != nil {
  77615. return nil, err
  77616. }
  77617. req.Header = reqHeaders
  77618. googleapi.Expand(req.URL, map[string]string{
  77619. "project": c.project,
  77620. "region": c.region,
  77621. "instanceGroupManager": c.instanceGroupManager,
  77622. })
  77623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77624. }
  77625. // Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call.
  77626. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77627. // status code is an error. Response headers are in either
  77628. // *Operation.ServerResponse.Header or (if a response was returned at
  77629. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77630. // to check whether the returned error was because
  77631. // http.StatusNotModified was returned.
  77632. func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77633. gensupport.SetOptions(c.urlParams_, opts...)
  77634. res, err := c.doRequest("json")
  77635. if res != nil && res.StatusCode == http.StatusNotModified {
  77636. if res.Body != nil {
  77637. res.Body.Close()
  77638. }
  77639. return nil, &googleapi.Error{
  77640. Code: res.StatusCode,
  77641. Header: res.Header,
  77642. }
  77643. }
  77644. if err != nil {
  77645. return nil, err
  77646. }
  77647. defer googleapi.CloseBody(res)
  77648. if err := googleapi.CheckResponse(res); err != nil {
  77649. return nil, err
  77650. }
  77651. ret := &Operation{
  77652. ServerResponse: googleapi.ServerResponse{
  77653. Header: res.Header,
  77654. HTTPStatusCode: res.StatusCode,
  77655. },
  77656. }
  77657. target := &ret
  77658. if err := gensupport.DecodeResponse(target, res); err != nil {
  77659. return nil, err
  77660. }
  77661. return ret, nil
  77662. // {
  77663. // "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.",
  77664. // "httpMethod": "POST",
  77665. // "id": "compute.regionInstanceGroupManagers.setInstanceTemplate",
  77666. // "parameterOrder": [
  77667. // "project",
  77668. // "region",
  77669. // "instanceGroupManager"
  77670. // ],
  77671. // "parameters": {
  77672. // "instanceGroupManager": {
  77673. // "description": "The name of the managed instance group.",
  77674. // "location": "path",
  77675. // "required": true,
  77676. // "type": "string"
  77677. // },
  77678. // "project": {
  77679. // "description": "Project ID for this request.",
  77680. // "location": "path",
  77681. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77682. // "required": true,
  77683. // "type": "string"
  77684. // },
  77685. // "region": {
  77686. // "description": "Name of the region scoping this request.",
  77687. // "location": "path",
  77688. // "required": true,
  77689. // "type": "string"
  77690. // },
  77691. // "requestId": {
  77692. // "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).",
  77693. // "location": "query",
  77694. // "type": "string"
  77695. // }
  77696. // },
  77697. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate",
  77698. // "request": {
  77699. // "$ref": "RegionInstanceGroupManagersSetTemplateRequest"
  77700. // },
  77701. // "response": {
  77702. // "$ref": "Operation"
  77703. // },
  77704. // "scopes": [
  77705. // "https://www.googleapis.com/auth/cloud-platform",
  77706. // "https://www.googleapis.com/auth/compute"
  77707. // ]
  77708. // }
  77709. }
  77710. // method id "compute.regionInstanceGroupManagers.setTargetPools":
  77711. type RegionInstanceGroupManagersSetTargetPoolsCall struct {
  77712. s *Service
  77713. project string
  77714. region string
  77715. instanceGroupManager string
  77716. regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest
  77717. urlParams_ gensupport.URLParams
  77718. ctx_ context.Context
  77719. header_ http.Header
  77720. }
  77721. // SetTargetPools: Modifies the target pools to which all new instances
  77722. // in this group are assigned. Existing instances in the group are not
  77723. // affected.
  77724. func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77725. c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77726. c.project = project
  77727. c.region = region
  77728. c.instanceGroupManager = instanceGroupManager
  77729. c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest
  77730. return c
  77731. }
  77732. // RequestId sets the optional parameter "requestId": An optional
  77733. // request ID to identify requests. Specify a unique request ID so that
  77734. // if you must retry your request, the server will know to ignore the
  77735. // request if it has already been completed.
  77736. //
  77737. // For example, consider a situation where you make an initial request
  77738. // and the request times out. If you make the request again with the
  77739. // same request ID, the server can check if original operation with the
  77740. // same request ID was received, and if so, will ignore the second
  77741. // request. This prevents clients from accidentally creating duplicate
  77742. // commitments.
  77743. //
  77744. // The request ID must be a valid UUID with the exception that zero UUID
  77745. // is not supported (00000000-0000-0000-0000-000000000000).
  77746. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77747. c.urlParams_.Set("requestId", requestId)
  77748. return c
  77749. }
  77750. // Fields allows partial responses to be retrieved. See
  77751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77752. // for more information.
  77753. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77755. return c
  77756. }
  77757. // Context sets the context to be used in this call's Do method. Any
  77758. // pending HTTP request will be aborted if the provided context is
  77759. // canceled.
  77760. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall {
  77761. c.ctx_ = ctx
  77762. return c
  77763. }
  77764. // Header returns an http.Header that can be modified by the caller to
  77765. // add HTTP headers to the request.
  77766. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header {
  77767. if c.header_ == nil {
  77768. c.header_ = make(http.Header)
  77769. }
  77770. return c.header_
  77771. }
  77772. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) {
  77773. reqHeaders := make(http.Header)
  77774. for k, v := range c.header_ {
  77775. reqHeaders[k] = v
  77776. }
  77777. reqHeaders.Set("User-Agent", c.s.userAgent())
  77778. var body io.Reader = nil
  77779. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest)
  77780. if err != nil {
  77781. return nil, err
  77782. }
  77783. reqHeaders.Set("Content-Type", "application/json")
  77784. c.urlParams_.Set("alt", alt)
  77785. c.urlParams_.Set("prettyPrint", "false")
  77786. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools")
  77787. urls += "?" + c.urlParams_.Encode()
  77788. req, err := http.NewRequest("POST", urls, body)
  77789. if err != nil {
  77790. return nil, err
  77791. }
  77792. req.Header = reqHeaders
  77793. googleapi.Expand(req.URL, map[string]string{
  77794. "project": c.project,
  77795. "region": c.region,
  77796. "instanceGroupManager": c.instanceGroupManager,
  77797. })
  77798. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77799. }
  77800. // Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call.
  77801. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  77802. // status code is an error. Response headers are in either
  77803. // *Operation.ServerResponse.Header or (if a response was returned at
  77804. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  77805. // to check whether the returned error was because
  77806. // http.StatusNotModified was returned.
  77807. func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  77808. gensupport.SetOptions(c.urlParams_, opts...)
  77809. res, err := c.doRequest("json")
  77810. if res != nil && res.StatusCode == http.StatusNotModified {
  77811. if res.Body != nil {
  77812. res.Body.Close()
  77813. }
  77814. return nil, &googleapi.Error{
  77815. Code: res.StatusCode,
  77816. Header: res.Header,
  77817. }
  77818. }
  77819. if err != nil {
  77820. return nil, err
  77821. }
  77822. defer googleapi.CloseBody(res)
  77823. if err := googleapi.CheckResponse(res); err != nil {
  77824. return nil, err
  77825. }
  77826. ret := &Operation{
  77827. ServerResponse: googleapi.ServerResponse{
  77828. Header: res.Header,
  77829. HTTPStatusCode: res.StatusCode,
  77830. },
  77831. }
  77832. target := &ret
  77833. if err := gensupport.DecodeResponse(target, res); err != nil {
  77834. return nil, err
  77835. }
  77836. return ret, nil
  77837. // {
  77838. // "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.",
  77839. // "httpMethod": "POST",
  77840. // "id": "compute.regionInstanceGroupManagers.setTargetPools",
  77841. // "parameterOrder": [
  77842. // "project",
  77843. // "region",
  77844. // "instanceGroupManager"
  77845. // ],
  77846. // "parameters": {
  77847. // "instanceGroupManager": {
  77848. // "description": "Name of the managed instance group.",
  77849. // "location": "path",
  77850. // "required": true,
  77851. // "type": "string"
  77852. // },
  77853. // "project": {
  77854. // "description": "Project ID for this request.",
  77855. // "location": "path",
  77856. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  77857. // "required": true,
  77858. // "type": "string"
  77859. // },
  77860. // "region": {
  77861. // "description": "Name of the region scoping this request.",
  77862. // "location": "path",
  77863. // "required": true,
  77864. // "type": "string"
  77865. // },
  77866. // "requestId": {
  77867. // "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).",
  77868. // "location": "query",
  77869. // "type": "string"
  77870. // }
  77871. // },
  77872. // "path": "{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools",
  77873. // "request": {
  77874. // "$ref": "RegionInstanceGroupManagersSetTargetPoolsRequest"
  77875. // },
  77876. // "response": {
  77877. // "$ref": "Operation"
  77878. // },
  77879. // "scopes": [
  77880. // "https://www.googleapis.com/auth/cloud-platform",
  77881. // "https://www.googleapis.com/auth/compute"
  77882. // ]
  77883. // }
  77884. }
  77885. // method id "compute.regionInstanceGroups.get":
  77886. type RegionInstanceGroupsGetCall struct {
  77887. s *Service
  77888. project string
  77889. region string
  77890. instanceGroup string
  77891. urlParams_ gensupport.URLParams
  77892. ifNoneMatch_ string
  77893. ctx_ context.Context
  77894. header_ http.Header
  77895. }
  77896. // Get: Returns the specified instance group resource.
  77897. func (r *RegionInstanceGroupsService) Get(project string, region string, instanceGroup string) *RegionInstanceGroupsGetCall {
  77898. c := &RegionInstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  77899. c.project = project
  77900. c.region = region
  77901. c.instanceGroup = instanceGroup
  77902. return c
  77903. }
  77904. // Fields allows partial responses to be retrieved. See
  77905. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  77906. // for more information.
  77907. func (c *RegionInstanceGroupsGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsGetCall {
  77908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  77909. return c
  77910. }
  77911. // IfNoneMatch sets the optional parameter which makes the operation
  77912. // fail if the object's ETag matches the given value. This is useful for
  77913. // getting updates only after the object has changed since the last
  77914. // request. Use googleapi.IsNotModified to check whether the response
  77915. // error from Do is the result of In-None-Match.
  77916. func (c *RegionInstanceGroupsGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsGetCall {
  77917. c.ifNoneMatch_ = entityTag
  77918. return c
  77919. }
  77920. // Context sets the context to be used in this call's Do method. Any
  77921. // pending HTTP request will be aborted if the provided context is
  77922. // canceled.
  77923. func (c *RegionInstanceGroupsGetCall) Context(ctx context.Context) *RegionInstanceGroupsGetCall {
  77924. c.ctx_ = ctx
  77925. return c
  77926. }
  77927. // Header returns an http.Header that can be modified by the caller to
  77928. // add HTTP headers to the request.
  77929. func (c *RegionInstanceGroupsGetCall) Header() http.Header {
  77930. if c.header_ == nil {
  77931. c.header_ = make(http.Header)
  77932. }
  77933. return c.header_
  77934. }
  77935. func (c *RegionInstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  77936. reqHeaders := make(http.Header)
  77937. for k, v := range c.header_ {
  77938. reqHeaders[k] = v
  77939. }
  77940. reqHeaders.Set("User-Agent", c.s.userAgent())
  77941. if c.ifNoneMatch_ != "" {
  77942. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  77943. }
  77944. var body io.Reader = nil
  77945. c.urlParams_.Set("alt", alt)
  77946. c.urlParams_.Set("prettyPrint", "false")
  77947. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}")
  77948. urls += "?" + c.urlParams_.Encode()
  77949. req, err := http.NewRequest("GET", urls, body)
  77950. if err != nil {
  77951. return nil, err
  77952. }
  77953. req.Header = reqHeaders
  77954. googleapi.Expand(req.URL, map[string]string{
  77955. "project": c.project,
  77956. "region": c.region,
  77957. "instanceGroup": c.instanceGroup,
  77958. })
  77959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  77960. }
  77961. // Do executes the "compute.regionInstanceGroups.get" call.
  77962. // Exactly one of *InstanceGroup or error will be non-nil. Any non-2xx
  77963. // status code is an error. Response headers are in either
  77964. // *InstanceGroup.ServerResponse.Header or (if a response was returned
  77965. // at all) in error.(*googleapi.Error).Header. Use
  77966. // googleapi.IsNotModified to check whether the returned error was
  77967. // because http.StatusNotModified was returned.
  77968. func (c *RegionInstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) {
  77969. gensupport.SetOptions(c.urlParams_, opts...)
  77970. res, err := c.doRequest("json")
  77971. if res != nil && res.StatusCode == http.StatusNotModified {
  77972. if res.Body != nil {
  77973. res.Body.Close()
  77974. }
  77975. return nil, &googleapi.Error{
  77976. Code: res.StatusCode,
  77977. Header: res.Header,
  77978. }
  77979. }
  77980. if err != nil {
  77981. return nil, err
  77982. }
  77983. defer googleapi.CloseBody(res)
  77984. if err := googleapi.CheckResponse(res); err != nil {
  77985. return nil, err
  77986. }
  77987. ret := &InstanceGroup{
  77988. ServerResponse: googleapi.ServerResponse{
  77989. Header: res.Header,
  77990. HTTPStatusCode: res.StatusCode,
  77991. },
  77992. }
  77993. target := &ret
  77994. if err := gensupport.DecodeResponse(target, res); err != nil {
  77995. return nil, err
  77996. }
  77997. return ret, nil
  77998. // {
  77999. // "description": "Returns the specified instance group resource.",
  78000. // "httpMethod": "GET",
  78001. // "id": "compute.regionInstanceGroups.get",
  78002. // "parameterOrder": [
  78003. // "project",
  78004. // "region",
  78005. // "instanceGroup"
  78006. // ],
  78007. // "parameters": {
  78008. // "instanceGroup": {
  78009. // "description": "Name of the instance group resource to return.",
  78010. // "location": "path",
  78011. // "required": true,
  78012. // "type": "string"
  78013. // },
  78014. // "project": {
  78015. // "description": "Project ID for this request.",
  78016. // "location": "path",
  78017. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78018. // "required": true,
  78019. // "type": "string"
  78020. // },
  78021. // "region": {
  78022. // "description": "Name of the region scoping this request.",
  78023. // "location": "path",
  78024. // "required": true,
  78025. // "type": "string"
  78026. // }
  78027. // },
  78028. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}",
  78029. // "response": {
  78030. // "$ref": "InstanceGroup"
  78031. // },
  78032. // "scopes": [
  78033. // "https://www.googleapis.com/auth/cloud-platform",
  78034. // "https://www.googleapis.com/auth/compute",
  78035. // "https://www.googleapis.com/auth/compute.readonly"
  78036. // ]
  78037. // }
  78038. }
  78039. // method id "compute.regionInstanceGroups.list":
  78040. type RegionInstanceGroupsListCall struct {
  78041. s *Service
  78042. project string
  78043. region string
  78044. urlParams_ gensupport.URLParams
  78045. ifNoneMatch_ string
  78046. ctx_ context.Context
  78047. header_ http.Header
  78048. }
  78049. // List: Retrieves the list of instance group resources contained within
  78050. // the specified region.
  78051. func (r *RegionInstanceGroupsService) List(project string, region string) *RegionInstanceGroupsListCall {
  78052. c := &RegionInstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78053. c.project = project
  78054. c.region = region
  78055. return c
  78056. }
  78057. // Filter sets the optional parameter "filter": A filter expression that
  78058. // filters resources listed in the response. The expression must specify
  78059. // the field name, a comparison operator, and the value that you want to
  78060. // use for filtering. The value must be a string, a number, or a
  78061. // boolean. The comparison operator must be either =, !=, >, or <.
  78062. //
  78063. // For example, if you are filtering Compute Engine instances, you can
  78064. // exclude instances named example-instance by specifying name !=
  78065. // example-instance.
  78066. //
  78067. // You can also filter nested fields. For example, you could specify
  78068. // scheduling.automaticRestart = false to include instances only if they
  78069. // are not scheduled for automatic restarts. You can use filtering on
  78070. // nested fields to filter based on resource labels.
  78071. //
  78072. // To filter on multiple expressions, provide each separate expression
  78073. // within parentheses. For example, (scheduling.automaticRestart = true)
  78074. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78075. // AND expression. However, you can include AND and OR expressions
  78076. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78077. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78078. // true).
  78079. func (c *RegionInstanceGroupsListCall) Filter(filter string) *RegionInstanceGroupsListCall {
  78080. c.urlParams_.Set("filter", filter)
  78081. return c
  78082. }
  78083. // MaxResults sets the optional parameter "maxResults": The maximum
  78084. // number of results per page that should be returned. If the number of
  78085. // available results is larger than maxResults, Compute Engine returns a
  78086. // nextPageToken that can be used to get the next page of results in
  78087. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78088. // (Default: 500)
  78089. func (c *RegionInstanceGroupsListCall) MaxResults(maxResults int64) *RegionInstanceGroupsListCall {
  78090. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78091. return c
  78092. }
  78093. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78094. // a certain order. By default, results are returned in alphanumerical
  78095. // order based on the resource name.
  78096. //
  78097. // You can also sort results in descending order based on the creation
  78098. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78099. // based on the creationTimestamp field in reverse chronological order
  78100. // (newest result first). Use this to sort resources like operations so
  78101. // that the newest operation is returned first.
  78102. //
  78103. // Currently, only sorting by name or creationTimestamp desc is
  78104. // supported.
  78105. func (c *RegionInstanceGroupsListCall) OrderBy(orderBy string) *RegionInstanceGroupsListCall {
  78106. c.urlParams_.Set("orderBy", orderBy)
  78107. return c
  78108. }
  78109. // PageToken sets the optional parameter "pageToken": Specifies a page
  78110. // token to use. Set pageToken to the nextPageToken returned by a
  78111. // previous list request to get the next page of results.
  78112. func (c *RegionInstanceGroupsListCall) PageToken(pageToken string) *RegionInstanceGroupsListCall {
  78113. c.urlParams_.Set("pageToken", pageToken)
  78114. return c
  78115. }
  78116. // Fields allows partial responses to be retrieved. See
  78117. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78118. // for more information.
  78119. func (c *RegionInstanceGroupsListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListCall {
  78120. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78121. return c
  78122. }
  78123. // IfNoneMatch sets the optional parameter which makes the operation
  78124. // fail if the object's ETag matches the given value. This is useful for
  78125. // getting updates only after the object has changed since the last
  78126. // request. Use googleapi.IsNotModified to check whether the response
  78127. // error from Do is the result of In-None-Match.
  78128. func (c *RegionInstanceGroupsListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupsListCall {
  78129. c.ifNoneMatch_ = entityTag
  78130. return c
  78131. }
  78132. // Context sets the context to be used in this call's Do method. Any
  78133. // pending HTTP request will be aborted if the provided context is
  78134. // canceled.
  78135. func (c *RegionInstanceGroupsListCall) Context(ctx context.Context) *RegionInstanceGroupsListCall {
  78136. c.ctx_ = ctx
  78137. return c
  78138. }
  78139. // Header returns an http.Header that can be modified by the caller to
  78140. // add HTTP headers to the request.
  78141. func (c *RegionInstanceGroupsListCall) Header() http.Header {
  78142. if c.header_ == nil {
  78143. c.header_ = make(http.Header)
  78144. }
  78145. return c.header_
  78146. }
  78147. func (c *RegionInstanceGroupsListCall) doRequest(alt string) (*http.Response, error) {
  78148. reqHeaders := make(http.Header)
  78149. for k, v := range c.header_ {
  78150. reqHeaders[k] = v
  78151. }
  78152. reqHeaders.Set("User-Agent", c.s.userAgent())
  78153. if c.ifNoneMatch_ != "" {
  78154. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78155. }
  78156. var body io.Reader = nil
  78157. c.urlParams_.Set("alt", alt)
  78158. c.urlParams_.Set("prettyPrint", "false")
  78159. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups")
  78160. urls += "?" + c.urlParams_.Encode()
  78161. req, err := http.NewRequest("GET", urls, body)
  78162. if err != nil {
  78163. return nil, err
  78164. }
  78165. req.Header = reqHeaders
  78166. googleapi.Expand(req.URL, map[string]string{
  78167. "project": c.project,
  78168. "region": c.region,
  78169. })
  78170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78171. }
  78172. // Do executes the "compute.regionInstanceGroups.list" call.
  78173. // Exactly one of *RegionInstanceGroupList or error will be non-nil. Any
  78174. // non-2xx status code is an error. Response headers are in either
  78175. // *RegionInstanceGroupList.ServerResponse.Header or (if a response was
  78176. // returned at all) in error.(*googleapi.Error).Header. Use
  78177. // googleapi.IsNotModified to check whether the returned error was
  78178. // because http.StatusNotModified was returned.
  78179. func (c *RegionInstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupList, error) {
  78180. gensupport.SetOptions(c.urlParams_, opts...)
  78181. res, err := c.doRequest("json")
  78182. if res != nil && res.StatusCode == http.StatusNotModified {
  78183. if res.Body != nil {
  78184. res.Body.Close()
  78185. }
  78186. return nil, &googleapi.Error{
  78187. Code: res.StatusCode,
  78188. Header: res.Header,
  78189. }
  78190. }
  78191. if err != nil {
  78192. return nil, err
  78193. }
  78194. defer googleapi.CloseBody(res)
  78195. if err := googleapi.CheckResponse(res); err != nil {
  78196. return nil, err
  78197. }
  78198. ret := &RegionInstanceGroupList{
  78199. ServerResponse: googleapi.ServerResponse{
  78200. Header: res.Header,
  78201. HTTPStatusCode: res.StatusCode,
  78202. },
  78203. }
  78204. target := &ret
  78205. if err := gensupport.DecodeResponse(target, res); err != nil {
  78206. return nil, err
  78207. }
  78208. return ret, nil
  78209. // {
  78210. // "description": "Retrieves the list of instance group resources contained within the specified region.",
  78211. // "httpMethod": "GET",
  78212. // "id": "compute.regionInstanceGroups.list",
  78213. // "parameterOrder": [
  78214. // "project",
  78215. // "region"
  78216. // ],
  78217. // "parameters": {
  78218. // "filter": {
  78219. // "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).",
  78220. // "location": "query",
  78221. // "type": "string"
  78222. // },
  78223. // "maxResults": {
  78224. // "default": "500",
  78225. // "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)",
  78226. // "format": "uint32",
  78227. // "location": "query",
  78228. // "minimum": "0",
  78229. // "type": "integer"
  78230. // },
  78231. // "orderBy": {
  78232. // "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.",
  78233. // "location": "query",
  78234. // "type": "string"
  78235. // },
  78236. // "pageToken": {
  78237. // "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.",
  78238. // "location": "query",
  78239. // "type": "string"
  78240. // },
  78241. // "project": {
  78242. // "description": "Project ID for this request.",
  78243. // "location": "path",
  78244. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78245. // "required": true,
  78246. // "type": "string"
  78247. // },
  78248. // "region": {
  78249. // "description": "Name of the region scoping this request.",
  78250. // "location": "path",
  78251. // "required": true,
  78252. // "type": "string"
  78253. // }
  78254. // },
  78255. // "path": "{project}/regions/{region}/instanceGroups",
  78256. // "response": {
  78257. // "$ref": "RegionInstanceGroupList"
  78258. // },
  78259. // "scopes": [
  78260. // "https://www.googleapis.com/auth/cloud-platform",
  78261. // "https://www.googleapis.com/auth/compute",
  78262. // "https://www.googleapis.com/auth/compute.readonly"
  78263. // ]
  78264. // }
  78265. }
  78266. // Pages invokes f for each page of results.
  78267. // A non-nil error returned from f will halt the iteration.
  78268. // The provided context supersedes any context provided to the Context method.
  78269. func (c *RegionInstanceGroupsListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupList) error) error {
  78270. c.ctx_ = ctx
  78271. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78272. for {
  78273. x, err := c.Do()
  78274. if err != nil {
  78275. return err
  78276. }
  78277. if err := f(x); err != nil {
  78278. return err
  78279. }
  78280. if x.NextPageToken == "" {
  78281. return nil
  78282. }
  78283. c.PageToken(x.NextPageToken)
  78284. }
  78285. }
  78286. // method id "compute.regionInstanceGroups.listInstances":
  78287. type RegionInstanceGroupsListInstancesCall struct {
  78288. s *Service
  78289. project string
  78290. region string
  78291. instanceGroup string
  78292. regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest
  78293. urlParams_ gensupport.URLParams
  78294. ctx_ context.Context
  78295. header_ http.Header
  78296. }
  78297. // ListInstances: Lists the instances in the specified instance group
  78298. // and displays information about the named ports. Depending on the
  78299. // specified options, this method can list all instances or only the
  78300. // instances that are running.
  78301. func (r *RegionInstanceGroupsService) ListInstances(project string, region string, instanceGroup string, regioninstancegroupslistinstancesrequest *RegionInstanceGroupsListInstancesRequest) *RegionInstanceGroupsListInstancesCall {
  78302. c := &RegionInstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78303. c.project = project
  78304. c.region = region
  78305. c.instanceGroup = instanceGroup
  78306. c.regioninstancegroupslistinstancesrequest = regioninstancegroupslistinstancesrequest
  78307. return c
  78308. }
  78309. // Filter sets the optional parameter "filter": A filter expression that
  78310. // filters resources listed in the response. The expression must specify
  78311. // the field name, a comparison operator, and the value that you want to
  78312. // use for filtering. The value must be a string, a number, or a
  78313. // boolean. The comparison operator must be either =, !=, >, or <.
  78314. //
  78315. // For example, if you are filtering Compute Engine instances, you can
  78316. // exclude instances named example-instance by specifying name !=
  78317. // example-instance.
  78318. //
  78319. // You can also filter nested fields. For example, you could specify
  78320. // scheduling.automaticRestart = false to include instances only if they
  78321. // are not scheduled for automatic restarts. You can use filtering on
  78322. // nested fields to filter based on resource labels.
  78323. //
  78324. // To filter on multiple expressions, provide each separate expression
  78325. // within parentheses. For example, (scheduling.automaticRestart = true)
  78326. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  78327. // AND expression. However, you can include AND and OR expressions
  78328. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  78329. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  78330. // true).
  78331. func (c *RegionInstanceGroupsListInstancesCall) Filter(filter string) *RegionInstanceGroupsListInstancesCall {
  78332. c.urlParams_.Set("filter", filter)
  78333. return c
  78334. }
  78335. // MaxResults sets the optional parameter "maxResults": The maximum
  78336. // number of results per page that should be returned. If the number of
  78337. // available results is larger than maxResults, Compute Engine returns a
  78338. // nextPageToken that can be used to get the next page of results in
  78339. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  78340. // (Default: 500)
  78341. func (c *RegionInstanceGroupsListInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupsListInstancesCall {
  78342. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  78343. return c
  78344. }
  78345. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  78346. // a certain order. By default, results are returned in alphanumerical
  78347. // order based on the resource name.
  78348. //
  78349. // You can also sort results in descending order based on the creation
  78350. // timestamp using orderBy="creationTimestamp desc". This sorts results
  78351. // based on the creationTimestamp field in reverse chronological order
  78352. // (newest result first). Use this to sort resources like operations so
  78353. // that the newest operation is returned first.
  78354. //
  78355. // Currently, only sorting by name or creationTimestamp desc is
  78356. // supported.
  78357. func (c *RegionInstanceGroupsListInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupsListInstancesCall {
  78358. c.urlParams_.Set("orderBy", orderBy)
  78359. return c
  78360. }
  78361. // PageToken sets the optional parameter "pageToken": Specifies a page
  78362. // token to use. Set pageToken to the nextPageToken returned by a
  78363. // previous list request to get the next page of results.
  78364. func (c *RegionInstanceGroupsListInstancesCall) PageToken(pageToken string) *RegionInstanceGroupsListInstancesCall {
  78365. c.urlParams_.Set("pageToken", pageToken)
  78366. return c
  78367. }
  78368. // Fields allows partial responses to be retrieved. See
  78369. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78370. // for more information.
  78371. func (c *RegionInstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsListInstancesCall {
  78372. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78373. return c
  78374. }
  78375. // Context sets the context to be used in this call's Do method. Any
  78376. // pending HTTP request will be aborted if the provided context is
  78377. // canceled.
  78378. func (c *RegionInstanceGroupsListInstancesCall) Context(ctx context.Context) *RegionInstanceGroupsListInstancesCall {
  78379. c.ctx_ = ctx
  78380. return c
  78381. }
  78382. // Header returns an http.Header that can be modified by the caller to
  78383. // add HTTP headers to the request.
  78384. func (c *RegionInstanceGroupsListInstancesCall) Header() http.Header {
  78385. if c.header_ == nil {
  78386. c.header_ = make(http.Header)
  78387. }
  78388. return c.header_
  78389. }
  78390. func (c *RegionInstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) {
  78391. reqHeaders := make(http.Header)
  78392. for k, v := range c.header_ {
  78393. reqHeaders[k] = v
  78394. }
  78395. reqHeaders.Set("User-Agent", c.s.userAgent())
  78396. var body io.Reader = nil
  78397. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupslistinstancesrequest)
  78398. if err != nil {
  78399. return nil, err
  78400. }
  78401. reqHeaders.Set("Content-Type", "application/json")
  78402. c.urlParams_.Set("alt", alt)
  78403. c.urlParams_.Set("prettyPrint", "false")
  78404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances")
  78405. urls += "?" + c.urlParams_.Encode()
  78406. req, err := http.NewRequest("POST", urls, body)
  78407. if err != nil {
  78408. return nil, err
  78409. }
  78410. req.Header = reqHeaders
  78411. googleapi.Expand(req.URL, map[string]string{
  78412. "project": c.project,
  78413. "region": c.region,
  78414. "instanceGroup": c.instanceGroup,
  78415. })
  78416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78417. }
  78418. // Do executes the "compute.regionInstanceGroups.listInstances" call.
  78419. // Exactly one of *RegionInstanceGroupsListInstances or error will be
  78420. // non-nil. Any non-2xx status code is an error. Response headers are in
  78421. // either *RegionInstanceGroupsListInstances.ServerResponse.Header or
  78422. // (if a response was returned at all) in
  78423. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  78424. // whether the returned error was because http.StatusNotModified was
  78425. // returned.
  78426. func (c *RegionInstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupsListInstances, error) {
  78427. gensupport.SetOptions(c.urlParams_, opts...)
  78428. res, err := c.doRequest("json")
  78429. if res != nil && res.StatusCode == http.StatusNotModified {
  78430. if res.Body != nil {
  78431. res.Body.Close()
  78432. }
  78433. return nil, &googleapi.Error{
  78434. Code: res.StatusCode,
  78435. Header: res.Header,
  78436. }
  78437. }
  78438. if err != nil {
  78439. return nil, err
  78440. }
  78441. defer googleapi.CloseBody(res)
  78442. if err := googleapi.CheckResponse(res); err != nil {
  78443. return nil, err
  78444. }
  78445. ret := &RegionInstanceGroupsListInstances{
  78446. ServerResponse: googleapi.ServerResponse{
  78447. Header: res.Header,
  78448. HTTPStatusCode: res.StatusCode,
  78449. },
  78450. }
  78451. target := &ret
  78452. if err := gensupport.DecodeResponse(target, res); err != nil {
  78453. return nil, err
  78454. }
  78455. return ret, nil
  78456. // {
  78457. // "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.",
  78458. // "httpMethod": "POST",
  78459. // "id": "compute.regionInstanceGroups.listInstances",
  78460. // "parameterOrder": [
  78461. // "project",
  78462. // "region",
  78463. // "instanceGroup"
  78464. // ],
  78465. // "parameters": {
  78466. // "filter": {
  78467. // "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).",
  78468. // "location": "query",
  78469. // "type": "string"
  78470. // },
  78471. // "instanceGroup": {
  78472. // "description": "Name of the regional instance group for which we want to list the instances.",
  78473. // "location": "path",
  78474. // "required": true,
  78475. // "type": "string"
  78476. // },
  78477. // "maxResults": {
  78478. // "default": "500",
  78479. // "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)",
  78480. // "format": "uint32",
  78481. // "location": "query",
  78482. // "minimum": "0",
  78483. // "type": "integer"
  78484. // },
  78485. // "orderBy": {
  78486. // "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.",
  78487. // "location": "query",
  78488. // "type": "string"
  78489. // },
  78490. // "pageToken": {
  78491. // "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.",
  78492. // "location": "query",
  78493. // "type": "string"
  78494. // },
  78495. // "project": {
  78496. // "description": "Project ID for this request.",
  78497. // "location": "path",
  78498. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78499. // "required": true,
  78500. // "type": "string"
  78501. // },
  78502. // "region": {
  78503. // "description": "Name of the region scoping this request.",
  78504. // "location": "path",
  78505. // "required": true,
  78506. // "type": "string"
  78507. // }
  78508. // },
  78509. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances",
  78510. // "request": {
  78511. // "$ref": "RegionInstanceGroupsListInstancesRequest"
  78512. // },
  78513. // "response": {
  78514. // "$ref": "RegionInstanceGroupsListInstances"
  78515. // },
  78516. // "scopes": [
  78517. // "https://www.googleapis.com/auth/cloud-platform",
  78518. // "https://www.googleapis.com/auth/compute",
  78519. // "https://www.googleapis.com/auth/compute.readonly"
  78520. // ]
  78521. // }
  78522. }
  78523. // Pages invokes f for each page of results.
  78524. // A non-nil error returned from f will halt the iteration.
  78525. // The provided context supersedes any context provided to the Context method.
  78526. func (c *RegionInstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupsListInstances) error) error {
  78527. c.ctx_ = ctx
  78528. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  78529. for {
  78530. x, err := c.Do()
  78531. if err != nil {
  78532. return err
  78533. }
  78534. if err := f(x); err != nil {
  78535. return err
  78536. }
  78537. if x.NextPageToken == "" {
  78538. return nil
  78539. }
  78540. c.PageToken(x.NextPageToken)
  78541. }
  78542. }
  78543. // method id "compute.regionInstanceGroups.setNamedPorts":
  78544. type RegionInstanceGroupsSetNamedPortsCall struct {
  78545. s *Service
  78546. project string
  78547. region string
  78548. instanceGroup string
  78549. regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest
  78550. urlParams_ gensupport.URLParams
  78551. ctx_ context.Context
  78552. header_ http.Header
  78553. }
  78554. // SetNamedPorts: Sets the named ports for the specified regional
  78555. // instance group.
  78556. func (r *RegionInstanceGroupsService) SetNamedPorts(project string, region string, instanceGroup string, regioninstancegroupssetnamedportsrequest *RegionInstanceGroupsSetNamedPortsRequest) *RegionInstanceGroupsSetNamedPortsCall {
  78557. c := &RegionInstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78558. c.project = project
  78559. c.region = region
  78560. c.instanceGroup = instanceGroup
  78561. c.regioninstancegroupssetnamedportsrequest = regioninstancegroupssetnamedportsrequest
  78562. return c
  78563. }
  78564. // RequestId sets the optional parameter "requestId": An optional
  78565. // request ID to identify requests. Specify a unique request ID so that
  78566. // if you must retry your request, the server will know to ignore the
  78567. // request if it has already been completed.
  78568. //
  78569. // For example, consider a situation where you make an initial request
  78570. // and the request times out. If you make the request again with the
  78571. // same request ID, the server can check if original operation with the
  78572. // same request ID was received, and if so, will ignore the second
  78573. // request. This prevents clients from accidentally creating duplicate
  78574. // commitments.
  78575. //
  78576. // The request ID must be a valid UUID with the exception that zero UUID
  78577. // is not supported (00000000-0000-0000-0000-000000000000).
  78578. func (c *RegionInstanceGroupsSetNamedPortsCall) RequestId(requestId string) *RegionInstanceGroupsSetNamedPortsCall {
  78579. c.urlParams_.Set("requestId", requestId)
  78580. return c
  78581. }
  78582. // Fields allows partial responses to be retrieved. See
  78583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78584. // for more information.
  78585. func (c *RegionInstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupsSetNamedPortsCall {
  78586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78587. return c
  78588. }
  78589. // Context sets the context to be used in this call's Do method. Any
  78590. // pending HTTP request will be aborted if the provided context is
  78591. // canceled.
  78592. func (c *RegionInstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *RegionInstanceGroupsSetNamedPortsCall {
  78593. c.ctx_ = ctx
  78594. return c
  78595. }
  78596. // Header returns an http.Header that can be modified by the caller to
  78597. // add HTTP headers to the request.
  78598. func (c *RegionInstanceGroupsSetNamedPortsCall) Header() http.Header {
  78599. if c.header_ == nil {
  78600. c.header_ = make(http.Header)
  78601. }
  78602. return c.header_
  78603. }
  78604. func (c *RegionInstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) {
  78605. reqHeaders := make(http.Header)
  78606. for k, v := range c.header_ {
  78607. reqHeaders[k] = v
  78608. }
  78609. reqHeaders.Set("User-Agent", c.s.userAgent())
  78610. var body io.Reader = nil
  78611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupssetnamedportsrequest)
  78612. if err != nil {
  78613. return nil, err
  78614. }
  78615. reqHeaders.Set("Content-Type", "application/json")
  78616. c.urlParams_.Set("alt", alt)
  78617. c.urlParams_.Set("prettyPrint", "false")
  78618. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts")
  78619. urls += "?" + c.urlParams_.Encode()
  78620. req, err := http.NewRequest("POST", urls, body)
  78621. if err != nil {
  78622. return nil, err
  78623. }
  78624. req.Header = reqHeaders
  78625. googleapi.Expand(req.URL, map[string]string{
  78626. "project": c.project,
  78627. "region": c.region,
  78628. "instanceGroup": c.instanceGroup,
  78629. })
  78630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78631. }
  78632. // Do executes the "compute.regionInstanceGroups.setNamedPorts" call.
  78633. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78634. // status code is an error. Response headers are in either
  78635. // *Operation.ServerResponse.Header or (if a response was returned at
  78636. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78637. // to check whether the returned error was because
  78638. // http.StatusNotModified was returned.
  78639. func (c *RegionInstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78640. gensupport.SetOptions(c.urlParams_, opts...)
  78641. res, err := c.doRequest("json")
  78642. if res != nil && res.StatusCode == http.StatusNotModified {
  78643. if res.Body != nil {
  78644. res.Body.Close()
  78645. }
  78646. return nil, &googleapi.Error{
  78647. Code: res.StatusCode,
  78648. Header: res.Header,
  78649. }
  78650. }
  78651. if err != nil {
  78652. return nil, err
  78653. }
  78654. defer googleapi.CloseBody(res)
  78655. if err := googleapi.CheckResponse(res); err != nil {
  78656. return nil, err
  78657. }
  78658. ret := &Operation{
  78659. ServerResponse: googleapi.ServerResponse{
  78660. Header: res.Header,
  78661. HTTPStatusCode: res.StatusCode,
  78662. },
  78663. }
  78664. target := &ret
  78665. if err := gensupport.DecodeResponse(target, res); err != nil {
  78666. return nil, err
  78667. }
  78668. return ret, nil
  78669. // {
  78670. // "description": "Sets the named ports for the specified regional instance group.",
  78671. // "httpMethod": "POST",
  78672. // "id": "compute.regionInstanceGroups.setNamedPorts",
  78673. // "parameterOrder": [
  78674. // "project",
  78675. // "region",
  78676. // "instanceGroup"
  78677. // ],
  78678. // "parameters": {
  78679. // "instanceGroup": {
  78680. // "description": "The name of the regional instance group where the named ports are updated.",
  78681. // "location": "path",
  78682. // "required": true,
  78683. // "type": "string"
  78684. // },
  78685. // "project": {
  78686. // "description": "Project ID for this request.",
  78687. // "location": "path",
  78688. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78689. // "required": true,
  78690. // "type": "string"
  78691. // },
  78692. // "region": {
  78693. // "description": "Name of the region scoping this request.",
  78694. // "location": "path",
  78695. // "required": true,
  78696. // "type": "string"
  78697. // },
  78698. // "requestId": {
  78699. // "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).",
  78700. // "location": "query",
  78701. // "type": "string"
  78702. // }
  78703. // },
  78704. // "path": "{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts",
  78705. // "request": {
  78706. // "$ref": "RegionInstanceGroupsSetNamedPortsRequest"
  78707. // },
  78708. // "response": {
  78709. // "$ref": "Operation"
  78710. // },
  78711. // "scopes": [
  78712. // "https://www.googleapis.com/auth/cloud-platform",
  78713. // "https://www.googleapis.com/auth/compute"
  78714. // ]
  78715. // }
  78716. }
  78717. // method id "compute.regionOperations.delete":
  78718. type RegionOperationsDeleteCall struct {
  78719. s *Service
  78720. project string
  78721. region string
  78722. operation string
  78723. urlParams_ gensupport.URLParams
  78724. ctx_ context.Context
  78725. header_ http.Header
  78726. }
  78727. // Delete: Deletes the specified region-specific Operations resource.
  78728. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete
  78729. func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall {
  78730. c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78731. c.project = project
  78732. c.region = region
  78733. c.operation = operation
  78734. return c
  78735. }
  78736. // Fields allows partial responses to be retrieved. See
  78737. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78738. // for more information.
  78739. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall {
  78740. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78741. return c
  78742. }
  78743. // Context sets the context to be used in this call's Do method. Any
  78744. // pending HTTP request will be aborted if the provided context is
  78745. // canceled.
  78746. func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall {
  78747. c.ctx_ = ctx
  78748. return c
  78749. }
  78750. // Header returns an http.Header that can be modified by the caller to
  78751. // add HTTP headers to the request.
  78752. func (c *RegionOperationsDeleteCall) Header() http.Header {
  78753. if c.header_ == nil {
  78754. c.header_ = make(http.Header)
  78755. }
  78756. return c.header_
  78757. }
  78758. func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  78759. reqHeaders := make(http.Header)
  78760. for k, v := range c.header_ {
  78761. reqHeaders[k] = v
  78762. }
  78763. reqHeaders.Set("User-Agent", c.s.userAgent())
  78764. var body io.Reader = nil
  78765. c.urlParams_.Set("alt", alt)
  78766. c.urlParams_.Set("prettyPrint", "false")
  78767. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  78768. urls += "?" + c.urlParams_.Encode()
  78769. req, err := http.NewRequest("DELETE", urls, body)
  78770. if err != nil {
  78771. return nil, err
  78772. }
  78773. req.Header = reqHeaders
  78774. googleapi.Expand(req.URL, map[string]string{
  78775. "project": c.project,
  78776. "region": c.region,
  78777. "operation": c.operation,
  78778. })
  78779. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78780. }
  78781. // Do executes the "compute.regionOperations.delete" call.
  78782. func (c *RegionOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  78783. gensupport.SetOptions(c.urlParams_, opts...)
  78784. res, err := c.doRequest("json")
  78785. if err != nil {
  78786. return err
  78787. }
  78788. defer googleapi.CloseBody(res)
  78789. if err := googleapi.CheckResponse(res); err != nil {
  78790. return err
  78791. }
  78792. return nil
  78793. // {
  78794. // "description": "Deletes the specified region-specific Operations resource.",
  78795. // "httpMethod": "DELETE",
  78796. // "id": "compute.regionOperations.delete",
  78797. // "parameterOrder": [
  78798. // "project",
  78799. // "region",
  78800. // "operation"
  78801. // ],
  78802. // "parameters": {
  78803. // "operation": {
  78804. // "description": "Name of the Operations resource to delete.",
  78805. // "location": "path",
  78806. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78807. // "required": true,
  78808. // "type": "string"
  78809. // },
  78810. // "project": {
  78811. // "description": "Project ID for this request.",
  78812. // "location": "path",
  78813. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78814. // "required": true,
  78815. // "type": "string"
  78816. // },
  78817. // "region": {
  78818. // "description": "Name of the region for this request.",
  78819. // "location": "path",
  78820. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78821. // "required": true,
  78822. // "type": "string"
  78823. // }
  78824. // },
  78825. // "path": "{project}/regions/{region}/operations/{operation}",
  78826. // "scopes": [
  78827. // "https://www.googleapis.com/auth/cloud-platform",
  78828. // "https://www.googleapis.com/auth/compute"
  78829. // ]
  78830. // }
  78831. }
  78832. // method id "compute.regionOperations.get":
  78833. type RegionOperationsGetCall struct {
  78834. s *Service
  78835. project string
  78836. region string
  78837. operation string
  78838. urlParams_ gensupport.URLParams
  78839. ifNoneMatch_ string
  78840. ctx_ context.Context
  78841. header_ http.Header
  78842. }
  78843. // Get: Retrieves the specified region-specific Operations resource.
  78844. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get
  78845. func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall {
  78846. c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  78847. c.project = project
  78848. c.region = region
  78849. c.operation = operation
  78850. return c
  78851. }
  78852. // Fields allows partial responses to be retrieved. See
  78853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  78854. // for more information.
  78855. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall {
  78856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  78857. return c
  78858. }
  78859. // IfNoneMatch sets the optional parameter which makes the operation
  78860. // fail if the object's ETag matches the given value. This is useful for
  78861. // getting updates only after the object has changed since the last
  78862. // request. Use googleapi.IsNotModified to check whether the response
  78863. // error from Do is the result of In-None-Match.
  78864. func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall {
  78865. c.ifNoneMatch_ = entityTag
  78866. return c
  78867. }
  78868. // Context sets the context to be used in this call's Do method. Any
  78869. // pending HTTP request will be aborted if the provided context is
  78870. // canceled.
  78871. func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall {
  78872. c.ctx_ = ctx
  78873. return c
  78874. }
  78875. // Header returns an http.Header that can be modified by the caller to
  78876. // add HTTP headers to the request.
  78877. func (c *RegionOperationsGetCall) Header() http.Header {
  78878. if c.header_ == nil {
  78879. c.header_ = make(http.Header)
  78880. }
  78881. return c.header_
  78882. }
  78883. func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  78884. reqHeaders := make(http.Header)
  78885. for k, v := range c.header_ {
  78886. reqHeaders[k] = v
  78887. }
  78888. reqHeaders.Set("User-Agent", c.s.userAgent())
  78889. if c.ifNoneMatch_ != "" {
  78890. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  78891. }
  78892. var body io.Reader = nil
  78893. c.urlParams_.Set("alt", alt)
  78894. c.urlParams_.Set("prettyPrint", "false")
  78895. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}")
  78896. urls += "?" + c.urlParams_.Encode()
  78897. req, err := http.NewRequest("GET", urls, body)
  78898. if err != nil {
  78899. return nil, err
  78900. }
  78901. req.Header = reqHeaders
  78902. googleapi.Expand(req.URL, map[string]string{
  78903. "project": c.project,
  78904. "region": c.region,
  78905. "operation": c.operation,
  78906. })
  78907. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  78908. }
  78909. // Do executes the "compute.regionOperations.get" call.
  78910. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  78911. // status code is an error. Response headers are in either
  78912. // *Operation.ServerResponse.Header or (if a response was returned at
  78913. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  78914. // to check whether the returned error was because
  78915. // http.StatusNotModified was returned.
  78916. func (c *RegionOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  78917. gensupport.SetOptions(c.urlParams_, opts...)
  78918. res, err := c.doRequest("json")
  78919. if res != nil && res.StatusCode == http.StatusNotModified {
  78920. if res.Body != nil {
  78921. res.Body.Close()
  78922. }
  78923. return nil, &googleapi.Error{
  78924. Code: res.StatusCode,
  78925. Header: res.Header,
  78926. }
  78927. }
  78928. if err != nil {
  78929. return nil, err
  78930. }
  78931. defer googleapi.CloseBody(res)
  78932. if err := googleapi.CheckResponse(res); err != nil {
  78933. return nil, err
  78934. }
  78935. ret := &Operation{
  78936. ServerResponse: googleapi.ServerResponse{
  78937. Header: res.Header,
  78938. HTTPStatusCode: res.StatusCode,
  78939. },
  78940. }
  78941. target := &ret
  78942. if err := gensupport.DecodeResponse(target, res); err != nil {
  78943. return nil, err
  78944. }
  78945. return ret, nil
  78946. // {
  78947. // "description": "Retrieves the specified region-specific Operations resource.",
  78948. // "httpMethod": "GET",
  78949. // "id": "compute.regionOperations.get",
  78950. // "parameterOrder": [
  78951. // "project",
  78952. // "region",
  78953. // "operation"
  78954. // ],
  78955. // "parameters": {
  78956. // "operation": {
  78957. // "description": "Name of the Operations resource to return.",
  78958. // "location": "path",
  78959. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  78960. // "required": true,
  78961. // "type": "string"
  78962. // },
  78963. // "project": {
  78964. // "description": "Project ID for this request.",
  78965. // "location": "path",
  78966. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  78967. // "required": true,
  78968. // "type": "string"
  78969. // },
  78970. // "region": {
  78971. // "description": "Name of the region for this request.",
  78972. // "location": "path",
  78973. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  78974. // "required": true,
  78975. // "type": "string"
  78976. // }
  78977. // },
  78978. // "path": "{project}/regions/{region}/operations/{operation}",
  78979. // "response": {
  78980. // "$ref": "Operation"
  78981. // },
  78982. // "scopes": [
  78983. // "https://www.googleapis.com/auth/cloud-platform",
  78984. // "https://www.googleapis.com/auth/compute",
  78985. // "https://www.googleapis.com/auth/compute.readonly"
  78986. // ]
  78987. // }
  78988. }
  78989. // method id "compute.regionOperations.list":
  78990. type RegionOperationsListCall struct {
  78991. s *Service
  78992. project string
  78993. region string
  78994. urlParams_ gensupport.URLParams
  78995. ifNoneMatch_ string
  78996. ctx_ context.Context
  78997. header_ http.Header
  78998. }
  78999. // List: Retrieves a list of Operation resources contained within the
  79000. // specified region.
  79001. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list
  79002. func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall {
  79003. c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79004. c.project = project
  79005. c.region = region
  79006. return c
  79007. }
  79008. // Filter sets the optional parameter "filter": A filter expression that
  79009. // filters resources listed in the response. The expression must specify
  79010. // the field name, a comparison operator, and the value that you want to
  79011. // use for filtering. The value must be a string, a number, or a
  79012. // boolean. The comparison operator must be either =, !=, >, or <.
  79013. //
  79014. // For example, if you are filtering Compute Engine instances, you can
  79015. // exclude instances named example-instance by specifying name !=
  79016. // example-instance.
  79017. //
  79018. // You can also filter nested fields. For example, you could specify
  79019. // scheduling.automaticRestart = false to include instances only if they
  79020. // are not scheduled for automatic restarts. You can use filtering on
  79021. // nested fields to filter based on resource labels.
  79022. //
  79023. // To filter on multiple expressions, provide each separate expression
  79024. // within parentheses. For example, (scheduling.automaticRestart = true)
  79025. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79026. // AND expression. However, you can include AND and OR expressions
  79027. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79028. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79029. // true).
  79030. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall {
  79031. c.urlParams_.Set("filter", filter)
  79032. return c
  79033. }
  79034. // MaxResults sets the optional parameter "maxResults": The maximum
  79035. // number of results per page that should be returned. If the number of
  79036. // available results is larger than maxResults, Compute Engine returns a
  79037. // nextPageToken that can be used to get the next page of results in
  79038. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79039. // (Default: 500)
  79040. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall {
  79041. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79042. return c
  79043. }
  79044. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79045. // a certain order. By default, results are returned in alphanumerical
  79046. // order based on the resource name.
  79047. //
  79048. // You can also sort results in descending order based on the creation
  79049. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79050. // based on the creationTimestamp field in reverse chronological order
  79051. // (newest result first). Use this to sort resources like operations so
  79052. // that the newest operation is returned first.
  79053. //
  79054. // Currently, only sorting by name or creationTimestamp desc is
  79055. // supported.
  79056. func (c *RegionOperationsListCall) OrderBy(orderBy string) *RegionOperationsListCall {
  79057. c.urlParams_.Set("orderBy", orderBy)
  79058. return c
  79059. }
  79060. // PageToken sets the optional parameter "pageToken": Specifies a page
  79061. // token to use. Set pageToken to the nextPageToken returned by a
  79062. // previous list request to get the next page of results.
  79063. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall {
  79064. c.urlParams_.Set("pageToken", pageToken)
  79065. return c
  79066. }
  79067. // Fields allows partial responses to be retrieved. See
  79068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79069. // for more information.
  79070. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall {
  79071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79072. return c
  79073. }
  79074. // IfNoneMatch sets the optional parameter which makes the operation
  79075. // fail if the object's ETag matches the given value. This is useful for
  79076. // getting updates only after the object has changed since the last
  79077. // request. Use googleapi.IsNotModified to check whether the response
  79078. // error from Do is the result of In-None-Match.
  79079. func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall {
  79080. c.ifNoneMatch_ = entityTag
  79081. return c
  79082. }
  79083. // Context sets the context to be used in this call's Do method. Any
  79084. // pending HTTP request will be aborted if the provided context is
  79085. // canceled.
  79086. func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall {
  79087. c.ctx_ = ctx
  79088. return c
  79089. }
  79090. // Header returns an http.Header that can be modified by the caller to
  79091. // add HTTP headers to the request.
  79092. func (c *RegionOperationsListCall) Header() http.Header {
  79093. if c.header_ == nil {
  79094. c.header_ = make(http.Header)
  79095. }
  79096. return c.header_
  79097. }
  79098. func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) {
  79099. reqHeaders := make(http.Header)
  79100. for k, v := range c.header_ {
  79101. reqHeaders[k] = v
  79102. }
  79103. reqHeaders.Set("User-Agent", c.s.userAgent())
  79104. if c.ifNoneMatch_ != "" {
  79105. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79106. }
  79107. var body io.Reader = nil
  79108. c.urlParams_.Set("alt", alt)
  79109. c.urlParams_.Set("prettyPrint", "false")
  79110. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations")
  79111. urls += "?" + c.urlParams_.Encode()
  79112. req, err := http.NewRequest("GET", urls, body)
  79113. if err != nil {
  79114. return nil, err
  79115. }
  79116. req.Header = reqHeaders
  79117. googleapi.Expand(req.URL, map[string]string{
  79118. "project": c.project,
  79119. "region": c.region,
  79120. })
  79121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79122. }
  79123. // Do executes the "compute.regionOperations.list" call.
  79124. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  79125. // status code is an error. Response headers are in either
  79126. // *OperationList.ServerResponse.Header or (if a response was returned
  79127. // at all) in error.(*googleapi.Error).Header. Use
  79128. // googleapi.IsNotModified to check whether the returned error was
  79129. // because http.StatusNotModified was returned.
  79130. func (c *RegionOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  79131. gensupport.SetOptions(c.urlParams_, opts...)
  79132. res, err := c.doRequest("json")
  79133. if res != nil && res.StatusCode == http.StatusNotModified {
  79134. if res.Body != nil {
  79135. res.Body.Close()
  79136. }
  79137. return nil, &googleapi.Error{
  79138. Code: res.StatusCode,
  79139. Header: res.Header,
  79140. }
  79141. }
  79142. if err != nil {
  79143. return nil, err
  79144. }
  79145. defer googleapi.CloseBody(res)
  79146. if err := googleapi.CheckResponse(res); err != nil {
  79147. return nil, err
  79148. }
  79149. ret := &OperationList{
  79150. ServerResponse: googleapi.ServerResponse{
  79151. Header: res.Header,
  79152. HTTPStatusCode: res.StatusCode,
  79153. },
  79154. }
  79155. target := &ret
  79156. if err := gensupport.DecodeResponse(target, res); err != nil {
  79157. return nil, err
  79158. }
  79159. return ret, nil
  79160. // {
  79161. // "description": "Retrieves a list of Operation resources contained within the specified region.",
  79162. // "httpMethod": "GET",
  79163. // "id": "compute.regionOperations.list",
  79164. // "parameterOrder": [
  79165. // "project",
  79166. // "region"
  79167. // ],
  79168. // "parameters": {
  79169. // "filter": {
  79170. // "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).",
  79171. // "location": "query",
  79172. // "type": "string"
  79173. // },
  79174. // "maxResults": {
  79175. // "default": "500",
  79176. // "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)",
  79177. // "format": "uint32",
  79178. // "location": "query",
  79179. // "minimum": "0",
  79180. // "type": "integer"
  79181. // },
  79182. // "orderBy": {
  79183. // "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.",
  79184. // "location": "query",
  79185. // "type": "string"
  79186. // },
  79187. // "pageToken": {
  79188. // "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.",
  79189. // "location": "query",
  79190. // "type": "string"
  79191. // },
  79192. // "project": {
  79193. // "description": "Project ID for this request.",
  79194. // "location": "path",
  79195. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79196. // "required": true,
  79197. // "type": "string"
  79198. // },
  79199. // "region": {
  79200. // "description": "Name of the region for this request.",
  79201. // "location": "path",
  79202. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79203. // "required": true,
  79204. // "type": "string"
  79205. // }
  79206. // },
  79207. // "path": "{project}/regions/{region}/operations",
  79208. // "response": {
  79209. // "$ref": "OperationList"
  79210. // },
  79211. // "scopes": [
  79212. // "https://www.googleapis.com/auth/cloud-platform",
  79213. // "https://www.googleapis.com/auth/compute",
  79214. // "https://www.googleapis.com/auth/compute.readonly"
  79215. // ]
  79216. // }
  79217. }
  79218. // Pages invokes f for each page of results.
  79219. // A non-nil error returned from f will halt the iteration.
  79220. // The provided context supersedes any context provided to the Context method.
  79221. func (c *RegionOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  79222. c.ctx_ = ctx
  79223. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79224. for {
  79225. x, err := c.Do()
  79226. if err != nil {
  79227. return err
  79228. }
  79229. if err := f(x); err != nil {
  79230. return err
  79231. }
  79232. if x.NextPageToken == "" {
  79233. return nil
  79234. }
  79235. c.PageToken(x.NextPageToken)
  79236. }
  79237. }
  79238. // method id "compute.regions.get":
  79239. type RegionsGetCall struct {
  79240. s *Service
  79241. project string
  79242. region string
  79243. urlParams_ gensupport.URLParams
  79244. ifNoneMatch_ string
  79245. ctx_ context.Context
  79246. header_ http.Header
  79247. }
  79248. // Get: Returns the specified Region resource. Gets a list of available
  79249. // regions by making a list() request.
  79250. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get
  79251. func (r *RegionsService) Get(project string, region string) *RegionsGetCall {
  79252. c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79253. c.project = project
  79254. c.region = region
  79255. return c
  79256. }
  79257. // Fields allows partial responses to be retrieved. See
  79258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79259. // for more information.
  79260. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall {
  79261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79262. return c
  79263. }
  79264. // IfNoneMatch sets the optional parameter which makes the operation
  79265. // fail if the object's ETag matches the given value. This is useful for
  79266. // getting updates only after the object has changed since the last
  79267. // request. Use googleapi.IsNotModified to check whether the response
  79268. // error from Do is the result of In-None-Match.
  79269. func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall {
  79270. c.ifNoneMatch_ = entityTag
  79271. return c
  79272. }
  79273. // Context sets the context to be used in this call's Do method. Any
  79274. // pending HTTP request will be aborted if the provided context is
  79275. // canceled.
  79276. func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall {
  79277. c.ctx_ = ctx
  79278. return c
  79279. }
  79280. // Header returns an http.Header that can be modified by the caller to
  79281. // add HTTP headers to the request.
  79282. func (c *RegionsGetCall) Header() http.Header {
  79283. if c.header_ == nil {
  79284. c.header_ = make(http.Header)
  79285. }
  79286. return c.header_
  79287. }
  79288. func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) {
  79289. reqHeaders := make(http.Header)
  79290. for k, v := range c.header_ {
  79291. reqHeaders[k] = v
  79292. }
  79293. reqHeaders.Set("User-Agent", c.s.userAgent())
  79294. if c.ifNoneMatch_ != "" {
  79295. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79296. }
  79297. var body io.Reader = nil
  79298. c.urlParams_.Set("alt", alt)
  79299. c.urlParams_.Set("prettyPrint", "false")
  79300. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}")
  79301. urls += "?" + c.urlParams_.Encode()
  79302. req, err := http.NewRequest("GET", urls, body)
  79303. if err != nil {
  79304. return nil, err
  79305. }
  79306. req.Header = reqHeaders
  79307. googleapi.Expand(req.URL, map[string]string{
  79308. "project": c.project,
  79309. "region": c.region,
  79310. })
  79311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79312. }
  79313. // Do executes the "compute.regions.get" call.
  79314. // Exactly one of *Region or error will be non-nil. Any non-2xx status
  79315. // code is an error. Response headers are in either
  79316. // *Region.ServerResponse.Header or (if a response was returned at all)
  79317. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  79318. // check whether the returned error was because http.StatusNotModified
  79319. // was returned.
  79320. func (c *RegionsGetCall) Do(opts ...googleapi.CallOption) (*Region, error) {
  79321. gensupport.SetOptions(c.urlParams_, opts...)
  79322. res, err := c.doRequest("json")
  79323. if res != nil && res.StatusCode == http.StatusNotModified {
  79324. if res.Body != nil {
  79325. res.Body.Close()
  79326. }
  79327. return nil, &googleapi.Error{
  79328. Code: res.StatusCode,
  79329. Header: res.Header,
  79330. }
  79331. }
  79332. if err != nil {
  79333. return nil, err
  79334. }
  79335. defer googleapi.CloseBody(res)
  79336. if err := googleapi.CheckResponse(res); err != nil {
  79337. return nil, err
  79338. }
  79339. ret := &Region{
  79340. ServerResponse: googleapi.ServerResponse{
  79341. Header: res.Header,
  79342. HTTPStatusCode: res.StatusCode,
  79343. },
  79344. }
  79345. target := &ret
  79346. if err := gensupport.DecodeResponse(target, res); err != nil {
  79347. return nil, err
  79348. }
  79349. return ret, nil
  79350. // {
  79351. // "description": "Returns the specified Region resource. Gets a list of available regions by making a list() request.",
  79352. // "httpMethod": "GET",
  79353. // "id": "compute.regions.get",
  79354. // "parameterOrder": [
  79355. // "project",
  79356. // "region"
  79357. // ],
  79358. // "parameters": {
  79359. // "project": {
  79360. // "description": "Project ID for this request.",
  79361. // "location": "path",
  79362. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79363. // "required": true,
  79364. // "type": "string"
  79365. // },
  79366. // "region": {
  79367. // "description": "Name of the region resource to return.",
  79368. // "location": "path",
  79369. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  79370. // "required": true,
  79371. // "type": "string"
  79372. // }
  79373. // },
  79374. // "path": "{project}/regions/{region}",
  79375. // "response": {
  79376. // "$ref": "Region"
  79377. // },
  79378. // "scopes": [
  79379. // "https://www.googleapis.com/auth/cloud-platform",
  79380. // "https://www.googleapis.com/auth/compute",
  79381. // "https://www.googleapis.com/auth/compute.readonly"
  79382. // ]
  79383. // }
  79384. }
  79385. // method id "compute.regions.list":
  79386. type RegionsListCall struct {
  79387. s *Service
  79388. project string
  79389. urlParams_ gensupport.URLParams
  79390. ifNoneMatch_ string
  79391. ctx_ context.Context
  79392. header_ http.Header
  79393. }
  79394. // List: Retrieves the list of region resources available to the
  79395. // specified project.
  79396. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list
  79397. func (r *RegionsService) List(project string) *RegionsListCall {
  79398. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79399. c.project = project
  79400. return c
  79401. }
  79402. // Filter sets the optional parameter "filter": A filter expression that
  79403. // filters resources listed in the response. The expression must specify
  79404. // the field name, a comparison operator, and the value that you want to
  79405. // use for filtering. The value must be a string, a number, or a
  79406. // boolean. The comparison operator must be either =, !=, >, or <.
  79407. //
  79408. // For example, if you are filtering Compute Engine instances, you can
  79409. // exclude instances named example-instance by specifying name !=
  79410. // example-instance.
  79411. //
  79412. // You can also filter nested fields. For example, you could specify
  79413. // scheduling.automaticRestart = false to include instances only if they
  79414. // are not scheduled for automatic restarts. You can use filtering on
  79415. // nested fields to filter based on resource labels.
  79416. //
  79417. // To filter on multiple expressions, provide each separate expression
  79418. // within parentheses. For example, (scheduling.automaticRestart = true)
  79419. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79420. // AND expression. However, you can include AND and OR expressions
  79421. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79422. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79423. // true).
  79424. func (c *RegionsListCall) Filter(filter string) *RegionsListCall {
  79425. c.urlParams_.Set("filter", filter)
  79426. return c
  79427. }
  79428. // MaxResults sets the optional parameter "maxResults": The maximum
  79429. // number of results per page that should be returned. If the number of
  79430. // available results is larger than maxResults, Compute Engine returns a
  79431. // nextPageToken that can be used to get the next page of results in
  79432. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79433. // (Default: 500)
  79434. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall {
  79435. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79436. return c
  79437. }
  79438. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79439. // a certain order. By default, results are returned in alphanumerical
  79440. // order based on the resource name.
  79441. //
  79442. // You can also sort results in descending order based on the creation
  79443. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79444. // based on the creationTimestamp field in reverse chronological order
  79445. // (newest result first). Use this to sort resources like operations so
  79446. // that the newest operation is returned first.
  79447. //
  79448. // Currently, only sorting by name or creationTimestamp desc is
  79449. // supported.
  79450. func (c *RegionsListCall) OrderBy(orderBy string) *RegionsListCall {
  79451. c.urlParams_.Set("orderBy", orderBy)
  79452. return c
  79453. }
  79454. // PageToken sets the optional parameter "pageToken": Specifies a page
  79455. // token to use. Set pageToken to the nextPageToken returned by a
  79456. // previous list request to get the next page of results.
  79457. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall {
  79458. c.urlParams_.Set("pageToken", pageToken)
  79459. return c
  79460. }
  79461. // Fields allows partial responses to be retrieved. See
  79462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79463. // for more information.
  79464. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  79465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79466. return c
  79467. }
  79468. // IfNoneMatch sets the optional parameter which makes the operation
  79469. // fail if the object's ETag matches the given value. This is useful for
  79470. // getting updates only after the object has changed since the last
  79471. // request. Use googleapi.IsNotModified to check whether the response
  79472. // error from Do is the result of In-None-Match.
  79473. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  79474. c.ifNoneMatch_ = entityTag
  79475. return c
  79476. }
  79477. // Context sets the context to be used in this call's Do method. Any
  79478. // pending HTTP request will be aborted if the provided context is
  79479. // canceled.
  79480. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  79481. c.ctx_ = ctx
  79482. return c
  79483. }
  79484. // Header returns an http.Header that can be modified by the caller to
  79485. // add HTTP headers to the request.
  79486. func (c *RegionsListCall) Header() http.Header {
  79487. if c.header_ == nil {
  79488. c.header_ = make(http.Header)
  79489. }
  79490. return c.header_
  79491. }
  79492. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  79493. reqHeaders := make(http.Header)
  79494. for k, v := range c.header_ {
  79495. reqHeaders[k] = v
  79496. }
  79497. reqHeaders.Set("User-Agent", c.s.userAgent())
  79498. if c.ifNoneMatch_ != "" {
  79499. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79500. }
  79501. var body io.Reader = nil
  79502. c.urlParams_.Set("alt", alt)
  79503. c.urlParams_.Set("prettyPrint", "false")
  79504. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions")
  79505. urls += "?" + c.urlParams_.Encode()
  79506. req, err := http.NewRequest("GET", urls, body)
  79507. if err != nil {
  79508. return nil, err
  79509. }
  79510. req.Header = reqHeaders
  79511. googleapi.Expand(req.URL, map[string]string{
  79512. "project": c.project,
  79513. })
  79514. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79515. }
  79516. // Do executes the "compute.regions.list" call.
  79517. // Exactly one of *RegionList or error will be non-nil. Any non-2xx
  79518. // status code is an error. Response headers are in either
  79519. // *RegionList.ServerResponse.Header or (if a response was returned at
  79520. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79521. // to check whether the returned error was because
  79522. // http.StatusNotModified was returned.
  79523. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionList, error) {
  79524. gensupport.SetOptions(c.urlParams_, opts...)
  79525. res, err := c.doRequest("json")
  79526. if res != nil && res.StatusCode == http.StatusNotModified {
  79527. if res.Body != nil {
  79528. res.Body.Close()
  79529. }
  79530. return nil, &googleapi.Error{
  79531. Code: res.StatusCode,
  79532. Header: res.Header,
  79533. }
  79534. }
  79535. if err != nil {
  79536. return nil, err
  79537. }
  79538. defer googleapi.CloseBody(res)
  79539. if err := googleapi.CheckResponse(res); err != nil {
  79540. return nil, err
  79541. }
  79542. ret := &RegionList{
  79543. ServerResponse: googleapi.ServerResponse{
  79544. Header: res.Header,
  79545. HTTPStatusCode: res.StatusCode,
  79546. },
  79547. }
  79548. target := &ret
  79549. if err := gensupport.DecodeResponse(target, res); err != nil {
  79550. return nil, err
  79551. }
  79552. return ret, nil
  79553. // {
  79554. // "description": "Retrieves the list of region resources available to the specified project.",
  79555. // "httpMethod": "GET",
  79556. // "id": "compute.regions.list",
  79557. // "parameterOrder": [
  79558. // "project"
  79559. // ],
  79560. // "parameters": {
  79561. // "filter": {
  79562. // "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).",
  79563. // "location": "query",
  79564. // "type": "string"
  79565. // },
  79566. // "maxResults": {
  79567. // "default": "500",
  79568. // "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)",
  79569. // "format": "uint32",
  79570. // "location": "query",
  79571. // "minimum": "0",
  79572. // "type": "integer"
  79573. // },
  79574. // "orderBy": {
  79575. // "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.",
  79576. // "location": "query",
  79577. // "type": "string"
  79578. // },
  79579. // "pageToken": {
  79580. // "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.",
  79581. // "location": "query",
  79582. // "type": "string"
  79583. // },
  79584. // "project": {
  79585. // "description": "Project ID for this request.",
  79586. // "location": "path",
  79587. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79588. // "required": true,
  79589. // "type": "string"
  79590. // }
  79591. // },
  79592. // "path": "{project}/regions",
  79593. // "response": {
  79594. // "$ref": "RegionList"
  79595. // },
  79596. // "scopes": [
  79597. // "https://www.googleapis.com/auth/cloud-platform",
  79598. // "https://www.googleapis.com/auth/compute",
  79599. // "https://www.googleapis.com/auth/compute.readonly"
  79600. // ]
  79601. // }
  79602. }
  79603. // Pages invokes f for each page of results.
  79604. // A non-nil error returned from f will halt the iteration.
  79605. // The provided context supersedes any context provided to the Context method.
  79606. func (c *RegionsListCall) Pages(ctx context.Context, f func(*RegionList) error) error {
  79607. c.ctx_ = ctx
  79608. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79609. for {
  79610. x, err := c.Do()
  79611. if err != nil {
  79612. return err
  79613. }
  79614. if err := f(x); err != nil {
  79615. return err
  79616. }
  79617. if x.NextPageToken == "" {
  79618. return nil
  79619. }
  79620. c.PageToken(x.NextPageToken)
  79621. }
  79622. }
  79623. // method id "compute.routers.aggregatedList":
  79624. type RoutersAggregatedListCall struct {
  79625. s *Service
  79626. project string
  79627. urlParams_ gensupport.URLParams
  79628. ifNoneMatch_ string
  79629. ctx_ context.Context
  79630. header_ http.Header
  79631. }
  79632. // AggregatedList: Retrieves an aggregated list of routers.
  79633. func (r *RoutersService) AggregatedList(project string) *RoutersAggregatedListCall {
  79634. c := &RoutersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79635. c.project = project
  79636. return c
  79637. }
  79638. // Filter sets the optional parameter "filter": A filter expression that
  79639. // filters resources listed in the response. The expression must specify
  79640. // the field name, a comparison operator, and the value that you want to
  79641. // use for filtering. The value must be a string, a number, or a
  79642. // boolean. The comparison operator must be either =, !=, >, or <.
  79643. //
  79644. // For example, if you are filtering Compute Engine instances, you can
  79645. // exclude instances named example-instance by specifying name !=
  79646. // example-instance.
  79647. //
  79648. // You can also filter nested fields. For example, you could specify
  79649. // scheduling.automaticRestart = false to include instances only if they
  79650. // are not scheduled for automatic restarts. You can use filtering on
  79651. // nested fields to filter based on resource labels.
  79652. //
  79653. // To filter on multiple expressions, provide each separate expression
  79654. // within parentheses. For example, (scheduling.automaticRestart = true)
  79655. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  79656. // AND expression. However, you can include AND and OR expressions
  79657. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  79658. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  79659. // true).
  79660. func (c *RoutersAggregatedListCall) Filter(filter string) *RoutersAggregatedListCall {
  79661. c.urlParams_.Set("filter", filter)
  79662. return c
  79663. }
  79664. // MaxResults sets the optional parameter "maxResults": The maximum
  79665. // number of results per page that should be returned. If the number of
  79666. // available results is larger than maxResults, Compute Engine returns a
  79667. // nextPageToken that can be used to get the next page of results in
  79668. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  79669. // (Default: 500)
  79670. func (c *RoutersAggregatedListCall) MaxResults(maxResults int64) *RoutersAggregatedListCall {
  79671. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  79672. return c
  79673. }
  79674. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  79675. // a certain order. By default, results are returned in alphanumerical
  79676. // order based on the resource name.
  79677. //
  79678. // You can also sort results in descending order based on the creation
  79679. // timestamp using orderBy="creationTimestamp desc". This sorts results
  79680. // based on the creationTimestamp field in reverse chronological order
  79681. // (newest result first). Use this to sort resources like operations so
  79682. // that the newest operation is returned first.
  79683. //
  79684. // Currently, only sorting by name or creationTimestamp desc is
  79685. // supported.
  79686. func (c *RoutersAggregatedListCall) OrderBy(orderBy string) *RoutersAggregatedListCall {
  79687. c.urlParams_.Set("orderBy", orderBy)
  79688. return c
  79689. }
  79690. // PageToken sets the optional parameter "pageToken": Specifies a page
  79691. // token to use. Set pageToken to the nextPageToken returned by a
  79692. // previous list request to get the next page of results.
  79693. func (c *RoutersAggregatedListCall) PageToken(pageToken string) *RoutersAggregatedListCall {
  79694. c.urlParams_.Set("pageToken", pageToken)
  79695. return c
  79696. }
  79697. // Fields allows partial responses to be retrieved. See
  79698. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79699. // for more information.
  79700. func (c *RoutersAggregatedListCall) Fields(s ...googleapi.Field) *RoutersAggregatedListCall {
  79701. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79702. return c
  79703. }
  79704. // IfNoneMatch sets the optional parameter which makes the operation
  79705. // fail if the object's ETag matches the given value. This is useful for
  79706. // getting updates only after the object has changed since the last
  79707. // request. Use googleapi.IsNotModified to check whether the response
  79708. // error from Do is the result of In-None-Match.
  79709. func (c *RoutersAggregatedListCall) IfNoneMatch(entityTag string) *RoutersAggregatedListCall {
  79710. c.ifNoneMatch_ = entityTag
  79711. return c
  79712. }
  79713. // Context sets the context to be used in this call's Do method. Any
  79714. // pending HTTP request will be aborted if the provided context is
  79715. // canceled.
  79716. func (c *RoutersAggregatedListCall) Context(ctx context.Context) *RoutersAggregatedListCall {
  79717. c.ctx_ = ctx
  79718. return c
  79719. }
  79720. // Header returns an http.Header that can be modified by the caller to
  79721. // add HTTP headers to the request.
  79722. func (c *RoutersAggregatedListCall) Header() http.Header {
  79723. if c.header_ == nil {
  79724. c.header_ = make(http.Header)
  79725. }
  79726. return c.header_
  79727. }
  79728. func (c *RoutersAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  79729. reqHeaders := make(http.Header)
  79730. for k, v := range c.header_ {
  79731. reqHeaders[k] = v
  79732. }
  79733. reqHeaders.Set("User-Agent", c.s.userAgent())
  79734. if c.ifNoneMatch_ != "" {
  79735. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  79736. }
  79737. var body io.Reader = nil
  79738. c.urlParams_.Set("alt", alt)
  79739. c.urlParams_.Set("prettyPrint", "false")
  79740. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/routers")
  79741. urls += "?" + c.urlParams_.Encode()
  79742. req, err := http.NewRequest("GET", urls, body)
  79743. if err != nil {
  79744. return nil, err
  79745. }
  79746. req.Header = reqHeaders
  79747. googleapi.Expand(req.URL, map[string]string{
  79748. "project": c.project,
  79749. })
  79750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79751. }
  79752. // Do executes the "compute.routers.aggregatedList" call.
  79753. // Exactly one of *RouterAggregatedList or error will be non-nil. Any
  79754. // non-2xx status code is an error. Response headers are in either
  79755. // *RouterAggregatedList.ServerResponse.Header or (if a response was
  79756. // returned at all) in error.(*googleapi.Error).Header. Use
  79757. // googleapi.IsNotModified to check whether the returned error was
  79758. // because http.StatusNotModified was returned.
  79759. func (c *RoutersAggregatedListCall) Do(opts ...googleapi.CallOption) (*RouterAggregatedList, error) {
  79760. gensupport.SetOptions(c.urlParams_, opts...)
  79761. res, err := c.doRequest("json")
  79762. if res != nil && res.StatusCode == http.StatusNotModified {
  79763. if res.Body != nil {
  79764. res.Body.Close()
  79765. }
  79766. return nil, &googleapi.Error{
  79767. Code: res.StatusCode,
  79768. Header: res.Header,
  79769. }
  79770. }
  79771. if err != nil {
  79772. return nil, err
  79773. }
  79774. defer googleapi.CloseBody(res)
  79775. if err := googleapi.CheckResponse(res); err != nil {
  79776. return nil, err
  79777. }
  79778. ret := &RouterAggregatedList{
  79779. ServerResponse: googleapi.ServerResponse{
  79780. Header: res.Header,
  79781. HTTPStatusCode: res.StatusCode,
  79782. },
  79783. }
  79784. target := &ret
  79785. if err := gensupport.DecodeResponse(target, res); err != nil {
  79786. return nil, err
  79787. }
  79788. return ret, nil
  79789. // {
  79790. // "description": "Retrieves an aggregated list of routers.",
  79791. // "httpMethod": "GET",
  79792. // "id": "compute.routers.aggregatedList",
  79793. // "parameterOrder": [
  79794. // "project"
  79795. // ],
  79796. // "parameters": {
  79797. // "filter": {
  79798. // "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).",
  79799. // "location": "query",
  79800. // "type": "string"
  79801. // },
  79802. // "maxResults": {
  79803. // "default": "500",
  79804. // "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)",
  79805. // "format": "uint32",
  79806. // "location": "query",
  79807. // "minimum": "0",
  79808. // "type": "integer"
  79809. // },
  79810. // "orderBy": {
  79811. // "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.",
  79812. // "location": "query",
  79813. // "type": "string"
  79814. // },
  79815. // "pageToken": {
  79816. // "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.",
  79817. // "location": "query",
  79818. // "type": "string"
  79819. // },
  79820. // "project": {
  79821. // "description": "Project ID for this request.",
  79822. // "location": "path",
  79823. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79824. // "required": true,
  79825. // "type": "string"
  79826. // }
  79827. // },
  79828. // "path": "{project}/aggregated/routers",
  79829. // "response": {
  79830. // "$ref": "RouterAggregatedList"
  79831. // },
  79832. // "scopes": [
  79833. // "https://www.googleapis.com/auth/cloud-platform",
  79834. // "https://www.googleapis.com/auth/compute",
  79835. // "https://www.googleapis.com/auth/compute.readonly"
  79836. // ]
  79837. // }
  79838. }
  79839. // Pages invokes f for each page of results.
  79840. // A non-nil error returned from f will halt the iteration.
  79841. // The provided context supersedes any context provided to the Context method.
  79842. func (c *RoutersAggregatedListCall) Pages(ctx context.Context, f func(*RouterAggregatedList) error) error {
  79843. c.ctx_ = ctx
  79844. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  79845. for {
  79846. x, err := c.Do()
  79847. if err != nil {
  79848. return err
  79849. }
  79850. if err := f(x); err != nil {
  79851. return err
  79852. }
  79853. if x.NextPageToken == "" {
  79854. return nil
  79855. }
  79856. c.PageToken(x.NextPageToken)
  79857. }
  79858. }
  79859. // method id "compute.routers.delete":
  79860. type RoutersDeleteCall struct {
  79861. s *Service
  79862. project string
  79863. region string
  79864. router string
  79865. urlParams_ gensupport.URLParams
  79866. ctx_ context.Context
  79867. header_ http.Header
  79868. }
  79869. // Delete: Deletes the specified Router resource.
  79870. func (r *RoutersService) Delete(project string, region string, router string) *RoutersDeleteCall {
  79871. c := &RoutersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  79872. c.project = project
  79873. c.region = region
  79874. c.router = router
  79875. return c
  79876. }
  79877. // RequestId sets the optional parameter "requestId": An optional
  79878. // request ID to identify requests. Specify a unique request ID so that
  79879. // if you must retry your request, the server will know to ignore the
  79880. // request if it has already been completed.
  79881. //
  79882. // For example, consider a situation where you make an initial request
  79883. // and the request times out. If you make the request again with the
  79884. // same request ID, the server can check if original operation with the
  79885. // same request ID was received, and if so, will ignore the second
  79886. // request. This prevents clients from accidentally creating duplicate
  79887. // commitments.
  79888. //
  79889. // The request ID must be a valid UUID with the exception that zero UUID
  79890. // is not supported (00000000-0000-0000-0000-000000000000).
  79891. func (c *RoutersDeleteCall) RequestId(requestId string) *RoutersDeleteCall {
  79892. c.urlParams_.Set("requestId", requestId)
  79893. return c
  79894. }
  79895. // Fields allows partial responses to be retrieved. See
  79896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  79897. // for more information.
  79898. func (c *RoutersDeleteCall) Fields(s ...googleapi.Field) *RoutersDeleteCall {
  79899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  79900. return c
  79901. }
  79902. // Context sets the context to be used in this call's Do method. Any
  79903. // pending HTTP request will be aborted if the provided context is
  79904. // canceled.
  79905. func (c *RoutersDeleteCall) Context(ctx context.Context) *RoutersDeleteCall {
  79906. c.ctx_ = ctx
  79907. return c
  79908. }
  79909. // Header returns an http.Header that can be modified by the caller to
  79910. // add HTTP headers to the request.
  79911. func (c *RoutersDeleteCall) Header() http.Header {
  79912. if c.header_ == nil {
  79913. c.header_ = make(http.Header)
  79914. }
  79915. return c.header_
  79916. }
  79917. func (c *RoutersDeleteCall) doRequest(alt string) (*http.Response, error) {
  79918. reqHeaders := make(http.Header)
  79919. for k, v := range c.header_ {
  79920. reqHeaders[k] = v
  79921. }
  79922. reqHeaders.Set("User-Agent", c.s.userAgent())
  79923. var body io.Reader = nil
  79924. c.urlParams_.Set("alt", alt)
  79925. c.urlParams_.Set("prettyPrint", "false")
  79926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  79927. urls += "?" + c.urlParams_.Encode()
  79928. req, err := http.NewRequest("DELETE", urls, body)
  79929. if err != nil {
  79930. return nil, err
  79931. }
  79932. req.Header = reqHeaders
  79933. googleapi.Expand(req.URL, map[string]string{
  79934. "project": c.project,
  79935. "region": c.region,
  79936. "router": c.router,
  79937. })
  79938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  79939. }
  79940. // Do executes the "compute.routers.delete" call.
  79941. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  79942. // status code is an error. Response headers are in either
  79943. // *Operation.ServerResponse.Header or (if a response was returned at
  79944. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  79945. // to check whether the returned error was because
  79946. // http.StatusNotModified was returned.
  79947. func (c *RoutersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  79948. gensupport.SetOptions(c.urlParams_, opts...)
  79949. res, err := c.doRequest("json")
  79950. if res != nil && res.StatusCode == http.StatusNotModified {
  79951. if res.Body != nil {
  79952. res.Body.Close()
  79953. }
  79954. return nil, &googleapi.Error{
  79955. Code: res.StatusCode,
  79956. Header: res.Header,
  79957. }
  79958. }
  79959. if err != nil {
  79960. return nil, err
  79961. }
  79962. defer googleapi.CloseBody(res)
  79963. if err := googleapi.CheckResponse(res); err != nil {
  79964. return nil, err
  79965. }
  79966. ret := &Operation{
  79967. ServerResponse: googleapi.ServerResponse{
  79968. Header: res.Header,
  79969. HTTPStatusCode: res.StatusCode,
  79970. },
  79971. }
  79972. target := &ret
  79973. if err := gensupport.DecodeResponse(target, res); err != nil {
  79974. return nil, err
  79975. }
  79976. return ret, nil
  79977. // {
  79978. // "description": "Deletes the specified Router resource.",
  79979. // "httpMethod": "DELETE",
  79980. // "id": "compute.routers.delete",
  79981. // "parameterOrder": [
  79982. // "project",
  79983. // "region",
  79984. // "router"
  79985. // ],
  79986. // "parameters": {
  79987. // "project": {
  79988. // "description": "Project ID for this request.",
  79989. // "location": "path",
  79990. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  79991. // "required": true,
  79992. // "type": "string"
  79993. // },
  79994. // "region": {
  79995. // "description": "Name of the region for this request.",
  79996. // "location": "path",
  79997. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  79998. // "required": true,
  79999. // "type": "string"
  80000. // },
  80001. // "requestId": {
  80002. // "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).",
  80003. // "location": "query",
  80004. // "type": "string"
  80005. // },
  80006. // "router": {
  80007. // "description": "Name of the Router resource to delete.",
  80008. // "location": "path",
  80009. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80010. // "required": true,
  80011. // "type": "string"
  80012. // }
  80013. // },
  80014. // "path": "{project}/regions/{region}/routers/{router}",
  80015. // "response": {
  80016. // "$ref": "Operation"
  80017. // },
  80018. // "scopes": [
  80019. // "https://www.googleapis.com/auth/cloud-platform",
  80020. // "https://www.googleapis.com/auth/compute"
  80021. // ]
  80022. // }
  80023. }
  80024. // method id "compute.routers.get":
  80025. type RoutersGetCall struct {
  80026. s *Service
  80027. project string
  80028. region string
  80029. router string
  80030. urlParams_ gensupport.URLParams
  80031. ifNoneMatch_ string
  80032. ctx_ context.Context
  80033. header_ http.Header
  80034. }
  80035. // Get: Returns the specified Router resource. Gets a list of available
  80036. // routers by making a list() request.
  80037. func (r *RoutersService) Get(project string, region string, router string) *RoutersGetCall {
  80038. c := &RoutersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80039. c.project = project
  80040. c.region = region
  80041. c.router = router
  80042. return c
  80043. }
  80044. // Fields allows partial responses to be retrieved. See
  80045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80046. // for more information.
  80047. func (c *RoutersGetCall) Fields(s ...googleapi.Field) *RoutersGetCall {
  80048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80049. return c
  80050. }
  80051. // IfNoneMatch sets the optional parameter which makes the operation
  80052. // fail if the object's ETag matches the given value. This is useful for
  80053. // getting updates only after the object has changed since the last
  80054. // request. Use googleapi.IsNotModified to check whether the response
  80055. // error from Do is the result of In-None-Match.
  80056. func (c *RoutersGetCall) IfNoneMatch(entityTag string) *RoutersGetCall {
  80057. c.ifNoneMatch_ = entityTag
  80058. return c
  80059. }
  80060. // Context sets the context to be used in this call's Do method. Any
  80061. // pending HTTP request will be aborted if the provided context is
  80062. // canceled.
  80063. func (c *RoutersGetCall) Context(ctx context.Context) *RoutersGetCall {
  80064. c.ctx_ = ctx
  80065. return c
  80066. }
  80067. // Header returns an http.Header that can be modified by the caller to
  80068. // add HTTP headers to the request.
  80069. func (c *RoutersGetCall) Header() http.Header {
  80070. if c.header_ == nil {
  80071. c.header_ = make(http.Header)
  80072. }
  80073. return c.header_
  80074. }
  80075. func (c *RoutersGetCall) doRequest(alt string) (*http.Response, error) {
  80076. reqHeaders := make(http.Header)
  80077. for k, v := range c.header_ {
  80078. reqHeaders[k] = v
  80079. }
  80080. reqHeaders.Set("User-Agent", c.s.userAgent())
  80081. if c.ifNoneMatch_ != "" {
  80082. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80083. }
  80084. var body io.Reader = nil
  80085. c.urlParams_.Set("alt", alt)
  80086. c.urlParams_.Set("prettyPrint", "false")
  80087. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  80088. urls += "?" + c.urlParams_.Encode()
  80089. req, err := http.NewRequest("GET", urls, body)
  80090. if err != nil {
  80091. return nil, err
  80092. }
  80093. req.Header = reqHeaders
  80094. googleapi.Expand(req.URL, map[string]string{
  80095. "project": c.project,
  80096. "region": c.region,
  80097. "router": c.router,
  80098. })
  80099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80100. }
  80101. // Do executes the "compute.routers.get" call.
  80102. // Exactly one of *Router or error will be non-nil. Any non-2xx status
  80103. // code is an error. Response headers are in either
  80104. // *Router.ServerResponse.Header or (if a response was returned at all)
  80105. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  80106. // check whether the returned error was because http.StatusNotModified
  80107. // was returned.
  80108. func (c *RoutersGetCall) Do(opts ...googleapi.CallOption) (*Router, error) {
  80109. gensupport.SetOptions(c.urlParams_, opts...)
  80110. res, err := c.doRequest("json")
  80111. if res != nil && res.StatusCode == http.StatusNotModified {
  80112. if res.Body != nil {
  80113. res.Body.Close()
  80114. }
  80115. return nil, &googleapi.Error{
  80116. Code: res.StatusCode,
  80117. Header: res.Header,
  80118. }
  80119. }
  80120. if err != nil {
  80121. return nil, err
  80122. }
  80123. defer googleapi.CloseBody(res)
  80124. if err := googleapi.CheckResponse(res); err != nil {
  80125. return nil, err
  80126. }
  80127. ret := &Router{
  80128. ServerResponse: googleapi.ServerResponse{
  80129. Header: res.Header,
  80130. HTTPStatusCode: res.StatusCode,
  80131. },
  80132. }
  80133. target := &ret
  80134. if err := gensupport.DecodeResponse(target, res); err != nil {
  80135. return nil, err
  80136. }
  80137. return ret, nil
  80138. // {
  80139. // "description": "Returns the specified Router resource. Gets a list of available routers by making a list() request.",
  80140. // "httpMethod": "GET",
  80141. // "id": "compute.routers.get",
  80142. // "parameterOrder": [
  80143. // "project",
  80144. // "region",
  80145. // "router"
  80146. // ],
  80147. // "parameters": {
  80148. // "project": {
  80149. // "description": "Project ID for this request.",
  80150. // "location": "path",
  80151. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80152. // "required": true,
  80153. // "type": "string"
  80154. // },
  80155. // "region": {
  80156. // "description": "Name of the region for this request.",
  80157. // "location": "path",
  80158. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80159. // "required": true,
  80160. // "type": "string"
  80161. // },
  80162. // "router": {
  80163. // "description": "Name of the Router resource to return.",
  80164. // "location": "path",
  80165. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80166. // "required": true,
  80167. // "type": "string"
  80168. // }
  80169. // },
  80170. // "path": "{project}/regions/{region}/routers/{router}",
  80171. // "response": {
  80172. // "$ref": "Router"
  80173. // },
  80174. // "scopes": [
  80175. // "https://www.googleapis.com/auth/cloud-platform",
  80176. // "https://www.googleapis.com/auth/compute",
  80177. // "https://www.googleapis.com/auth/compute.readonly"
  80178. // ]
  80179. // }
  80180. }
  80181. // method id "compute.routers.getNatMappingInfo":
  80182. type RoutersGetNatMappingInfoCall struct {
  80183. s *Service
  80184. project string
  80185. region string
  80186. router string
  80187. urlParams_ gensupport.URLParams
  80188. ifNoneMatch_ string
  80189. ctx_ context.Context
  80190. header_ http.Header
  80191. }
  80192. // GetNatMappingInfo: Retrieves runtime Nat mapping information of VM
  80193. // endpoints.
  80194. func (r *RoutersService) GetNatMappingInfo(project string, region string, router string) *RoutersGetNatMappingInfoCall {
  80195. c := &RoutersGetNatMappingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80196. c.project = project
  80197. c.region = region
  80198. c.router = router
  80199. return c
  80200. }
  80201. // Filter sets the optional parameter "filter": A filter expression that
  80202. // filters resources listed in the response. The expression must specify
  80203. // the field name, a comparison operator, and the value that you want to
  80204. // use for filtering. The value must be a string, a number, or a
  80205. // boolean. The comparison operator must be either =, !=, >, or <.
  80206. //
  80207. // For example, if you are filtering Compute Engine instances, you can
  80208. // exclude instances named example-instance by specifying name !=
  80209. // example-instance.
  80210. //
  80211. // You can also filter nested fields. For example, you could specify
  80212. // scheduling.automaticRestart = false to include instances only if they
  80213. // are not scheduled for automatic restarts. You can use filtering on
  80214. // nested fields to filter based on resource labels.
  80215. //
  80216. // To filter on multiple expressions, provide each separate expression
  80217. // within parentheses. For example, (scheduling.automaticRestart = true)
  80218. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80219. // AND expression. However, you can include AND and OR expressions
  80220. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80221. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80222. // true).
  80223. func (c *RoutersGetNatMappingInfoCall) Filter(filter string) *RoutersGetNatMappingInfoCall {
  80224. c.urlParams_.Set("filter", filter)
  80225. return c
  80226. }
  80227. // MaxResults sets the optional parameter "maxResults": The maximum
  80228. // number of results per page that should be returned. If the number of
  80229. // available results is larger than maxResults, Compute Engine returns a
  80230. // nextPageToken that can be used to get the next page of results in
  80231. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80232. // (Default: 500)
  80233. func (c *RoutersGetNatMappingInfoCall) MaxResults(maxResults int64) *RoutersGetNatMappingInfoCall {
  80234. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80235. return c
  80236. }
  80237. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80238. // a certain order. By default, results are returned in alphanumerical
  80239. // order based on the resource name.
  80240. //
  80241. // You can also sort results in descending order based on the creation
  80242. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80243. // based on the creationTimestamp field in reverse chronological order
  80244. // (newest result first). Use this to sort resources like operations so
  80245. // that the newest operation is returned first.
  80246. //
  80247. // Currently, only sorting by name or creationTimestamp desc is
  80248. // supported.
  80249. func (c *RoutersGetNatMappingInfoCall) OrderBy(orderBy string) *RoutersGetNatMappingInfoCall {
  80250. c.urlParams_.Set("orderBy", orderBy)
  80251. return c
  80252. }
  80253. // PageToken sets the optional parameter "pageToken": Specifies a page
  80254. // token to use. Set pageToken to the nextPageToken returned by a
  80255. // previous list request to get the next page of results.
  80256. func (c *RoutersGetNatMappingInfoCall) PageToken(pageToken string) *RoutersGetNatMappingInfoCall {
  80257. c.urlParams_.Set("pageToken", pageToken)
  80258. return c
  80259. }
  80260. // Fields allows partial responses to be retrieved. See
  80261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80262. // for more information.
  80263. func (c *RoutersGetNatMappingInfoCall) Fields(s ...googleapi.Field) *RoutersGetNatMappingInfoCall {
  80264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80265. return c
  80266. }
  80267. // IfNoneMatch sets the optional parameter which makes the operation
  80268. // fail if the object's ETag matches the given value. This is useful for
  80269. // getting updates only after the object has changed since the last
  80270. // request. Use googleapi.IsNotModified to check whether the response
  80271. // error from Do is the result of In-None-Match.
  80272. func (c *RoutersGetNatMappingInfoCall) IfNoneMatch(entityTag string) *RoutersGetNatMappingInfoCall {
  80273. c.ifNoneMatch_ = entityTag
  80274. return c
  80275. }
  80276. // Context sets the context to be used in this call's Do method. Any
  80277. // pending HTTP request will be aborted if the provided context is
  80278. // canceled.
  80279. func (c *RoutersGetNatMappingInfoCall) Context(ctx context.Context) *RoutersGetNatMappingInfoCall {
  80280. c.ctx_ = ctx
  80281. return c
  80282. }
  80283. // Header returns an http.Header that can be modified by the caller to
  80284. // add HTTP headers to the request.
  80285. func (c *RoutersGetNatMappingInfoCall) Header() http.Header {
  80286. if c.header_ == nil {
  80287. c.header_ = make(http.Header)
  80288. }
  80289. return c.header_
  80290. }
  80291. func (c *RoutersGetNatMappingInfoCall) doRequest(alt string) (*http.Response, error) {
  80292. reqHeaders := make(http.Header)
  80293. for k, v := range c.header_ {
  80294. reqHeaders[k] = v
  80295. }
  80296. reqHeaders.Set("User-Agent", c.s.userAgent())
  80297. if c.ifNoneMatch_ != "" {
  80298. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80299. }
  80300. var body io.Reader = nil
  80301. c.urlParams_.Set("alt", alt)
  80302. c.urlParams_.Set("prettyPrint", "false")
  80303. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getNatMappingInfo")
  80304. urls += "?" + c.urlParams_.Encode()
  80305. req, err := http.NewRequest("GET", urls, body)
  80306. if err != nil {
  80307. return nil, err
  80308. }
  80309. req.Header = reqHeaders
  80310. googleapi.Expand(req.URL, map[string]string{
  80311. "project": c.project,
  80312. "region": c.region,
  80313. "router": c.router,
  80314. })
  80315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80316. }
  80317. // Do executes the "compute.routers.getNatMappingInfo" call.
  80318. // Exactly one of *VmEndpointNatMappingsList or error will be non-nil.
  80319. // Any non-2xx status code is an error. Response headers are in either
  80320. // *VmEndpointNatMappingsList.ServerResponse.Header or (if a response
  80321. // was returned at all) in error.(*googleapi.Error).Header. Use
  80322. // googleapi.IsNotModified to check whether the returned error was
  80323. // because http.StatusNotModified was returned.
  80324. func (c *RoutersGetNatMappingInfoCall) Do(opts ...googleapi.CallOption) (*VmEndpointNatMappingsList, error) {
  80325. gensupport.SetOptions(c.urlParams_, opts...)
  80326. res, err := c.doRequest("json")
  80327. if res != nil && res.StatusCode == http.StatusNotModified {
  80328. if res.Body != nil {
  80329. res.Body.Close()
  80330. }
  80331. return nil, &googleapi.Error{
  80332. Code: res.StatusCode,
  80333. Header: res.Header,
  80334. }
  80335. }
  80336. if err != nil {
  80337. return nil, err
  80338. }
  80339. defer googleapi.CloseBody(res)
  80340. if err := googleapi.CheckResponse(res); err != nil {
  80341. return nil, err
  80342. }
  80343. ret := &VmEndpointNatMappingsList{
  80344. ServerResponse: googleapi.ServerResponse{
  80345. Header: res.Header,
  80346. HTTPStatusCode: res.StatusCode,
  80347. },
  80348. }
  80349. target := &ret
  80350. if err := gensupport.DecodeResponse(target, res); err != nil {
  80351. return nil, err
  80352. }
  80353. return ret, nil
  80354. // {
  80355. // "description": "Retrieves runtime Nat mapping information of VM endpoints.",
  80356. // "httpMethod": "GET",
  80357. // "id": "compute.routers.getNatMappingInfo",
  80358. // "parameterOrder": [
  80359. // "project",
  80360. // "region",
  80361. // "router"
  80362. // ],
  80363. // "parameters": {
  80364. // "filter": {
  80365. // "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).",
  80366. // "location": "query",
  80367. // "type": "string"
  80368. // },
  80369. // "maxResults": {
  80370. // "default": "500",
  80371. // "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)",
  80372. // "format": "uint32",
  80373. // "location": "query",
  80374. // "minimum": "0",
  80375. // "type": "integer"
  80376. // },
  80377. // "orderBy": {
  80378. // "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.",
  80379. // "location": "query",
  80380. // "type": "string"
  80381. // },
  80382. // "pageToken": {
  80383. // "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.",
  80384. // "location": "query",
  80385. // "type": "string"
  80386. // },
  80387. // "project": {
  80388. // "description": "Project ID for this request.",
  80389. // "location": "path",
  80390. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80391. // "required": true,
  80392. // "type": "string"
  80393. // },
  80394. // "region": {
  80395. // "description": "Name of the region for this request.",
  80396. // "location": "path",
  80397. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80398. // "required": true,
  80399. // "type": "string"
  80400. // },
  80401. // "router": {
  80402. // "description": "Name of the Router resource to query for Nat Mapping information of VM endpoints.",
  80403. // "location": "path",
  80404. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80405. // "required": true,
  80406. // "type": "string"
  80407. // }
  80408. // },
  80409. // "path": "{project}/regions/{region}/routers/{router}/getNatMappingInfo",
  80410. // "response": {
  80411. // "$ref": "VmEndpointNatMappingsList"
  80412. // },
  80413. // "scopes": [
  80414. // "https://www.googleapis.com/auth/cloud-platform",
  80415. // "https://www.googleapis.com/auth/compute",
  80416. // "https://www.googleapis.com/auth/compute.readonly"
  80417. // ]
  80418. // }
  80419. }
  80420. // Pages invokes f for each page of results.
  80421. // A non-nil error returned from f will halt the iteration.
  80422. // The provided context supersedes any context provided to the Context method.
  80423. func (c *RoutersGetNatMappingInfoCall) Pages(ctx context.Context, f func(*VmEndpointNatMappingsList) error) error {
  80424. c.ctx_ = ctx
  80425. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80426. for {
  80427. x, err := c.Do()
  80428. if err != nil {
  80429. return err
  80430. }
  80431. if err := f(x); err != nil {
  80432. return err
  80433. }
  80434. if x.NextPageToken == "" {
  80435. return nil
  80436. }
  80437. c.PageToken(x.NextPageToken)
  80438. }
  80439. }
  80440. // method id "compute.routers.getRouterStatus":
  80441. type RoutersGetRouterStatusCall struct {
  80442. s *Service
  80443. project string
  80444. region string
  80445. router string
  80446. urlParams_ gensupport.URLParams
  80447. ifNoneMatch_ string
  80448. ctx_ context.Context
  80449. header_ http.Header
  80450. }
  80451. // GetRouterStatus: Retrieves runtime information of the specified
  80452. // router.
  80453. func (r *RoutersService) GetRouterStatus(project string, region string, router string) *RoutersGetRouterStatusCall {
  80454. c := &RoutersGetRouterStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80455. c.project = project
  80456. c.region = region
  80457. c.router = router
  80458. return c
  80459. }
  80460. // Fields allows partial responses to be retrieved. See
  80461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80462. // for more information.
  80463. func (c *RoutersGetRouterStatusCall) Fields(s ...googleapi.Field) *RoutersGetRouterStatusCall {
  80464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80465. return c
  80466. }
  80467. // IfNoneMatch sets the optional parameter which makes the operation
  80468. // fail if the object's ETag matches the given value. This is useful for
  80469. // getting updates only after the object has changed since the last
  80470. // request. Use googleapi.IsNotModified to check whether the response
  80471. // error from Do is the result of In-None-Match.
  80472. func (c *RoutersGetRouterStatusCall) IfNoneMatch(entityTag string) *RoutersGetRouterStatusCall {
  80473. c.ifNoneMatch_ = entityTag
  80474. return c
  80475. }
  80476. // Context sets the context to be used in this call's Do method. Any
  80477. // pending HTTP request will be aborted if the provided context is
  80478. // canceled.
  80479. func (c *RoutersGetRouterStatusCall) Context(ctx context.Context) *RoutersGetRouterStatusCall {
  80480. c.ctx_ = ctx
  80481. return c
  80482. }
  80483. // Header returns an http.Header that can be modified by the caller to
  80484. // add HTTP headers to the request.
  80485. func (c *RoutersGetRouterStatusCall) Header() http.Header {
  80486. if c.header_ == nil {
  80487. c.header_ = make(http.Header)
  80488. }
  80489. return c.header_
  80490. }
  80491. func (c *RoutersGetRouterStatusCall) doRequest(alt string) (*http.Response, error) {
  80492. reqHeaders := make(http.Header)
  80493. for k, v := range c.header_ {
  80494. reqHeaders[k] = v
  80495. }
  80496. reqHeaders.Set("User-Agent", c.s.userAgent())
  80497. if c.ifNoneMatch_ != "" {
  80498. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80499. }
  80500. var body io.Reader = nil
  80501. c.urlParams_.Set("alt", alt)
  80502. c.urlParams_.Set("prettyPrint", "false")
  80503. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/getRouterStatus")
  80504. urls += "?" + c.urlParams_.Encode()
  80505. req, err := http.NewRequest("GET", urls, body)
  80506. if err != nil {
  80507. return nil, err
  80508. }
  80509. req.Header = reqHeaders
  80510. googleapi.Expand(req.URL, map[string]string{
  80511. "project": c.project,
  80512. "region": c.region,
  80513. "router": c.router,
  80514. })
  80515. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80516. }
  80517. // Do executes the "compute.routers.getRouterStatus" call.
  80518. // Exactly one of *RouterStatusResponse or error will be non-nil. Any
  80519. // non-2xx status code is an error. Response headers are in either
  80520. // *RouterStatusResponse.ServerResponse.Header or (if a response was
  80521. // returned at all) in error.(*googleapi.Error).Header. Use
  80522. // googleapi.IsNotModified to check whether the returned error was
  80523. // because http.StatusNotModified was returned.
  80524. func (c *RoutersGetRouterStatusCall) Do(opts ...googleapi.CallOption) (*RouterStatusResponse, error) {
  80525. gensupport.SetOptions(c.urlParams_, opts...)
  80526. res, err := c.doRequest("json")
  80527. if res != nil && res.StatusCode == http.StatusNotModified {
  80528. if res.Body != nil {
  80529. res.Body.Close()
  80530. }
  80531. return nil, &googleapi.Error{
  80532. Code: res.StatusCode,
  80533. Header: res.Header,
  80534. }
  80535. }
  80536. if err != nil {
  80537. return nil, err
  80538. }
  80539. defer googleapi.CloseBody(res)
  80540. if err := googleapi.CheckResponse(res); err != nil {
  80541. return nil, err
  80542. }
  80543. ret := &RouterStatusResponse{
  80544. ServerResponse: googleapi.ServerResponse{
  80545. Header: res.Header,
  80546. HTTPStatusCode: res.StatusCode,
  80547. },
  80548. }
  80549. target := &ret
  80550. if err := gensupport.DecodeResponse(target, res); err != nil {
  80551. return nil, err
  80552. }
  80553. return ret, nil
  80554. // {
  80555. // "description": "Retrieves runtime information of the specified router.",
  80556. // "httpMethod": "GET",
  80557. // "id": "compute.routers.getRouterStatus",
  80558. // "parameterOrder": [
  80559. // "project",
  80560. // "region",
  80561. // "router"
  80562. // ],
  80563. // "parameters": {
  80564. // "project": {
  80565. // "description": "Project ID for this request.",
  80566. // "location": "path",
  80567. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80568. // "required": true,
  80569. // "type": "string"
  80570. // },
  80571. // "region": {
  80572. // "description": "Name of the region for this request.",
  80573. // "location": "path",
  80574. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80575. // "required": true,
  80576. // "type": "string"
  80577. // },
  80578. // "router": {
  80579. // "description": "Name of the Router resource to query.",
  80580. // "location": "path",
  80581. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  80582. // "required": true,
  80583. // "type": "string"
  80584. // }
  80585. // },
  80586. // "path": "{project}/regions/{region}/routers/{router}/getRouterStatus",
  80587. // "response": {
  80588. // "$ref": "RouterStatusResponse"
  80589. // },
  80590. // "scopes": [
  80591. // "https://www.googleapis.com/auth/cloud-platform",
  80592. // "https://www.googleapis.com/auth/compute",
  80593. // "https://www.googleapis.com/auth/compute.readonly"
  80594. // ]
  80595. // }
  80596. }
  80597. // method id "compute.routers.insert":
  80598. type RoutersInsertCall struct {
  80599. s *Service
  80600. project string
  80601. region string
  80602. router *Router
  80603. urlParams_ gensupport.URLParams
  80604. ctx_ context.Context
  80605. header_ http.Header
  80606. }
  80607. // Insert: Creates a Router resource in the specified project and region
  80608. // using the data included in the request.
  80609. func (r *RoutersService) Insert(project string, region string, router *Router) *RoutersInsertCall {
  80610. c := &RoutersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80611. c.project = project
  80612. c.region = region
  80613. c.router = router
  80614. return c
  80615. }
  80616. // RequestId sets the optional parameter "requestId": An optional
  80617. // request ID to identify requests. Specify a unique request ID so that
  80618. // if you must retry your request, the server will know to ignore the
  80619. // request if it has already been completed.
  80620. //
  80621. // For example, consider a situation where you make an initial request
  80622. // and the request times out. If you make the request again with the
  80623. // same request ID, the server can check if original operation with the
  80624. // same request ID was received, and if so, will ignore the second
  80625. // request. This prevents clients from accidentally creating duplicate
  80626. // commitments.
  80627. //
  80628. // The request ID must be a valid UUID with the exception that zero UUID
  80629. // is not supported (00000000-0000-0000-0000-000000000000).
  80630. func (c *RoutersInsertCall) RequestId(requestId string) *RoutersInsertCall {
  80631. c.urlParams_.Set("requestId", requestId)
  80632. return c
  80633. }
  80634. // Fields allows partial responses to be retrieved. See
  80635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80636. // for more information.
  80637. func (c *RoutersInsertCall) Fields(s ...googleapi.Field) *RoutersInsertCall {
  80638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80639. return c
  80640. }
  80641. // Context sets the context to be used in this call's Do method. Any
  80642. // pending HTTP request will be aborted if the provided context is
  80643. // canceled.
  80644. func (c *RoutersInsertCall) Context(ctx context.Context) *RoutersInsertCall {
  80645. c.ctx_ = ctx
  80646. return c
  80647. }
  80648. // Header returns an http.Header that can be modified by the caller to
  80649. // add HTTP headers to the request.
  80650. func (c *RoutersInsertCall) Header() http.Header {
  80651. if c.header_ == nil {
  80652. c.header_ = make(http.Header)
  80653. }
  80654. return c.header_
  80655. }
  80656. func (c *RoutersInsertCall) doRequest(alt string) (*http.Response, error) {
  80657. reqHeaders := make(http.Header)
  80658. for k, v := range c.header_ {
  80659. reqHeaders[k] = v
  80660. }
  80661. reqHeaders.Set("User-Agent", c.s.userAgent())
  80662. var body io.Reader = nil
  80663. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router)
  80664. if err != nil {
  80665. return nil, err
  80666. }
  80667. reqHeaders.Set("Content-Type", "application/json")
  80668. c.urlParams_.Set("alt", alt)
  80669. c.urlParams_.Set("prettyPrint", "false")
  80670. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  80671. urls += "?" + c.urlParams_.Encode()
  80672. req, err := http.NewRequest("POST", urls, body)
  80673. if err != nil {
  80674. return nil, err
  80675. }
  80676. req.Header = reqHeaders
  80677. googleapi.Expand(req.URL, map[string]string{
  80678. "project": c.project,
  80679. "region": c.region,
  80680. })
  80681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80682. }
  80683. // Do executes the "compute.routers.insert" call.
  80684. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  80685. // status code is an error. Response headers are in either
  80686. // *Operation.ServerResponse.Header or (if a response was returned at
  80687. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80688. // to check whether the returned error was because
  80689. // http.StatusNotModified was returned.
  80690. func (c *RoutersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  80691. gensupport.SetOptions(c.urlParams_, opts...)
  80692. res, err := c.doRequest("json")
  80693. if res != nil && res.StatusCode == http.StatusNotModified {
  80694. if res.Body != nil {
  80695. res.Body.Close()
  80696. }
  80697. return nil, &googleapi.Error{
  80698. Code: res.StatusCode,
  80699. Header: res.Header,
  80700. }
  80701. }
  80702. if err != nil {
  80703. return nil, err
  80704. }
  80705. defer googleapi.CloseBody(res)
  80706. if err := googleapi.CheckResponse(res); err != nil {
  80707. return nil, err
  80708. }
  80709. ret := &Operation{
  80710. ServerResponse: googleapi.ServerResponse{
  80711. Header: res.Header,
  80712. HTTPStatusCode: res.StatusCode,
  80713. },
  80714. }
  80715. target := &ret
  80716. if err := gensupport.DecodeResponse(target, res); err != nil {
  80717. return nil, err
  80718. }
  80719. return ret, nil
  80720. // {
  80721. // "description": "Creates a Router resource in the specified project and region using the data included in the request.",
  80722. // "httpMethod": "POST",
  80723. // "id": "compute.routers.insert",
  80724. // "parameterOrder": [
  80725. // "project",
  80726. // "region"
  80727. // ],
  80728. // "parameters": {
  80729. // "project": {
  80730. // "description": "Project ID for this request.",
  80731. // "location": "path",
  80732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80733. // "required": true,
  80734. // "type": "string"
  80735. // },
  80736. // "region": {
  80737. // "description": "Name of the region for this request.",
  80738. // "location": "path",
  80739. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80740. // "required": true,
  80741. // "type": "string"
  80742. // },
  80743. // "requestId": {
  80744. // "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).",
  80745. // "location": "query",
  80746. // "type": "string"
  80747. // }
  80748. // },
  80749. // "path": "{project}/regions/{region}/routers",
  80750. // "request": {
  80751. // "$ref": "Router"
  80752. // },
  80753. // "response": {
  80754. // "$ref": "Operation"
  80755. // },
  80756. // "scopes": [
  80757. // "https://www.googleapis.com/auth/cloud-platform",
  80758. // "https://www.googleapis.com/auth/compute"
  80759. // ]
  80760. // }
  80761. }
  80762. // method id "compute.routers.list":
  80763. type RoutersListCall struct {
  80764. s *Service
  80765. project string
  80766. region string
  80767. urlParams_ gensupport.URLParams
  80768. ifNoneMatch_ string
  80769. ctx_ context.Context
  80770. header_ http.Header
  80771. }
  80772. // List: Retrieves a list of Router resources available to the specified
  80773. // project.
  80774. func (r *RoutersService) List(project string, region string) *RoutersListCall {
  80775. c := &RoutersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  80776. c.project = project
  80777. c.region = region
  80778. return c
  80779. }
  80780. // Filter sets the optional parameter "filter": A filter expression that
  80781. // filters resources listed in the response. The expression must specify
  80782. // the field name, a comparison operator, and the value that you want to
  80783. // use for filtering. The value must be a string, a number, or a
  80784. // boolean. The comparison operator must be either =, !=, >, or <.
  80785. //
  80786. // For example, if you are filtering Compute Engine instances, you can
  80787. // exclude instances named example-instance by specifying name !=
  80788. // example-instance.
  80789. //
  80790. // You can also filter nested fields. For example, you could specify
  80791. // scheduling.automaticRestart = false to include instances only if they
  80792. // are not scheduled for automatic restarts. You can use filtering on
  80793. // nested fields to filter based on resource labels.
  80794. //
  80795. // To filter on multiple expressions, provide each separate expression
  80796. // within parentheses. For example, (scheduling.automaticRestart = true)
  80797. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  80798. // AND expression. However, you can include AND and OR expressions
  80799. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  80800. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  80801. // true).
  80802. func (c *RoutersListCall) Filter(filter string) *RoutersListCall {
  80803. c.urlParams_.Set("filter", filter)
  80804. return c
  80805. }
  80806. // MaxResults sets the optional parameter "maxResults": The maximum
  80807. // number of results per page that should be returned. If the number of
  80808. // available results is larger than maxResults, Compute Engine returns a
  80809. // nextPageToken that can be used to get the next page of results in
  80810. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  80811. // (Default: 500)
  80812. func (c *RoutersListCall) MaxResults(maxResults int64) *RoutersListCall {
  80813. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  80814. return c
  80815. }
  80816. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  80817. // a certain order. By default, results are returned in alphanumerical
  80818. // order based on the resource name.
  80819. //
  80820. // You can also sort results in descending order based on the creation
  80821. // timestamp using orderBy="creationTimestamp desc". This sorts results
  80822. // based on the creationTimestamp field in reverse chronological order
  80823. // (newest result first). Use this to sort resources like operations so
  80824. // that the newest operation is returned first.
  80825. //
  80826. // Currently, only sorting by name or creationTimestamp desc is
  80827. // supported.
  80828. func (c *RoutersListCall) OrderBy(orderBy string) *RoutersListCall {
  80829. c.urlParams_.Set("orderBy", orderBy)
  80830. return c
  80831. }
  80832. // PageToken sets the optional parameter "pageToken": Specifies a page
  80833. // token to use. Set pageToken to the nextPageToken returned by a
  80834. // previous list request to get the next page of results.
  80835. func (c *RoutersListCall) PageToken(pageToken string) *RoutersListCall {
  80836. c.urlParams_.Set("pageToken", pageToken)
  80837. return c
  80838. }
  80839. // Fields allows partial responses to be retrieved. See
  80840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  80841. // for more information.
  80842. func (c *RoutersListCall) Fields(s ...googleapi.Field) *RoutersListCall {
  80843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  80844. return c
  80845. }
  80846. // IfNoneMatch sets the optional parameter which makes the operation
  80847. // fail if the object's ETag matches the given value. This is useful for
  80848. // getting updates only after the object has changed since the last
  80849. // request. Use googleapi.IsNotModified to check whether the response
  80850. // error from Do is the result of In-None-Match.
  80851. func (c *RoutersListCall) IfNoneMatch(entityTag string) *RoutersListCall {
  80852. c.ifNoneMatch_ = entityTag
  80853. return c
  80854. }
  80855. // Context sets the context to be used in this call's Do method. Any
  80856. // pending HTTP request will be aborted if the provided context is
  80857. // canceled.
  80858. func (c *RoutersListCall) Context(ctx context.Context) *RoutersListCall {
  80859. c.ctx_ = ctx
  80860. return c
  80861. }
  80862. // Header returns an http.Header that can be modified by the caller to
  80863. // add HTTP headers to the request.
  80864. func (c *RoutersListCall) Header() http.Header {
  80865. if c.header_ == nil {
  80866. c.header_ = make(http.Header)
  80867. }
  80868. return c.header_
  80869. }
  80870. func (c *RoutersListCall) doRequest(alt string) (*http.Response, error) {
  80871. reqHeaders := make(http.Header)
  80872. for k, v := range c.header_ {
  80873. reqHeaders[k] = v
  80874. }
  80875. reqHeaders.Set("User-Agent", c.s.userAgent())
  80876. if c.ifNoneMatch_ != "" {
  80877. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  80878. }
  80879. var body io.Reader = nil
  80880. c.urlParams_.Set("alt", alt)
  80881. c.urlParams_.Set("prettyPrint", "false")
  80882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers")
  80883. urls += "?" + c.urlParams_.Encode()
  80884. req, err := http.NewRequest("GET", urls, body)
  80885. if err != nil {
  80886. return nil, err
  80887. }
  80888. req.Header = reqHeaders
  80889. googleapi.Expand(req.URL, map[string]string{
  80890. "project": c.project,
  80891. "region": c.region,
  80892. })
  80893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  80894. }
  80895. // Do executes the "compute.routers.list" call.
  80896. // Exactly one of *RouterList or error will be non-nil. Any non-2xx
  80897. // status code is an error. Response headers are in either
  80898. // *RouterList.ServerResponse.Header or (if a response was returned at
  80899. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  80900. // to check whether the returned error was because
  80901. // http.StatusNotModified was returned.
  80902. func (c *RoutersListCall) Do(opts ...googleapi.CallOption) (*RouterList, error) {
  80903. gensupport.SetOptions(c.urlParams_, opts...)
  80904. res, err := c.doRequest("json")
  80905. if res != nil && res.StatusCode == http.StatusNotModified {
  80906. if res.Body != nil {
  80907. res.Body.Close()
  80908. }
  80909. return nil, &googleapi.Error{
  80910. Code: res.StatusCode,
  80911. Header: res.Header,
  80912. }
  80913. }
  80914. if err != nil {
  80915. return nil, err
  80916. }
  80917. defer googleapi.CloseBody(res)
  80918. if err := googleapi.CheckResponse(res); err != nil {
  80919. return nil, err
  80920. }
  80921. ret := &RouterList{
  80922. ServerResponse: googleapi.ServerResponse{
  80923. Header: res.Header,
  80924. HTTPStatusCode: res.StatusCode,
  80925. },
  80926. }
  80927. target := &ret
  80928. if err := gensupport.DecodeResponse(target, res); err != nil {
  80929. return nil, err
  80930. }
  80931. return ret, nil
  80932. // {
  80933. // "description": "Retrieves a list of Router resources available to the specified project.",
  80934. // "httpMethod": "GET",
  80935. // "id": "compute.routers.list",
  80936. // "parameterOrder": [
  80937. // "project",
  80938. // "region"
  80939. // ],
  80940. // "parameters": {
  80941. // "filter": {
  80942. // "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).",
  80943. // "location": "query",
  80944. // "type": "string"
  80945. // },
  80946. // "maxResults": {
  80947. // "default": "500",
  80948. // "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)",
  80949. // "format": "uint32",
  80950. // "location": "query",
  80951. // "minimum": "0",
  80952. // "type": "integer"
  80953. // },
  80954. // "orderBy": {
  80955. // "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.",
  80956. // "location": "query",
  80957. // "type": "string"
  80958. // },
  80959. // "pageToken": {
  80960. // "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.",
  80961. // "location": "query",
  80962. // "type": "string"
  80963. // },
  80964. // "project": {
  80965. // "description": "Project ID for this request.",
  80966. // "location": "path",
  80967. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  80968. // "required": true,
  80969. // "type": "string"
  80970. // },
  80971. // "region": {
  80972. // "description": "Name of the region for this request.",
  80973. // "location": "path",
  80974. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  80975. // "required": true,
  80976. // "type": "string"
  80977. // }
  80978. // },
  80979. // "path": "{project}/regions/{region}/routers",
  80980. // "response": {
  80981. // "$ref": "RouterList"
  80982. // },
  80983. // "scopes": [
  80984. // "https://www.googleapis.com/auth/cloud-platform",
  80985. // "https://www.googleapis.com/auth/compute",
  80986. // "https://www.googleapis.com/auth/compute.readonly"
  80987. // ]
  80988. // }
  80989. }
  80990. // Pages invokes f for each page of results.
  80991. // A non-nil error returned from f will halt the iteration.
  80992. // The provided context supersedes any context provided to the Context method.
  80993. func (c *RoutersListCall) Pages(ctx context.Context, f func(*RouterList) error) error {
  80994. c.ctx_ = ctx
  80995. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  80996. for {
  80997. x, err := c.Do()
  80998. if err != nil {
  80999. return err
  81000. }
  81001. if err := f(x); err != nil {
  81002. return err
  81003. }
  81004. if x.NextPageToken == "" {
  81005. return nil
  81006. }
  81007. c.PageToken(x.NextPageToken)
  81008. }
  81009. }
  81010. // method id "compute.routers.patch":
  81011. type RoutersPatchCall struct {
  81012. s *Service
  81013. project string
  81014. region string
  81015. router string
  81016. router2 *Router
  81017. urlParams_ gensupport.URLParams
  81018. ctx_ context.Context
  81019. header_ http.Header
  81020. }
  81021. // Patch: Patches the specified Router resource with the data included
  81022. // in the request. This method supports PATCH semantics and uses JSON
  81023. // merge patch format and processing rules.
  81024. func (r *RoutersService) Patch(project string, region string, router string, router2 *Router) *RoutersPatchCall {
  81025. c := &RoutersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81026. c.project = project
  81027. c.region = region
  81028. c.router = router
  81029. c.router2 = router2
  81030. return c
  81031. }
  81032. // RequestId sets the optional parameter "requestId": An optional
  81033. // request ID to identify requests. Specify a unique request ID so that
  81034. // if you must retry your request, the server will know to ignore the
  81035. // request if it has already been completed.
  81036. //
  81037. // For example, consider a situation where you make an initial request
  81038. // and the request times out. If you make the request again with the
  81039. // same request ID, the server can check if original operation with the
  81040. // same request ID was received, and if so, will ignore the second
  81041. // request. This prevents clients from accidentally creating duplicate
  81042. // commitments.
  81043. //
  81044. // The request ID must be a valid UUID with the exception that zero UUID
  81045. // is not supported (00000000-0000-0000-0000-000000000000).
  81046. func (c *RoutersPatchCall) RequestId(requestId string) *RoutersPatchCall {
  81047. c.urlParams_.Set("requestId", requestId)
  81048. return c
  81049. }
  81050. // Fields allows partial responses to be retrieved. See
  81051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81052. // for more information.
  81053. func (c *RoutersPatchCall) Fields(s ...googleapi.Field) *RoutersPatchCall {
  81054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81055. return c
  81056. }
  81057. // Context sets the context to be used in this call's Do method. Any
  81058. // pending HTTP request will be aborted if the provided context is
  81059. // canceled.
  81060. func (c *RoutersPatchCall) Context(ctx context.Context) *RoutersPatchCall {
  81061. c.ctx_ = ctx
  81062. return c
  81063. }
  81064. // Header returns an http.Header that can be modified by the caller to
  81065. // add HTTP headers to the request.
  81066. func (c *RoutersPatchCall) Header() http.Header {
  81067. if c.header_ == nil {
  81068. c.header_ = make(http.Header)
  81069. }
  81070. return c.header_
  81071. }
  81072. func (c *RoutersPatchCall) doRequest(alt string) (*http.Response, error) {
  81073. reqHeaders := make(http.Header)
  81074. for k, v := range c.header_ {
  81075. reqHeaders[k] = v
  81076. }
  81077. reqHeaders.Set("User-Agent", c.s.userAgent())
  81078. var body io.Reader = nil
  81079. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  81080. if err != nil {
  81081. return nil, err
  81082. }
  81083. reqHeaders.Set("Content-Type", "application/json")
  81084. c.urlParams_.Set("alt", alt)
  81085. c.urlParams_.Set("prettyPrint", "false")
  81086. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  81087. urls += "?" + c.urlParams_.Encode()
  81088. req, err := http.NewRequest("PATCH", urls, body)
  81089. if err != nil {
  81090. return nil, err
  81091. }
  81092. req.Header = reqHeaders
  81093. googleapi.Expand(req.URL, map[string]string{
  81094. "project": c.project,
  81095. "region": c.region,
  81096. "router": c.router,
  81097. })
  81098. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81099. }
  81100. // Do executes the "compute.routers.patch" call.
  81101. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81102. // status code is an error. Response headers are in either
  81103. // *Operation.ServerResponse.Header or (if a response was returned at
  81104. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81105. // to check whether the returned error was because
  81106. // http.StatusNotModified was returned.
  81107. func (c *RoutersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81108. gensupport.SetOptions(c.urlParams_, opts...)
  81109. res, err := c.doRequest("json")
  81110. if res != nil && res.StatusCode == http.StatusNotModified {
  81111. if res.Body != nil {
  81112. res.Body.Close()
  81113. }
  81114. return nil, &googleapi.Error{
  81115. Code: res.StatusCode,
  81116. Header: res.Header,
  81117. }
  81118. }
  81119. if err != nil {
  81120. return nil, err
  81121. }
  81122. defer googleapi.CloseBody(res)
  81123. if err := googleapi.CheckResponse(res); err != nil {
  81124. return nil, err
  81125. }
  81126. ret := &Operation{
  81127. ServerResponse: googleapi.ServerResponse{
  81128. Header: res.Header,
  81129. HTTPStatusCode: res.StatusCode,
  81130. },
  81131. }
  81132. target := &ret
  81133. if err := gensupport.DecodeResponse(target, res); err != nil {
  81134. return nil, err
  81135. }
  81136. return ret, nil
  81137. // {
  81138. // "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.",
  81139. // "httpMethod": "PATCH",
  81140. // "id": "compute.routers.patch",
  81141. // "parameterOrder": [
  81142. // "project",
  81143. // "region",
  81144. // "router"
  81145. // ],
  81146. // "parameters": {
  81147. // "project": {
  81148. // "description": "Project ID for this request.",
  81149. // "location": "path",
  81150. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81151. // "required": true,
  81152. // "type": "string"
  81153. // },
  81154. // "region": {
  81155. // "description": "Name of the region for this request.",
  81156. // "location": "path",
  81157. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81158. // "required": true,
  81159. // "type": "string"
  81160. // },
  81161. // "requestId": {
  81162. // "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).",
  81163. // "location": "query",
  81164. // "type": "string"
  81165. // },
  81166. // "router": {
  81167. // "description": "Name of the Router resource to patch.",
  81168. // "location": "path",
  81169. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81170. // "required": true,
  81171. // "type": "string"
  81172. // }
  81173. // },
  81174. // "path": "{project}/regions/{region}/routers/{router}",
  81175. // "request": {
  81176. // "$ref": "Router"
  81177. // },
  81178. // "response": {
  81179. // "$ref": "Operation"
  81180. // },
  81181. // "scopes": [
  81182. // "https://www.googleapis.com/auth/cloud-platform",
  81183. // "https://www.googleapis.com/auth/compute"
  81184. // ]
  81185. // }
  81186. }
  81187. // method id "compute.routers.preview":
  81188. type RoutersPreviewCall struct {
  81189. s *Service
  81190. project string
  81191. region string
  81192. router string
  81193. router2 *Router
  81194. urlParams_ gensupport.URLParams
  81195. ctx_ context.Context
  81196. header_ http.Header
  81197. }
  81198. // Preview: Preview fields auto-generated during router create and
  81199. // update operations. Calling this method does NOT create or update the
  81200. // router.
  81201. func (r *RoutersService) Preview(project string, region string, router string, router2 *Router) *RoutersPreviewCall {
  81202. c := &RoutersPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81203. c.project = project
  81204. c.region = region
  81205. c.router = router
  81206. c.router2 = router2
  81207. return c
  81208. }
  81209. // Fields allows partial responses to be retrieved. See
  81210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81211. // for more information.
  81212. func (c *RoutersPreviewCall) Fields(s ...googleapi.Field) *RoutersPreviewCall {
  81213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81214. return c
  81215. }
  81216. // Context sets the context to be used in this call's Do method. Any
  81217. // pending HTTP request will be aborted if the provided context is
  81218. // canceled.
  81219. func (c *RoutersPreviewCall) Context(ctx context.Context) *RoutersPreviewCall {
  81220. c.ctx_ = ctx
  81221. return c
  81222. }
  81223. // Header returns an http.Header that can be modified by the caller to
  81224. // add HTTP headers to the request.
  81225. func (c *RoutersPreviewCall) Header() http.Header {
  81226. if c.header_ == nil {
  81227. c.header_ = make(http.Header)
  81228. }
  81229. return c.header_
  81230. }
  81231. func (c *RoutersPreviewCall) doRequest(alt string) (*http.Response, error) {
  81232. reqHeaders := make(http.Header)
  81233. for k, v := range c.header_ {
  81234. reqHeaders[k] = v
  81235. }
  81236. reqHeaders.Set("User-Agent", c.s.userAgent())
  81237. var body io.Reader = nil
  81238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  81239. if err != nil {
  81240. return nil, err
  81241. }
  81242. reqHeaders.Set("Content-Type", "application/json")
  81243. c.urlParams_.Set("alt", alt)
  81244. c.urlParams_.Set("prettyPrint", "false")
  81245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}/preview")
  81246. urls += "?" + c.urlParams_.Encode()
  81247. req, err := http.NewRequest("POST", urls, body)
  81248. if err != nil {
  81249. return nil, err
  81250. }
  81251. req.Header = reqHeaders
  81252. googleapi.Expand(req.URL, map[string]string{
  81253. "project": c.project,
  81254. "region": c.region,
  81255. "router": c.router,
  81256. })
  81257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81258. }
  81259. // Do executes the "compute.routers.preview" call.
  81260. // Exactly one of *RoutersPreviewResponse or error will be non-nil. Any
  81261. // non-2xx status code is an error. Response headers are in either
  81262. // *RoutersPreviewResponse.ServerResponse.Header or (if a response was
  81263. // returned at all) in error.(*googleapi.Error).Header. Use
  81264. // googleapi.IsNotModified to check whether the returned error was
  81265. // because http.StatusNotModified was returned.
  81266. func (c *RoutersPreviewCall) Do(opts ...googleapi.CallOption) (*RoutersPreviewResponse, error) {
  81267. gensupport.SetOptions(c.urlParams_, opts...)
  81268. res, err := c.doRequest("json")
  81269. if res != nil && res.StatusCode == http.StatusNotModified {
  81270. if res.Body != nil {
  81271. res.Body.Close()
  81272. }
  81273. return nil, &googleapi.Error{
  81274. Code: res.StatusCode,
  81275. Header: res.Header,
  81276. }
  81277. }
  81278. if err != nil {
  81279. return nil, err
  81280. }
  81281. defer googleapi.CloseBody(res)
  81282. if err := googleapi.CheckResponse(res); err != nil {
  81283. return nil, err
  81284. }
  81285. ret := &RoutersPreviewResponse{
  81286. ServerResponse: googleapi.ServerResponse{
  81287. Header: res.Header,
  81288. HTTPStatusCode: res.StatusCode,
  81289. },
  81290. }
  81291. target := &ret
  81292. if err := gensupport.DecodeResponse(target, res); err != nil {
  81293. return nil, err
  81294. }
  81295. return ret, nil
  81296. // {
  81297. // "description": "Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router.",
  81298. // "httpMethod": "POST",
  81299. // "id": "compute.routers.preview",
  81300. // "parameterOrder": [
  81301. // "project",
  81302. // "region",
  81303. // "router"
  81304. // ],
  81305. // "parameters": {
  81306. // "project": {
  81307. // "description": "Project ID for this request.",
  81308. // "location": "path",
  81309. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81310. // "required": true,
  81311. // "type": "string"
  81312. // },
  81313. // "region": {
  81314. // "description": "Name of the region for this request.",
  81315. // "location": "path",
  81316. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81317. // "required": true,
  81318. // "type": "string"
  81319. // },
  81320. // "router": {
  81321. // "description": "Name of the Router resource to query.",
  81322. // "location": "path",
  81323. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81324. // "required": true,
  81325. // "type": "string"
  81326. // }
  81327. // },
  81328. // "path": "{project}/regions/{region}/routers/{router}/preview",
  81329. // "request": {
  81330. // "$ref": "Router"
  81331. // },
  81332. // "response": {
  81333. // "$ref": "RoutersPreviewResponse"
  81334. // },
  81335. // "scopes": [
  81336. // "https://www.googleapis.com/auth/cloud-platform",
  81337. // "https://www.googleapis.com/auth/compute",
  81338. // "https://www.googleapis.com/auth/compute.readonly"
  81339. // ]
  81340. // }
  81341. }
  81342. // method id "compute.routers.update":
  81343. type RoutersUpdateCall struct {
  81344. s *Service
  81345. project string
  81346. region string
  81347. router string
  81348. router2 *Router
  81349. urlParams_ gensupport.URLParams
  81350. ctx_ context.Context
  81351. header_ http.Header
  81352. }
  81353. // Update: Updates the specified Router resource with the data included
  81354. // in the request.
  81355. func (r *RoutersService) Update(project string, region string, router string, router2 *Router) *RoutersUpdateCall {
  81356. c := &RoutersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81357. c.project = project
  81358. c.region = region
  81359. c.router = router
  81360. c.router2 = router2
  81361. return c
  81362. }
  81363. // RequestId sets the optional parameter "requestId": An optional
  81364. // request ID to identify requests. Specify a unique request ID so that
  81365. // if you must retry your request, the server will know to ignore the
  81366. // request if it has already been completed.
  81367. //
  81368. // For example, consider a situation where you make an initial request
  81369. // and the request times out. If you make the request again with the
  81370. // same request ID, the server can check if original operation with the
  81371. // same request ID was received, and if so, will ignore the second
  81372. // request. This prevents clients from accidentally creating duplicate
  81373. // commitments.
  81374. //
  81375. // The request ID must be a valid UUID with the exception that zero UUID
  81376. // is not supported (00000000-0000-0000-0000-000000000000).
  81377. func (c *RoutersUpdateCall) RequestId(requestId string) *RoutersUpdateCall {
  81378. c.urlParams_.Set("requestId", requestId)
  81379. return c
  81380. }
  81381. // Fields allows partial responses to be retrieved. See
  81382. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81383. // for more information.
  81384. func (c *RoutersUpdateCall) Fields(s ...googleapi.Field) *RoutersUpdateCall {
  81385. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81386. return c
  81387. }
  81388. // Context sets the context to be used in this call's Do method. Any
  81389. // pending HTTP request will be aborted if the provided context is
  81390. // canceled.
  81391. func (c *RoutersUpdateCall) Context(ctx context.Context) *RoutersUpdateCall {
  81392. c.ctx_ = ctx
  81393. return c
  81394. }
  81395. // Header returns an http.Header that can be modified by the caller to
  81396. // add HTTP headers to the request.
  81397. func (c *RoutersUpdateCall) Header() http.Header {
  81398. if c.header_ == nil {
  81399. c.header_ = make(http.Header)
  81400. }
  81401. return c.header_
  81402. }
  81403. func (c *RoutersUpdateCall) doRequest(alt string) (*http.Response, error) {
  81404. reqHeaders := make(http.Header)
  81405. for k, v := range c.header_ {
  81406. reqHeaders[k] = v
  81407. }
  81408. reqHeaders.Set("User-Agent", c.s.userAgent())
  81409. var body io.Reader = nil
  81410. body, err := googleapi.WithoutDataWrapper.JSONReader(c.router2)
  81411. if err != nil {
  81412. return nil, err
  81413. }
  81414. reqHeaders.Set("Content-Type", "application/json")
  81415. c.urlParams_.Set("alt", alt)
  81416. c.urlParams_.Set("prettyPrint", "false")
  81417. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/routers/{router}")
  81418. urls += "?" + c.urlParams_.Encode()
  81419. req, err := http.NewRequest("PUT", urls, body)
  81420. if err != nil {
  81421. return nil, err
  81422. }
  81423. req.Header = reqHeaders
  81424. googleapi.Expand(req.URL, map[string]string{
  81425. "project": c.project,
  81426. "region": c.region,
  81427. "router": c.router,
  81428. })
  81429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81430. }
  81431. // Do executes the "compute.routers.update" call.
  81432. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81433. // status code is an error. Response headers are in either
  81434. // *Operation.ServerResponse.Header or (if a response was returned at
  81435. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81436. // to check whether the returned error was because
  81437. // http.StatusNotModified was returned.
  81438. func (c *RoutersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81439. gensupport.SetOptions(c.urlParams_, opts...)
  81440. res, err := c.doRequest("json")
  81441. if res != nil && res.StatusCode == http.StatusNotModified {
  81442. if res.Body != nil {
  81443. res.Body.Close()
  81444. }
  81445. return nil, &googleapi.Error{
  81446. Code: res.StatusCode,
  81447. Header: res.Header,
  81448. }
  81449. }
  81450. if err != nil {
  81451. return nil, err
  81452. }
  81453. defer googleapi.CloseBody(res)
  81454. if err := googleapi.CheckResponse(res); err != nil {
  81455. return nil, err
  81456. }
  81457. ret := &Operation{
  81458. ServerResponse: googleapi.ServerResponse{
  81459. Header: res.Header,
  81460. HTTPStatusCode: res.StatusCode,
  81461. },
  81462. }
  81463. target := &ret
  81464. if err := gensupport.DecodeResponse(target, res); err != nil {
  81465. return nil, err
  81466. }
  81467. return ret, nil
  81468. // {
  81469. // "description": "Updates the specified Router resource with the data included in the request.",
  81470. // "httpMethod": "PUT",
  81471. // "id": "compute.routers.update",
  81472. // "parameterOrder": [
  81473. // "project",
  81474. // "region",
  81475. // "router"
  81476. // ],
  81477. // "parameters": {
  81478. // "project": {
  81479. // "description": "Project ID for this request.",
  81480. // "location": "path",
  81481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81482. // "required": true,
  81483. // "type": "string"
  81484. // },
  81485. // "region": {
  81486. // "description": "Name of the region for this request.",
  81487. // "location": "path",
  81488. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  81489. // "required": true,
  81490. // "type": "string"
  81491. // },
  81492. // "requestId": {
  81493. // "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).",
  81494. // "location": "query",
  81495. // "type": "string"
  81496. // },
  81497. // "router": {
  81498. // "description": "Name of the Router resource to update.",
  81499. // "location": "path",
  81500. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81501. // "required": true,
  81502. // "type": "string"
  81503. // }
  81504. // },
  81505. // "path": "{project}/regions/{region}/routers/{router}",
  81506. // "request": {
  81507. // "$ref": "Router"
  81508. // },
  81509. // "response": {
  81510. // "$ref": "Operation"
  81511. // },
  81512. // "scopes": [
  81513. // "https://www.googleapis.com/auth/cloud-platform",
  81514. // "https://www.googleapis.com/auth/compute"
  81515. // ]
  81516. // }
  81517. }
  81518. // method id "compute.routes.delete":
  81519. type RoutesDeleteCall struct {
  81520. s *Service
  81521. project string
  81522. route string
  81523. urlParams_ gensupport.URLParams
  81524. ctx_ context.Context
  81525. header_ http.Header
  81526. }
  81527. // Delete: Deletes the specified Route resource.
  81528. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete
  81529. func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall {
  81530. c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81531. c.project = project
  81532. c.route = route
  81533. return c
  81534. }
  81535. // RequestId sets the optional parameter "requestId": An optional
  81536. // request ID to identify requests. Specify a unique request ID so that
  81537. // if you must retry your request, the server will know to ignore the
  81538. // request if it has already been completed.
  81539. //
  81540. // For example, consider a situation where you make an initial request
  81541. // and the request times out. If you make the request again with the
  81542. // same request ID, the server can check if original operation with the
  81543. // same request ID was received, and if so, will ignore the second
  81544. // request. This prevents clients from accidentally creating duplicate
  81545. // commitments.
  81546. //
  81547. // The request ID must be a valid UUID with the exception that zero UUID
  81548. // is not supported (00000000-0000-0000-0000-000000000000).
  81549. func (c *RoutesDeleteCall) RequestId(requestId string) *RoutesDeleteCall {
  81550. c.urlParams_.Set("requestId", requestId)
  81551. return c
  81552. }
  81553. // Fields allows partial responses to be retrieved. See
  81554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81555. // for more information.
  81556. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall {
  81557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81558. return c
  81559. }
  81560. // Context sets the context to be used in this call's Do method. Any
  81561. // pending HTTP request will be aborted if the provided context is
  81562. // canceled.
  81563. func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall {
  81564. c.ctx_ = ctx
  81565. return c
  81566. }
  81567. // Header returns an http.Header that can be modified by the caller to
  81568. // add HTTP headers to the request.
  81569. func (c *RoutesDeleteCall) Header() http.Header {
  81570. if c.header_ == nil {
  81571. c.header_ = make(http.Header)
  81572. }
  81573. return c.header_
  81574. }
  81575. func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) {
  81576. reqHeaders := make(http.Header)
  81577. for k, v := range c.header_ {
  81578. reqHeaders[k] = v
  81579. }
  81580. reqHeaders.Set("User-Agent", c.s.userAgent())
  81581. var body io.Reader = nil
  81582. c.urlParams_.Set("alt", alt)
  81583. c.urlParams_.Set("prettyPrint", "false")
  81584. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  81585. urls += "?" + c.urlParams_.Encode()
  81586. req, err := http.NewRequest("DELETE", urls, body)
  81587. if err != nil {
  81588. return nil, err
  81589. }
  81590. req.Header = reqHeaders
  81591. googleapi.Expand(req.URL, map[string]string{
  81592. "project": c.project,
  81593. "route": c.route,
  81594. })
  81595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81596. }
  81597. // Do executes the "compute.routes.delete" call.
  81598. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81599. // status code is an error. Response headers are in either
  81600. // *Operation.ServerResponse.Header or (if a response was returned at
  81601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81602. // to check whether the returned error was because
  81603. // http.StatusNotModified was returned.
  81604. func (c *RoutesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81605. gensupport.SetOptions(c.urlParams_, opts...)
  81606. res, err := c.doRequest("json")
  81607. if res != nil && res.StatusCode == http.StatusNotModified {
  81608. if res.Body != nil {
  81609. res.Body.Close()
  81610. }
  81611. return nil, &googleapi.Error{
  81612. Code: res.StatusCode,
  81613. Header: res.Header,
  81614. }
  81615. }
  81616. if err != nil {
  81617. return nil, err
  81618. }
  81619. defer googleapi.CloseBody(res)
  81620. if err := googleapi.CheckResponse(res); err != nil {
  81621. return nil, err
  81622. }
  81623. ret := &Operation{
  81624. ServerResponse: googleapi.ServerResponse{
  81625. Header: res.Header,
  81626. HTTPStatusCode: res.StatusCode,
  81627. },
  81628. }
  81629. target := &ret
  81630. if err := gensupport.DecodeResponse(target, res); err != nil {
  81631. return nil, err
  81632. }
  81633. return ret, nil
  81634. // {
  81635. // "description": "Deletes the specified Route resource.",
  81636. // "httpMethod": "DELETE",
  81637. // "id": "compute.routes.delete",
  81638. // "parameterOrder": [
  81639. // "project",
  81640. // "route"
  81641. // ],
  81642. // "parameters": {
  81643. // "project": {
  81644. // "description": "Project ID for this request.",
  81645. // "location": "path",
  81646. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81647. // "required": true,
  81648. // "type": "string"
  81649. // },
  81650. // "requestId": {
  81651. // "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).",
  81652. // "location": "query",
  81653. // "type": "string"
  81654. // },
  81655. // "route": {
  81656. // "description": "Name of the Route resource to delete.",
  81657. // "location": "path",
  81658. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81659. // "required": true,
  81660. // "type": "string"
  81661. // }
  81662. // },
  81663. // "path": "{project}/global/routes/{route}",
  81664. // "response": {
  81665. // "$ref": "Operation"
  81666. // },
  81667. // "scopes": [
  81668. // "https://www.googleapis.com/auth/cloud-platform",
  81669. // "https://www.googleapis.com/auth/compute"
  81670. // ]
  81671. // }
  81672. }
  81673. // method id "compute.routes.get":
  81674. type RoutesGetCall struct {
  81675. s *Service
  81676. project string
  81677. route string
  81678. urlParams_ gensupport.URLParams
  81679. ifNoneMatch_ string
  81680. ctx_ context.Context
  81681. header_ http.Header
  81682. }
  81683. // Get: Returns the specified Route resource. Gets a list of available
  81684. // routes by making a list() request.
  81685. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get
  81686. func (r *RoutesService) Get(project string, route string) *RoutesGetCall {
  81687. c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81688. c.project = project
  81689. c.route = route
  81690. return c
  81691. }
  81692. // Fields allows partial responses to be retrieved. See
  81693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81694. // for more information.
  81695. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall {
  81696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81697. return c
  81698. }
  81699. // IfNoneMatch sets the optional parameter which makes the operation
  81700. // fail if the object's ETag matches the given value. This is useful for
  81701. // getting updates only after the object has changed since the last
  81702. // request. Use googleapi.IsNotModified to check whether the response
  81703. // error from Do is the result of In-None-Match.
  81704. func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall {
  81705. c.ifNoneMatch_ = entityTag
  81706. return c
  81707. }
  81708. // Context sets the context to be used in this call's Do method. Any
  81709. // pending HTTP request will be aborted if the provided context is
  81710. // canceled.
  81711. func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall {
  81712. c.ctx_ = ctx
  81713. return c
  81714. }
  81715. // Header returns an http.Header that can be modified by the caller to
  81716. // add HTTP headers to the request.
  81717. func (c *RoutesGetCall) Header() http.Header {
  81718. if c.header_ == nil {
  81719. c.header_ = make(http.Header)
  81720. }
  81721. return c.header_
  81722. }
  81723. func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) {
  81724. reqHeaders := make(http.Header)
  81725. for k, v := range c.header_ {
  81726. reqHeaders[k] = v
  81727. }
  81728. reqHeaders.Set("User-Agent", c.s.userAgent())
  81729. if c.ifNoneMatch_ != "" {
  81730. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  81731. }
  81732. var body io.Reader = nil
  81733. c.urlParams_.Set("alt", alt)
  81734. c.urlParams_.Set("prettyPrint", "false")
  81735. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}")
  81736. urls += "?" + c.urlParams_.Encode()
  81737. req, err := http.NewRequest("GET", urls, body)
  81738. if err != nil {
  81739. return nil, err
  81740. }
  81741. req.Header = reqHeaders
  81742. googleapi.Expand(req.URL, map[string]string{
  81743. "project": c.project,
  81744. "route": c.route,
  81745. })
  81746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81747. }
  81748. // Do executes the "compute.routes.get" call.
  81749. // Exactly one of *Route or error will be non-nil. Any non-2xx status
  81750. // code is an error. Response headers are in either
  81751. // *Route.ServerResponse.Header or (if a response was returned at all)
  81752. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  81753. // check whether the returned error was because http.StatusNotModified
  81754. // was returned.
  81755. func (c *RoutesGetCall) Do(opts ...googleapi.CallOption) (*Route, error) {
  81756. gensupport.SetOptions(c.urlParams_, opts...)
  81757. res, err := c.doRequest("json")
  81758. if res != nil && res.StatusCode == http.StatusNotModified {
  81759. if res.Body != nil {
  81760. res.Body.Close()
  81761. }
  81762. return nil, &googleapi.Error{
  81763. Code: res.StatusCode,
  81764. Header: res.Header,
  81765. }
  81766. }
  81767. if err != nil {
  81768. return nil, err
  81769. }
  81770. defer googleapi.CloseBody(res)
  81771. if err := googleapi.CheckResponse(res); err != nil {
  81772. return nil, err
  81773. }
  81774. ret := &Route{
  81775. ServerResponse: googleapi.ServerResponse{
  81776. Header: res.Header,
  81777. HTTPStatusCode: res.StatusCode,
  81778. },
  81779. }
  81780. target := &ret
  81781. if err := gensupport.DecodeResponse(target, res); err != nil {
  81782. return nil, err
  81783. }
  81784. return ret, nil
  81785. // {
  81786. // "description": "Returns the specified Route resource. Gets a list of available routes by making a list() request.",
  81787. // "httpMethod": "GET",
  81788. // "id": "compute.routes.get",
  81789. // "parameterOrder": [
  81790. // "project",
  81791. // "route"
  81792. // ],
  81793. // "parameters": {
  81794. // "project": {
  81795. // "description": "Project ID for this request.",
  81796. // "location": "path",
  81797. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81798. // "required": true,
  81799. // "type": "string"
  81800. // },
  81801. // "route": {
  81802. // "description": "Name of the Route resource to return.",
  81803. // "location": "path",
  81804. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  81805. // "required": true,
  81806. // "type": "string"
  81807. // }
  81808. // },
  81809. // "path": "{project}/global/routes/{route}",
  81810. // "response": {
  81811. // "$ref": "Route"
  81812. // },
  81813. // "scopes": [
  81814. // "https://www.googleapis.com/auth/cloud-platform",
  81815. // "https://www.googleapis.com/auth/compute",
  81816. // "https://www.googleapis.com/auth/compute.readonly"
  81817. // ]
  81818. // }
  81819. }
  81820. // method id "compute.routes.insert":
  81821. type RoutesInsertCall struct {
  81822. s *Service
  81823. project string
  81824. route *Route
  81825. urlParams_ gensupport.URLParams
  81826. ctx_ context.Context
  81827. header_ http.Header
  81828. }
  81829. // Insert: Creates a Route resource in the specified project using the
  81830. // data included in the request.
  81831. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert
  81832. func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall {
  81833. c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81834. c.project = project
  81835. c.route = route
  81836. return c
  81837. }
  81838. // RequestId sets the optional parameter "requestId": An optional
  81839. // request ID to identify requests. Specify a unique request ID so that
  81840. // if you must retry your request, the server will know to ignore the
  81841. // request if it has already been completed.
  81842. //
  81843. // For example, consider a situation where you make an initial request
  81844. // and the request times out. If you make the request again with the
  81845. // same request ID, the server can check if original operation with the
  81846. // same request ID was received, and if so, will ignore the second
  81847. // request. This prevents clients from accidentally creating duplicate
  81848. // commitments.
  81849. //
  81850. // The request ID must be a valid UUID with the exception that zero UUID
  81851. // is not supported (00000000-0000-0000-0000-000000000000).
  81852. func (c *RoutesInsertCall) RequestId(requestId string) *RoutesInsertCall {
  81853. c.urlParams_.Set("requestId", requestId)
  81854. return c
  81855. }
  81856. // Fields allows partial responses to be retrieved. See
  81857. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  81858. // for more information.
  81859. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall {
  81860. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  81861. return c
  81862. }
  81863. // Context sets the context to be used in this call's Do method. Any
  81864. // pending HTTP request will be aborted if the provided context is
  81865. // canceled.
  81866. func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall {
  81867. c.ctx_ = ctx
  81868. return c
  81869. }
  81870. // Header returns an http.Header that can be modified by the caller to
  81871. // add HTTP headers to the request.
  81872. func (c *RoutesInsertCall) Header() http.Header {
  81873. if c.header_ == nil {
  81874. c.header_ = make(http.Header)
  81875. }
  81876. return c.header_
  81877. }
  81878. func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) {
  81879. reqHeaders := make(http.Header)
  81880. for k, v := range c.header_ {
  81881. reqHeaders[k] = v
  81882. }
  81883. reqHeaders.Set("User-Agent", c.s.userAgent())
  81884. var body io.Reader = nil
  81885. body, err := googleapi.WithoutDataWrapper.JSONReader(c.route)
  81886. if err != nil {
  81887. return nil, err
  81888. }
  81889. reqHeaders.Set("Content-Type", "application/json")
  81890. c.urlParams_.Set("alt", alt)
  81891. c.urlParams_.Set("prettyPrint", "false")
  81892. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  81893. urls += "?" + c.urlParams_.Encode()
  81894. req, err := http.NewRequest("POST", urls, body)
  81895. if err != nil {
  81896. return nil, err
  81897. }
  81898. req.Header = reqHeaders
  81899. googleapi.Expand(req.URL, map[string]string{
  81900. "project": c.project,
  81901. })
  81902. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  81903. }
  81904. // Do executes the "compute.routes.insert" call.
  81905. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  81906. // status code is an error. Response headers are in either
  81907. // *Operation.ServerResponse.Header or (if a response was returned at
  81908. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  81909. // to check whether the returned error was because
  81910. // http.StatusNotModified was returned.
  81911. func (c *RoutesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  81912. gensupport.SetOptions(c.urlParams_, opts...)
  81913. res, err := c.doRequest("json")
  81914. if res != nil && res.StatusCode == http.StatusNotModified {
  81915. if res.Body != nil {
  81916. res.Body.Close()
  81917. }
  81918. return nil, &googleapi.Error{
  81919. Code: res.StatusCode,
  81920. Header: res.Header,
  81921. }
  81922. }
  81923. if err != nil {
  81924. return nil, err
  81925. }
  81926. defer googleapi.CloseBody(res)
  81927. if err := googleapi.CheckResponse(res); err != nil {
  81928. return nil, err
  81929. }
  81930. ret := &Operation{
  81931. ServerResponse: googleapi.ServerResponse{
  81932. Header: res.Header,
  81933. HTTPStatusCode: res.StatusCode,
  81934. },
  81935. }
  81936. target := &ret
  81937. if err := gensupport.DecodeResponse(target, res); err != nil {
  81938. return nil, err
  81939. }
  81940. return ret, nil
  81941. // {
  81942. // "description": "Creates a Route resource in the specified project using the data included in the request.",
  81943. // "httpMethod": "POST",
  81944. // "id": "compute.routes.insert",
  81945. // "parameterOrder": [
  81946. // "project"
  81947. // ],
  81948. // "parameters": {
  81949. // "project": {
  81950. // "description": "Project ID for this request.",
  81951. // "location": "path",
  81952. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  81953. // "required": true,
  81954. // "type": "string"
  81955. // },
  81956. // "requestId": {
  81957. // "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).",
  81958. // "location": "query",
  81959. // "type": "string"
  81960. // }
  81961. // },
  81962. // "path": "{project}/global/routes",
  81963. // "request": {
  81964. // "$ref": "Route"
  81965. // },
  81966. // "response": {
  81967. // "$ref": "Operation"
  81968. // },
  81969. // "scopes": [
  81970. // "https://www.googleapis.com/auth/cloud-platform",
  81971. // "https://www.googleapis.com/auth/compute"
  81972. // ]
  81973. // }
  81974. }
  81975. // method id "compute.routes.list":
  81976. type RoutesListCall struct {
  81977. s *Service
  81978. project string
  81979. urlParams_ gensupport.URLParams
  81980. ifNoneMatch_ string
  81981. ctx_ context.Context
  81982. header_ http.Header
  81983. }
  81984. // List: Retrieves the list of Route resources available to the
  81985. // specified project.
  81986. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list
  81987. func (r *RoutesService) List(project string) *RoutesListCall {
  81988. c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  81989. c.project = project
  81990. return c
  81991. }
  81992. // Filter sets the optional parameter "filter": A filter expression that
  81993. // filters resources listed in the response. The expression must specify
  81994. // the field name, a comparison operator, and the value that you want to
  81995. // use for filtering. The value must be a string, a number, or a
  81996. // boolean. The comparison operator must be either =, !=, >, or <.
  81997. //
  81998. // For example, if you are filtering Compute Engine instances, you can
  81999. // exclude instances named example-instance by specifying name !=
  82000. // example-instance.
  82001. //
  82002. // You can also filter nested fields. For example, you could specify
  82003. // scheduling.automaticRestart = false to include instances only if they
  82004. // are not scheduled for automatic restarts. You can use filtering on
  82005. // nested fields to filter based on resource labels.
  82006. //
  82007. // To filter on multiple expressions, provide each separate expression
  82008. // within parentheses. For example, (scheduling.automaticRestart = true)
  82009. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82010. // AND expression. However, you can include AND and OR expressions
  82011. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  82012. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  82013. // true).
  82014. func (c *RoutesListCall) Filter(filter string) *RoutesListCall {
  82015. c.urlParams_.Set("filter", filter)
  82016. return c
  82017. }
  82018. // MaxResults sets the optional parameter "maxResults": The maximum
  82019. // number of results per page that should be returned. If the number of
  82020. // available results is larger than maxResults, Compute Engine returns a
  82021. // nextPageToken that can be used to get the next page of results in
  82022. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  82023. // (Default: 500)
  82024. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall {
  82025. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  82026. return c
  82027. }
  82028. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  82029. // a certain order. By default, results are returned in alphanumerical
  82030. // order based on the resource name.
  82031. //
  82032. // You can also sort results in descending order based on the creation
  82033. // timestamp using orderBy="creationTimestamp desc". This sorts results
  82034. // based on the creationTimestamp field in reverse chronological order
  82035. // (newest result first). Use this to sort resources like operations so
  82036. // that the newest operation is returned first.
  82037. //
  82038. // Currently, only sorting by name or creationTimestamp desc is
  82039. // supported.
  82040. func (c *RoutesListCall) OrderBy(orderBy string) *RoutesListCall {
  82041. c.urlParams_.Set("orderBy", orderBy)
  82042. return c
  82043. }
  82044. // PageToken sets the optional parameter "pageToken": Specifies a page
  82045. // token to use. Set pageToken to the nextPageToken returned by a
  82046. // previous list request to get the next page of results.
  82047. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall {
  82048. c.urlParams_.Set("pageToken", pageToken)
  82049. return c
  82050. }
  82051. // Fields allows partial responses to be retrieved. See
  82052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82053. // for more information.
  82054. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall {
  82055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82056. return c
  82057. }
  82058. // IfNoneMatch sets the optional parameter which makes the operation
  82059. // fail if the object's ETag matches the given value. This is useful for
  82060. // getting updates only after the object has changed since the last
  82061. // request. Use googleapi.IsNotModified to check whether the response
  82062. // error from Do is the result of In-None-Match.
  82063. func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall {
  82064. c.ifNoneMatch_ = entityTag
  82065. return c
  82066. }
  82067. // Context sets the context to be used in this call's Do method. Any
  82068. // pending HTTP request will be aborted if the provided context is
  82069. // canceled.
  82070. func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall {
  82071. c.ctx_ = ctx
  82072. return c
  82073. }
  82074. // Header returns an http.Header that can be modified by the caller to
  82075. // add HTTP headers to the request.
  82076. func (c *RoutesListCall) Header() http.Header {
  82077. if c.header_ == nil {
  82078. c.header_ = make(http.Header)
  82079. }
  82080. return c.header_
  82081. }
  82082. func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) {
  82083. reqHeaders := make(http.Header)
  82084. for k, v := range c.header_ {
  82085. reqHeaders[k] = v
  82086. }
  82087. reqHeaders.Set("User-Agent", c.s.userAgent())
  82088. if c.ifNoneMatch_ != "" {
  82089. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82090. }
  82091. var body io.Reader = nil
  82092. c.urlParams_.Set("alt", alt)
  82093. c.urlParams_.Set("prettyPrint", "false")
  82094. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes")
  82095. urls += "?" + c.urlParams_.Encode()
  82096. req, err := http.NewRequest("GET", urls, body)
  82097. if err != nil {
  82098. return nil, err
  82099. }
  82100. req.Header = reqHeaders
  82101. googleapi.Expand(req.URL, map[string]string{
  82102. "project": c.project,
  82103. })
  82104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82105. }
  82106. // Do executes the "compute.routes.list" call.
  82107. // Exactly one of *RouteList or error will be non-nil. Any non-2xx
  82108. // status code is an error. Response headers are in either
  82109. // *RouteList.ServerResponse.Header or (if a response was returned at
  82110. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82111. // to check whether the returned error was because
  82112. // http.StatusNotModified was returned.
  82113. func (c *RoutesListCall) Do(opts ...googleapi.CallOption) (*RouteList, error) {
  82114. gensupport.SetOptions(c.urlParams_, opts...)
  82115. res, err := c.doRequest("json")
  82116. if res != nil && res.StatusCode == http.StatusNotModified {
  82117. if res.Body != nil {
  82118. res.Body.Close()
  82119. }
  82120. return nil, &googleapi.Error{
  82121. Code: res.StatusCode,
  82122. Header: res.Header,
  82123. }
  82124. }
  82125. if err != nil {
  82126. return nil, err
  82127. }
  82128. defer googleapi.CloseBody(res)
  82129. if err := googleapi.CheckResponse(res); err != nil {
  82130. return nil, err
  82131. }
  82132. ret := &RouteList{
  82133. ServerResponse: googleapi.ServerResponse{
  82134. Header: res.Header,
  82135. HTTPStatusCode: res.StatusCode,
  82136. },
  82137. }
  82138. target := &ret
  82139. if err := gensupport.DecodeResponse(target, res); err != nil {
  82140. return nil, err
  82141. }
  82142. return ret, nil
  82143. // {
  82144. // "description": "Retrieves the list of Route resources available to the specified project.",
  82145. // "httpMethod": "GET",
  82146. // "id": "compute.routes.list",
  82147. // "parameterOrder": [
  82148. // "project"
  82149. // ],
  82150. // "parameters": {
  82151. // "filter": {
  82152. // "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).",
  82153. // "location": "query",
  82154. // "type": "string"
  82155. // },
  82156. // "maxResults": {
  82157. // "default": "500",
  82158. // "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)",
  82159. // "format": "uint32",
  82160. // "location": "query",
  82161. // "minimum": "0",
  82162. // "type": "integer"
  82163. // },
  82164. // "orderBy": {
  82165. // "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.",
  82166. // "location": "query",
  82167. // "type": "string"
  82168. // },
  82169. // "pageToken": {
  82170. // "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.",
  82171. // "location": "query",
  82172. // "type": "string"
  82173. // },
  82174. // "project": {
  82175. // "description": "Project ID for this request.",
  82176. // "location": "path",
  82177. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82178. // "required": true,
  82179. // "type": "string"
  82180. // }
  82181. // },
  82182. // "path": "{project}/global/routes",
  82183. // "response": {
  82184. // "$ref": "RouteList"
  82185. // },
  82186. // "scopes": [
  82187. // "https://www.googleapis.com/auth/cloud-platform",
  82188. // "https://www.googleapis.com/auth/compute",
  82189. // "https://www.googleapis.com/auth/compute.readonly"
  82190. // ]
  82191. // }
  82192. }
  82193. // Pages invokes f for each page of results.
  82194. // A non-nil error returned from f will halt the iteration.
  82195. // The provided context supersedes any context provided to the Context method.
  82196. func (c *RoutesListCall) Pages(ctx context.Context, f func(*RouteList) error) error {
  82197. c.ctx_ = ctx
  82198. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  82199. for {
  82200. x, err := c.Do()
  82201. if err != nil {
  82202. return err
  82203. }
  82204. if err := f(x); err != nil {
  82205. return err
  82206. }
  82207. if x.NextPageToken == "" {
  82208. return nil
  82209. }
  82210. c.PageToken(x.NextPageToken)
  82211. }
  82212. }
  82213. // method id "compute.securityPolicies.addRule":
  82214. type SecurityPoliciesAddRuleCall struct {
  82215. s *Service
  82216. project string
  82217. securityPolicy string
  82218. securitypolicyrule *SecurityPolicyRule
  82219. urlParams_ gensupport.URLParams
  82220. ctx_ context.Context
  82221. header_ http.Header
  82222. }
  82223. // AddRule: Inserts a rule into a security policy.
  82224. func (r *SecurityPoliciesService) AddRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesAddRuleCall {
  82225. c := &SecurityPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82226. c.project = project
  82227. c.securityPolicy = securityPolicy
  82228. c.securitypolicyrule = securitypolicyrule
  82229. return c
  82230. }
  82231. // Fields allows partial responses to be retrieved. See
  82232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82233. // for more information.
  82234. func (c *SecurityPoliciesAddRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesAddRuleCall {
  82235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82236. return c
  82237. }
  82238. // Context sets the context to be used in this call's Do method. Any
  82239. // pending HTTP request will be aborted if the provided context is
  82240. // canceled.
  82241. func (c *SecurityPoliciesAddRuleCall) Context(ctx context.Context) *SecurityPoliciesAddRuleCall {
  82242. c.ctx_ = ctx
  82243. return c
  82244. }
  82245. // Header returns an http.Header that can be modified by the caller to
  82246. // add HTTP headers to the request.
  82247. func (c *SecurityPoliciesAddRuleCall) Header() http.Header {
  82248. if c.header_ == nil {
  82249. c.header_ = make(http.Header)
  82250. }
  82251. return c.header_
  82252. }
  82253. func (c *SecurityPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) {
  82254. reqHeaders := make(http.Header)
  82255. for k, v := range c.header_ {
  82256. reqHeaders[k] = v
  82257. }
  82258. reqHeaders.Set("User-Agent", c.s.userAgent())
  82259. var body io.Reader = nil
  82260. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  82261. if err != nil {
  82262. return nil, err
  82263. }
  82264. reqHeaders.Set("Content-Type", "application/json")
  82265. c.urlParams_.Set("alt", alt)
  82266. c.urlParams_.Set("prettyPrint", "false")
  82267. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/addRule")
  82268. urls += "?" + c.urlParams_.Encode()
  82269. req, err := http.NewRequest("POST", urls, body)
  82270. if err != nil {
  82271. return nil, err
  82272. }
  82273. req.Header = reqHeaders
  82274. googleapi.Expand(req.URL, map[string]string{
  82275. "project": c.project,
  82276. "securityPolicy": c.securityPolicy,
  82277. })
  82278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82279. }
  82280. // Do executes the "compute.securityPolicies.addRule" call.
  82281. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82282. // status code is an error. Response headers are in either
  82283. // *Operation.ServerResponse.Header or (if a response was returned at
  82284. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82285. // to check whether the returned error was because
  82286. // http.StatusNotModified was returned.
  82287. func (c *SecurityPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82288. gensupport.SetOptions(c.urlParams_, opts...)
  82289. res, err := c.doRequest("json")
  82290. if res != nil && res.StatusCode == http.StatusNotModified {
  82291. if res.Body != nil {
  82292. res.Body.Close()
  82293. }
  82294. return nil, &googleapi.Error{
  82295. Code: res.StatusCode,
  82296. Header: res.Header,
  82297. }
  82298. }
  82299. if err != nil {
  82300. return nil, err
  82301. }
  82302. defer googleapi.CloseBody(res)
  82303. if err := googleapi.CheckResponse(res); err != nil {
  82304. return nil, err
  82305. }
  82306. ret := &Operation{
  82307. ServerResponse: googleapi.ServerResponse{
  82308. Header: res.Header,
  82309. HTTPStatusCode: res.StatusCode,
  82310. },
  82311. }
  82312. target := &ret
  82313. if err := gensupport.DecodeResponse(target, res); err != nil {
  82314. return nil, err
  82315. }
  82316. return ret, nil
  82317. // {
  82318. // "description": "Inserts a rule into a security policy.",
  82319. // "httpMethod": "POST",
  82320. // "id": "compute.securityPolicies.addRule",
  82321. // "parameterOrder": [
  82322. // "project",
  82323. // "securityPolicy"
  82324. // ],
  82325. // "parameters": {
  82326. // "project": {
  82327. // "description": "Project ID for this request.",
  82328. // "location": "path",
  82329. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82330. // "required": true,
  82331. // "type": "string"
  82332. // },
  82333. // "securityPolicy": {
  82334. // "description": "Name of the security policy to update.",
  82335. // "location": "path",
  82336. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82337. // "required": true,
  82338. // "type": "string"
  82339. // }
  82340. // },
  82341. // "path": "{project}/global/securityPolicies/{securityPolicy}/addRule",
  82342. // "request": {
  82343. // "$ref": "SecurityPolicyRule"
  82344. // },
  82345. // "response": {
  82346. // "$ref": "Operation"
  82347. // },
  82348. // "scopes": [
  82349. // "https://www.googleapis.com/auth/cloud-platform",
  82350. // "https://www.googleapis.com/auth/compute"
  82351. // ]
  82352. // }
  82353. }
  82354. // method id "compute.securityPolicies.delete":
  82355. type SecurityPoliciesDeleteCall struct {
  82356. s *Service
  82357. project string
  82358. securityPolicy string
  82359. urlParams_ gensupport.URLParams
  82360. ctx_ context.Context
  82361. header_ http.Header
  82362. }
  82363. // Delete: Deletes the specified policy.
  82364. func (r *SecurityPoliciesService) Delete(project string, securityPolicy string) *SecurityPoliciesDeleteCall {
  82365. c := &SecurityPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82366. c.project = project
  82367. c.securityPolicy = securityPolicy
  82368. return c
  82369. }
  82370. // RequestId sets the optional parameter "requestId": An optional
  82371. // request ID to identify requests. Specify a unique request ID so that
  82372. // if you must retry your request, the server will know to ignore the
  82373. // request if it has already been completed.
  82374. //
  82375. // For example, consider a situation where you make an initial request
  82376. // and the request times out. If you make the request again with the
  82377. // same request ID, the server can check if original operation with the
  82378. // same request ID was received, and if so, will ignore the second
  82379. // request. This prevents clients from accidentally creating duplicate
  82380. // commitments.
  82381. //
  82382. // The request ID must be a valid UUID with the exception that zero UUID
  82383. // is not supported (00000000-0000-0000-0000-000000000000).
  82384. func (c *SecurityPoliciesDeleteCall) RequestId(requestId string) *SecurityPoliciesDeleteCall {
  82385. c.urlParams_.Set("requestId", requestId)
  82386. return c
  82387. }
  82388. // Fields allows partial responses to be retrieved. See
  82389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82390. // for more information.
  82391. func (c *SecurityPoliciesDeleteCall) Fields(s ...googleapi.Field) *SecurityPoliciesDeleteCall {
  82392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82393. return c
  82394. }
  82395. // Context sets the context to be used in this call's Do method. Any
  82396. // pending HTTP request will be aborted if the provided context is
  82397. // canceled.
  82398. func (c *SecurityPoliciesDeleteCall) Context(ctx context.Context) *SecurityPoliciesDeleteCall {
  82399. c.ctx_ = ctx
  82400. return c
  82401. }
  82402. // Header returns an http.Header that can be modified by the caller to
  82403. // add HTTP headers to the request.
  82404. func (c *SecurityPoliciesDeleteCall) Header() http.Header {
  82405. if c.header_ == nil {
  82406. c.header_ = make(http.Header)
  82407. }
  82408. return c.header_
  82409. }
  82410. func (c *SecurityPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  82411. reqHeaders := make(http.Header)
  82412. for k, v := range c.header_ {
  82413. reqHeaders[k] = v
  82414. }
  82415. reqHeaders.Set("User-Agent", c.s.userAgent())
  82416. var body io.Reader = nil
  82417. c.urlParams_.Set("alt", alt)
  82418. c.urlParams_.Set("prettyPrint", "false")
  82419. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  82420. urls += "?" + c.urlParams_.Encode()
  82421. req, err := http.NewRequest("DELETE", urls, body)
  82422. if err != nil {
  82423. return nil, err
  82424. }
  82425. req.Header = reqHeaders
  82426. googleapi.Expand(req.URL, map[string]string{
  82427. "project": c.project,
  82428. "securityPolicy": c.securityPolicy,
  82429. })
  82430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82431. }
  82432. // Do executes the "compute.securityPolicies.delete" call.
  82433. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82434. // status code is an error. Response headers are in either
  82435. // *Operation.ServerResponse.Header or (if a response was returned at
  82436. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82437. // to check whether the returned error was because
  82438. // http.StatusNotModified was returned.
  82439. func (c *SecurityPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82440. gensupport.SetOptions(c.urlParams_, opts...)
  82441. res, err := c.doRequest("json")
  82442. if res != nil && res.StatusCode == http.StatusNotModified {
  82443. if res.Body != nil {
  82444. res.Body.Close()
  82445. }
  82446. return nil, &googleapi.Error{
  82447. Code: res.StatusCode,
  82448. Header: res.Header,
  82449. }
  82450. }
  82451. if err != nil {
  82452. return nil, err
  82453. }
  82454. defer googleapi.CloseBody(res)
  82455. if err := googleapi.CheckResponse(res); err != nil {
  82456. return nil, err
  82457. }
  82458. ret := &Operation{
  82459. ServerResponse: googleapi.ServerResponse{
  82460. Header: res.Header,
  82461. HTTPStatusCode: res.StatusCode,
  82462. },
  82463. }
  82464. target := &ret
  82465. if err := gensupport.DecodeResponse(target, res); err != nil {
  82466. return nil, err
  82467. }
  82468. return ret, nil
  82469. // {
  82470. // "description": "Deletes the specified policy.",
  82471. // "httpMethod": "DELETE",
  82472. // "id": "compute.securityPolicies.delete",
  82473. // "parameterOrder": [
  82474. // "project",
  82475. // "securityPolicy"
  82476. // ],
  82477. // "parameters": {
  82478. // "project": {
  82479. // "description": "Project ID for this request.",
  82480. // "location": "path",
  82481. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82482. // "required": true,
  82483. // "type": "string"
  82484. // },
  82485. // "requestId": {
  82486. // "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).",
  82487. // "location": "query",
  82488. // "type": "string"
  82489. // },
  82490. // "securityPolicy": {
  82491. // "description": "Name of the security policy to delete.",
  82492. // "location": "path",
  82493. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82494. // "required": true,
  82495. // "type": "string"
  82496. // }
  82497. // },
  82498. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  82499. // "response": {
  82500. // "$ref": "Operation"
  82501. // },
  82502. // "scopes": [
  82503. // "https://www.googleapis.com/auth/cloud-platform",
  82504. // "https://www.googleapis.com/auth/compute"
  82505. // ]
  82506. // }
  82507. }
  82508. // method id "compute.securityPolicies.get":
  82509. type SecurityPoliciesGetCall struct {
  82510. s *Service
  82511. project string
  82512. securityPolicy string
  82513. urlParams_ gensupport.URLParams
  82514. ifNoneMatch_ string
  82515. ctx_ context.Context
  82516. header_ http.Header
  82517. }
  82518. // Get: List all of the ordered rules present in a single specified
  82519. // policy.
  82520. func (r *SecurityPoliciesService) Get(project string, securityPolicy string) *SecurityPoliciesGetCall {
  82521. c := &SecurityPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82522. c.project = project
  82523. c.securityPolicy = securityPolicy
  82524. return c
  82525. }
  82526. // Fields allows partial responses to be retrieved. See
  82527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82528. // for more information.
  82529. func (c *SecurityPoliciesGetCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetCall {
  82530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82531. return c
  82532. }
  82533. // IfNoneMatch sets the optional parameter which makes the operation
  82534. // fail if the object's ETag matches the given value. This is useful for
  82535. // getting updates only after the object has changed since the last
  82536. // request. Use googleapi.IsNotModified to check whether the response
  82537. // error from Do is the result of In-None-Match.
  82538. func (c *SecurityPoliciesGetCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetCall {
  82539. c.ifNoneMatch_ = entityTag
  82540. return c
  82541. }
  82542. // Context sets the context to be used in this call's Do method. Any
  82543. // pending HTTP request will be aborted if the provided context is
  82544. // canceled.
  82545. func (c *SecurityPoliciesGetCall) Context(ctx context.Context) *SecurityPoliciesGetCall {
  82546. c.ctx_ = ctx
  82547. return c
  82548. }
  82549. // Header returns an http.Header that can be modified by the caller to
  82550. // add HTTP headers to the request.
  82551. func (c *SecurityPoliciesGetCall) Header() http.Header {
  82552. if c.header_ == nil {
  82553. c.header_ = make(http.Header)
  82554. }
  82555. return c.header_
  82556. }
  82557. func (c *SecurityPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  82558. reqHeaders := make(http.Header)
  82559. for k, v := range c.header_ {
  82560. reqHeaders[k] = v
  82561. }
  82562. reqHeaders.Set("User-Agent", c.s.userAgent())
  82563. if c.ifNoneMatch_ != "" {
  82564. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82565. }
  82566. var body io.Reader = nil
  82567. c.urlParams_.Set("alt", alt)
  82568. c.urlParams_.Set("prettyPrint", "false")
  82569. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  82570. urls += "?" + c.urlParams_.Encode()
  82571. req, err := http.NewRequest("GET", urls, body)
  82572. if err != nil {
  82573. return nil, err
  82574. }
  82575. req.Header = reqHeaders
  82576. googleapi.Expand(req.URL, map[string]string{
  82577. "project": c.project,
  82578. "securityPolicy": c.securityPolicy,
  82579. })
  82580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82581. }
  82582. // Do executes the "compute.securityPolicies.get" call.
  82583. // Exactly one of *SecurityPolicy or error will be non-nil. Any non-2xx
  82584. // status code is an error. Response headers are in either
  82585. // *SecurityPolicy.ServerResponse.Header or (if a response was returned
  82586. // at all) in error.(*googleapi.Error).Header. Use
  82587. // googleapi.IsNotModified to check whether the returned error was
  82588. // because http.StatusNotModified was returned.
  82589. func (c *SecurityPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SecurityPolicy, error) {
  82590. gensupport.SetOptions(c.urlParams_, opts...)
  82591. res, err := c.doRequest("json")
  82592. if res != nil && res.StatusCode == http.StatusNotModified {
  82593. if res.Body != nil {
  82594. res.Body.Close()
  82595. }
  82596. return nil, &googleapi.Error{
  82597. Code: res.StatusCode,
  82598. Header: res.Header,
  82599. }
  82600. }
  82601. if err != nil {
  82602. return nil, err
  82603. }
  82604. defer googleapi.CloseBody(res)
  82605. if err := googleapi.CheckResponse(res); err != nil {
  82606. return nil, err
  82607. }
  82608. ret := &SecurityPolicy{
  82609. ServerResponse: googleapi.ServerResponse{
  82610. Header: res.Header,
  82611. HTTPStatusCode: res.StatusCode,
  82612. },
  82613. }
  82614. target := &ret
  82615. if err := gensupport.DecodeResponse(target, res); err != nil {
  82616. return nil, err
  82617. }
  82618. return ret, nil
  82619. // {
  82620. // "description": "List all of the ordered rules present in a single specified policy.",
  82621. // "httpMethod": "GET",
  82622. // "id": "compute.securityPolicies.get",
  82623. // "parameterOrder": [
  82624. // "project",
  82625. // "securityPolicy"
  82626. // ],
  82627. // "parameters": {
  82628. // "project": {
  82629. // "description": "Project ID for this request.",
  82630. // "location": "path",
  82631. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82632. // "required": true,
  82633. // "type": "string"
  82634. // },
  82635. // "securityPolicy": {
  82636. // "description": "Name of the security policy to get.",
  82637. // "location": "path",
  82638. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82639. // "required": true,
  82640. // "type": "string"
  82641. // }
  82642. // },
  82643. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  82644. // "response": {
  82645. // "$ref": "SecurityPolicy"
  82646. // },
  82647. // "scopes": [
  82648. // "https://www.googleapis.com/auth/cloud-platform",
  82649. // "https://www.googleapis.com/auth/compute",
  82650. // "https://www.googleapis.com/auth/compute.readonly"
  82651. // ]
  82652. // }
  82653. }
  82654. // method id "compute.securityPolicies.getRule":
  82655. type SecurityPoliciesGetRuleCall struct {
  82656. s *Service
  82657. project string
  82658. securityPolicy string
  82659. urlParams_ gensupport.URLParams
  82660. ifNoneMatch_ string
  82661. ctx_ context.Context
  82662. header_ http.Header
  82663. }
  82664. // GetRule: Gets a rule at the specified priority.
  82665. func (r *SecurityPoliciesService) GetRule(project string, securityPolicy string) *SecurityPoliciesGetRuleCall {
  82666. c := &SecurityPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82667. c.project = project
  82668. c.securityPolicy = securityPolicy
  82669. return c
  82670. }
  82671. // Priority sets the optional parameter "priority": The priority of the
  82672. // rule to get from the security policy.
  82673. func (c *SecurityPoliciesGetRuleCall) Priority(priority int64) *SecurityPoliciesGetRuleCall {
  82674. c.urlParams_.Set("priority", fmt.Sprint(priority))
  82675. return c
  82676. }
  82677. // Fields allows partial responses to be retrieved. See
  82678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82679. // for more information.
  82680. func (c *SecurityPoliciesGetRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesGetRuleCall {
  82681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82682. return c
  82683. }
  82684. // IfNoneMatch sets the optional parameter which makes the operation
  82685. // fail if the object's ETag matches the given value. This is useful for
  82686. // getting updates only after the object has changed since the last
  82687. // request. Use googleapi.IsNotModified to check whether the response
  82688. // error from Do is the result of In-None-Match.
  82689. func (c *SecurityPoliciesGetRuleCall) IfNoneMatch(entityTag string) *SecurityPoliciesGetRuleCall {
  82690. c.ifNoneMatch_ = entityTag
  82691. return c
  82692. }
  82693. // Context sets the context to be used in this call's Do method. Any
  82694. // pending HTTP request will be aborted if the provided context is
  82695. // canceled.
  82696. func (c *SecurityPoliciesGetRuleCall) Context(ctx context.Context) *SecurityPoliciesGetRuleCall {
  82697. c.ctx_ = ctx
  82698. return c
  82699. }
  82700. // Header returns an http.Header that can be modified by the caller to
  82701. // add HTTP headers to the request.
  82702. func (c *SecurityPoliciesGetRuleCall) Header() http.Header {
  82703. if c.header_ == nil {
  82704. c.header_ = make(http.Header)
  82705. }
  82706. return c.header_
  82707. }
  82708. func (c *SecurityPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) {
  82709. reqHeaders := make(http.Header)
  82710. for k, v := range c.header_ {
  82711. reqHeaders[k] = v
  82712. }
  82713. reqHeaders.Set("User-Agent", c.s.userAgent())
  82714. if c.ifNoneMatch_ != "" {
  82715. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  82716. }
  82717. var body io.Reader = nil
  82718. c.urlParams_.Set("alt", alt)
  82719. c.urlParams_.Set("prettyPrint", "false")
  82720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/getRule")
  82721. urls += "?" + c.urlParams_.Encode()
  82722. req, err := http.NewRequest("GET", urls, body)
  82723. if err != nil {
  82724. return nil, err
  82725. }
  82726. req.Header = reqHeaders
  82727. googleapi.Expand(req.URL, map[string]string{
  82728. "project": c.project,
  82729. "securityPolicy": c.securityPolicy,
  82730. })
  82731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82732. }
  82733. // Do executes the "compute.securityPolicies.getRule" call.
  82734. // Exactly one of *SecurityPolicyRule or error will be non-nil. Any
  82735. // non-2xx status code is an error. Response headers are in either
  82736. // *SecurityPolicyRule.ServerResponse.Header or (if a response was
  82737. // returned at all) in error.(*googleapi.Error).Header. Use
  82738. // googleapi.IsNotModified to check whether the returned error was
  82739. // because http.StatusNotModified was returned.
  82740. func (c *SecurityPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyRule, error) {
  82741. gensupport.SetOptions(c.urlParams_, opts...)
  82742. res, err := c.doRequest("json")
  82743. if res != nil && res.StatusCode == http.StatusNotModified {
  82744. if res.Body != nil {
  82745. res.Body.Close()
  82746. }
  82747. return nil, &googleapi.Error{
  82748. Code: res.StatusCode,
  82749. Header: res.Header,
  82750. }
  82751. }
  82752. if err != nil {
  82753. return nil, err
  82754. }
  82755. defer googleapi.CloseBody(res)
  82756. if err := googleapi.CheckResponse(res); err != nil {
  82757. return nil, err
  82758. }
  82759. ret := &SecurityPolicyRule{
  82760. ServerResponse: googleapi.ServerResponse{
  82761. Header: res.Header,
  82762. HTTPStatusCode: res.StatusCode,
  82763. },
  82764. }
  82765. target := &ret
  82766. if err := gensupport.DecodeResponse(target, res); err != nil {
  82767. return nil, err
  82768. }
  82769. return ret, nil
  82770. // {
  82771. // "description": "Gets a rule at the specified priority.",
  82772. // "httpMethod": "GET",
  82773. // "id": "compute.securityPolicies.getRule",
  82774. // "parameterOrder": [
  82775. // "project",
  82776. // "securityPolicy"
  82777. // ],
  82778. // "parameters": {
  82779. // "priority": {
  82780. // "description": "The priority of the rule to get from the security policy.",
  82781. // "format": "int32",
  82782. // "location": "query",
  82783. // "type": "integer"
  82784. // },
  82785. // "project": {
  82786. // "description": "Project ID for this request.",
  82787. // "location": "path",
  82788. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82789. // "required": true,
  82790. // "type": "string"
  82791. // },
  82792. // "securityPolicy": {
  82793. // "description": "Name of the security policy to which the queried rule belongs.",
  82794. // "location": "path",
  82795. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  82796. // "required": true,
  82797. // "type": "string"
  82798. // }
  82799. // },
  82800. // "path": "{project}/global/securityPolicies/{securityPolicy}/getRule",
  82801. // "response": {
  82802. // "$ref": "SecurityPolicyRule"
  82803. // },
  82804. // "scopes": [
  82805. // "https://www.googleapis.com/auth/cloud-platform",
  82806. // "https://www.googleapis.com/auth/compute",
  82807. // "https://www.googleapis.com/auth/compute.readonly"
  82808. // ]
  82809. // }
  82810. }
  82811. // method id "compute.securityPolicies.insert":
  82812. type SecurityPoliciesInsertCall struct {
  82813. s *Service
  82814. project string
  82815. securitypolicy *SecurityPolicy
  82816. urlParams_ gensupport.URLParams
  82817. ctx_ context.Context
  82818. header_ http.Header
  82819. }
  82820. // Insert: Creates a new policy in the specified project using the data
  82821. // included in the request.
  82822. func (r *SecurityPoliciesService) Insert(project string, securitypolicy *SecurityPolicy) *SecurityPoliciesInsertCall {
  82823. c := &SecurityPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82824. c.project = project
  82825. c.securitypolicy = securitypolicy
  82826. return c
  82827. }
  82828. // RequestId sets the optional parameter "requestId": An optional
  82829. // request ID to identify requests. Specify a unique request ID so that
  82830. // if you must retry your request, the server will know to ignore the
  82831. // request if it has already been completed.
  82832. //
  82833. // For example, consider a situation where you make an initial request
  82834. // and the request times out. If you make the request again with the
  82835. // same request ID, the server can check if original operation with the
  82836. // same request ID was received, and if so, will ignore the second
  82837. // request. This prevents clients from accidentally creating duplicate
  82838. // commitments.
  82839. //
  82840. // The request ID must be a valid UUID with the exception that zero UUID
  82841. // is not supported (00000000-0000-0000-0000-000000000000).
  82842. func (c *SecurityPoliciesInsertCall) RequestId(requestId string) *SecurityPoliciesInsertCall {
  82843. c.urlParams_.Set("requestId", requestId)
  82844. return c
  82845. }
  82846. // Fields allows partial responses to be retrieved. See
  82847. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  82848. // for more information.
  82849. func (c *SecurityPoliciesInsertCall) Fields(s ...googleapi.Field) *SecurityPoliciesInsertCall {
  82850. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  82851. return c
  82852. }
  82853. // Context sets the context to be used in this call's Do method. Any
  82854. // pending HTTP request will be aborted if the provided context is
  82855. // canceled.
  82856. func (c *SecurityPoliciesInsertCall) Context(ctx context.Context) *SecurityPoliciesInsertCall {
  82857. c.ctx_ = ctx
  82858. return c
  82859. }
  82860. // Header returns an http.Header that can be modified by the caller to
  82861. // add HTTP headers to the request.
  82862. func (c *SecurityPoliciesInsertCall) Header() http.Header {
  82863. if c.header_ == nil {
  82864. c.header_ = make(http.Header)
  82865. }
  82866. return c.header_
  82867. }
  82868. func (c *SecurityPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  82869. reqHeaders := make(http.Header)
  82870. for k, v := range c.header_ {
  82871. reqHeaders[k] = v
  82872. }
  82873. reqHeaders.Set("User-Agent", c.s.userAgent())
  82874. var body io.Reader = nil
  82875. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  82876. if err != nil {
  82877. return nil, err
  82878. }
  82879. reqHeaders.Set("Content-Type", "application/json")
  82880. c.urlParams_.Set("alt", alt)
  82881. c.urlParams_.Set("prettyPrint", "false")
  82882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  82883. urls += "?" + c.urlParams_.Encode()
  82884. req, err := http.NewRequest("POST", urls, body)
  82885. if err != nil {
  82886. return nil, err
  82887. }
  82888. req.Header = reqHeaders
  82889. googleapi.Expand(req.URL, map[string]string{
  82890. "project": c.project,
  82891. })
  82892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  82893. }
  82894. // Do executes the "compute.securityPolicies.insert" call.
  82895. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  82896. // status code is an error. Response headers are in either
  82897. // *Operation.ServerResponse.Header or (if a response was returned at
  82898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  82899. // to check whether the returned error was because
  82900. // http.StatusNotModified was returned.
  82901. func (c *SecurityPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  82902. gensupport.SetOptions(c.urlParams_, opts...)
  82903. res, err := c.doRequest("json")
  82904. if res != nil && res.StatusCode == http.StatusNotModified {
  82905. if res.Body != nil {
  82906. res.Body.Close()
  82907. }
  82908. return nil, &googleapi.Error{
  82909. Code: res.StatusCode,
  82910. Header: res.Header,
  82911. }
  82912. }
  82913. if err != nil {
  82914. return nil, err
  82915. }
  82916. defer googleapi.CloseBody(res)
  82917. if err := googleapi.CheckResponse(res); err != nil {
  82918. return nil, err
  82919. }
  82920. ret := &Operation{
  82921. ServerResponse: googleapi.ServerResponse{
  82922. Header: res.Header,
  82923. HTTPStatusCode: res.StatusCode,
  82924. },
  82925. }
  82926. target := &ret
  82927. if err := gensupport.DecodeResponse(target, res); err != nil {
  82928. return nil, err
  82929. }
  82930. return ret, nil
  82931. // {
  82932. // "description": "Creates a new policy in the specified project using the data included in the request.",
  82933. // "httpMethod": "POST",
  82934. // "id": "compute.securityPolicies.insert",
  82935. // "parameterOrder": [
  82936. // "project"
  82937. // ],
  82938. // "parameters": {
  82939. // "project": {
  82940. // "description": "Project ID for this request.",
  82941. // "location": "path",
  82942. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  82943. // "required": true,
  82944. // "type": "string"
  82945. // },
  82946. // "requestId": {
  82947. // "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).",
  82948. // "location": "query",
  82949. // "type": "string"
  82950. // }
  82951. // },
  82952. // "path": "{project}/global/securityPolicies",
  82953. // "request": {
  82954. // "$ref": "SecurityPolicy"
  82955. // },
  82956. // "response": {
  82957. // "$ref": "Operation"
  82958. // },
  82959. // "scopes": [
  82960. // "https://www.googleapis.com/auth/cloud-platform",
  82961. // "https://www.googleapis.com/auth/compute"
  82962. // ]
  82963. // }
  82964. }
  82965. // method id "compute.securityPolicies.list":
  82966. type SecurityPoliciesListCall struct {
  82967. s *Service
  82968. project string
  82969. urlParams_ gensupport.URLParams
  82970. ifNoneMatch_ string
  82971. ctx_ context.Context
  82972. header_ http.Header
  82973. }
  82974. // List: List all the policies that have been configured for the
  82975. // specified project.
  82976. func (r *SecurityPoliciesService) List(project string) *SecurityPoliciesListCall {
  82977. c := &SecurityPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  82978. c.project = project
  82979. return c
  82980. }
  82981. // Filter sets the optional parameter "filter": A filter expression that
  82982. // filters resources listed in the response. The expression must specify
  82983. // the field name, a comparison operator, and the value that you want to
  82984. // use for filtering. The value must be a string, a number, or a
  82985. // boolean. The comparison operator must be either =, !=, >, or <.
  82986. //
  82987. // For example, if you are filtering Compute Engine instances, you can
  82988. // exclude instances named example-instance by specifying name !=
  82989. // example-instance.
  82990. //
  82991. // You can also filter nested fields. For example, you could specify
  82992. // scheduling.automaticRestart = false to include instances only if they
  82993. // are not scheduled for automatic restarts. You can use filtering on
  82994. // nested fields to filter based on resource labels.
  82995. //
  82996. // To filter on multiple expressions, provide each separate expression
  82997. // within parentheses. For example, (scheduling.automaticRestart = true)
  82998. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  82999. // AND expression. However, you can include AND and OR expressions
  83000. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  83001. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  83002. // true).
  83003. func (c *SecurityPoliciesListCall) Filter(filter string) *SecurityPoliciesListCall {
  83004. c.urlParams_.Set("filter", filter)
  83005. return c
  83006. }
  83007. // MaxResults sets the optional parameter "maxResults": The maximum
  83008. // number of results per page that should be returned. If the number of
  83009. // available results is larger than maxResults, Compute Engine returns a
  83010. // nextPageToken that can be used to get the next page of results in
  83011. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  83012. // (Default: 500)
  83013. func (c *SecurityPoliciesListCall) MaxResults(maxResults int64) *SecurityPoliciesListCall {
  83014. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  83015. return c
  83016. }
  83017. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  83018. // a certain order. By default, results are returned in alphanumerical
  83019. // order based on the resource name.
  83020. //
  83021. // You can also sort results in descending order based on the creation
  83022. // timestamp using orderBy="creationTimestamp desc". This sorts results
  83023. // based on the creationTimestamp field in reverse chronological order
  83024. // (newest result first). Use this to sort resources like operations so
  83025. // that the newest operation is returned first.
  83026. //
  83027. // Currently, only sorting by name or creationTimestamp desc is
  83028. // supported.
  83029. func (c *SecurityPoliciesListCall) OrderBy(orderBy string) *SecurityPoliciesListCall {
  83030. c.urlParams_.Set("orderBy", orderBy)
  83031. return c
  83032. }
  83033. // PageToken sets the optional parameter "pageToken": Specifies a page
  83034. // token to use. Set pageToken to the nextPageToken returned by a
  83035. // previous list request to get the next page of results.
  83036. func (c *SecurityPoliciesListCall) PageToken(pageToken string) *SecurityPoliciesListCall {
  83037. c.urlParams_.Set("pageToken", pageToken)
  83038. return c
  83039. }
  83040. // Fields allows partial responses to be retrieved. See
  83041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83042. // for more information.
  83043. func (c *SecurityPoliciesListCall) Fields(s ...googleapi.Field) *SecurityPoliciesListCall {
  83044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83045. return c
  83046. }
  83047. // IfNoneMatch sets the optional parameter which makes the operation
  83048. // fail if the object's ETag matches the given value. This is useful for
  83049. // getting updates only after the object has changed since the last
  83050. // request. Use googleapi.IsNotModified to check whether the response
  83051. // error from Do is the result of In-None-Match.
  83052. func (c *SecurityPoliciesListCall) IfNoneMatch(entityTag string) *SecurityPoliciesListCall {
  83053. c.ifNoneMatch_ = entityTag
  83054. return c
  83055. }
  83056. // Context sets the context to be used in this call's Do method. Any
  83057. // pending HTTP request will be aborted if the provided context is
  83058. // canceled.
  83059. func (c *SecurityPoliciesListCall) Context(ctx context.Context) *SecurityPoliciesListCall {
  83060. c.ctx_ = ctx
  83061. return c
  83062. }
  83063. // Header returns an http.Header that can be modified by the caller to
  83064. // add HTTP headers to the request.
  83065. func (c *SecurityPoliciesListCall) Header() http.Header {
  83066. if c.header_ == nil {
  83067. c.header_ = make(http.Header)
  83068. }
  83069. return c.header_
  83070. }
  83071. func (c *SecurityPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  83072. reqHeaders := make(http.Header)
  83073. for k, v := range c.header_ {
  83074. reqHeaders[k] = v
  83075. }
  83076. reqHeaders.Set("User-Agent", c.s.userAgent())
  83077. if c.ifNoneMatch_ != "" {
  83078. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83079. }
  83080. var body io.Reader = nil
  83081. c.urlParams_.Set("alt", alt)
  83082. c.urlParams_.Set("prettyPrint", "false")
  83083. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies")
  83084. urls += "?" + c.urlParams_.Encode()
  83085. req, err := http.NewRequest("GET", urls, body)
  83086. if err != nil {
  83087. return nil, err
  83088. }
  83089. req.Header = reqHeaders
  83090. googleapi.Expand(req.URL, map[string]string{
  83091. "project": c.project,
  83092. })
  83093. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83094. }
  83095. // Do executes the "compute.securityPolicies.list" call.
  83096. // Exactly one of *SecurityPolicyList or error will be non-nil. Any
  83097. // non-2xx status code is an error. Response headers are in either
  83098. // *SecurityPolicyList.ServerResponse.Header or (if a response was
  83099. // returned at all) in error.(*googleapi.Error).Header. Use
  83100. // googleapi.IsNotModified to check whether the returned error was
  83101. // because http.StatusNotModified was returned.
  83102. func (c *SecurityPoliciesListCall) Do(opts ...googleapi.CallOption) (*SecurityPolicyList, error) {
  83103. gensupport.SetOptions(c.urlParams_, opts...)
  83104. res, err := c.doRequest("json")
  83105. if res != nil && res.StatusCode == http.StatusNotModified {
  83106. if res.Body != nil {
  83107. res.Body.Close()
  83108. }
  83109. return nil, &googleapi.Error{
  83110. Code: res.StatusCode,
  83111. Header: res.Header,
  83112. }
  83113. }
  83114. if err != nil {
  83115. return nil, err
  83116. }
  83117. defer googleapi.CloseBody(res)
  83118. if err := googleapi.CheckResponse(res); err != nil {
  83119. return nil, err
  83120. }
  83121. ret := &SecurityPolicyList{
  83122. ServerResponse: googleapi.ServerResponse{
  83123. Header: res.Header,
  83124. HTTPStatusCode: res.StatusCode,
  83125. },
  83126. }
  83127. target := &ret
  83128. if err := gensupport.DecodeResponse(target, res); err != nil {
  83129. return nil, err
  83130. }
  83131. return ret, nil
  83132. // {
  83133. // "description": "List all the policies that have been configured for the specified project.",
  83134. // "httpMethod": "GET",
  83135. // "id": "compute.securityPolicies.list",
  83136. // "parameterOrder": [
  83137. // "project"
  83138. // ],
  83139. // "parameters": {
  83140. // "filter": {
  83141. // "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).",
  83142. // "location": "query",
  83143. // "type": "string"
  83144. // },
  83145. // "maxResults": {
  83146. // "default": "500",
  83147. // "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)",
  83148. // "format": "uint32",
  83149. // "location": "query",
  83150. // "minimum": "0",
  83151. // "type": "integer"
  83152. // },
  83153. // "orderBy": {
  83154. // "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.",
  83155. // "location": "query",
  83156. // "type": "string"
  83157. // },
  83158. // "pageToken": {
  83159. // "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.",
  83160. // "location": "query",
  83161. // "type": "string"
  83162. // },
  83163. // "project": {
  83164. // "description": "Project ID for this request.",
  83165. // "location": "path",
  83166. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83167. // "required": true,
  83168. // "type": "string"
  83169. // }
  83170. // },
  83171. // "path": "{project}/global/securityPolicies",
  83172. // "response": {
  83173. // "$ref": "SecurityPolicyList"
  83174. // },
  83175. // "scopes": [
  83176. // "https://www.googleapis.com/auth/cloud-platform",
  83177. // "https://www.googleapis.com/auth/compute",
  83178. // "https://www.googleapis.com/auth/compute.readonly"
  83179. // ]
  83180. // }
  83181. }
  83182. // Pages invokes f for each page of results.
  83183. // A non-nil error returned from f will halt the iteration.
  83184. // The provided context supersedes any context provided to the Context method.
  83185. func (c *SecurityPoliciesListCall) Pages(ctx context.Context, f func(*SecurityPolicyList) error) error {
  83186. c.ctx_ = ctx
  83187. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  83188. for {
  83189. x, err := c.Do()
  83190. if err != nil {
  83191. return err
  83192. }
  83193. if err := f(x); err != nil {
  83194. return err
  83195. }
  83196. if x.NextPageToken == "" {
  83197. return nil
  83198. }
  83199. c.PageToken(x.NextPageToken)
  83200. }
  83201. }
  83202. // method id "compute.securityPolicies.patch":
  83203. type SecurityPoliciesPatchCall struct {
  83204. s *Service
  83205. project string
  83206. securityPolicy string
  83207. securitypolicy *SecurityPolicy
  83208. urlParams_ gensupport.URLParams
  83209. ctx_ context.Context
  83210. header_ http.Header
  83211. }
  83212. // Patch: Patches the specified policy with the data included in the
  83213. // request.
  83214. func (r *SecurityPoliciesService) Patch(project string, securityPolicy string, securitypolicy *SecurityPolicy) *SecurityPoliciesPatchCall {
  83215. c := &SecurityPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83216. c.project = project
  83217. c.securityPolicy = securityPolicy
  83218. c.securitypolicy = securitypolicy
  83219. return c
  83220. }
  83221. // RequestId sets the optional parameter "requestId": An optional
  83222. // request ID to identify requests. Specify a unique request ID so that
  83223. // if you must retry your request, the server will know to ignore the
  83224. // request if it has already been completed.
  83225. //
  83226. // For example, consider a situation where you make an initial request
  83227. // and the request times out. If you make the request again with the
  83228. // same request ID, the server can check if original operation with the
  83229. // same request ID was received, and if so, will ignore the second
  83230. // request. This prevents clients from accidentally creating duplicate
  83231. // commitments.
  83232. //
  83233. // The request ID must be a valid UUID with the exception that zero UUID
  83234. // is not supported (00000000-0000-0000-0000-000000000000).
  83235. func (c *SecurityPoliciesPatchCall) RequestId(requestId string) *SecurityPoliciesPatchCall {
  83236. c.urlParams_.Set("requestId", requestId)
  83237. return c
  83238. }
  83239. // Fields allows partial responses to be retrieved. See
  83240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83241. // for more information.
  83242. func (c *SecurityPoliciesPatchCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchCall {
  83243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83244. return c
  83245. }
  83246. // Context sets the context to be used in this call's Do method. Any
  83247. // pending HTTP request will be aborted if the provided context is
  83248. // canceled.
  83249. func (c *SecurityPoliciesPatchCall) Context(ctx context.Context) *SecurityPoliciesPatchCall {
  83250. c.ctx_ = ctx
  83251. return c
  83252. }
  83253. // Header returns an http.Header that can be modified by the caller to
  83254. // add HTTP headers to the request.
  83255. func (c *SecurityPoliciesPatchCall) Header() http.Header {
  83256. if c.header_ == nil {
  83257. c.header_ = make(http.Header)
  83258. }
  83259. return c.header_
  83260. }
  83261. func (c *SecurityPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  83262. reqHeaders := make(http.Header)
  83263. for k, v := range c.header_ {
  83264. reqHeaders[k] = v
  83265. }
  83266. reqHeaders.Set("User-Agent", c.s.userAgent())
  83267. var body io.Reader = nil
  83268. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicy)
  83269. if err != nil {
  83270. return nil, err
  83271. }
  83272. reqHeaders.Set("Content-Type", "application/json")
  83273. c.urlParams_.Set("alt", alt)
  83274. c.urlParams_.Set("prettyPrint", "false")
  83275. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}")
  83276. urls += "?" + c.urlParams_.Encode()
  83277. req, err := http.NewRequest("PATCH", urls, body)
  83278. if err != nil {
  83279. return nil, err
  83280. }
  83281. req.Header = reqHeaders
  83282. googleapi.Expand(req.URL, map[string]string{
  83283. "project": c.project,
  83284. "securityPolicy": c.securityPolicy,
  83285. })
  83286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83287. }
  83288. // Do executes the "compute.securityPolicies.patch" call.
  83289. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83290. // status code is an error. Response headers are in either
  83291. // *Operation.ServerResponse.Header or (if a response was returned at
  83292. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83293. // to check whether the returned error was because
  83294. // http.StatusNotModified was returned.
  83295. func (c *SecurityPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83296. gensupport.SetOptions(c.urlParams_, opts...)
  83297. res, err := c.doRequest("json")
  83298. if res != nil && res.StatusCode == http.StatusNotModified {
  83299. if res.Body != nil {
  83300. res.Body.Close()
  83301. }
  83302. return nil, &googleapi.Error{
  83303. Code: res.StatusCode,
  83304. Header: res.Header,
  83305. }
  83306. }
  83307. if err != nil {
  83308. return nil, err
  83309. }
  83310. defer googleapi.CloseBody(res)
  83311. if err := googleapi.CheckResponse(res); err != nil {
  83312. return nil, err
  83313. }
  83314. ret := &Operation{
  83315. ServerResponse: googleapi.ServerResponse{
  83316. Header: res.Header,
  83317. HTTPStatusCode: res.StatusCode,
  83318. },
  83319. }
  83320. target := &ret
  83321. if err := gensupport.DecodeResponse(target, res); err != nil {
  83322. return nil, err
  83323. }
  83324. return ret, nil
  83325. // {
  83326. // "description": "Patches the specified policy with the data included in the request.",
  83327. // "httpMethod": "PATCH",
  83328. // "id": "compute.securityPolicies.patch",
  83329. // "parameterOrder": [
  83330. // "project",
  83331. // "securityPolicy"
  83332. // ],
  83333. // "parameters": {
  83334. // "project": {
  83335. // "description": "Project ID for this request.",
  83336. // "location": "path",
  83337. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83338. // "required": true,
  83339. // "type": "string"
  83340. // },
  83341. // "requestId": {
  83342. // "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).",
  83343. // "location": "query",
  83344. // "type": "string"
  83345. // },
  83346. // "securityPolicy": {
  83347. // "description": "Name of the security policy to update.",
  83348. // "location": "path",
  83349. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83350. // "required": true,
  83351. // "type": "string"
  83352. // }
  83353. // },
  83354. // "path": "{project}/global/securityPolicies/{securityPolicy}",
  83355. // "request": {
  83356. // "$ref": "SecurityPolicy"
  83357. // },
  83358. // "response": {
  83359. // "$ref": "Operation"
  83360. // },
  83361. // "scopes": [
  83362. // "https://www.googleapis.com/auth/cloud-platform",
  83363. // "https://www.googleapis.com/auth/compute"
  83364. // ]
  83365. // }
  83366. }
  83367. // method id "compute.securityPolicies.patchRule":
  83368. type SecurityPoliciesPatchRuleCall struct {
  83369. s *Service
  83370. project string
  83371. securityPolicy string
  83372. securitypolicyrule *SecurityPolicyRule
  83373. urlParams_ gensupport.URLParams
  83374. ctx_ context.Context
  83375. header_ http.Header
  83376. }
  83377. // PatchRule: Patches a rule at the specified priority.
  83378. func (r *SecurityPoliciesService) PatchRule(project string, securityPolicy string, securitypolicyrule *SecurityPolicyRule) *SecurityPoliciesPatchRuleCall {
  83379. c := &SecurityPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83380. c.project = project
  83381. c.securityPolicy = securityPolicy
  83382. c.securitypolicyrule = securitypolicyrule
  83383. return c
  83384. }
  83385. // Priority sets the optional parameter "priority": The priority of the
  83386. // rule to patch.
  83387. func (c *SecurityPoliciesPatchRuleCall) Priority(priority int64) *SecurityPoliciesPatchRuleCall {
  83388. c.urlParams_.Set("priority", fmt.Sprint(priority))
  83389. return c
  83390. }
  83391. // Fields allows partial responses to be retrieved. See
  83392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83393. // for more information.
  83394. func (c *SecurityPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesPatchRuleCall {
  83395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83396. return c
  83397. }
  83398. // Context sets the context to be used in this call's Do method. Any
  83399. // pending HTTP request will be aborted if the provided context is
  83400. // canceled.
  83401. func (c *SecurityPoliciesPatchRuleCall) Context(ctx context.Context) *SecurityPoliciesPatchRuleCall {
  83402. c.ctx_ = ctx
  83403. return c
  83404. }
  83405. // Header returns an http.Header that can be modified by the caller to
  83406. // add HTTP headers to the request.
  83407. func (c *SecurityPoliciesPatchRuleCall) Header() http.Header {
  83408. if c.header_ == nil {
  83409. c.header_ = make(http.Header)
  83410. }
  83411. return c.header_
  83412. }
  83413. func (c *SecurityPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) {
  83414. reqHeaders := make(http.Header)
  83415. for k, v := range c.header_ {
  83416. reqHeaders[k] = v
  83417. }
  83418. reqHeaders.Set("User-Agent", c.s.userAgent())
  83419. var body io.Reader = nil
  83420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyrule)
  83421. if err != nil {
  83422. return nil, err
  83423. }
  83424. reqHeaders.Set("Content-Type", "application/json")
  83425. c.urlParams_.Set("alt", alt)
  83426. c.urlParams_.Set("prettyPrint", "false")
  83427. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/patchRule")
  83428. urls += "?" + c.urlParams_.Encode()
  83429. req, err := http.NewRequest("POST", urls, body)
  83430. if err != nil {
  83431. return nil, err
  83432. }
  83433. req.Header = reqHeaders
  83434. googleapi.Expand(req.URL, map[string]string{
  83435. "project": c.project,
  83436. "securityPolicy": c.securityPolicy,
  83437. })
  83438. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83439. }
  83440. // Do executes the "compute.securityPolicies.patchRule" call.
  83441. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83442. // status code is an error. Response headers are in either
  83443. // *Operation.ServerResponse.Header or (if a response was returned at
  83444. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83445. // to check whether the returned error was because
  83446. // http.StatusNotModified was returned.
  83447. func (c *SecurityPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83448. gensupport.SetOptions(c.urlParams_, opts...)
  83449. res, err := c.doRequest("json")
  83450. if res != nil && res.StatusCode == http.StatusNotModified {
  83451. if res.Body != nil {
  83452. res.Body.Close()
  83453. }
  83454. return nil, &googleapi.Error{
  83455. Code: res.StatusCode,
  83456. Header: res.Header,
  83457. }
  83458. }
  83459. if err != nil {
  83460. return nil, err
  83461. }
  83462. defer googleapi.CloseBody(res)
  83463. if err := googleapi.CheckResponse(res); err != nil {
  83464. return nil, err
  83465. }
  83466. ret := &Operation{
  83467. ServerResponse: googleapi.ServerResponse{
  83468. Header: res.Header,
  83469. HTTPStatusCode: res.StatusCode,
  83470. },
  83471. }
  83472. target := &ret
  83473. if err := gensupport.DecodeResponse(target, res); err != nil {
  83474. return nil, err
  83475. }
  83476. return ret, nil
  83477. // {
  83478. // "description": "Patches a rule at the specified priority.",
  83479. // "httpMethod": "POST",
  83480. // "id": "compute.securityPolicies.patchRule",
  83481. // "parameterOrder": [
  83482. // "project",
  83483. // "securityPolicy"
  83484. // ],
  83485. // "parameters": {
  83486. // "priority": {
  83487. // "description": "The priority of the rule to patch.",
  83488. // "format": "int32",
  83489. // "location": "query",
  83490. // "type": "integer"
  83491. // },
  83492. // "project": {
  83493. // "description": "Project ID for this request.",
  83494. // "location": "path",
  83495. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83496. // "required": true,
  83497. // "type": "string"
  83498. // },
  83499. // "securityPolicy": {
  83500. // "description": "Name of the security policy to update.",
  83501. // "location": "path",
  83502. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83503. // "required": true,
  83504. // "type": "string"
  83505. // }
  83506. // },
  83507. // "path": "{project}/global/securityPolicies/{securityPolicy}/patchRule",
  83508. // "request": {
  83509. // "$ref": "SecurityPolicyRule"
  83510. // },
  83511. // "response": {
  83512. // "$ref": "Operation"
  83513. // },
  83514. // "scopes": [
  83515. // "https://www.googleapis.com/auth/cloud-platform",
  83516. // "https://www.googleapis.com/auth/compute"
  83517. // ]
  83518. // }
  83519. }
  83520. // method id "compute.securityPolicies.removeRule":
  83521. type SecurityPoliciesRemoveRuleCall struct {
  83522. s *Service
  83523. project string
  83524. securityPolicy string
  83525. urlParams_ gensupport.URLParams
  83526. ctx_ context.Context
  83527. header_ http.Header
  83528. }
  83529. // RemoveRule: Deletes a rule at the specified priority.
  83530. func (r *SecurityPoliciesService) RemoveRule(project string, securityPolicy string) *SecurityPoliciesRemoveRuleCall {
  83531. c := &SecurityPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83532. c.project = project
  83533. c.securityPolicy = securityPolicy
  83534. return c
  83535. }
  83536. // Priority sets the optional parameter "priority": The priority of the
  83537. // rule to remove from the security policy.
  83538. func (c *SecurityPoliciesRemoveRuleCall) Priority(priority int64) *SecurityPoliciesRemoveRuleCall {
  83539. c.urlParams_.Set("priority", fmt.Sprint(priority))
  83540. return c
  83541. }
  83542. // Fields allows partial responses to be retrieved. See
  83543. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83544. // for more information.
  83545. func (c *SecurityPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *SecurityPoliciesRemoveRuleCall {
  83546. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83547. return c
  83548. }
  83549. // Context sets the context to be used in this call's Do method. Any
  83550. // pending HTTP request will be aborted if the provided context is
  83551. // canceled.
  83552. func (c *SecurityPoliciesRemoveRuleCall) Context(ctx context.Context) *SecurityPoliciesRemoveRuleCall {
  83553. c.ctx_ = ctx
  83554. return c
  83555. }
  83556. // Header returns an http.Header that can be modified by the caller to
  83557. // add HTTP headers to the request.
  83558. func (c *SecurityPoliciesRemoveRuleCall) Header() http.Header {
  83559. if c.header_ == nil {
  83560. c.header_ = make(http.Header)
  83561. }
  83562. return c.header_
  83563. }
  83564. func (c *SecurityPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) {
  83565. reqHeaders := make(http.Header)
  83566. for k, v := range c.header_ {
  83567. reqHeaders[k] = v
  83568. }
  83569. reqHeaders.Set("User-Agent", c.s.userAgent())
  83570. var body io.Reader = nil
  83571. c.urlParams_.Set("alt", alt)
  83572. c.urlParams_.Set("prettyPrint", "false")
  83573. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/securityPolicies/{securityPolicy}/removeRule")
  83574. urls += "?" + c.urlParams_.Encode()
  83575. req, err := http.NewRequest("POST", urls, body)
  83576. if err != nil {
  83577. return nil, err
  83578. }
  83579. req.Header = reqHeaders
  83580. googleapi.Expand(req.URL, map[string]string{
  83581. "project": c.project,
  83582. "securityPolicy": c.securityPolicy,
  83583. })
  83584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83585. }
  83586. // Do executes the "compute.securityPolicies.removeRule" call.
  83587. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83588. // status code is an error. Response headers are in either
  83589. // *Operation.ServerResponse.Header or (if a response was returned at
  83590. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83591. // to check whether the returned error was because
  83592. // http.StatusNotModified was returned.
  83593. func (c *SecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83594. gensupport.SetOptions(c.urlParams_, opts...)
  83595. res, err := c.doRequest("json")
  83596. if res != nil && res.StatusCode == http.StatusNotModified {
  83597. if res.Body != nil {
  83598. res.Body.Close()
  83599. }
  83600. return nil, &googleapi.Error{
  83601. Code: res.StatusCode,
  83602. Header: res.Header,
  83603. }
  83604. }
  83605. if err != nil {
  83606. return nil, err
  83607. }
  83608. defer googleapi.CloseBody(res)
  83609. if err := googleapi.CheckResponse(res); err != nil {
  83610. return nil, err
  83611. }
  83612. ret := &Operation{
  83613. ServerResponse: googleapi.ServerResponse{
  83614. Header: res.Header,
  83615. HTTPStatusCode: res.StatusCode,
  83616. },
  83617. }
  83618. target := &ret
  83619. if err := gensupport.DecodeResponse(target, res); err != nil {
  83620. return nil, err
  83621. }
  83622. return ret, nil
  83623. // {
  83624. // "description": "Deletes a rule at the specified priority.",
  83625. // "httpMethod": "POST",
  83626. // "id": "compute.securityPolicies.removeRule",
  83627. // "parameterOrder": [
  83628. // "project",
  83629. // "securityPolicy"
  83630. // ],
  83631. // "parameters": {
  83632. // "priority": {
  83633. // "description": "The priority of the rule to remove from the security policy.",
  83634. // "format": "int32",
  83635. // "location": "query",
  83636. // "type": "integer"
  83637. // },
  83638. // "project": {
  83639. // "description": "Project ID for this request.",
  83640. // "location": "path",
  83641. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83642. // "required": true,
  83643. // "type": "string"
  83644. // },
  83645. // "securityPolicy": {
  83646. // "description": "Name of the security policy to update.",
  83647. // "location": "path",
  83648. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83649. // "required": true,
  83650. // "type": "string"
  83651. // }
  83652. // },
  83653. // "path": "{project}/global/securityPolicies/{securityPolicy}/removeRule",
  83654. // "response": {
  83655. // "$ref": "Operation"
  83656. // },
  83657. // "scopes": [
  83658. // "https://www.googleapis.com/auth/cloud-platform",
  83659. // "https://www.googleapis.com/auth/compute"
  83660. // ]
  83661. // }
  83662. }
  83663. // method id "compute.snapshots.delete":
  83664. type SnapshotsDeleteCall struct {
  83665. s *Service
  83666. project string
  83667. snapshot string
  83668. urlParams_ gensupport.URLParams
  83669. ctx_ context.Context
  83670. header_ http.Header
  83671. }
  83672. // Delete: Deletes the specified Snapshot resource. Keep in mind that
  83673. // deleting a single snapshot might not necessarily delete all the data
  83674. // on that snapshot. If any data on the snapshot that is marked for
  83675. // deletion is needed for subsequent snapshots, the data will be moved
  83676. // to the next corresponding snapshot.
  83677. //
  83678. // For more information, see Deleting snapshots.
  83679. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete
  83680. func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall {
  83681. c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83682. c.project = project
  83683. c.snapshot = snapshot
  83684. return c
  83685. }
  83686. // RequestId sets the optional parameter "requestId": An optional
  83687. // request ID to identify requests. Specify a unique request ID so that
  83688. // if you must retry your request, the server will know to ignore the
  83689. // request if it has already been completed.
  83690. //
  83691. // For example, consider a situation where you make an initial request
  83692. // and the request times out. If you make the request again with the
  83693. // same request ID, the server can check if original operation with the
  83694. // same request ID was received, and if so, will ignore the second
  83695. // request. This prevents clients from accidentally creating duplicate
  83696. // commitments.
  83697. //
  83698. // The request ID must be a valid UUID with the exception that zero UUID
  83699. // is not supported (00000000-0000-0000-0000-000000000000).
  83700. func (c *SnapshotsDeleteCall) RequestId(requestId string) *SnapshotsDeleteCall {
  83701. c.urlParams_.Set("requestId", requestId)
  83702. return c
  83703. }
  83704. // Fields allows partial responses to be retrieved. See
  83705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83706. // for more information.
  83707. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall {
  83708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83709. return c
  83710. }
  83711. // Context sets the context to be used in this call's Do method. Any
  83712. // pending HTTP request will be aborted if the provided context is
  83713. // canceled.
  83714. func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall {
  83715. c.ctx_ = ctx
  83716. return c
  83717. }
  83718. // Header returns an http.Header that can be modified by the caller to
  83719. // add HTTP headers to the request.
  83720. func (c *SnapshotsDeleteCall) Header() http.Header {
  83721. if c.header_ == nil {
  83722. c.header_ = make(http.Header)
  83723. }
  83724. return c.header_
  83725. }
  83726. func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) {
  83727. reqHeaders := make(http.Header)
  83728. for k, v := range c.header_ {
  83729. reqHeaders[k] = v
  83730. }
  83731. reqHeaders.Set("User-Agent", c.s.userAgent())
  83732. var body io.Reader = nil
  83733. c.urlParams_.Set("alt", alt)
  83734. c.urlParams_.Set("prettyPrint", "false")
  83735. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  83736. urls += "?" + c.urlParams_.Encode()
  83737. req, err := http.NewRequest("DELETE", urls, body)
  83738. if err != nil {
  83739. return nil, err
  83740. }
  83741. req.Header = reqHeaders
  83742. googleapi.Expand(req.URL, map[string]string{
  83743. "project": c.project,
  83744. "snapshot": c.snapshot,
  83745. })
  83746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83747. }
  83748. // Do executes the "compute.snapshots.delete" call.
  83749. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  83750. // status code is an error. Response headers are in either
  83751. // *Operation.ServerResponse.Header or (if a response was returned at
  83752. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83753. // to check whether the returned error was because
  83754. // http.StatusNotModified was returned.
  83755. func (c *SnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  83756. gensupport.SetOptions(c.urlParams_, opts...)
  83757. res, err := c.doRequest("json")
  83758. if res != nil && res.StatusCode == http.StatusNotModified {
  83759. if res.Body != nil {
  83760. res.Body.Close()
  83761. }
  83762. return nil, &googleapi.Error{
  83763. Code: res.StatusCode,
  83764. Header: res.Header,
  83765. }
  83766. }
  83767. if err != nil {
  83768. return nil, err
  83769. }
  83770. defer googleapi.CloseBody(res)
  83771. if err := googleapi.CheckResponse(res); err != nil {
  83772. return nil, err
  83773. }
  83774. ret := &Operation{
  83775. ServerResponse: googleapi.ServerResponse{
  83776. Header: res.Header,
  83777. HTTPStatusCode: res.StatusCode,
  83778. },
  83779. }
  83780. target := &ret
  83781. if err := gensupport.DecodeResponse(target, res); err != nil {
  83782. return nil, err
  83783. }
  83784. return ret, nil
  83785. // {
  83786. // "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.",
  83787. // "httpMethod": "DELETE",
  83788. // "id": "compute.snapshots.delete",
  83789. // "parameterOrder": [
  83790. // "project",
  83791. // "snapshot"
  83792. // ],
  83793. // "parameters": {
  83794. // "project": {
  83795. // "description": "Project ID for this request.",
  83796. // "location": "path",
  83797. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83798. // "required": true,
  83799. // "type": "string"
  83800. // },
  83801. // "requestId": {
  83802. // "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).",
  83803. // "location": "query",
  83804. // "type": "string"
  83805. // },
  83806. // "snapshot": {
  83807. // "description": "Name of the Snapshot resource to delete.",
  83808. // "location": "path",
  83809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83810. // "required": true,
  83811. // "type": "string"
  83812. // }
  83813. // },
  83814. // "path": "{project}/global/snapshots/{snapshot}",
  83815. // "response": {
  83816. // "$ref": "Operation"
  83817. // },
  83818. // "scopes": [
  83819. // "https://www.googleapis.com/auth/cloud-platform",
  83820. // "https://www.googleapis.com/auth/compute"
  83821. // ]
  83822. // }
  83823. }
  83824. // method id "compute.snapshots.get":
  83825. type SnapshotsGetCall struct {
  83826. s *Service
  83827. project string
  83828. snapshot string
  83829. urlParams_ gensupport.URLParams
  83830. ifNoneMatch_ string
  83831. ctx_ context.Context
  83832. header_ http.Header
  83833. }
  83834. // Get: Returns the specified Snapshot resource. Gets a list of
  83835. // available snapshots by making a list() request.
  83836. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get
  83837. func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall {
  83838. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83839. c.project = project
  83840. c.snapshot = snapshot
  83841. return c
  83842. }
  83843. // Fields allows partial responses to be retrieved. See
  83844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83845. // for more information.
  83846. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  83847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83848. return c
  83849. }
  83850. // IfNoneMatch sets the optional parameter which makes the operation
  83851. // fail if the object's ETag matches the given value. This is useful for
  83852. // getting updates only after the object has changed since the last
  83853. // request. Use googleapi.IsNotModified to check whether the response
  83854. // error from Do is the result of In-None-Match.
  83855. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  83856. c.ifNoneMatch_ = entityTag
  83857. return c
  83858. }
  83859. // Context sets the context to be used in this call's Do method. Any
  83860. // pending HTTP request will be aborted if the provided context is
  83861. // canceled.
  83862. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  83863. c.ctx_ = ctx
  83864. return c
  83865. }
  83866. // Header returns an http.Header that can be modified by the caller to
  83867. // add HTTP headers to the request.
  83868. func (c *SnapshotsGetCall) Header() http.Header {
  83869. if c.header_ == nil {
  83870. c.header_ = make(http.Header)
  83871. }
  83872. return c.header_
  83873. }
  83874. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  83875. reqHeaders := make(http.Header)
  83876. for k, v := range c.header_ {
  83877. reqHeaders[k] = v
  83878. }
  83879. reqHeaders.Set("User-Agent", c.s.userAgent())
  83880. if c.ifNoneMatch_ != "" {
  83881. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  83882. }
  83883. var body io.Reader = nil
  83884. c.urlParams_.Set("alt", alt)
  83885. c.urlParams_.Set("prettyPrint", "false")
  83886. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}")
  83887. urls += "?" + c.urlParams_.Encode()
  83888. req, err := http.NewRequest("GET", urls, body)
  83889. if err != nil {
  83890. return nil, err
  83891. }
  83892. req.Header = reqHeaders
  83893. googleapi.Expand(req.URL, map[string]string{
  83894. "project": c.project,
  83895. "snapshot": c.snapshot,
  83896. })
  83897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  83898. }
  83899. // Do executes the "compute.snapshots.get" call.
  83900. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  83901. // code is an error. Response headers are in either
  83902. // *Snapshot.ServerResponse.Header or (if a response was returned at
  83903. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  83904. // to check whether the returned error was because
  83905. // http.StatusNotModified was returned.
  83906. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  83907. gensupport.SetOptions(c.urlParams_, opts...)
  83908. res, err := c.doRequest("json")
  83909. if res != nil && res.StatusCode == http.StatusNotModified {
  83910. if res.Body != nil {
  83911. res.Body.Close()
  83912. }
  83913. return nil, &googleapi.Error{
  83914. Code: res.StatusCode,
  83915. Header: res.Header,
  83916. }
  83917. }
  83918. if err != nil {
  83919. return nil, err
  83920. }
  83921. defer googleapi.CloseBody(res)
  83922. if err := googleapi.CheckResponse(res); err != nil {
  83923. return nil, err
  83924. }
  83925. ret := &Snapshot{
  83926. ServerResponse: googleapi.ServerResponse{
  83927. Header: res.Header,
  83928. HTTPStatusCode: res.StatusCode,
  83929. },
  83930. }
  83931. target := &ret
  83932. if err := gensupport.DecodeResponse(target, res); err != nil {
  83933. return nil, err
  83934. }
  83935. return ret, nil
  83936. // {
  83937. // "description": "Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request.",
  83938. // "httpMethod": "GET",
  83939. // "id": "compute.snapshots.get",
  83940. // "parameterOrder": [
  83941. // "project",
  83942. // "snapshot"
  83943. // ],
  83944. // "parameters": {
  83945. // "project": {
  83946. // "description": "Project ID for this request.",
  83947. // "location": "path",
  83948. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  83949. // "required": true,
  83950. // "type": "string"
  83951. // },
  83952. // "snapshot": {
  83953. // "description": "Name of the Snapshot resource to return.",
  83954. // "location": "path",
  83955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  83956. // "required": true,
  83957. // "type": "string"
  83958. // }
  83959. // },
  83960. // "path": "{project}/global/snapshots/{snapshot}",
  83961. // "response": {
  83962. // "$ref": "Snapshot"
  83963. // },
  83964. // "scopes": [
  83965. // "https://www.googleapis.com/auth/cloud-platform",
  83966. // "https://www.googleapis.com/auth/compute",
  83967. // "https://www.googleapis.com/auth/compute.readonly"
  83968. // ]
  83969. // }
  83970. }
  83971. // method id "compute.snapshots.getIamPolicy":
  83972. type SnapshotsGetIamPolicyCall struct {
  83973. s *Service
  83974. project string
  83975. resource string
  83976. urlParams_ gensupport.URLParams
  83977. ifNoneMatch_ string
  83978. ctx_ context.Context
  83979. header_ http.Header
  83980. }
  83981. // GetIamPolicy: Gets the access control policy for a resource. May be
  83982. // empty if no such policy or resource exists.
  83983. func (r *SnapshotsService) GetIamPolicy(project string, resource string) *SnapshotsGetIamPolicyCall {
  83984. c := &SnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  83985. c.project = project
  83986. c.resource = resource
  83987. return c
  83988. }
  83989. // Fields allows partial responses to be retrieved. See
  83990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  83991. // for more information.
  83992. func (c *SnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsGetIamPolicyCall {
  83993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  83994. return c
  83995. }
  83996. // IfNoneMatch sets the optional parameter which makes the operation
  83997. // fail if the object's ETag matches the given value. This is useful for
  83998. // getting updates only after the object has changed since the last
  83999. // request. Use googleapi.IsNotModified to check whether the response
  84000. // error from Do is the result of In-None-Match.
  84001. func (c *SnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *SnapshotsGetIamPolicyCall {
  84002. c.ifNoneMatch_ = entityTag
  84003. return c
  84004. }
  84005. // Context sets the context to be used in this call's Do method. Any
  84006. // pending HTTP request will be aborted if the provided context is
  84007. // canceled.
  84008. func (c *SnapshotsGetIamPolicyCall) Context(ctx context.Context) *SnapshotsGetIamPolicyCall {
  84009. c.ctx_ = ctx
  84010. return c
  84011. }
  84012. // Header returns an http.Header that can be modified by the caller to
  84013. // add HTTP headers to the request.
  84014. func (c *SnapshotsGetIamPolicyCall) Header() http.Header {
  84015. if c.header_ == nil {
  84016. c.header_ = make(http.Header)
  84017. }
  84018. return c.header_
  84019. }
  84020. func (c *SnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  84021. reqHeaders := make(http.Header)
  84022. for k, v := range c.header_ {
  84023. reqHeaders[k] = v
  84024. }
  84025. reqHeaders.Set("User-Agent", c.s.userAgent())
  84026. if c.ifNoneMatch_ != "" {
  84027. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84028. }
  84029. var body io.Reader = nil
  84030. c.urlParams_.Set("alt", alt)
  84031. c.urlParams_.Set("prettyPrint", "false")
  84032. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/getIamPolicy")
  84033. urls += "?" + c.urlParams_.Encode()
  84034. req, err := http.NewRequest("GET", urls, body)
  84035. if err != nil {
  84036. return nil, err
  84037. }
  84038. req.Header = reqHeaders
  84039. googleapi.Expand(req.URL, map[string]string{
  84040. "project": c.project,
  84041. "resource": c.resource,
  84042. })
  84043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84044. }
  84045. // Do executes the "compute.snapshots.getIamPolicy" call.
  84046. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  84047. // code is an error. Response headers are in either
  84048. // *Policy.ServerResponse.Header or (if a response was returned at all)
  84049. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  84050. // check whether the returned error was because http.StatusNotModified
  84051. // was returned.
  84052. func (c *SnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  84053. gensupport.SetOptions(c.urlParams_, opts...)
  84054. res, err := c.doRequest("json")
  84055. if res != nil && res.StatusCode == http.StatusNotModified {
  84056. if res.Body != nil {
  84057. res.Body.Close()
  84058. }
  84059. return nil, &googleapi.Error{
  84060. Code: res.StatusCode,
  84061. Header: res.Header,
  84062. }
  84063. }
  84064. if err != nil {
  84065. return nil, err
  84066. }
  84067. defer googleapi.CloseBody(res)
  84068. if err := googleapi.CheckResponse(res); err != nil {
  84069. return nil, err
  84070. }
  84071. ret := &Policy{
  84072. ServerResponse: googleapi.ServerResponse{
  84073. Header: res.Header,
  84074. HTTPStatusCode: res.StatusCode,
  84075. },
  84076. }
  84077. target := &ret
  84078. if err := gensupport.DecodeResponse(target, res); err != nil {
  84079. return nil, err
  84080. }
  84081. return ret, nil
  84082. // {
  84083. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  84084. // "httpMethod": "GET",
  84085. // "id": "compute.snapshots.getIamPolicy",
  84086. // "parameterOrder": [
  84087. // "project",
  84088. // "resource"
  84089. // ],
  84090. // "parameters": {
  84091. // "project": {
  84092. // "description": "Project ID for this request.",
  84093. // "location": "path",
  84094. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84095. // "required": true,
  84096. // "type": "string"
  84097. // },
  84098. // "resource": {
  84099. // "description": "Name or id of the resource for this request.",
  84100. // "location": "path",
  84101. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84102. // "required": true,
  84103. // "type": "string"
  84104. // }
  84105. // },
  84106. // "path": "{project}/global/snapshots/{resource}/getIamPolicy",
  84107. // "response": {
  84108. // "$ref": "Policy"
  84109. // },
  84110. // "scopes": [
  84111. // "https://www.googleapis.com/auth/cloud-platform",
  84112. // "https://www.googleapis.com/auth/compute",
  84113. // "https://www.googleapis.com/auth/compute.readonly"
  84114. // ]
  84115. // }
  84116. }
  84117. // method id "compute.snapshots.list":
  84118. type SnapshotsListCall struct {
  84119. s *Service
  84120. project string
  84121. urlParams_ gensupport.URLParams
  84122. ifNoneMatch_ string
  84123. ctx_ context.Context
  84124. header_ http.Header
  84125. }
  84126. // List: Retrieves the list of Snapshot resources contained within the
  84127. // specified project.
  84128. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list
  84129. func (r *SnapshotsService) List(project string) *SnapshotsListCall {
  84130. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84131. c.project = project
  84132. return c
  84133. }
  84134. // Filter sets the optional parameter "filter": A filter expression that
  84135. // filters resources listed in the response. The expression must specify
  84136. // the field name, a comparison operator, and the value that you want to
  84137. // use for filtering. The value must be a string, a number, or a
  84138. // boolean. The comparison operator must be either =, !=, >, or <.
  84139. //
  84140. // For example, if you are filtering Compute Engine instances, you can
  84141. // exclude instances named example-instance by specifying name !=
  84142. // example-instance.
  84143. //
  84144. // You can also filter nested fields. For example, you could specify
  84145. // scheduling.automaticRestart = false to include instances only if they
  84146. // are not scheduled for automatic restarts. You can use filtering on
  84147. // nested fields to filter based on resource labels.
  84148. //
  84149. // To filter on multiple expressions, provide each separate expression
  84150. // within parentheses. For example, (scheduling.automaticRestart = true)
  84151. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  84152. // AND expression. However, you can include AND and OR expressions
  84153. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  84154. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  84155. // true).
  84156. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall {
  84157. c.urlParams_.Set("filter", filter)
  84158. return c
  84159. }
  84160. // MaxResults sets the optional parameter "maxResults": The maximum
  84161. // number of results per page that should be returned. If the number of
  84162. // available results is larger than maxResults, Compute Engine returns a
  84163. // nextPageToken that can be used to get the next page of results in
  84164. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  84165. // (Default: 500)
  84166. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  84167. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  84168. return c
  84169. }
  84170. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  84171. // a certain order. By default, results are returned in alphanumerical
  84172. // order based on the resource name.
  84173. //
  84174. // You can also sort results in descending order based on the creation
  84175. // timestamp using orderBy="creationTimestamp desc". This sorts results
  84176. // based on the creationTimestamp field in reverse chronological order
  84177. // (newest result first). Use this to sort resources like operations so
  84178. // that the newest operation is returned first.
  84179. //
  84180. // Currently, only sorting by name or creationTimestamp desc is
  84181. // supported.
  84182. func (c *SnapshotsListCall) OrderBy(orderBy string) *SnapshotsListCall {
  84183. c.urlParams_.Set("orderBy", orderBy)
  84184. return c
  84185. }
  84186. // PageToken sets the optional parameter "pageToken": Specifies a page
  84187. // token to use. Set pageToken to the nextPageToken returned by a
  84188. // previous list request to get the next page of results.
  84189. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  84190. c.urlParams_.Set("pageToken", pageToken)
  84191. return c
  84192. }
  84193. // Fields allows partial responses to be retrieved. See
  84194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84195. // for more information.
  84196. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  84197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84198. return c
  84199. }
  84200. // IfNoneMatch sets the optional parameter which makes the operation
  84201. // fail if the object's ETag matches the given value. This is useful for
  84202. // getting updates only after the object has changed since the last
  84203. // request. Use googleapi.IsNotModified to check whether the response
  84204. // error from Do is the result of In-None-Match.
  84205. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  84206. c.ifNoneMatch_ = entityTag
  84207. return c
  84208. }
  84209. // Context sets the context to be used in this call's Do method. Any
  84210. // pending HTTP request will be aborted if the provided context is
  84211. // canceled.
  84212. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  84213. c.ctx_ = ctx
  84214. return c
  84215. }
  84216. // Header returns an http.Header that can be modified by the caller to
  84217. // add HTTP headers to the request.
  84218. func (c *SnapshotsListCall) Header() http.Header {
  84219. if c.header_ == nil {
  84220. c.header_ = make(http.Header)
  84221. }
  84222. return c.header_
  84223. }
  84224. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  84225. reqHeaders := make(http.Header)
  84226. for k, v := range c.header_ {
  84227. reqHeaders[k] = v
  84228. }
  84229. reqHeaders.Set("User-Agent", c.s.userAgent())
  84230. if c.ifNoneMatch_ != "" {
  84231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84232. }
  84233. var body io.Reader = nil
  84234. c.urlParams_.Set("alt", alt)
  84235. c.urlParams_.Set("prettyPrint", "false")
  84236. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots")
  84237. urls += "?" + c.urlParams_.Encode()
  84238. req, err := http.NewRequest("GET", urls, body)
  84239. if err != nil {
  84240. return nil, err
  84241. }
  84242. req.Header = reqHeaders
  84243. googleapi.Expand(req.URL, map[string]string{
  84244. "project": c.project,
  84245. })
  84246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84247. }
  84248. // Do executes the "compute.snapshots.list" call.
  84249. // Exactly one of *SnapshotList or error will be non-nil. Any non-2xx
  84250. // status code is an error. Response headers are in either
  84251. // *SnapshotList.ServerResponse.Header or (if a response was returned at
  84252. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84253. // to check whether the returned error was because
  84254. // http.StatusNotModified was returned.
  84255. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotList, error) {
  84256. gensupport.SetOptions(c.urlParams_, opts...)
  84257. res, err := c.doRequest("json")
  84258. if res != nil && res.StatusCode == http.StatusNotModified {
  84259. if res.Body != nil {
  84260. res.Body.Close()
  84261. }
  84262. return nil, &googleapi.Error{
  84263. Code: res.StatusCode,
  84264. Header: res.Header,
  84265. }
  84266. }
  84267. if err != nil {
  84268. return nil, err
  84269. }
  84270. defer googleapi.CloseBody(res)
  84271. if err := googleapi.CheckResponse(res); err != nil {
  84272. return nil, err
  84273. }
  84274. ret := &SnapshotList{
  84275. ServerResponse: googleapi.ServerResponse{
  84276. Header: res.Header,
  84277. HTTPStatusCode: res.StatusCode,
  84278. },
  84279. }
  84280. target := &ret
  84281. if err := gensupport.DecodeResponse(target, res); err != nil {
  84282. return nil, err
  84283. }
  84284. return ret, nil
  84285. // {
  84286. // "description": "Retrieves the list of Snapshot resources contained within the specified project.",
  84287. // "httpMethod": "GET",
  84288. // "id": "compute.snapshots.list",
  84289. // "parameterOrder": [
  84290. // "project"
  84291. // ],
  84292. // "parameters": {
  84293. // "filter": {
  84294. // "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).",
  84295. // "location": "query",
  84296. // "type": "string"
  84297. // },
  84298. // "maxResults": {
  84299. // "default": "500",
  84300. // "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)",
  84301. // "format": "uint32",
  84302. // "location": "query",
  84303. // "minimum": "0",
  84304. // "type": "integer"
  84305. // },
  84306. // "orderBy": {
  84307. // "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.",
  84308. // "location": "query",
  84309. // "type": "string"
  84310. // },
  84311. // "pageToken": {
  84312. // "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.",
  84313. // "location": "query",
  84314. // "type": "string"
  84315. // },
  84316. // "project": {
  84317. // "description": "Project ID for this request.",
  84318. // "location": "path",
  84319. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84320. // "required": true,
  84321. // "type": "string"
  84322. // }
  84323. // },
  84324. // "path": "{project}/global/snapshots",
  84325. // "response": {
  84326. // "$ref": "SnapshotList"
  84327. // },
  84328. // "scopes": [
  84329. // "https://www.googleapis.com/auth/cloud-platform",
  84330. // "https://www.googleapis.com/auth/compute",
  84331. // "https://www.googleapis.com/auth/compute.readonly"
  84332. // ]
  84333. // }
  84334. }
  84335. // Pages invokes f for each page of results.
  84336. // A non-nil error returned from f will halt the iteration.
  84337. // The provided context supersedes any context provided to the Context method.
  84338. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotList) error) error {
  84339. c.ctx_ = ctx
  84340. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  84341. for {
  84342. x, err := c.Do()
  84343. if err != nil {
  84344. return err
  84345. }
  84346. if err := f(x); err != nil {
  84347. return err
  84348. }
  84349. if x.NextPageToken == "" {
  84350. return nil
  84351. }
  84352. c.PageToken(x.NextPageToken)
  84353. }
  84354. }
  84355. // method id "compute.snapshots.setIamPolicy":
  84356. type SnapshotsSetIamPolicyCall struct {
  84357. s *Service
  84358. project string
  84359. resource string
  84360. globalsetpolicyrequest *GlobalSetPolicyRequest
  84361. urlParams_ gensupport.URLParams
  84362. ctx_ context.Context
  84363. header_ http.Header
  84364. }
  84365. // SetIamPolicy: Sets the access control policy on the specified
  84366. // resource. Replaces any existing policy.
  84367. func (r *SnapshotsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *SnapshotsSetIamPolicyCall {
  84368. c := &SnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84369. c.project = project
  84370. c.resource = resource
  84371. c.globalsetpolicyrequest = globalsetpolicyrequest
  84372. return c
  84373. }
  84374. // Fields allows partial responses to be retrieved. See
  84375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84376. // for more information.
  84377. func (c *SnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *SnapshotsSetIamPolicyCall {
  84378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84379. return c
  84380. }
  84381. // Context sets the context to be used in this call's Do method. Any
  84382. // pending HTTP request will be aborted if the provided context is
  84383. // canceled.
  84384. func (c *SnapshotsSetIamPolicyCall) Context(ctx context.Context) *SnapshotsSetIamPolicyCall {
  84385. c.ctx_ = ctx
  84386. return c
  84387. }
  84388. // Header returns an http.Header that can be modified by the caller to
  84389. // add HTTP headers to the request.
  84390. func (c *SnapshotsSetIamPolicyCall) Header() http.Header {
  84391. if c.header_ == nil {
  84392. c.header_ = make(http.Header)
  84393. }
  84394. return c.header_
  84395. }
  84396. func (c *SnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  84397. reqHeaders := make(http.Header)
  84398. for k, v := range c.header_ {
  84399. reqHeaders[k] = v
  84400. }
  84401. reqHeaders.Set("User-Agent", c.s.userAgent())
  84402. var body io.Reader = nil
  84403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  84404. if err != nil {
  84405. return nil, err
  84406. }
  84407. reqHeaders.Set("Content-Type", "application/json")
  84408. c.urlParams_.Set("alt", alt)
  84409. c.urlParams_.Set("prettyPrint", "false")
  84410. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setIamPolicy")
  84411. urls += "?" + c.urlParams_.Encode()
  84412. req, err := http.NewRequest("POST", urls, body)
  84413. if err != nil {
  84414. return nil, err
  84415. }
  84416. req.Header = reqHeaders
  84417. googleapi.Expand(req.URL, map[string]string{
  84418. "project": c.project,
  84419. "resource": c.resource,
  84420. })
  84421. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84422. }
  84423. // Do executes the "compute.snapshots.setIamPolicy" call.
  84424. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  84425. // code is an error. Response headers are in either
  84426. // *Policy.ServerResponse.Header or (if a response was returned at all)
  84427. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  84428. // check whether the returned error was because http.StatusNotModified
  84429. // was returned.
  84430. func (c *SnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  84431. gensupport.SetOptions(c.urlParams_, opts...)
  84432. res, err := c.doRequest("json")
  84433. if res != nil && res.StatusCode == http.StatusNotModified {
  84434. if res.Body != nil {
  84435. res.Body.Close()
  84436. }
  84437. return nil, &googleapi.Error{
  84438. Code: res.StatusCode,
  84439. Header: res.Header,
  84440. }
  84441. }
  84442. if err != nil {
  84443. return nil, err
  84444. }
  84445. defer googleapi.CloseBody(res)
  84446. if err := googleapi.CheckResponse(res); err != nil {
  84447. return nil, err
  84448. }
  84449. ret := &Policy{
  84450. ServerResponse: googleapi.ServerResponse{
  84451. Header: res.Header,
  84452. HTTPStatusCode: res.StatusCode,
  84453. },
  84454. }
  84455. target := &ret
  84456. if err := gensupport.DecodeResponse(target, res); err != nil {
  84457. return nil, err
  84458. }
  84459. return ret, nil
  84460. // {
  84461. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  84462. // "httpMethod": "POST",
  84463. // "id": "compute.snapshots.setIamPolicy",
  84464. // "parameterOrder": [
  84465. // "project",
  84466. // "resource"
  84467. // ],
  84468. // "parameters": {
  84469. // "project": {
  84470. // "description": "Project ID for this request.",
  84471. // "location": "path",
  84472. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84473. // "required": true,
  84474. // "type": "string"
  84475. // },
  84476. // "resource": {
  84477. // "description": "Name or id of the resource for this request.",
  84478. // "location": "path",
  84479. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84480. // "required": true,
  84481. // "type": "string"
  84482. // }
  84483. // },
  84484. // "path": "{project}/global/snapshots/{resource}/setIamPolicy",
  84485. // "request": {
  84486. // "$ref": "GlobalSetPolicyRequest"
  84487. // },
  84488. // "response": {
  84489. // "$ref": "Policy"
  84490. // },
  84491. // "scopes": [
  84492. // "https://www.googleapis.com/auth/cloud-platform",
  84493. // "https://www.googleapis.com/auth/compute"
  84494. // ]
  84495. // }
  84496. }
  84497. // method id "compute.snapshots.setLabels":
  84498. type SnapshotsSetLabelsCall struct {
  84499. s *Service
  84500. project string
  84501. resource string
  84502. globalsetlabelsrequest *GlobalSetLabelsRequest
  84503. urlParams_ gensupport.URLParams
  84504. ctx_ context.Context
  84505. header_ http.Header
  84506. }
  84507. // SetLabels: Sets the labels on a snapshot. To learn more about labels,
  84508. // read the Labeling Resources documentation.
  84509. func (r *SnapshotsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *SnapshotsSetLabelsCall {
  84510. c := &SnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84511. c.project = project
  84512. c.resource = resource
  84513. c.globalsetlabelsrequest = globalsetlabelsrequest
  84514. return c
  84515. }
  84516. // Fields allows partial responses to be retrieved. See
  84517. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84518. // for more information.
  84519. func (c *SnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *SnapshotsSetLabelsCall {
  84520. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84521. return c
  84522. }
  84523. // Context sets the context to be used in this call's Do method. Any
  84524. // pending HTTP request will be aborted if the provided context is
  84525. // canceled.
  84526. func (c *SnapshotsSetLabelsCall) Context(ctx context.Context) *SnapshotsSetLabelsCall {
  84527. c.ctx_ = ctx
  84528. return c
  84529. }
  84530. // Header returns an http.Header that can be modified by the caller to
  84531. // add HTTP headers to the request.
  84532. func (c *SnapshotsSetLabelsCall) Header() http.Header {
  84533. if c.header_ == nil {
  84534. c.header_ = make(http.Header)
  84535. }
  84536. return c.header_
  84537. }
  84538. func (c *SnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) {
  84539. reqHeaders := make(http.Header)
  84540. for k, v := range c.header_ {
  84541. reqHeaders[k] = v
  84542. }
  84543. reqHeaders.Set("User-Agent", c.s.userAgent())
  84544. var body io.Reader = nil
  84545. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest)
  84546. if err != nil {
  84547. return nil, err
  84548. }
  84549. reqHeaders.Set("Content-Type", "application/json")
  84550. c.urlParams_.Set("alt", alt)
  84551. c.urlParams_.Set("prettyPrint", "false")
  84552. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/setLabels")
  84553. urls += "?" + c.urlParams_.Encode()
  84554. req, err := http.NewRequest("POST", urls, body)
  84555. if err != nil {
  84556. return nil, err
  84557. }
  84558. req.Header = reqHeaders
  84559. googleapi.Expand(req.URL, map[string]string{
  84560. "project": c.project,
  84561. "resource": c.resource,
  84562. })
  84563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84564. }
  84565. // Do executes the "compute.snapshots.setLabels" call.
  84566. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84567. // status code is an error. Response headers are in either
  84568. // *Operation.ServerResponse.Header or (if a response was returned at
  84569. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84570. // to check whether the returned error was because
  84571. // http.StatusNotModified was returned.
  84572. func (c *SnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84573. gensupport.SetOptions(c.urlParams_, opts...)
  84574. res, err := c.doRequest("json")
  84575. if res != nil && res.StatusCode == http.StatusNotModified {
  84576. if res.Body != nil {
  84577. res.Body.Close()
  84578. }
  84579. return nil, &googleapi.Error{
  84580. Code: res.StatusCode,
  84581. Header: res.Header,
  84582. }
  84583. }
  84584. if err != nil {
  84585. return nil, err
  84586. }
  84587. defer googleapi.CloseBody(res)
  84588. if err := googleapi.CheckResponse(res); err != nil {
  84589. return nil, err
  84590. }
  84591. ret := &Operation{
  84592. ServerResponse: googleapi.ServerResponse{
  84593. Header: res.Header,
  84594. HTTPStatusCode: res.StatusCode,
  84595. },
  84596. }
  84597. target := &ret
  84598. if err := gensupport.DecodeResponse(target, res); err != nil {
  84599. return nil, err
  84600. }
  84601. return ret, nil
  84602. // {
  84603. // "description": "Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation.",
  84604. // "httpMethod": "POST",
  84605. // "id": "compute.snapshots.setLabels",
  84606. // "parameterOrder": [
  84607. // "project",
  84608. // "resource"
  84609. // ],
  84610. // "parameters": {
  84611. // "project": {
  84612. // "description": "Project ID for this request.",
  84613. // "location": "path",
  84614. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84615. // "required": true,
  84616. // "type": "string"
  84617. // },
  84618. // "resource": {
  84619. // "description": "Name or id of the resource for this request.",
  84620. // "location": "path",
  84621. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84622. // "required": true,
  84623. // "type": "string"
  84624. // }
  84625. // },
  84626. // "path": "{project}/global/snapshots/{resource}/setLabels",
  84627. // "request": {
  84628. // "$ref": "GlobalSetLabelsRequest"
  84629. // },
  84630. // "response": {
  84631. // "$ref": "Operation"
  84632. // },
  84633. // "scopes": [
  84634. // "https://www.googleapis.com/auth/cloud-platform",
  84635. // "https://www.googleapis.com/auth/compute"
  84636. // ]
  84637. // }
  84638. }
  84639. // method id "compute.snapshots.testIamPermissions":
  84640. type SnapshotsTestIamPermissionsCall struct {
  84641. s *Service
  84642. project string
  84643. resource string
  84644. testpermissionsrequest *TestPermissionsRequest
  84645. urlParams_ gensupport.URLParams
  84646. ctx_ context.Context
  84647. header_ http.Header
  84648. }
  84649. // TestIamPermissions: Returns permissions that a caller has on the
  84650. // specified resource.
  84651. func (r *SnapshotsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *SnapshotsTestIamPermissionsCall {
  84652. c := &SnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84653. c.project = project
  84654. c.resource = resource
  84655. c.testpermissionsrequest = testpermissionsrequest
  84656. return c
  84657. }
  84658. // Fields allows partial responses to be retrieved. See
  84659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84660. // for more information.
  84661. func (c *SnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *SnapshotsTestIamPermissionsCall {
  84662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84663. return c
  84664. }
  84665. // Context sets the context to be used in this call's Do method. Any
  84666. // pending HTTP request will be aborted if the provided context is
  84667. // canceled.
  84668. func (c *SnapshotsTestIamPermissionsCall) Context(ctx context.Context) *SnapshotsTestIamPermissionsCall {
  84669. c.ctx_ = ctx
  84670. return c
  84671. }
  84672. // Header returns an http.Header that can be modified by the caller to
  84673. // add HTTP headers to the request.
  84674. func (c *SnapshotsTestIamPermissionsCall) Header() http.Header {
  84675. if c.header_ == nil {
  84676. c.header_ = make(http.Header)
  84677. }
  84678. return c.header_
  84679. }
  84680. func (c *SnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  84681. reqHeaders := make(http.Header)
  84682. for k, v := range c.header_ {
  84683. reqHeaders[k] = v
  84684. }
  84685. reqHeaders.Set("User-Agent", c.s.userAgent())
  84686. var body io.Reader = nil
  84687. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  84688. if err != nil {
  84689. return nil, err
  84690. }
  84691. reqHeaders.Set("Content-Type", "application/json")
  84692. c.urlParams_.Set("alt", alt)
  84693. c.urlParams_.Set("prettyPrint", "false")
  84694. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{resource}/testIamPermissions")
  84695. urls += "?" + c.urlParams_.Encode()
  84696. req, err := http.NewRequest("POST", urls, body)
  84697. if err != nil {
  84698. return nil, err
  84699. }
  84700. req.Header = reqHeaders
  84701. googleapi.Expand(req.URL, map[string]string{
  84702. "project": c.project,
  84703. "resource": c.resource,
  84704. })
  84705. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84706. }
  84707. // Do executes the "compute.snapshots.testIamPermissions" call.
  84708. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  84709. // non-2xx status code is an error. Response headers are in either
  84710. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  84711. // returned at all) in error.(*googleapi.Error).Header. Use
  84712. // googleapi.IsNotModified to check whether the returned error was
  84713. // because http.StatusNotModified was returned.
  84714. func (c *SnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  84715. gensupport.SetOptions(c.urlParams_, opts...)
  84716. res, err := c.doRequest("json")
  84717. if res != nil && res.StatusCode == http.StatusNotModified {
  84718. if res.Body != nil {
  84719. res.Body.Close()
  84720. }
  84721. return nil, &googleapi.Error{
  84722. Code: res.StatusCode,
  84723. Header: res.Header,
  84724. }
  84725. }
  84726. if err != nil {
  84727. return nil, err
  84728. }
  84729. defer googleapi.CloseBody(res)
  84730. if err := googleapi.CheckResponse(res); err != nil {
  84731. return nil, err
  84732. }
  84733. ret := &TestPermissionsResponse{
  84734. ServerResponse: googleapi.ServerResponse{
  84735. Header: res.Header,
  84736. HTTPStatusCode: res.StatusCode,
  84737. },
  84738. }
  84739. target := &ret
  84740. if err := gensupport.DecodeResponse(target, res); err != nil {
  84741. return nil, err
  84742. }
  84743. return ret, nil
  84744. // {
  84745. // "description": "Returns permissions that a caller has on the specified resource.",
  84746. // "httpMethod": "POST",
  84747. // "id": "compute.snapshots.testIamPermissions",
  84748. // "parameterOrder": [
  84749. // "project",
  84750. // "resource"
  84751. // ],
  84752. // "parameters": {
  84753. // "project": {
  84754. // "description": "Project ID for this request.",
  84755. // "location": "path",
  84756. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84757. // "required": true,
  84758. // "type": "string"
  84759. // },
  84760. // "resource": {
  84761. // "description": "Name or id of the resource for this request.",
  84762. // "location": "path",
  84763. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84764. // "required": true,
  84765. // "type": "string"
  84766. // }
  84767. // },
  84768. // "path": "{project}/global/snapshots/{resource}/testIamPermissions",
  84769. // "request": {
  84770. // "$ref": "TestPermissionsRequest"
  84771. // },
  84772. // "response": {
  84773. // "$ref": "TestPermissionsResponse"
  84774. // },
  84775. // "scopes": [
  84776. // "https://www.googleapis.com/auth/cloud-platform",
  84777. // "https://www.googleapis.com/auth/compute",
  84778. // "https://www.googleapis.com/auth/compute.readonly"
  84779. // ]
  84780. // }
  84781. }
  84782. // method id "compute.sslCertificates.delete":
  84783. type SslCertificatesDeleteCall struct {
  84784. s *Service
  84785. project string
  84786. sslCertificate string
  84787. urlParams_ gensupport.URLParams
  84788. ctx_ context.Context
  84789. header_ http.Header
  84790. }
  84791. // Delete: Deletes the specified SslCertificate resource.
  84792. func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall {
  84793. c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84794. c.project = project
  84795. c.sslCertificate = sslCertificate
  84796. return c
  84797. }
  84798. // RequestId sets the optional parameter "requestId": An optional
  84799. // request ID to identify requests. Specify a unique request ID so that
  84800. // if you must retry your request, the server will know to ignore the
  84801. // request if it has already been completed.
  84802. //
  84803. // For example, consider a situation where you make an initial request
  84804. // and the request times out. If you make the request again with the
  84805. // same request ID, the server can check if original operation with the
  84806. // same request ID was received, and if so, will ignore the second
  84807. // request. This prevents clients from accidentally creating duplicate
  84808. // commitments.
  84809. //
  84810. // The request ID must be a valid UUID with the exception that zero UUID
  84811. // is not supported (00000000-0000-0000-0000-000000000000).
  84812. func (c *SslCertificatesDeleteCall) RequestId(requestId string) *SslCertificatesDeleteCall {
  84813. c.urlParams_.Set("requestId", requestId)
  84814. return c
  84815. }
  84816. // Fields allows partial responses to be retrieved. See
  84817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84818. // for more information.
  84819. func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall {
  84820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84821. return c
  84822. }
  84823. // Context sets the context to be used in this call's Do method. Any
  84824. // pending HTTP request will be aborted if the provided context is
  84825. // canceled.
  84826. func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall {
  84827. c.ctx_ = ctx
  84828. return c
  84829. }
  84830. // Header returns an http.Header that can be modified by the caller to
  84831. // add HTTP headers to the request.
  84832. func (c *SslCertificatesDeleteCall) Header() http.Header {
  84833. if c.header_ == nil {
  84834. c.header_ = make(http.Header)
  84835. }
  84836. return c.header_
  84837. }
  84838. func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  84839. reqHeaders := make(http.Header)
  84840. for k, v := range c.header_ {
  84841. reqHeaders[k] = v
  84842. }
  84843. reqHeaders.Set("User-Agent", c.s.userAgent())
  84844. var body io.Reader = nil
  84845. c.urlParams_.Set("alt", alt)
  84846. c.urlParams_.Set("prettyPrint", "false")
  84847. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  84848. urls += "?" + c.urlParams_.Encode()
  84849. req, err := http.NewRequest("DELETE", urls, body)
  84850. if err != nil {
  84851. return nil, err
  84852. }
  84853. req.Header = reqHeaders
  84854. googleapi.Expand(req.URL, map[string]string{
  84855. "project": c.project,
  84856. "sslCertificate": c.sslCertificate,
  84857. })
  84858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  84859. }
  84860. // Do executes the "compute.sslCertificates.delete" call.
  84861. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  84862. // status code is an error. Response headers are in either
  84863. // *Operation.ServerResponse.Header or (if a response was returned at
  84864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  84865. // to check whether the returned error was because
  84866. // http.StatusNotModified was returned.
  84867. func (c *SslCertificatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  84868. gensupport.SetOptions(c.urlParams_, opts...)
  84869. res, err := c.doRequest("json")
  84870. if res != nil && res.StatusCode == http.StatusNotModified {
  84871. if res.Body != nil {
  84872. res.Body.Close()
  84873. }
  84874. return nil, &googleapi.Error{
  84875. Code: res.StatusCode,
  84876. Header: res.Header,
  84877. }
  84878. }
  84879. if err != nil {
  84880. return nil, err
  84881. }
  84882. defer googleapi.CloseBody(res)
  84883. if err := googleapi.CheckResponse(res); err != nil {
  84884. return nil, err
  84885. }
  84886. ret := &Operation{
  84887. ServerResponse: googleapi.ServerResponse{
  84888. Header: res.Header,
  84889. HTTPStatusCode: res.StatusCode,
  84890. },
  84891. }
  84892. target := &ret
  84893. if err := gensupport.DecodeResponse(target, res); err != nil {
  84894. return nil, err
  84895. }
  84896. return ret, nil
  84897. // {
  84898. // "description": "Deletes the specified SslCertificate resource.",
  84899. // "httpMethod": "DELETE",
  84900. // "id": "compute.sslCertificates.delete",
  84901. // "parameterOrder": [
  84902. // "project",
  84903. // "sslCertificate"
  84904. // ],
  84905. // "parameters": {
  84906. // "project": {
  84907. // "description": "Project ID for this request.",
  84908. // "location": "path",
  84909. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  84910. // "required": true,
  84911. // "type": "string"
  84912. // },
  84913. // "requestId": {
  84914. // "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).",
  84915. // "location": "query",
  84916. // "type": "string"
  84917. // },
  84918. // "sslCertificate": {
  84919. // "description": "Name of the SslCertificate resource to delete.",
  84920. // "location": "path",
  84921. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  84922. // "required": true,
  84923. // "type": "string"
  84924. // }
  84925. // },
  84926. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  84927. // "response": {
  84928. // "$ref": "Operation"
  84929. // },
  84930. // "scopes": [
  84931. // "https://www.googleapis.com/auth/cloud-platform",
  84932. // "https://www.googleapis.com/auth/compute"
  84933. // ]
  84934. // }
  84935. }
  84936. // method id "compute.sslCertificates.get":
  84937. type SslCertificatesGetCall struct {
  84938. s *Service
  84939. project string
  84940. sslCertificate string
  84941. urlParams_ gensupport.URLParams
  84942. ifNoneMatch_ string
  84943. ctx_ context.Context
  84944. header_ http.Header
  84945. }
  84946. // Get: Returns the specified SslCertificate resource. Gets a list of
  84947. // available SSL certificates by making a list() request.
  84948. func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall {
  84949. c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  84950. c.project = project
  84951. c.sslCertificate = sslCertificate
  84952. return c
  84953. }
  84954. // Fields allows partial responses to be retrieved. See
  84955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  84956. // for more information.
  84957. func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall {
  84958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  84959. return c
  84960. }
  84961. // IfNoneMatch sets the optional parameter which makes the operation
  84962. // fail if the object's ETag matches the given value. This is useful for
  84963. // getting updates only after the object has changed since the last
  84964. // request. Use googleapi.IsNotModified to check whether the response
  84965. // error from Do is the result of In-None-Match.
  84966. func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall {
  84967. c.ifNoneMatch_ = entityTag
  84968. return c
  84969. }
  84970. // Context sets the context to be used in this call's Do method. Any
  84971. // pending HTTP request will be aborted if the provided context is
  84972. // canceled.
  84973. func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall {
  84974. c.ctx_ = ctx
  84975. return c
  84976. }
  84977. // Header returns an http.Header that can be modified by the caller to
  84978. // add HTTP headers to the request.
  84979. func (c *SslCertificatesGetCall) Header() http.Header {
  84980. if c.header_ == nil {
  84981. c.header_ = make(http.Header)
  84982. }
  84983. return c.header_
  84984. }
  84985. func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) {
  84986. reqHeaders := make(http.Header)
  84987. for k, v := range c.header_ {
  84988. reqHeaders[k] = v
  84989. }
  84990. reqHeaders.Set("User-Agent", c.s.userAgent())
  84991. if c.ifNoneMatch_ != "" {
  84992. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  84993. }
  84994. var body io.Reader = nil
  84995. c.urlParams_.Set("alt", alt)
  84996. c.urlParams_.Set("prettyPrint", "false")
  84997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}")
  84998. urls += "?" + c.urlParams_.Encode()
  84999. req, err := http.NewRequest("GET", urls, body)
  85000. if err != nil {
  85001. return nil, err
  85002. }
  85003. req.Header = reqHeaders
  85004. googleapi.Expand(req.URL, map[string]string{
  85005. "project": c.project,
  85006. "sslCertificate": c.sslCertificate,
  85007. })
  85008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85009. }
  85010. // Do executes the "compute.sslCertificates.get" call.
  85011. // Exactly one of *SslCertificate or error will be non-nil. Any non-2xx
  85012. // status code is an error. Response headers are in either
  85013. // *SslCertificate.ServerResponse.Header or (if a response was returned
  85014. // at all) in error.(*googleapi.Error).Header. Use
  85015. // googleapi.IsNotModified to check whether the returned error was
  85016. // because http.StatusNotModified was returned.
  85017. func (c *SslCertificatesGetCall) Do(opts ...googleapi.CallOption) (*SslCertificate, error) {
  85018. gensupport.SetOptions(c.urlParams_, opts...)
  85019. res, err := c.doRequest("json")
  85020. if res != nil && res.StatusCode == http.StatusNotModified {
  85021. if res.Body != nil {
  85022. res.Body.Close()
  85023. }
  85024. return nil, &googleapi.Error{
  85025. Code: res.StatusCode,
  85026. Header: res.Header,
  85027. }
  85028. }
  85029. if err != nil {
  85030. return nil, err
  85031. }
  85032. defer googleapi.CloseBody(res)
  85033. if err := googleapi.CheckResponse(res); err != nil {
  85034. return nil, err
  85035. }
  85036. ret := &SslCertificate{
  85037. ServerResponse: googleapi.ServerResponse{
  85038. Header: res.Header,
  85039. HTTPStatusCode: res.StatusCode,
  85040. },
  85041. }
  85042. target := &ret
  85043. if err := gensupport.DecodeResponse(target, res); err != nil {
  85044. return nil, err
  85045. }
  85046. return ret, nil
  85047. // {
  85048. // "description": "Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request.",
  85049. // "httpMethod": "GET",
  85050. // "id": "compute.sslCertificates.get",
  85051. // "parameterOrder": [
  85052. // "project",
  85053. // "sslCertificate"
  85054. // ],
  85055. // "parameters": {
  85056. // "project": {
  85057. // "description": "Project ID for this request.",
  85058. // "location": "path",
  85059. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85060. // "required": true,
  85061. // "type": "string"
  85062. // },
  85063. // "sslCertificate": {
  85064. // "description": "Name of the SslCertificate resource to return.",
  85065. // "location": "path",
  85066. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  85067. // "required": true,
  85068. // "type": "string"
  85069. // }
  85070. // },
  85071. // "path": "{project}/global/sslCertificates/{sslCertificate}",
  85072. // "response": {
  85073. // "$ref": "SslCertificate"
  85074. // },
  85075. // "scopes": [
  85076. // "https://www.googleapis.com/auth/cloud-platform",
  85077. // "https://www.googleapis.com/auth/compute",
  85078. // "https://www.googleapis.com/auth/compute.readonly"
  85079. // ]
  85080. // }
  85081. }
  85082. // method id "compute.sslCertificates.insert":
  85083. type SslCertificatesInsertCall struct {
  85084. s *Service
  85085. project string
  85086. sslcertificate *SslCertificate
  85087. urlParams_ gensupport.URLParams
  85088. ctx_ context.Context
  85089. header_ http.Header
  85090. }
  85091. // Insert: Creates a SslCertificate resource in the specified project
  85092. // using the data included in the request.
  85093. func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall {
  85094. c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85095. c.project = project
  85096. c.sslcertificate = sslcertificate
  85097. return c
  85098. }
  85099. // RequestId sets the optional parameter "requestId": An optional
  85100. // request ID to identify requests. Specify a unique request ID so that
  85101. // if you must retry your request, the server will know to ignore the
  85102. // request if it has already been completed.
  85103. //
  85104. // For example, consider a situation where you make an initial request
  85105. // and the request times out. If you make the request again with the
  85106. // same request ID, the server can check if original operation with the
  85107. // same request ID was received, and if so, will ignore the second
  85108. // request. This prevents clients from accidentally creating duplicate
  85109. // commitments.
  85110. //
  85111. // The request ID must be a valid UUID with the exception that zero UUID
  85112. // is not supported (00000000-0000-0000-0000-000000000000).
  85113. func (c *SslCertificatesInsertCall) RequestId(requestId string) *SslCertificatesInsertCall {
  85114. c.urlParams_.Set("requestId", requestId)
  85115. return c
  85116. }
  85117. // Fields allows partial responses to be retrieved. See
  85118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85119. // for more information.
  85120. func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall {
  85121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85122. return c
  85123. }
  85124. // Context sets the context to be used in this call's Do method. Any
  85125. // pending HTTP request will be aborted if the provided context is
  85126. // canceled.
  85127. func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall {
  85128. c.ctx_ = ctx
  85129. return c
  85130. }
  85131. // Header returns an http.Header that can be modified by the caller to
  85132. // add HTTP headers to the request.
  85133. func (c *SslCertificatesInsertCall) Header() http.Header {
  85134. if c.header_ == nil {
  85135. c.header_ = make(http.Header)
  85136. }
  85137. return c.header_
  85138. }
  85139. func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) {
  85140. reqHeaders := make(http.Header)
  85141. for k, v := range c.header_ {
  85142. reqHeaders[k] = v
  85143. }
  85144. reqHeaders.Set("User-Agent", c.s.userAgent())
  85145. var body io.Reader = nil
  85146. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate)
  85147. if err != nil {
  85148. return nil, err
  85149. }
  85150. reqHeaders.Set("Content-Type", "application/json")
  85151. c.urlParams_.Set("alt", alt)
  85152. c.urlParams_.Set("prettyPrint", "false")
  85153. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  85154. urls += "?" + c.urlParams_.Encode()
  85155. req, err := http.NewRequest("POST", urls, body)
  85156. if err != nil {
  85157. return nil, err
  85158. }
  85159. req.Header = reqHeaders
  85160. googleapi.Expand(req.URL, map[string]string{
  85161. "project": c.project,
  85162. })
  85163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85164. }
  85165. // Do executes the "compute.sslCertificates.insert" call.
  85166. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85167. // status code is an error. Response headers are in either
  85168. // *Operation.ServerResponse.Header or (if a response was returned at
  85169. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85170. // to check whether the returned error was because
  85171. // http.StatusNotModified was returned.
  85172. func (c *SslCertificatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85173. gensupport.SetOptions(c.urlParams_, opts...)
  85174. res, err := c.doRequest("json")
  85175. if res != nil && res.StatusCode == http.StatusNotModified {
  85176. if res.Body != nil {
  85177. res.Body.Close()
  85178. }
  85179. return nil, &googleapi.Error{
  85180. Code: res.StatusCode,
  85181. Header: res.Header,
  85182. }
  85183. }
  85184. if err != nil {
  85185. return nil, err
  85186. }
  85187. defer googleapi.CloseBody(res)
  85188. if err := googleapi.CheckResponse(res); err != nil {
  85189. return nil, err
  85190. }
  85191. ret := &Operation{
  85192. ServerResponse: googleapi.ServerResponse{
  85193. Header: res.Header,
  85194. HTTPStatusCode: res.StatusCode,
  85195. },
  85196. }
  85197. target := &ret
  85198. if err := gensupport.DecodeResponse(target, res); err != nil {
  85199. return nil, err
  85200. }
  85201. return ret, nil
  85202. // {
  85203. // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.",
  85204. // "httpMethod": "POST",
  85205. // "id": "compute.sslCertificates.insert",
  85206. // "parameterOrder": [
  85207. // "project"
  85208. // ],
  85209. // "parameters": {
  85210. // "project": {
  85211. // "description": "Project ID for this request.",
  85212. // "location": "path",
  85213. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85214. // "required": true,
  85215. // "type": "string"
  85216. // },
  85217. // "requestId": {
  85218. // "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).",
  85219. // "location": "query",
  85220. // "type": "string"
  85221. // }
  85222. // },
  85223. // "path": "{project}/global/sslCertificates",
  85224. // "request": {
  85225. // "$ref": "SslCertificate"
  85226. // },
  85227. // "response": {
  85228. // "$ref": "Operation"
  85229. // },
  85230. // "scopes": [
  85231. // "https://www.googleapis.com/auth/cloud-platform",
  85232. // "https://www.googleapis.com/auth/compute"
  85233. // ]
  85234. // }
  85235. }
  85236. // method id "compute.sslCertificates.list":
  85237. type SslCertificatesListCall struct {
  85238. s *Service
  85239. project string
  85240. urlParams_ gensupport.URLParams
  85241. ifNoneMatch_ string
  85242. ctx_ context.Context
  85243. header_ http.Header
  85244. }
  85245. // List: Retrieves the list of SslCertificate resources available to the
  85246. // specified project.
  85247. func (r *SslCertificatesService) List(project string) *SslCertificatesListCall {
  85248. c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85249. c.project = project
  85250. return c
  85251. }
  85252. // Filter sets the optional parameter "filter": A filter expression that
  85253. // filters resources listed in the response. The expression must specify
  85254. // the field name, a comparison operator, and the value that you want to
  85255. // use for filtering. The value must be a string, a number, or a
  85256. // boolean. The comparison operator must be either =, !=, >, or <.
  85257. //
  85258. // For example, if you are filtering Compute Engine instances, you can
  85259. // exclude instances named example-instance by specifying name !=
  85260. // example-instance.
  85261. //
  85262. // You can also filter nested fields. For example, you could specify
  85263. // scheduling.automaticRestart = false to include instances only if they
  85264. // are not scheduled for automatic restarts. You can use filtering on
  85265. // nested fields to filter based on resource labels.
  85266. //
  85267. // To filter on multiple expressions, provide each separate expression
  85268. // within parentheses. For example, (scheduling.automaticRestart = true)
  85269. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85270. // AND expression. However, you can include AND and OR expressions
  85271. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85272. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85273. // true).
  85274. func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall {
  85275. c.urlParams_.Set("filter", filter)
  85276. return c
  85277. }
  85278. // MaxResults sets the optional parameter "maxResults": The maximum
  85279. // number of results per page that should be returned. If the number of
  85280. // available results is larger than maxResults, Compute Engine returns a
  85281. // nextPageToken that can be used to get the next page of results in
  85282. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85283. // (Default: 500)
  85284. func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall {
  85285. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85286. return c
  85287. }
  85288. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85289. // a certain order. By default, results are returned in alphanumerical
  85290. // order based on the resource name.
  85291. //
  85292. // You can also sort results in descending order based on the creation
  85293. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85294. // based on the creationTimestamp field in reverse chronological order
  85295. // (newest result first). Use this to sort resources like operations so
  85296. // that the newest operation is returned first.
  85297. //
  85298. // Currently, only sorting by name or creationTimestamp desc is
  85299. // supported.
  85300. func (c *SslCertificatesListCall) OrderBy(orderBy string) *SslCertificatesListCall {
  85301. c.urlParams_.Set("orderBy", orderBy)
  85302. return c
  85303. }
  85304. // PageToken sets the optional parameter "pageToken": Specifies a page
  85305. // token to use. Set pageToken to the nextPageToken returned by a
  85306. // previous list request to get the next page of results.
  85307. func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall {
  85308. c.urlParams_.Set("pageToken", pageToken)
  85309. return c
  85310. }
  85311. // Fields allows partial responses to be retrieved. See
  85312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85313. // for more information.
  85314. func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall {
  85315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85316. return c
  85317. }
  85318. // IfNoneMatch sets the optional parameter which makes the operation
  85319. // fail if the object's ETag matches the given value. This is useful for
  85320. // getting updates only after the object has changed since the last
  85321. // request. Use googleapi.IsNotModified to check whether the response
  85322. // error from Do is the result of In-None-Match.
  85323. func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall {
  85324. c.ifNoneMatch_ = entityTag
  85325. return c
  85326. }
  85327. // Context sets the context to be used in this call's Do method. Any
  85328. // pending HTTP request will be aborted if the provided context is
  85329. // canceled.
  85330. func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall {
  85331. c.ctx_ = ctx
  85332. return c
  85333. }
  85334. // Header returns an http.Header that can be modified by the caller to
  85335. // add HTTP headers to the request.
  85336. func (c *SslCertificatesListCall) Header() http.Header {
  85337. if c.header_ == nil {
  85338. c.header_ = make(http.Header)
  85339. }
  85340. return c.header_
  85341. }
  85342. func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) {
  85343. reqHeaders := make(http.Header)
  85344. for k, v := range c.header_ {
  85345. reqHeaders[k] = v
  85346. }
  85347. reqHeaders.Set("User-Agent", c.s.userAgent())
  85348. if c.ifNoneMatch_ != "" {
  85349. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85350. }
  85351. var body io.Reader = nil
  85352. c.urlParams_.Set("alt", alt)
  85353. c.urlParams_.Set("prettyPrint", "false")
  85354. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates")
  85355. urls += "?" + c.urlParams_.Encode()
  85356. req, err := http.NewRequest("GET", urls, body)
  85357. if err != nil {
  85358. return nil, err
  85359. }
  85360. req.Header = reqHeaders
  85361. googleapi.Expand(req.URL, map[string]string{
  85362. "project": c.project,
  85363. })
  85364. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85365. }
  85366. // Do executes the "compute.sslCertificates.list" call.
  85367. // Exactly one of *SslCertificateList or error will be non-nil. Any
  85368. // non-2xx status code is an error. Response headers are in either
  85369. // *SslCertificateList.ServerResponse.Header or (if a response was
  85370. // returned at all) in error.(*googleapi.Error).Header. Use
  85371. // googleapi.IsNotModified to check whether the returned error was
  85372. // because http.StatusNotModified was returned.
  85373. func (c *SslCertificatesListCall) Do(opts ...googleapi.CallOption) (*SslCertificateList, error) {
  85374. gensupport.SetOptions(c.urlParams_, opts...)
  85375. res, err := c.doRequest("json")
  85376. if res != nil && res.StatusCode == http.StatusNotModified {
  85377. if res.Body != nil {
  85378. res.Body.Close()
  85379. }
  85380. return nil, &googleapi.Error{
  85381. Code: res.StatusCode,
  85382. Header: res.Header,
  85383. }
  85384. }
  85385. if err != nil {
  85386. return nil, err
  85387. }
  85388. defer googleapi.CloseBody(res)
  85389. if err := googleapi.CheckResponse(res); err != nil {
  85390. return nil, err
  85391. }
  85392. ret := &SslCertificateList{
  85393. ServerResponse: googleapi.ServerResponse{
  85394. Header: res.Header,
  85395. HTTPStatusCode: res.StatusCode,
  85396. },
  85397. }
  85398. target := &ret
  85399. if err := gensupport.DecodeResponse(target, res); err != nil {
  85400. return nil, err
  85401. }
  85402. return ret, nil
  85403. // {
  85404. // "description": "Retrieves the list of SslCertificate resources available to the specified project.",
  85405. // "httpMethod": "GET",
  85406. // "id": "compute.sslCertificates.list",
  85407. // "parameterOrder": [
  85408. // "project"
  85409. // ],
  85410. // "parameters": {
  85411. // "filter": {
  85412. // "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).",
  85413. // "location": "query",
  85414. // "type": "string"
  85415. // },
  85416. // "maxResults": {
  85417. // "default": "500",
  85418. // "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)",
  85419. // "format": "uint32",
  85420. // "location": "query",
  85421. // "minimum": "0",
  85422. // "type": "integer"
  85423. // },
  85424. // "orderBy": {
  85425. // "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.",
  85426. // "location": "query",
  85427. // "type": "string"
  85428. // },
  85429. // "pageToken": {
  85430. // "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.",
  85431. // "location": "query",
  85432. // "type": "string"
  85433. // },
  85434. // "project": {
  85435. // "description": "Project ID for this request.",
  85436. // "location": "path",
  85437. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85438. // "required": true,
  85439. // "type": "string"
  85440. // }
  85441. // },
  85442. // "path": "{project}/global/sslCertificates",
  85443. // "response": {
  85444. // "$ref": "SslCertificateList"
  85445. // },
  85446. // "scopes": [
  85447. // "https://www.googleapis.com/auth/cloud-platform",
  85448. // "https://www.googleapis.com/auth/compute",
  85449. // "https://www.googleapis.com/auth/compute.readonly"
  85450. // ]
  85451. // }
  85452. }
  85453. // Pages invokes f for each page of results.
  85454. // A non-nil error returned from f will halt the iteration.
  85455. // The provided context supersedes any context provided to the Context method.
  85456. func (c *SslCertificatesListCall) Pages(ctx context.Context, f func(*SslCertificateList) error) error {
  85457. c.ctx_ = ctx
  85458. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  85459. for {
  85460. x, err := c.Do()
  85461. if err != nil {
  85462. return err
  85463. }
  85464. if err := f(x); err != nil {
  85465. return err
  85466. }
  85467. if x.NextPageToken == "" {
  85468. return nil
  85469. }
  85470. c.PageToken(x.NextPageToken)
  85471. }
  85472. }
  85473. // method id "compute.sslPolicies.delete":
  85474. type SslPoliciesDeleteCall struct {
  85475. s *Service
  85476. project string
  85477. sslPolicy string
  85478. urlParams_ gensupport.URLParams
  85479. ctx_ context.Context
  85480. header_ http.Header
  85481. }
  85482. // Delete: Deletes the specified SSL policy. The SSL policy resource can
  85483. // be deleted only if it is not in use by any TargetHttpsProxy or
  85484. // TargetSslProxy resources.
  85485. func (r *SslPoliciesService) Delete(project string, sslPolicy string) *SslPoliciesDeleteCall {
  85486. c := &SslPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85487. c.project = project
  85488. c.sslPolicy = sslPolicy
  85489. return c
  85490. }
  85491. // RequestId sets the optional parameter "requestId": An optional
  85492. // request ID to identify requests. Specify a unique request ID so that
  85493. // if you must retry your request, the server will know to ignore the
  85494. // request if it has already been completed.
  85495. //
  85496. // For example, consider a situation where you make an initial request
  85497. // and the request times out. If you make the request again with the
  85498. // same request ID, the server can check if original operation with the
  85499. // same request ID was received, and if so, will ignore the second
  85500. // request. This prevents clients from accidentally creating duplicate
  85501. // commitments.
  85502. //
  85503. // The request ID must be a valid UUID with the exception that zero UUID
  85504. // is not supported (00000000-0000-0000-0000-000000000000).
  85505. func (c *SslPoliciesDeleteCall) RequestId(requestId string) *SslPoliciesDeleteCall {
  85506. c.urlParams_.Set("requestId", requestId)
  85507. return c
  85508. }
  85509. // Fields allows partial responses to be retrieved. See
  85510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85511. // for more information.
  85512. func (c *SslPoliciesDeleteCall) Fields(s ...googleapi.Field) *SslPoliciesDeleteCall {
  85513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85514. return c
  85515. }
  85516. // Context sets the context to be used in this call's Do method. Any
  85517. // pending HTTP request will be aborted if the provided context is
  85518. // canceled.
  85519. func (c *SslPoliciesDeleteCall) Context(ctx context.Context) *SslPoliciesDeleteCall {
  85520. c.ctx_ = ctx
  85521. return c
  85522. }
  85523. // Header returns an http.Header that can be modified by the caller to
  85524. // add HTTP headers to the request.
  85525. func (c *SslPoliciesDeleteCall) Header() http.Header {
  85526. if c.header_ == nil {
  85527. c.header_ = make(http.Header)
  85528. }
  85529. return c.header_
  85530. }
  85531. func (c *SslPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  85532. reqHeaders := make(http.Header)
  85533. for k, v := range c.header_ {
  85534. reqHeaders[k] = v
  85535. }
  85536. reqHeaders.Set("User-Agent", c.s.userAgent())
  85537. var body io.Reader = nil
  85538. c.urlParams_.Set("alt", alt)
  85539. c.urlParams_.Set("prettyPrint", "false")
  85540. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  85541. urls += "?" + c.urlParams_.Encode()
  85542. req, err := http.NewRequest("DELETE", urls, body)
  85543. if err != nil {
  85544. return nil, err
  85545. }
  85546. req.Header = reqHeaders
  85547. googleapi.Expand(req.URL, map[string]string{
  85548. "project": c.project,
  85549. "sslPolicy": c.sslPolicy,
  85550. })
  85551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85552. }
  85553. // Do executes the "compute.sslPolicies.delete" call.
  85554. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85555. // status code is an error. Response headers are in either
  85556. // *Operation.ServerResponse.Header or (if a response was returned at
  85557. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85558. // to check whether the returned error was because
  85559. // http.StatusNotModified was returned.
  85560. func (c *SslPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85561. gensupport.SetOptions(c.urlParams_, opts...)
  85562. res, err := c.doRequest("json")
  85563. if res != nil && res.StatusCode == http.StatusNotModified {
  85564. if res.Body != nil {
  85565. res.Body.Close()
  85566. }
  85567. return nil, &googleapi.Error{
  85568. Code: res.StatusCode,
  85569. Header: res.Header,
  85570. }
  85571. }
  85572. if err != nil {
  85573. return nil, err
  85574. }
  85575. defer googleapi.CloseBody(res)
  85576. if err := googleapi.CheckResponse(res); err != nil {
  85577. return nil, err
  85578. }
  85579. ret := &Operation{
  85580. ServerResponse: googleapi.ServerResponse{
  85581. Header: res.Header,
  85582. HTTPStatusCode: res.StatusCode,
  85583. },
  85584. }
  85585. target := &ret
  85586. if err := gensupport.DecodeResponse(target, res); err != nil {
  85587. return nil, err
  85588. }
  85589. return ret, nil
  85590. // {
  85591. // "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.",
  85592. // "httpMethod": "DELETE",
  85593. // "id": "compute.sslPolicies.delete",
  85594. // "parameterOrder": [
  85595. // "project",
  85596. // "sslPolicy"
  85597. // ],
  85598. // "parameters": {
  85599. // "project": {
  85600. // "description": "Project ID for this request.",
  85601. // "location": "path",
  85602. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85603. // "required": true,
  85604. // "type": "string"
  85605. // },
  85606. // "requestId": {
  85607. // "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).",
  85608. // "location": "query",
  85609. // "type": "string"
  85610. // },
  85611. // "sslPolicy": {
  85612. // "description": "Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035.",
  85613. // "location": "path",
  85614. // "required": true,
  85615. // "type": "string"
  85616. // }
  85617. // },
  85618. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  85619. // "response": {
  85620. // "$ref": "Operation"
  85621. // },
  85622. // "scopes": [
  85623. // "https://www.googleapis.com/auth/cloud-platform",
  85624. // "https://www.googleapis.com/auth/compute"
  85625. // ]
  85626. // }
  85627. }
  85628. // method id "compute.sslPolicies.get":
  85629. type SslPoliciesGetCall struct {
  85630. s *Service
  85631. project string
  85632. sslPolicy string
  85633. urlParams_ gensupport.URLParams
  85634. ifNoneMatch_ string
  85635. ctx_ context.Context
  85636. header_ http.Header
  85637. }
  85638. // Get: Lists all of the ordered rules present in a single specified
  85639. // policy.
  85640. func (r *SslPoliciesService) Get(project string, sslPolicy string) *SslPoliciesGetCall {
  85641. c := &SslPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85642. c.project = project
  85643. c.sslPolicy = sslPolicy
  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 *SslPoliciesGetCall) Fields(s ...googleapi.Field) *SslPoliciesGetCall {
  85650. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85651. return c
  85652. }
  85653. // IfNoneMatch sets the optional parameter which makes the operation
  85654. // fail if the object's ETag matches the given value. This is useful for
  85655. // getting updates only after the object has changed since the last
  85656. // request. Use googleapi.IsNotModified to check whether the response
  85657. // error from Do is the result of In-None-Match.
  85658. func (c *SslPoliciesGetCall) IfNoneMatch(entityTag string) *SslPoliciesGetCall {
  85659. c.ifNoneMatch_ = entityTag
  85660. return c
  85661. }
  85662. // Context sets the context to be used in this call's Do method. Any
  85663. // pending HTTP request will be aborted if the provided context is
  85664. // canceled.
  85665. func (c *SslPoliciesGetCall) Context(ctx context.Context) *SslPoliciesGetCall {
  85666. c.ctx_ = ctx
  85667. return c
  85668. }
  85669. // Header returns an http.Header that can be modified by the caller to
  85670. // add HTTP headers to the request.
  85671. func (c *SslPoliciesGetCall) Header() http.Header {
  85672. if c.header_ == nil {
  85673. c.header_ = make(http.Header)
  85674. }
  85675. return c.header_
  85676. }
  85677. func (c *SslPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  85678. reqHeaders := make(http.Header)
  85679. for k, v := range c.header_ {
  85680. reqHeaders[k] = v
  85681. }
  85682. reqHeaders.Set("User-Agent", c.s.userAgent())
  85683. if c.ifNoneMatch_ != "" {
  85684. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  85685. }
  85686. var body io.Reader = nil
  85687. c.urlParams_.Set("alt", alt)
  85688. c.urlParams_.Set("prettyPrint", "false")
  85689. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  85690. urls += "?" + c.urlParams_.Encode()
  85691. req, err := http.NewRequest("GET", urls, body)
  85692. if err != nil {
  85693. return nil, err
  85694. }
  85695. req.Header = reqHeaders
  85696. googleapi.Expand(req.URL, map[string]string{
  85697. "project": c.project,
  85698. "sslPolicy": c.sslPolicy,
  85699. })
  85700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85701. }
  85702. // Do executes the "compute.sslPolicies.get" call.
  85703. // Exactly one of *SslPolicy or error will be non-nil. Any non-2xx
  85704. // status code is an error. Response headers are in either
  85705. // *SslPolicy.ServerResponse.Header or (if a response was returned at
  85706. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85707. // to check whether the returned error was because
  85708. // http.StatusNotModified was returned.
  85709. func (c *SslPoliciesGetCall) Do(opts ...googleapi.CallOption) (*SslPolicy, error) {
  85710. gensupport.SetOptions(c.urlParams_, opts...)
  85711. res, err := c.doRequest("json")
  85712. if res != nil && res.StatusCode == http.StatusNotModified {
  85713. if res.Body != nil {
  85714. res.Body.Close()
  85715. }
  85716. return nil, &googleapi.Error{
  85717. Code: res.StatusCode,
  85718. Header: res.Header,
  85719. }
  85720. }
  85721. if err != nil {
  85722. return nil, err
  85723. }
  85724. defer googleapi.CloseBody(res)
  85725. if err := googleapi.CheckResponse(res); err != nil {
  85726. return nil, err
  85727. }
  85728. ret := &SslPolicy{
  85729. ServerResponse: googleapi.ServerResponse{
  85730. Header: res.Header,
  85731. HTTPStatusCode: res.StatusCode,
  85732. },
  85733. }
  85734. target := &ret
  85735. if err := gensupport.DecodeResponse(target, res); err != nil {
  85736. return nil, err
  85737. }
  85738. return ret, nil
  85739. // {
  85740. // "description": "Lists all of the ordered rules present in a single specified policy.",
  85741. // "httpMethod": "GET",
  85742. // "id": "compute.sslPolicies.get",
  85743. // "parameterOrder": [
  85744. // "project",
  85745. // "sslPolicy"
  85746. // ],
  85747. // "parameters": {
  85748. // "project": {
  85749. // "description": "Project ID for this request.",
  85750. // "location": "path",
  85751. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85752. // "required": true,
  85753. // "type": "string"
  85754. // },
  85755. // "sslPolicy": {
  85756. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  85757. // "location": "path",
  85758. // "required": true,
  85759. // "type": "string"
  85760. // }
  85761. // },
  85762. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  85763. // "response": {
  85764. // "$ref": "SslPolicy"
  85765. // },
  85766. // "scopes": [
  85767. // "https://www.googleapis.com/auth/cloud-platform",
  85768. // "https://www.googleapis.com/auth/compute",
  85769. // "https://www.googleapis.com/auth/compute.readonly"
  85770. // ]
  85771. // }
  85772. }
  85773. // method id "compute.sslPolicies.insert":
  85774. type SslPoliciesInsertCall struct {
  85775. s *Service
  85776. project string
  85777. sslpolicy *SslPolicy
  85778. urlParams_ gensupport.URLParams
  85779. ctx_ context.Context
  85780. header_ http.Header
  85781. }
  85782. // Insert: Returns the specified SSL policy resource. Gets a list of
  85783. // available SSL policies by making a list() request.
  85784. func (r *SslPoliciesService) Insert(project string, sslpolicy *SslPolicy) *SslPoliciesInsertCall {
  85785. c := &SslPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85786. c.project = project
  85787. c.sslpolicy = sslpolicy
  85788. return c
  85789. }
  85790. // RequestId sets the optional parameter "requestId": An optional
  85791. // request ID to identify requests. Specify a unique request ID so that
  85792. // if you must retry your request, the server will know to ignore the
  85793. // request if it has already been completed.
  85794. //
  85795. // For example, consider a situation where you make an initial request
  85796. // and the request times out. If you make the request again with the
  85797. // same request ID, the server can check if original operation with the
  85798. // same request ID was received, and if so, will ignore the second
  85799. // request. This prevents clients from accidentally creating duplicate
  85800. // commitments.
  85801. //
  85802. // The request ID must be a valid UUID with the exception that zero UUID
  85803. // is not supported (00000000-0000-0000-0000-000000000000).
  85804. func (c *SslPoliciesInsertCall) RequestId(requestId string) *SslPoliciesInsertCall {
  85805. c.urlParams_.Set("requestId", requestId)
  85806. return c
  85807. }
  85808. // Fields allows partial responses to be retrieved. See
  85809. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  85810. // for more information.
  85811. func (c *SslPoliciesInsertCall) Fields(s ...googleapi.Field) *SslPoliciesInsertCall {
  85812. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  85813. return c
  85814. }
  85815. // Context sets the context to be used in this call's Do method. Any
  85816. // pending HTTP request will be aborted if the provided context is
  85817. // canceled.
  85818. func (c *SslPoliciesInsertCall) Context(ctx context.Context) *SslPoliciesInsertCall {
  85819. c.ctx_ = ctx
  85820. return c
  85821. }
  85822. // Header returns an http.Header that can be modified by the caller to
  85823. // add HTTP headers to the request.
  85824. func (c *SslPoliciesInsertCall) Header() http.Header {
  85825. if c.header_ == nil {
  85826. c.header_ = make(http.Header)
  85827. }
  85828. return c.header_
  85829. }
  85830. func (c *SslPoliciesInsertCall) doRequest(alt string) (*http.Response, error) {
  85831. reqHeaders := make(http.Header)
  85832. for k, v := range c.header_ {
  85833. reqHeaders[k] = v
  85834. }
  85835. reqHeaders.Set("User-Agent", c.s.userAgent())
  85836. var body io.Reader = nil
  85837. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  85838. if err != nil {
  85839. return nil, err
  85840. }
  85841. reqHeaders.Set("Content-Type", "application/json")
  85842. c.urlParams_.Set("alt", alt)
  85843. c.urlParams_.Set("prettyPrint", "false")
  85844. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  85845. urls += "?" + c.urlParams_.Encode()
  85846. req, err := http.NewRequest("POST", urls, body)
  85847. if err != nil {
  85848. return nil, err
  85849. }
  85850. req.Header = reqHeaders
  85851. googleapi.Expand(req.URL, map[string]string{
  85852. "project": c.project,
  85853. })
  85854. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  85855. }
  85856. // Do executes the "compute.sslPolicies.insert" call.
  85857. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  85858. // status code is an error. Response headers are in either
  85859. // *Operation.ServerResponse.Header or (if a response was returned at
  85860. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  85861. // to check whether the returned error was because
  85862. // http.StatusNotModified was returned.
  85863. func (c *SslPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  85864. gensupport.SetOptions(c.urlParams_, opts...)
  85865. res, err := c.doRequest("json")
  85866. if res != nil && res.StatusCode == http.StatusNotModified {
  85867. if res.Body != nil {
  85868. res.Body.Close()
  85869. }
  85870. return nil, &googleapi.Error{
  85871. Code: res.StatusCode,
  85872. Header: res.Header,
  85873. }
  85874. }
  85875. if err != nil {
  85876. return nil, err
  85877. }
  85878. defer googleapi.CloseBody(res)
  85879. if err := googleapi.CheckResponse(res); err != nil {
  85880. return nil, err
  85881. }
  85882. ret := &Operation{
  85883. ServerResponse: googleapi.ServerResponse{
  85884. Header: res.Header,
  85885. HTTPStatusCode: res.StatusCode,
  85886. },
  85887. }
  85888. target := &ret
  85889. if err := gensupport.DecodeResponse(target, res); err != nil {
  85890. return nil, err
  85891. }
  85892. return ret, nil
  85893. // {
  85894. // "description": "Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request.",
  85895. // "httpMethod": "POST",
  85896. // "id": "compute.sslPolicies.insert",
  85897. // "parameterOrder": [
  85898. // "project"
  85899. // ],
  85900. // "parameters": {
  85901. // "project": {
  85902. // "description": "Project ID for this request.",
  85903. // "location": "path",
  85904. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  85905. // "required": true,
  85906. // "type": "string"
  85907. // },
  85908. // "requestId": {
  85909. // "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).",
  85910. // "location": "query",
  85911. // "type": "string"
  85912. // }
  85913. // },
  85914. // "path": "{project}/global/sslPolicies",
  85915. // "request": {
  85916. // "$ref": "SslPolicy"
  85917. // },
  85918. // "response": {
  85919. // "$ref": "Operation"
  85920. // },
  85921. // "scopes": [
  85922. // "https://www.googleapis.com/auth/cloud-platform",
  85923. // "https://www.googleapis.com/auth/compute"
  85924. // ]
  85925. // }
  85926. }
  85927. // method id "compute.sslPolicies.list":
  85928. type SslPoliciesListCall struct {
  85929. s *Service
  85930. project string
  85931. urlParams_ gensupport.URLParams
  85932. ifNoneMatch_ string
  85933. ctx_ context.Context
  85934. header_ http.Header
  85935. }
  85936. // List: Lists all the SSL policies that have been configured for the
  85937. // specified project.
  85938. func (r *SslPoliciesService) List(project string) *SslPoliciesListCall {
  85939. c := &SslPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  85940. c.project = project
  85941. return c
  85942. }
  85943. // Filter sets the optional parameter "filter": A filter expression that
  85944. // filters resources listed in the response. The expression must specify
  85945. // the field name, a comparison operator, and the value that you want to
  85946. // use for filtering. The value must be a string, a number, or a
  85947. // boolean. The comparison operator must be either =, !=, >, or <.
  85948. //
  85949. // For example, if you are filtering Compute Engine instances, you can
  85950. // exclude instances named example-instance by specifying name !=
  85951. // example-instance.
  85952. //
  85953. // You can also filter nested fields. For example, you could specify
  85954. // scheduling.automaticRestart = false to include instances only if they
  85955. // are not scheduled for automatic restarts. You can use filtering on
  85956. // nested fields to filter based on resource labels.
  85957. //
  85958. // To filter on multiple expressions, provide each separate expression
  85959. // within parentheses. For example, (scheduling.automaticRestart = true)
  85960. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  85961. // AND expression. However, you can include AND and OR expressions
  85962. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  85963. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  85964. // true).
  85965. func (c *SslPoliciesListCall) Filter(filter string) *SslPoliciesListCall {
  85966. c.urlParams_.Set("filter", filter)
  85967. return c
  85968. }
  85969. // MaxResults sets the optional parameter "maxResults": The maximum
  85970. // number of results per page that should be returned. If the number of
  85971. // available results is larger than maxResults, Compute Engine returns a
  85972. // nextPageToken that can be used to get the next page of results in
  85973. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  85974. // (Default: 500)
  85975. func (c *SslPoliciesListCall) MaxResults(maxResults int64) *SslPoliciesListCall {
  85976. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  85977. return c
  85978. }
  85979. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  85980. // a certain order. By default, results are returned in alphanumerical
  85981. // order based on the resource name.
  85982. //
  85983. // You can also sort results in descending order based on the creation
  85984. // timestamp using orderBy="creationTimestamp desc". This sorts results
  85985. // based on the creationTimestamp field in reverse chronological order
  85986. // (newest result first). Use this to sort resources like operations so
  85987. // that the newest operation is returned first.
  85988. //
  85989. // Currently, only sorting by name or creationTimestamp desc is
  85990. // supported.
  85991. func (c *SslPoliciesListCall) OrderBy(orderBy string) *SslPoliciesListCall {
  85992. c.urlParams_.Set("orderBy", orderBy)
  85993. return c
  85994. }
  85995. // PageToken sets the optional parameter "pageToken": Specifies a page
  85996. // token to use. Set pageToken to the nextPageToken returned by a
  85997. // previous list request to get the next page of results.
  85998. func (c *SslPoliciesListCall) PageToken(pageToken string) *SslPoliciesListCall {
  85999. c.urlParams_.Set("pageToken", pageToken)
  86000. return c
  86001. }
  86002. // Fields allows partial responses to be retrieved. See
  86003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86004. // for more information.
  86005. func (c *SslPoliciesListCall) Fields(s ...googleapi.Field) *SslPoliciesListCall {
  86006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86007. return c
  86008. }
  86009. // IfNoneMatch sets the optional parameter which makes the operation
  86010. // fail if the object's ETag matches the given value. This is useful for
  86011. // getting updates only after the object has changed since the last
  86012. // request. Use googleapi.IsNotModified to check whether the response
  86013. // error from Do is the result of In-None-Match.
  86014. func (c *SslPoliciesListCall) IfNoneMatch(entityTag string) *SslPoliciesListCall {
  86015. c.ifNoneMatch_ = entityTag
  86016. return c
  86017. }
  86018. // Context sets the context to be used in this call's Do method. Any
  86019. // pending HTTP request will be aborted if the provided context is
  86020. // canceled.
  86021. func (c *SslPoliciesListCall) Context(ctx context.Context) *SslPoliciesListCall {
  86022. c.ctx_ = ctx
  86023. return c
  86024. }
  86025. // Header returns an http.Header that can be modified by the caller to
  86026. // add HTTP headers to the request.
  86027. func (c *SslPoliciesListCall) Header() http.Header {
  86028. if c.header_ == nil {
  86029. c.header_ = make(http.Header)
  86030. }
  86031. return c.header_
  86032. }
  86033. func (c *SslPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  86034. reqHeaders := make(http.Header)
  86035. for k, v := range c.header_ {
  86036. reqHeaders[k] = v
  86037. }
  86038. reqHeaders.Set("User-Agent", c.s.userAgent())
  86039. if c.ifNoneMatch_ != "" {
  86040. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86041. }
  86042. var body io.Reader = nil
  86043. c.urlParams_.Set("alt", alt)
  86044. c.urlParams_.Set("prettyPrint", "false")
  86045. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies")
  86046. urls += "?" + c.urlParams_.Encode()
  86047. req, err := http.NewRequest("GET", urls, body)
  86048. if err != nil {
  86049. return nil, err
  86050. }
  86051. req.Header = reqHeaders
  86052. googleapi.Expand(req.URL, map[string]string{
  86053. "project": c.project,
  86054. })
  86055. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86056. }
  86057. // Do executes the "compute.sslPolicies.list" call.
  86058. // Exactly one of *SslPoliciesList or error will be non-nil. Any non-2xx
  86059. // status code is an error. Response headers are in either
  86060. // *SslPoliciesList.ServerResponse.Header or (if a response was returned
  86061. // at all) in error.(*googleapi.Error).Header. Use
  86062. // googleapi.IsNotModified to check whether the returned error was
  86063. // because http.StatusNotModified was returned.
  86064. func (c *SslPoliciesListCall) Do(opts ...googleapi.CallOption) (*SslPoliciesList, error) {
  86065. gensupport.SetOptions(c.urlParams_, opts...)
  86066. res, err := c.doRequest("json")
  86067. if res != nil && res.StatusCode == http.StatusNotModified {
  86068. if res.Body != nil {
  86069. res.Body.Close()
  86070. }
  86071. return nil, &googleapi.Error{
  86072. Code: res.StatusCode,
  86073. Header: res.Header,
  86074. }
  86075. }
  86076. if err != nil {
  86077. return nil, err
  86078. }
  86079. defer googleapi.CloseBody(res)
  86080. if err := googleapi.CheckResponse(res); err != nil {
  86081. return nil, err
  86082. }
  86083. ret := &SslPoliciesList{
  86084. ServerResponse: googleapi.ServerResponse{
  86085. Header: res.Header,
  86086. HTTPStatusCode: res.StatusCode,
  86087. },
  86088. }
  86089. target := &ret
  86090. if err := gensupport.DecodeResponse(target, res); err != nil {
  86091. return nil, err
  86092. }
  86093. return ret, nil
  86094. // {
  86095. // "description": "Lists all the SSL policies that have been configured for the specified project.",
  86096. // "httpMethod": "GET",
  86097. // "id": "compute.sslPolicies.list",
  86098. // "parameterOrder": [
  86099. // "project"
  86100. // ],
  86101. // "parameters": {
  86102. // "filter": {
  86103. // "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).",
  86104. // "location": "query",
  86105. // "type": "string"
  86106. // },
  86107. // "maxResults": {
  86108. // "default": "500",
  86109. // "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)",
  86110. // "format": "uint32",
  86111. // "location": "query",
  86112. // "minimum": "0",
  86113. // "type": "integer"
  86114. // },
  86115. // "orderBy": {
  86116. // "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.",
  86117. // "location": "query",
  86118. // "type": "string"
  86119. // },
  86120. // "pageToken": {
  86121. // "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.",
  86122. // "location": "query",
  86123. // "type": "string"
  86124. // },
  86125. // "project": {
  86126. // "description": "Project ID for this request.",
  86127. // "location": "path",
  86128. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86129. // "required": true,
  86130. // "type": "string"
  86131. // }
  86132. // },
  86133. // "path": "{project}/global/sslPolicies",
  86134. // "response": {
  86135. // "$ref": "SslPoliciesList"
  86136. // },
  86137. // "scopes": [
  86138. // "https://www.googleapis.com/auth/cloud-platform",
  86139. // "https://www.googleapis.com/auth/compute",
  86140. // "https://www.googleapis.com/auth/compute.readonly"
  86141. // ]
  86142. // }
  86143. }
  86144. // Pages invokes f for each page of results.
  86145. // A non-nil error returned from f will halt the iteration.
  86146. // The provided context supersedes any context provided to the Context method.
  86147. func (c *SslPoliciesListCall) Pages(ctx context.Context, f func(*SslPoliciesList) error) error {
  86148. c.ctx_ = ctx
  86149. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86150. for {
  86151. x, err := c.Do()
  86152. if err != nil {
  86153. return err
  86154. }
  86155. if err := f(x); err != nil {
  86156. return err
  86157. }
  86158. if x.NextPageToken == "" {
  86159. return nil
  86160. }
  86161. c.PageToken(x.NextPageToken)
  86162. }
  86163. }
  86164. // method id "compute.sslPolicies.listAvailableFeatures":
  86165. type SslPoliciesListAvailableFeaturesCall struct {
  86166. s *Service
  86167. project string
  86168. urlParams_ gensupport.URLParams
  86169. ifNoneMatch_ string
  86170. ctx_ context.Context
  86171. header_ http.Header
  86172. }
  86173. // ListAvailableFeatures: Lists all features that can be specified in
  86174. // the SSL policy when using custom profile.
  86175. func (r *SslPoliciesService) ListAvailableFeatures(project string) *SslPoliciesListAvailableFeaturesCall {
  86176. c := &SslPoliciesListAvailableFeaturesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86177. c.project = project
  86178. return c
  86179. }
  86180. // Filter sets the optional parameter "filter": A filter expression that
  86181. // filters resources listed in the response. The expression must specify
  86182. // the field name, a comparison operator, and the value that you want to
  86183. // use for filtering. The value must be a string, a number, or a
  86184. // boolean. The comparison operator must be either =, !=, >, or <.
  86185. //
  86186. // For example, if you are filtering Compute Engine instances, you can
  86187. // exclude instances named example-instance by specifying name !=
  86188. // example-instance.
  86189. //
  86190. // You can also filter nested fields. For example, you could specify
  86191. // scheduling.automaticRestart = false to include instances only if they
  86192. // are not scheduled for automatic restarts. You can use filtering on
  86193. // nested fields to filter based on resource labels.
  86194. //
  86195. // To filter on multiple expressions, provide each separate expression
  86196. // within parentheses. For example, (scheduling.automaticRestart = true)
  86197. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86198. // AND expression. However, you can include AND and OR expressions
  86199. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86200. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86201. // true).
  86202. func (c *SslPoliciesListAvailableFeaturesCall) Filter(filter string) *SslPoliciesListAvailableFeaturesCall {
  86203. c.urlParams_.Set("filter", filter)
  86204. return c
  86205. }
  86206. // MaxResults sets the optional parameter "maxResults": The maximum
  86207. // number of results per page that should be returned. If the number of
  86208. // available results is larger than maxResults, Compute Engine returns a
  86209. // nextPageToken that can be used to get the next page of results in
  86210. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86211. // (Default: 500)
  86212. func (c *SslPoliciesListAvailableFeaturesCall) MaxResults(maxResults int64) *SslPoliciesListAvailableFeaturesCall {
  86213. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86214. return c
  86215. }
  86216. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86217. // a certain order. By default, results are returned in alphanumerical
  86218. // order based on the resource name.
  86219. //
  86220. // You can also sort results in descending order based on the creation
  86221. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86222. // based on the creationTimestamp field in reverse chronological order
  86223. // (newest result first). Use this to sort resources like operations so
  86224. // that the newest operation is returned first.
  86225. //
  86226. // Currently, only sorting by name or creationTimestamp desc is
  86227. // supported.
  86228. func (c *SslPoliciesListAvailableFeaturesCall) OrderBy(orderBy string) *SslPoliciesListAvailableFeaturesCall {
  86229. c.urlParams_.Set("orderBy", orderBy)
  86230. return c
  86231. }
  86232. // PageToken sets the optional parameter "pageToken": Specifies a page
  86233. // token to use. Set pageToken to the nextPageToken returned by a
  86234. // previous list request to get the next page of results.
  86235. func (c *SslPoliciesListAvailableFeaturesCall) PageToken(pageToken string) *SslPoliciesListAvailableFeaturesCall {
  86236. c.urlParams_.Set("pageToken", pageToken)
  86237. return c
  86238. }
  86239. // Fields allows partial responses to be retrieved. See
  86240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86241. // for more information.
  86242. func (c *SslPoliciesListAvailableFeaturesCall) Fields(s ...googleapi.Field) *SslPoliciesListAvailableFeaturesCall {
  86243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86244. return c
  86245. }
  86246. // IfNoneMatch sets the optional parameter which makes the operation
  86247. // fail if the object's ETag matches the given value. This is useful for
  86248. // getting updates only after the object has changed since the last
  86249. // request. Use googleapi.IsNotModified to check whether the response
  86250. // error from Do is the result of In-None-Match.
  86251. func (c *SslPoliciesListAvailableFeaturesCall) IfNoneMatch(entityTag string) *SslPoliciesListAvailableFeaturesCall {
  86252. c.ifNoneMatch_ = entityTag
  86253. return c
  86254. }
  86255. // Context sets the context to be used in this call's Do method. Any
  86256. // pending HTTP request will be aborted if the provided context is
  86257. // canceled.
  86258. func (c *SslPoliciesListAvailableFeaturesCall) Context(ctx context.Context) *SslPoliciesListAvailableFeaturesCall {
  86259. c.ctx_ = ctx
  86260. return c
  86261. }
  86262. // Header returns an http.Header that can be modified by the caller to
  86263. // add HTTP headers to the request.
  86264. func (c *SslPoliciesListAvailableFeaturesCall) Header() http.Header {
  86265. if c.header_ == nil {
  86266. c.header_ = make(http.Header)
  86267. }
  86268. return c.header_
  86269. }
  86270. func (c *SslPoliciesListAvailableFeaturesCall) doRequest(alt string) (*http.Response, error) {
  86271. reqHeaders := make(http.Header)
  86272. for k, v := range c.header_ {
  86273. reqHeaders[k] = v
  86274. }
  86275. reqHeaders.Set("User-Agent", c.s.userAgent())
  86276. if c.ifNoneMatch_ != "" {
  86277. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86278. }
  86279. var body io.Reader = nil
  86280. c.urlParams_.Set("alt", alt)
  86281. c.urlParams_.Set("prettyPrint", "false")
  86282. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/listAvailableFeatures")
  86283. urls += "?" + c.urlParams_.Encode()
  86284. req, err := http.NewRequest("GET", urls, body)
  86285. if err != nil {
  86286. return nil, err
  86287. }
  86288. req.Header = reqHeaders
  86289. googleapi.Expand(req.URL, map[string]string{
  86290. "project": c.project,
  86291. })
  86292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86293. }
  86294. // Do executes the "compute.sslPolicies.listAvailableFeatures" call.
  86295. // Exactly one of *SslPoliciesListAvailableFeaturesResponse or error
  86296. // will be non-nil. Any non-2xx status code is an error. Response
  86297. // headers are in either
  86298. // *SslPoliciesListAvailableFeaturesResponse.ServerResponse.Header or
  86299. // (if a response was returned at all) in
  86300. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  86301. // whether the returned error was because http.StatusNotModified was
  86302. // returned.
  86303. func (c *SslPoliciesListAvailableFeaturesCall) Do(opts ...googleapi.CallOption) (*SslPoliciesListAvailableFeaturesResponse, error) {
  86304. gensupport.SetOptions(c.urlParams_, opts...)
  86305. res, err := c.doRequest("json")
  86306. if res != nil && res.StatusCode == http.StatusNotModified {
  86307. if res.Body != nil {
  86308. res.Body.Close()
  86309. }
  86310. return nil, &googleapi.Error{
  86311. Code: res.StatusCode,
  86312. Header: res.Header,
  86313. }
  86314. }
  86315. if err != nil {
  86316. return nil, err
  86317. }
  86318. defer googleapi.CloseBody(res)
  86319. if err := googleapi.CheckResponse(res); err != nil {
  86320. return nil, err
  86321. }
  86322. ret := &SslPoliciesListAvailableFeaturesResponse{
  86323. ServerResponse: googleapi.ServerResponse{
  86324. Header: res.Header,
  86325. HTTPStatusCode: res.StatusCode,
  86326. },
  86327. }
  86328. target := &ret
  86329. if err := gensupport.DecodeResponse(target, res); err != nil {
  86330. return nil, err
  86331. }
  86332. return ret, nil
  86333. // {
  86334. // "description": "Lists all features that can be specified in the SSL policy when using custom profile.",
  86335. // "httpMethod": "GET",
  86336. // "id": "compute.sslPolicies.listAvailableFeatures",
  86337. // "parameterOrder": [
  86338. // "project"
  86339. // ],
  86340. // "parameters": {
  86341. // "filter": {
  86342. // "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).",
  86343. // "location": "query",
  86344. // "type": "string"
  86345. // },
  86346. // "maxResults": {
  86347. // "default": "500",
  86348. // "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)",
  86349. // "format": "uint32",
  86350. // "location": "query",
  86351. // "minimum": "0",
  86352. // "type": "integer"
  86353. // },
  86354. // "orderBy": {
  86355. // "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.",
  86356. // "location": "query",
  86357. // "type": "string"
  86358. // },
  86359. // "pageToken": {
  86360. // "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.",
  86361. // "location": "query",
  86362. // "type": "string"
  86363. // },
  86364. // "project": {
  86365. // "description": "Project ID for this request.",
  86366. // "location": "path",
  86367. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86368. // "required": true,
  86369. // "type": "string"
  86370. // }
  86371. // },
  86372. // "path": "{project}/global/sslPolicies/listAvailableFeatures",
  86373. // "response": {
  86374. // "$ref": "SslPoliciesListAvailableFeaturesResponse"
  86375. // },
  86376. // "scopes": [
  86377. // "https://www.googleapis.com/auth/cloud-platform",
  86378. // "https://www.googleapis.com/auth/compute",
  86379. // "https://www.googleapis.com/auth/compute.readonly"
  86380. // ]
  86381. // }
  86382. }
  86383. // method id "compute.sslPolicies.patch":
  86384. type SslPoliciesPatchCall struct {
  86385. s *Service
  86386. project string
  86387. sslPolicy string
  86388. sslpolicy *SslPolicy
  86389. urlParams_ gensupport.URLParams
  86390. ctx_ context.Context
  86391. header_ http.Header
  86392. }
  86393. // Patch: Patches the specified SSL policy with the data included in the
  86394. // request.
  86395. func (r *SslPoliciesService) Patch(project string, sslPolicy string, sslpolicy *SslPolicy) *SslPoliciesPatchCall {
  86396. c := &SslPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86397. c.project = project
  86398. c.sslPolicy = sslPolicy
  86399. c.sslpolicy = sslpolicy
  86400. return c
  86401. }
  86402. // RequestId sets the optional parameter "requestId": An optional
  86403. // request ID to identify requests. Specify a unique request ID so that
  86404. // if you must retry your request, the server will know to ignore the
  86405. // request if it has already been completed.
  86406. //
  86407. // For example, consider a situation where you make an initial request
  86408. // and the request times out. If you make the request again with the
  86409. // same request ID, the server can check if original operation with the
  86410. // same request ID was received, and if so, will ignore the second
  86411. // request. This prevents clients from accidentally creating duplicate
  86412. // commitments.
  86413. //
  86414. // The request ID must be a valid UUID with the exception that zero UUID
  86415. // is not supported (00000000-0000-0000-0000-000000000000).
  86416. func (c *SslPoliciesPatchCall) RequestId(requestId string) *SslPoliciesPatchCall {
  86417. c.urlParams_.Set("requestId", requestId)
  86418. return c
  86419. }
  86420. // Fields allows partial responses to be retrieved. See
  86421. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86422. // for more information.
  86423. func (c *SslPoliciesPatchCall) Fields(s ...googleapi.Field) *SslPoliciesPatchCall {
  86424. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86425. return c
  86426. }
  86427. // Context sets the context to be used in this call's Do method. Any
  86428. // pending HTTP request will be aborted if the provided context is
  86429. // canceled.
  86430. func (c *SslPoliciesPatchCall) Context(ctx context.Context) *SslPoliciesPatchCall {
  86431. c.ctx_ = ctx
  86432. return c
  86433. }
  86434. // Header returns an http.Header that can be modified by the caller to
  86435. // add HTTP headers to the request.
  86436. func (c *SslPoliciesPatchCall) Header() http.Header {
  86437. if c.header_ == nil {
  86438. c.header_ = make(http.Header)
  86439. }
  86440. return c.header_
  86441. }
  86442. func (c *SslPoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  86443. reqHeaders := make(http.Header)
  86444. for k, v := range c.header_ {
  86445. reqHeaders[k] = v
  86446. }
  86447. reqHeaders.Set("User-Agent", c.s.userAgent())
  86448. var body io.Reader = nil
  86449. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicy)
  86450. if err != nil {
  86451. return nil, err
  86452. }
  86453. reqHeaders.Set("Content-Type", "application/json")
  86454. c.urlParams_.Set("alt", alt)
  86455. c.urlParams_.Set("prettyPrint", "false")
  86456. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslPolicies/{sslPolicy}")
  86457. urls += "?" + c.urlParams_.Encode()
  86458. req, err := http.NewRequest("PATCH", urls, body)
  86459. if err != nil {
  86460. return nil, err
  86461. }
  86462. req.Header = reqHeaders
  86463. googleapi.Expand(req.URL, map[string]string{
  86464. "project": c.project,
  86465. "sslPolicy": c.sslPolicy,
  86466. })
  86467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86468. }
  86469. // Do executes the "compute.sslPolicies.patch" call.
  86470. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86471. // status code is an error. Response headers are in either
  86472. // *Operation.ServerResponse.Header or (if a response was returned at
  86473. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86474. // to check whether the returned error was because
  86475. // http.StatusNotModified was returned.
  86476. func (c *SslPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86477. gensupport.SetOptions(c.urlParams_, opts...)
  86478. res, err := c.doRequest("json")
  86479. if res != nil && res.StatusCode == http.StatusNotModified {
  86480. if res.Body != nil {
  86481. res.Body.Close()
  86482. }
  86483. return nil, &googleapi.Error{
  86484. Code: res.StatusCode,
  86485. Header: res.Header,
  86486. }
  86487. }
  86488. if err != nil {
  86489. return nil, err
  86490. }
  86491. defer googleapi.CloseBody(res)
  86492. if err := googleapi.CheckResponse(res); err != nil {
  86493. return nil, err
  86494. }
  86495. ret := &Operation{
  86496. ServerResponse: googleapi.ServerResponse{
  86497. Header: res.Header,
  86498. HTTPStatusCode: res.StatusCode,
  86499. },
  86500. }
  86501. target := &ret
  86502. if err := gensupport.DecodeResponse(target, res); err != nil {
  86503. return nil, err
  86504. }
  86505. return ret, nil
  86506. // {
  86507. // "description": "Patches the specified SSL policy with the data included in the request.",
  86508. // "httpMethod": "PATCH",
  86509. // "id": "compute.sslPolicies.patch",
  86510. // "parameterOrder": [
  86511. // "project",
  86512. // "sslPolicy"
  86513. // ],
  86514. // "parameters": {
  86515. // "project": {
  86516. // "description": "Project ID for this request.",
  86517. // "location": "path",
  86518. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86519. // "required": true,
  86520. // "type": "string"
  86521. // },
  86522. // "requestId": {
  86523. // "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).",
  86524. // "location": "query",
  86525. // "type": "string"
  86526. // },
  86527. // "sslPolicy": {
  86528. // "description": "Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035.",
  86529. // "location": "path",
  86530. // "required": true,
  86531. // "type": "string"
  86532. // }
  86533. // },
  86534. // "path": "{project}/global/sslPolicies/{sslPolicy}",
  86535. // "request": {
  86536. // "$ref": "SslPolicy"
  86537. // },
  86538. // "response": {
  86539. // "$ref": "Operation"
  86540. // },
  86541. // "scopes": [
  86542. // "https://www.googleapis.com/auth/cloud-platform",
  86543. // "https://www.googleapis.com/auth/compute"
  86544. // ]
  86545. // }
  86546. }
  86547. // method id "compute.subnetworks.aggregatedList":
  86548. type SubnetworksAggregatedListCall struct {
  86549. s *Service
  86550. project string
  86551. urlParams_ gensupport.URLParams
  86552. ifNoneMatch_ string
  86553. ctx_ context.Context
  86554. header_ http.Header
  86555. }
  86556. // AggregatedList: Retrieves an aggregated list of subnetworks.
  86557. func (r *SubnetworksService) AggregatedList(project string) *SubnetworksAggregatedListCall {
  86558. c := &SubnetworksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86559. c.project = project
  86560. return c
  86561. }
  86562. // Filter sets the optional parameter "filter": A filter expression that
  86563. // filters resources listed in the response. The expression must specify
  86564. // the field name, a comparison operator, and the value that you want to
  86565. // use for filtering. The value must be a string, a number, or a
  86566. // boolean. The comparison operator must be either =, !=, >, or <.
  86567. //
  86568. // For example, if you are filtering Compute Engine instances, you can
  86569. // exclude instances named example-instance by specifying name !=
  86570. // example-instance.
  86571. //
  86572. // You can also filter nested fields. For example, you could specify
  86573. // scheduling.automaticRestart = false to include instances only if they
  86574. // are not scheduled for automatic restarts. You can use filtering on
  86575. // nested fields to filter based on resource labels.
  86576. //
  86577. // To filter on multiple expressions, provide each separate expression
  86578. // within parentheses. For example, (scheduling.automaticRestart = true)
  86579. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  86580. // AND expression. However, you can include AND and OR expressions
  86581. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  86582. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  86583. // true).
  86584. func (c *SubnetworksAggregatedListCall) Filter(filter string) *SubnetworksAggregatedListCall {
  86585. c.urlParams_.Set("filter", filter)
  86586. return c
  86587. }
  86588. // MaxResults sets the optional parameter "maxResults": The maximum
  86589. // number of results per page that should be returned. If the number of
  86590. // available results is larger than maxResults, Compute Engine returns a
  86591. // nextPageToken that can be used to get the next page of results in
  86592. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  86593. // (Default: 500)
  86594. func (c *SubnetworksAggregatedListCall) MaxResults(maxResults int64) *SubnetworksAggregatedListCall {
  86595. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  86596. return c
  86597. }
  86598. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  86599. // a certain order. By default, results are returned in alphanumerical
  86600. // order based on the resource name.
  86601. //
  86602. // You can also sort results in descending order based on the creation
  86603. // timestamp using orderBy="creationTimestamp desc". This sorts results
  86604. // based on the creationTimestamp field in reverse chronological order
  86605. // (newest result first). Use this to sort resources like operations so
  86606. // that the newest operation is returned first.
  86607. //
  86608. // Currently, only sorting by name or creationTimestamp desc is
  86609. // supported.
  86610. func (c *SubnetworksAggregatedListCall) OrderBy(orderBy string) *SubnetworksAggregatedListCall {
  86611. c.urlParams_.Set("orderBy", orderBy)
  86612. return c
  86613. }
  86614. // PageToken sets the optional parameter "pageToken": Specifies a page
  86615. // token to use. Set pageToken to the nextPageToken returned by a
  86616. // previous list request to get the next page of results.
  86617. func (c *SubnetworksAggregatedListCall) PageToken(pageToken string) *SubnetworksAggregatedListCall {
  86618. c.urlParams_.Set("pageToken", pageToken)
  86619. return c
  86620. }
  86621. // Fields allows partial responses to be retrieved. See
  86622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86623. // for more information.
  86624. func (c *SubnetworksAggregatedListCall) Fields(s ...googleapi.Field) *SubnetworksAggregatedListCall {
  86625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86626. return c
  86627. }
  86628. // IfNoneMatch sets the optional parameter which makes the operation
  86629. // fail if the object's ETag matches the given value. This is useful for
  86630. // getting updates only after the object has changed since the last
  86631. // request. Use googleapi.IsNotModified to check whether the response
  86632. // error from Do is the result of In-None-Match.
  86633. func (c *SubnetworksAggregatedListCall) IfNoneMatch(entityTag string) *SubnetworksAggregatedListCall {
  86634. c.ifNoneMatch_ = entityTag
  86635. return c
  86636. }
  86637. // Context sets the context to be used in this call's Do method. Any
  86638. // pending HTTP request will be aborted if the provided context is
  86639. // canceled.
  86640. func (c *SubnetworksAggregatedListCall) Context(ctx context.Context) *SubnetworksAggregatedListCall {
  86641. c.ctx_ = ctx
  86642. return c
  86643. }
  86644. // Header returns an http.Header that can be modified by the caller to
  86645. // add HTTP headers to the request.
  86646. func (c *SubnetworksAggregatedListCall) Header() http.Header {
  86647. if c.header_ == nil {
  86648. c.header_ = make(http.Header)
  86649. }
  86650. return c.header_
  86651. }
  86652. func (c *SubnetworksAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  86653. reqHeaders := make(http.Header)
  86654. for k, v := range c.header_ {
  86655. reqHeaders[k] = v
  86656. }
  86657. reqHeaders.Set("User-Agent", c.s.userAgent())
  86658. if c.ifNoneMatch_ != "" {
  86659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  86660. }
  86661. var body io.Reader = nil
  86662. c.urlParams_.Set("alt", alt)
  86663. c.urlParams_.Set("prettyPrint", "false")
  86664. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks")
  86665. urls += "?" + c.urlParams_.Encode()
  86666. req, err := http.NewRequest("GET", urls, body)
  86667. if err != nil {
  86668. return nil, err
  86669. }
  86670. req.Header = reqHeaders
  86671. googleapi.Expand(req.URL, map[string]string{
  86672. "project": c.project,
  86673. })
  86674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86675. }
  86676. // Do executes the "compute.subnetworks.aggregatedList" call.
  86677. // Exactly one of *SubnetworkAggregatedList or error will be non-nil.
  86678. // Any non-2xx status code is an error. Response headers are in either
  86679. // *SubnetworkAggregatedList.ServerResponse.Header or (if a response was
  86680. // returned at all) in error.(*googleapi.Error).Header. Use
  86681. // googleapi.IsNotModified to check whether the returned error was
  86682. // because http.StatusNotModified was returned.
  86683. func (c *SubnetworksAggregatedListCall) Do(opts ...googleapi.CallOption) (*SubnetworkAggregatedList, error) {
  86684. gensupport.SetOptions(c.urlParams_, opts...)
  86685. res, err := c.doRequest("json")
  86686. if res != nil && res.StatusCode == http.StatusNotModified {
  86687. if res.Body != nil {
  86688. res.Body.Close()
  86689. }
  86690. return nil, &googleapi.Error{
  86691. Code: res.StatusCode,
  86692. Header: res.Header,
  86693. }
  86694. }
  86695. if err != nil {
  86696. return nil, err
  86697. }
  86698. defer googleapi.CloseBody(res)
  86699. if err := googleapi.CheckResponse(res); err != nil {
  86700. return nil, err
  86701. }
  86702. ret := &SubnetworkAggregatedList{
  86703. ServerResponse: googleapi.ServerResponse{
  86704. Header: res.Header,
  86705. HTTPStatusCode: res.StatusCode,
  86706. },
  86707. }
  86708. target := &ret
  86709. if err := gensupport.DecodeResponse(target, res); err != nil {
  86710. return nil, err
  86711. }
  86712. return ret, nil
  86713. // {
  86714. // "description": "Retrieves an aggregated list of subnetworks.",
  86715. // "httpMethod": "GET",
  86716. // "id": "compute.subnetworks.aggregatedList",
  86717. // "parameterOrder": [
  86718. // "project"
  86719. // ],
  86720. // "parameters": {
  86721. // "filter": {
  86722. // "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).",
  86723. // "location": "query",
  86724. // "type": "string"
  86725. // },
  86726. // "maxResults": {
  86727. // "default": "500",
  86728. // "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)",
  86729. // "format": "uint32",
  86730. // "location": "query",
  86731. // "minimum": "0",
  86732. // "type": "integer"
  86733. // },
  86734. // "orderBy": {
  86735. // "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.",
  86736. // "location": "query",
  86737. // "type": "string"
  86738. // },
  86739. // "pageToken": {
  86740. // "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.",
  86741. // "location": "query",
  86742. // "type": "string"
  86743. // },
  86744. // "project": {
  86745. // "description": "Project ID for this request.",
  86746. // "location": "path",
  86747. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86748. // "required": true,
  86749. // "type": "string"
  86750. // }
  86751. // },
  86752. // "path": "{project}/aggregated/subnetworks",
  86753. // "response": {
  86754. // "$ref": "SubnetworkAggregatedList"
  86755. // },
  86756. // "scopes": [
  86757. // "https://www.googleapis.com/auth/cloud-platform",
  86758. // "https://www.googleapis.com/auth/compute",
  86759. // "https://www.googleapis.com/auth/compute.readonly"
  86760. // ]
  86761. // }
  86762. }
  86763. // Pages invokes f for each page of results.
  86764. // A non-nil error returned from f will halt the iteration.
  86765. // The provided context supersedes any context provided to the Context method.
  86766. func (c *SubnetworksAggregatedListCall) Pages(ctx context.Context, f func(*SubnetworkAggregatedList) error) error {
  86767. c.ctx_ = ctx
  86768. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  86769. for {
  86770. x, err := c.Do()
  86771. if err != nil {
  86772. return err
  86773. }
  86774. if err := f(x); err != nil {
  86775. return err
  86776. }
  86777. if x.NextPageToken == "" {
  86778. return nil
  86779. }
  86780. c.PageToken(x.NextPageToken)
  86781. }
  86782. }
  86783. // method id "compute.subnetworks.delete":
  86784. type SubnetworksDeleteCall struct {
  86785. s *Service
  86786. project string
  86787. region string
  86788. subnetwork string
  86789. urlParams_ gensupport.URLParams
  86790. ctx_ context.Context
  86791. header_ http.Header
  86792. }
  86793. // Delete: Deletes the specified subnetwork.
  86794. func (r *SubnetworksService) Delete(project string, region string, subnetwork string) *SubnetworksDeleteCall {
  86795. c := &SubnetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86796. c.project = project
  86797. c.region = region
  86798. c.subnetwork = subnetwork
  86799. return c
  86800. }
  86801. // RequestId sets the optional parameter "requestId": An optional
  86802. // request ID to identify requests. Specify a unique request ID so that
  86803. // if you must retry your request, the server will know to ignore the
  86804. // request if it has already been completed.
  86805. //
  86806. // For example, consider a situation where you make an initial request
  86807. // and the request times out. If you make the request again with the
  86808. // same request ID, the server can check if original operation with the
  86809. // same request ID was received, and if so, will ignore the second
  86810. // request. This prevents clients from accidentally creating duplicate
  86811. // commitments.
  86812. //
  86813. // The request ID must be a valid UUID with the exception that zero UUID
  86814. // is not supported (00000000-0000-0000-0000-000000000000).
  86815. func (c *SubnetworksDeleteCall) RequestId(requestId string) *SubnetworksDeleteCall {
  86816. c.urlParams_.Set("requestId", requestId)
  86817. return c
  86818. }
  86819. // Fields allows partial responses to be retrieved. See
  86820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86821. // for more information.
  86822. func (c *SubnetworksDeleteCall) Fields(s ...googleapi.Field) *SubnetworksDeleteCall {
  86823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86824. return c
  86825. }
  86826. // Context sets the context to be used in this call's Do method. Any
  86827. // pending HTTP request will be aborted if the provided context is
  86828. // canceled.
  86829. func (c *SubnetworksDeleteCall) Context(ctx context.Context) *SubnetworksDeleteCall {
  86830. c.ctx_ = ctx
  86831. return c
  86832. }
  86833. // Header returns an http.Header that can be modified by the caller to
  86834. // add HTTP headers to the request.
  86835. func (c *SubnetworksDeleteCall) Header() http.Header {
  86836. if c.header_ == nil {
  86837. c.header_ = make(http.Header)
  86838. }
  86839. return c.header_
  86840. }
  86841. func (c *SubnetworksDeleteCall) doRequest(alt string) (*http.Response, error) {
  86842. reqHeaders := make(http.Header)
  86843. for k, v := range c.header_ {
  86844. reqHeaders[k] = v
  86845. }
  86846. reqHeaders.Set("User-Agent", c.s.userAgent())
  86847. var body io.Reader = nil
  86848. c.urlParams_.Set("alt", alt)
  86849. c.urlParams_.Set("prettyPrint", "false")
  86850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  86851. urls += "?" + c.urlParams_.Encode()
  86852. req, err := http.NewRequest("DELETE", urls, body)
  86853. if err != nil {
  86854. return nil, err
  86855. }
  86856. req.Header = reqHeaders
  86857. googleapi.Expand(req.URL, map[string]string{
  86858. "project": c.project,
  86859. "region": c.region,
  86860. "subnetwork": c.subnetwork,
  86861. })
  86862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  86863. }
  86864. // Do executes the "compute.subnetworks.delete" call.
  86865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  86866. // status code is an error. Response headers are in either
  86867. // *Operation.ServerResponse.Header or (if a response was returned at
  86868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  86869. // to check whether the returned error was because
  86870. // http.StatusNotModified was returned.
  86871. func (c *SubnetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  86872. gensupport.SetOptions(c.urlParams_, opts...)
  86873. res, err := c.doRequest("json")
  86874. if res != nil && res.StatusCode == http.StatusNotModified {
  86875. if res.Body != nil {
  86876. res.Body.Close()
  86877. }
  86878. return nil, &googleapi.Error{
  86879. Code: res.StatusCode,
  86880. Header: res.Header,
  86881. }
  86882. }
  86883. if err != nil {
  86884. return nil, err
  86885. }
  86886. defer googleapi.CloseBody(res)
  86887. if err := googleapi.CheckResponse(res); err != nil {
  86888. return nil, err
  86889. }
  86890. ret := &Operation{
  86891. ServerResponse: googleapi.ServerResponse{
  86892. Header: res.Header,
  86893. HTTPStatusCode: res.StatusCode,
  86894. },
  86895. }
  86896. target := &ret
  86897. if err := gensupport.DecodeResponse(target, res); err != nil {
  86898. return nil, err
  86899. }
  86900. return ret, nil
  86901. // {
  86902. // "description": "Deletes the specified subnetwork.",
  86903. // "httpMethod": "DELETE",
  86904. // "id": "compute.subnetworks.delete",
  86905. // "parameterOrder": [
  86906. // "project",
  86907. // "region",
  86908. // "subnetwork"
  86909. // ],
  86910. // "parameters": {
  86911. // "project": {
  86912. // "description": "Project ID for this request.",
  86913. // "location": "path",
  86914. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  86915. // "required": true,
  86916. // "type": "string"
  86917. // },
  86918. // "region": {
  86919. // "description": "Name of the region scoping this request.",
  86920. // "location": "path",
  86921. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  86922. // "required": true,
  86923. // "type": "string"
  86924. // },
  86925. // "requestId": {
  86926. // "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).",
  86927. // "location": "query",
  86928. // "type": "string"
  86929. // },
  86930. // "subnetwork": {
  86931. // "description": "Name of the Subnetwork resource to delete.",
  86932. // "location": "path",
  86933. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  86934. // "required": true,
  86935. // "type": "string"
  86936. // }
  86937. // },
  86938. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  86939. // "response": {
  86940. // "$ref": "Operation"
  86941. // },
  86942. // "scopes": [
  86943. // "https://www.googleapis.com/auth/cloud-platform",
  86944. // "https://www.googleapis.com/auth/compute"
  86945. // ]
  86946. // }
  86947. }
  86948. // method id "compute.subnetworks.expandIpCidrRange":
  86949. type SubnetworksExpandIpCidrRangeCall struct {
  86950. s *Service
  86951. project string
  86952. region string
  86953. subnetwork string
  86954. subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest
  86955. urlParams_ gensupport.URLParams
  86956. ctx_ context.Context
  86957. header_ http.Header
  86958. }
  86959. // ExpandIpCidrRange: Expands the IP CIDR range of the subnetwork to a
  86960. // specified value.
  86961. func (r *SubnetworksService) ExpandIpCidrRange(project string, region string, subnetwork string, subnetworksexpandipcidrrangerequest *SubnetworksExpandIpCidrRangeRequest) *SubnetworksExpandIpCidrRangeCall {
  86962. c := &SubnetworksExpandIpCidrRangeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  86963. c.project = project
  86964. c.region = region
  86965. c.subnetwork = subnetwork
  86966. c.subnetworksexpandipcidrrangerequest = subnetworksexpandipcidrrangerequest
  86967. return c
  86968. }
  86969. // RequestId sets the optional parameter "requestId": An optional
  86970. // request ID to identify requests. Specify a unique request ID so that
  86971. // if you must retry your request, the server will know to ignore the
  86972. // request if it has already been completed.
  86973. //
  86974. // For example, consider a situation where you make an initial request
  86975. // and the request times out. If you make the request again with the
  86976. // same request ID, the server can check if original operation with the
  86977. // same request ID was received, and if so, will ignore the second
  86978. // request. This prevents clients from accidentally creating duplicate
  86979. // commitments.
  86980. //
  86981. // The request ID must be a valid UUID with the exception that zero UUID
  86982. // is not supported (00000000-0000-0000-0000-000000000000).
  86983. func (c *SubnetworksExpandIpCidrRangeCall) RequestId(requestId string) *SubnetworksExpandIpCidrRangeCall {
  86984. c.urlParams_.Set("requestId", requestId)
  86985. return c
  86986. }
  86987. // Fields allows partial responses to be retrieved. See
  86988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  86989. // for more information.
  86990. func (c *SubnetworksExpandIpCidrRangeCall) Fields(s ...googleapi.Field) *SubnetworksExpandIpCidrRangeCall {
  86991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  86992. return c
  86993. }
  86994. // Context sets the context to be used in this call's Do method. Any
  86995. // pending HTTP request will be aborted if the provided context is
  86996. // canceled.
  86997. func (c *SubnetworksExpandIpCidrRangeCall) Context(ctx context.Context) *SubnetworksExpandIpCidrRangeCall {
  86998. c.ctx_ = ctx
  86999. return c
  87000. }
  87001. // Header returns an http.Header that can be modified by the caller to
  87002. // add HTTP headers to the request.
  87003. func (c *SubnetworksExpandIpCidrRangeCall) Header() http.Header {
  87004. if c.header_ == nil {
  87005. c.header_ = make(http.Header)
  87006. }
  87007. return c.header_
  87008. }
  87009. func (c *SubnetworksExpandIpCidrRangeCall) doRequest(alt string) (*http.Response, error) {
  87010. reqHeaders := make(http.Header)
  87011. for k, v := range c.header_ {
  87012. reqHeaders[k] = v
  87013. }
  87014. reqHeaders.Set("User-Agent", c.s.userAgent())
  87015. var body io.Reader = nil
  87016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworksexpandipcidrrangerequest)
  87017. if err != nil {
  87018. return nil, err
  87019. }
  87020. reqHeaders.Set("Content-Type", "application/json")
  87021. c.urlParams_.Set("alt", alt)
  87022. c.urlParams_.Set("prettyPrint", "false")
  87023. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange")
  87024. urls += "?" + c.urlParams_.Encode()
  87025. req, err := http.NewRequest("POST", urls, body)
  87026. if err != nil {
  87027. return nil, err
  87028. }
  87029. req.Header = reqHeaders
  87030. googleapi.Expand(req.URL, map[string]string{
  87031. "project": c.project,
  87032. "region": c.region,
  87033. "subnetwork": c.subnetwork,
  87034. })
  87035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87036. }
  87037. // Do executes the "compute.subnetworks.expandIpCidrRange" call.
  87038. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87039. // status code is an error. Response headers are in either
  87040. // *Operation.ServerResponse.Header or (if a response was returned at
  87041. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87042. // to check whether the returned error was because
  87043. // http.StatusNotModified was returned.
  87044. func (c *SubnetworksExpandIpCidrRangeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87045. gensupport.SetOptions(c.urlParams_, opts...)
  87046. res, err := c.doRequest("json")
  87047. if res != nil && res.StatusCode == http.StatusNotModified {
  87048. if res.Body != nil {
  87049. res.Body.Close()
  87050. }
  87051. return nil, &googleapi.Error{
  87052. Code: res.StatusCode,
  87053. Header: res.Header,
  87054. }
  87055. }
  87056. if err != nil {
  87057. return nil, err
  87058. }
  87059. defer googleapi.CloseBody(res)
  87060. if err := googleapi.CheckResponse(res); err != nil {
  87061. return nil, err
  87062. }
  87063. ret := &Operation{
  87064. ServerResponse: googleapi.ServerResponse{
  87065. Header: res.Header,
  87066. HTTPStatusCode: res.StatusCode,
  87067. },
  87068. }
  87069. target := &ret
  87070. if err := gensupport.DecodeResponse(target, res); err != nil {
  87071. return nil, err
  87072. }
  87073. return ret, nil
  87074. // {
  87075. // "description": "Expands the IP CIDR range of the subnetwork to a specified value.",
  87076. // "httpMethod": "POST",
  87077. // "id": "compute.subnetworks.expandIpCidrRange",
  87078. // "parameterOrder": [
  87079. // "project",
  87080. // "region",
  87081. // "subnetwork"
  87082. // ],
  87083. // "parameters": {
  87084. // "project": {
  87085. // "description": "Project ID for this request.",
  87086. // "location": "path",
  87087. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87088. // "required": true,
  87089. // "type": "string"
  87090. // },
  87091. // "region": {
  87092. // "description": "Name of the region scoping this request.",
  87093. // "location": "path",
  87094. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87095. // "required": true,
  87096. // "type": "string"
  87097. // },
  87098. // "requestId": {
  87099. // "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).",
  87100. // "location": "query",
  87101. // "type": "string"
  87102. // },
  87103. // "subnetwork": {
  87104. // "description": "Name of the Subnetwork resource to update.",
  87105. // "location": "path",
  87106. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87107. // "required": true,
  87108. // "type": "string"
  87109. // }
  87110. // },
  87111. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange",
  87112. // "request": {
  87113. // "$ref": "SubnetworksExpandIpCidrRangeRequest"
  87114. // },
  87115. // "response": {
  87116. // "$ref": "Operation"
  87117. // },
  87118. // "scopes": [
  87119. // "https://www.googleapis.com/auth/cloud-platform",
  87120. // "https://www.googleapis.com/auth/compute"
  87121. // ]
  87122. // }
  87123. }
  87124. // method id "compute.subnetworks.get":
  87125. type SubnetworksGetCall struct {
  87126. s *Service
  87127. project string
  87128. region string
  87129. subnetwork string
  87130. urlParams_ gensupport.URLParams
  87131. ifNoneMatch_ string
  87132. ctx_ context.Context
  87133. header_ http.Header
  87134. }
  87135. // Get: Returns the specified subnetwork. Gets a list of available
  87136. // subnetworks list() request.
  87137. func (r *SubnetworksService) Get(project string, region string, subnetwork string) *SubnetworksGetCall {
  87138. c := &SubnetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87139. c.project = project
  87140. c.region = region
  87141. c.subnetwork = subnetwork
  87142. return c
  87143. }
  87144. // Fields allows partial responses to be retrieved. See
  87145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87146. // for more information.
  87147. func (c *SubnetworksGetCall) Fields(s ...googleapi.Field) *SubnetworksGetCall {
  87148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87149. return c
  87150. }
  87151. // IfNoneMatch sets the optional parameter which makes the operation
  87152. // fail if the object's ETag matches the given value. This is useful for
  87153. // getting updates only after the object has changed since the last
  87154. // request. Use googleapi.IsNotModified to check whether the response
  87155. // error from Do is the result of In-None-Match.
  87156. func (c *SubnetworksGetCall) IfNoneMatch(entityTag string) *SubnetworksGetCall {
  87157. c.ifNoneMatch_ = entityTag
  87158. return c
  87159. }
  87160. // Context sets the context to be used in this call's Do method. Any
  87161. // pending HTTP request will be aborted if the provided context is
  87162. // canceled.
  87163. func (c *SubnetworksGetCall) Context(ctx context.Context) *SubnetworksGetCall {
  87164. c.ctx_ = ctx
  87165. return c
  87166. }
  87167. // Header returns an http.Header that can be modified by the caller to
  87168. // add HTTP headers to the request.
  87169. func (c *SubnetworksGetCall) Header() http.Header {
  87170. if c.header_ == nil {
  87171. c.header_ = make(http.Header)
  87172. }
  87173. return c.header_
  87174. }
  87175. func (c *SubnetworksGetCall) doRequest(alt string) (*http.Response, error) {
  87176. reqHeaders := make(http.Header)
  87177. for k, v := range c.header_ {
  87178. reqHeaders[k] = v
  87179. }
  87180. reqHeaders.Set("User-Agent", c.s.userAgent())
  87181. if c.ifNoneMatch_ != "" {
  87182. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87183. }
  87184. var body io.Reader = nil
  87185. c.urlParams_.Set("alt", alt)
  87186. c.urlParams_.Set("prettyPrint", "false")
  87187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  87188. urls += "?" + c.urlParams_.Encode()
  87189. req, err := http.NewRequest("GET", urls, body)
  87190. if err != nil {
  87191. return nil, err
  87192. }
  87193. req.Header = reqHeaders
  87194. googleapi.Expand(req.URL, map[string]string{
  87195. "project": c.project,
  87196. "region": c.region,
  87197. "subnetwork": c.subnetwork,
  87198. })
  87199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87200. }
  87201. // Do executes the "compute.subnetworks.get" call.
  87202. // Exactly one of *Subnetwork or error will be non-nil. Any non-2xx
  87203. // status code is an error. Response headers are in either
  87204. // *Subnetwork.ServerResponse.Header or (if a response was returned at
  87205. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87206. // to check whether the returned error was because
  87207. // http.StatusNotModified was returned.
  87208. func (c *SubnetworksGetCall) Do(opts ...googleapi.CallOption) (*Subnetwork, error) {
  87209. gensupport.SetOptions(c.urlParams_, opts...)
  87210. res, err := c.doRequest("json")
  87211. if res != nil && res.StatusCode == http.StatusNotModified {
  87212. if res.Body != nil {
  87213. res.Body.Close()
  87214. }
  87215. return nil, &googleapi.Error{
  87216. Code: res.StatusCode,
  87217. Header: res.Header,
  87218. }
  87219. }
  87220. if err != nil {
  87221. return nil, err
  87222. }
  87223. defer googleapi.CloseBody(res)
  87224. if err := googleapi.CheckResponse(res); err != nil {
  87225. return nil, err
  87226. }
  87227. ret := &Subnetwork{
  87228. ServerResponse: googleapi.ServerResponse{
  87229. Header: res.Header,
  87230. HTTPStatusCode: res.StatusCode,
  87231. },
  87232. }
  87233. target := &ret
  87234. if err := gensupport.DecodeResponse(target, res); err != nil {
  87235. return nil, err
  87236. }
  87237. return ret, nil
  87238. // {
  87239. // "description": "Returns the specified subnetwork. Gets a list of available subnetworks list() request.",
  87240. // "httpMethod": "GET",
  87241. // "id": "compute.subnetworks.get",
  87242. // "parameterOrder": [
  87243. // "project",
  87244. // "region",
  87245. // "subnetwork"
  87246. // ],
  87247. // "parameters": {
  87248. // "project": {
  87249. // "description": "Project ID for this request.",
  87250. // "location": "path",
  87251. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87252. // "required": true,
  87253. // "type": "string"
  87254. // },
  87255. // "region": {
  87256. // "description": "Name of the region scoping this request.",
  87257. // "location": "path",
  87258. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87259. // "required": true,
  87260. // "type": "string"
  87261. // },
  87262. // "subnetwork": {
  87263. // "description": "Name of the Subnetwork resource to return.",
  87264. // "location": "path",
  87265. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87266. // "required": true,
  87267. // "type": "string"
  87268. // }
  87269. // },
  87270. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  87271. // "response": {
  87272. // "$ref": "Subnetwork"
  87273. // },
  87274. // "scopes": [
  87275. // "https://www.googleapis.com/auth/cloud-platform",
  87276. // "https://www.googleapis.com/auth/compute",
  87277. // "https://www.googleapis.com/auth/compute.readonly"
  87278. // ]
  87279. // }
  87280. }
  87281. // method id "compute.subnetworks.getIamPolicy":
  87282. type SubnetworksGetIamPolicyCall struct {
  87283. s *Service
  87284. project string
  87285. region string
  87286. resource string
  87287. urlParams_ gensupport.URLParams
  87288. ifNoneMatch_ string
  87289. ctx_ context.Context
  87290. header_ http.Header
  87291. }
  87292. // GetIamPolicy: Gets the access control policy for a resource. May be
  87293. // empty if no such policy or resource exists.
  87294. func (r *SubnetworksService) GetIamPolicy(project string, region string, resource string) *SubnetworksGetIamPolicyCall {
  87295. c := &SubnetworksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87296. c.project = project
  87297. c.region = region
  87298. c.resource = resource
  87299. return c
  87300. }
  87301. // Fields allows partial responses to be retrieved. See
  87302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87303. // for more information.
  87304. func (c *SubnetworksGetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksGetIamPolicyCall {
  87305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87306. return c
  87307. }
  87308. // IfNoneMatch sets the optional parameter which makes the operation
  87309. // fail if the object's ETag matches the given value. This is useful for
  87310. // getting updates only after the object has changed since the last
  87311. // request. Use googleapi.IsNotModified to check whether the response
  87312. // error from Do is the result of In-None-Match.
  87313. func (c *SubnetworksGetIamPolicyCall) IfNoneMatch(entityTag string) *SubnetworksGetIamPolicyCall {
  87314. c.ifNoneMatch_ = entityTag
  87315. return c
  87316. }
  87317. // Context sets the context to be used in this call's Do method. Any
  87318. // pending HTTP request will be aborted if the provided context is
  87319. // canceled.
  87320. func (c *SubnetworksGetIamPolicyCall) Context(ctx context.Context) *SubnetworksGetIamPolicyCall {
  87321. c.ctx_ = ctx
  87322. return c
  87323. }
  87324. // Header returns an http.Header that can be modified by the caller to
  87325. // add HTTP headers to the request.
  87326. func (c *SubnetworksGetIamPolicyCall) Header() http.Header {
  87327. if c.header_ == nil {
  87328. c.header_ = make(http.Header)
  87329. }
  87330. return c.header_
  87331. }
  87332. func (c *SubnetworksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  87333. reqHeaders := make(http.Header)
  87334. for k, v := range c.header_ {
  87335. reqHeaders[k] = v
  87336. }
  87337. reqHeaders.Set("User-Agent", c.s.userAgent())
  87338. if c.ifNoneMatch_ != "" {
  87339. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87340. }
  87341. var body io.Reader = nil
  87342. c.urlParams_.Set("alt", alt)
  87343. c.urlParams_.Set("prettyPrint", "false")
  87344. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy")
  87345. urls += "?" + c.urlParams_.Encode()
  87346. req, err := http.NewRequest("GET", urls, body)
  87347. if err != nil {
  87348. return nil, err
  87349. }
  87350. req.Header = reqHeaders
  87351. googleapi.Expand(req.URL, map[string]string{
  87352. "project": c.project,
  87353. "region": c.region,
  87354. "resource": c.resource,
  87355. })
  87356. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87357. }
  87358. // Do executes the "compute.subnetworks.getIamPolicy" call.
  87359. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  87360. // code is an error. Response headers are in either
  87361. // *Policy.ServerResponse.Header or (if a response was returned at all)
  87362. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  87363. // check whether the returned error was because http.StatusNotModified
  87364. // was returned.
  87365. func (c *SubnetworksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  87366. gensupport.SetOptions(c.urlParams_, opts...)
  87367. res, err := c.doRequest("json")
  87368. if res != nil && res.StatusCode == http.StatusNotModified {
  87369. if res.Body != nil {
  87370. res.Body.Close()
  87371. }
  87372. return nil, &googleapi.Error{
  87373. Code: res.StatusCode,
  87374. Header: res.Header,
  87375. }
  87376. }
  87377. if err != nil {
  87378. return nil, err
  87379. }
  87380. defer googleapi.CloseBody(res)
  87381. if err := googleapi.CheckResponse(res); err != nil {
  87382. return nil, err
  87383. }
  87384. ret := &Policy{
  87385. ServerResponse: googleapi.ServerResponse{
  87386. Header: res.Header,
  87387. HTTPStatusCode: res.StatusCode,
  87388. },
  87389. }
  87390. target := &ret
  87391. if err := gensupport.DecodeResponse(target, res); err != nil {
  87392. return nil, err
  87393. }
  87394. return ret, nil
  87395. // {
  87396. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  87397. // "httpMethod": "GET",
  87398. // "id": "compute.subnetworks.getIamPolicy",
  87399. // "parameterOrder": [
  87400. // "project",
  87401. // "region",
  87402. // "resource"
  87403. // ],
  87404. // "parameters": {
  87405. // "project": {
  87406. // "description": "Project ID for this request.",
  87407. // "location": "path",
  87408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87409. // "required": true,
  87410. // "type": "string"
  87411. // },
  87412. // "region": {
  87413. // "description": "The name of the region for this request.",
  87414. // "location": "path",
  87415. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87416. // "required": true,
  87417. // "type": "string"
  87418. // },
  87419. // "resource": {
  87420. // "description": "Name or id of the resource for this request.",
  87421. // "location": "path",
  87422. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  87423. // "required": true,
  87424. // "type": "string"
  87425. // }
  87426. // },
  87427. // "path": "{project}/regions/{region}/subnetworks/{resource}/getIamPolicy",
  87428. // "response": {
  87429. // "$ref": "Policy"
  87430. // },
  87431. // "scopes": [
  87432. // "https://www.googleapis.com/auth/cloud-platform",
  87433. // "https://www.googleapis.com/auth/compute",
  87434. // "https://www.googleapis.com/auth/compute.readonly"
  87435. // ]
  87436. // }
  87437. }
  87438. // method id "compute.subnetworks.insert":
  87439. type SubnetworksInsertCall struct {
  87440. s *Service
  87441. project string
  87442. region string
  87443. subnetwork *Subnetwork
  87444. urlParams_ gensupport.URLParams
  87445. ctx_ context.Context
  87446. header_ http.Header
  87447. }
  87448. // Insert: Creates a subnetwork in the specified project using the data
  87449. // included in the request.
  87450. func (r *SubnetworksService) Insert(project string, region string, subnetwork *Subnetwork) *SubnetworksInsertCall {
  87451. c := &SubnetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87452. c.project = project
  87453. c.region = region
  87454. c.subnetwork = subnetwork
  87455. return c
  87456. }
  87457. // RequestId sets the optional parameter "requestId": An optional
  87458. // request ID to identify requests. Specify a unique request ID so that
  87459. // if you must retry your request, the server will know to ignore the
  87460. // request if it has already been completed.
  87461. //
  87462. // For example, consider a situation where you make an initial request
  87463. // and the request times out. If you make the request again with the
  87464. // same request ID, the server can check if original operation with the
  87465. // same request ID was received, and if so, will ignore the second
  87466. // request. This prevents clients from accidentally creating duplicate
  87467. // commitments.
  87468. //
  87469. // The request ID must be a valid UUID with the exception that zero UUID
  87470. // is not supported (00000000-0000-0000-0000-000000000000).
  87471. func (c *SubnetworksInsertCall) RequestId(requestId string) *SubnetworksInsertCall {
  87472. c.urlParams_.Set("requestId", requestId)
  87473. return c
  87474. }
  87475. // Fields allows partial responses to be retrieved. See
  87476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87477. // for more information.
  87478. func (c *SubnetworksInsertCall) Fields(s ...googleapi.Field) *SubnetworksInsertCall {
  87479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87480. return c
  87481. }
  87482. // Context sets the context to be used in this call's Do method. Any
  87483. // pending HTTP request will be aborted if the provided context is
  87484. // canceled.
  87485. func (c *SubnetworksInsertCall) Context(ctx context.Context) *SubnetworksInsertCall {
  87486. c.ctx_ = ctx
  87487. return c
  87488. }
  87489. // Header returns an http.Header that can be modified by the caller to
  87490. // add HTTP headers to the request.
  87491. func (c *SubnetworksInsertCall) Header() http.Header {
  87492. if c.header_ == nil {
  87493. c.header_ = make(http.Header)
  87494. }
  87495. return c.header_
  87496. }
  87497. func (c *SubnetworksInsertCall) doRequest(alt string) (*http.Response, error) {
  87498. reqHeaders := make(http.Header)
  87499. for k, v := range c.header_ {
  87500. reqHeaders[k] = v
  87501. }
  87502. reqHeaders.Set("User-Agent", c.s.userAgent())
  87503. var body io.Reader = nil
  87504. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork)
  87505. if err != nil {
  87506. return nil, err
  87507. }
  87508. reqHeaders.Set("Content-Type", "application/json")
  87509. c.urlParams_.Set("alt", alt)
  87510. c.urlParams_.Set("prettyPrint", "false")
  87511. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  87512. urls += "?" + c.urlParams_.Encode()
  87513. req, err := http.NewRequest("POST", urls, body)
  87514. if err != nil {
  87515. return nil, err
  87516. }
  87517. req.Header = reqHeaders
  87518. googleapi.Expand(req.URL, map[string]string{
  87519. "project": c.project,
  87520. "region": c.region,
  87521. })
  87522. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87523. }
  87524. // Do executes the "compute.subnetworks.insert" call.
  87525. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  87526. // status code is an error. Response headers are in either
  87527. // *Operation.ServerResponse.Header or (if a response was returned at
  87528. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  87529. // to check whether the returned error was because
  87530. // http.StatusNotModified was returned.
  87531. func (c *SubnetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  87532. gensupport.SetOptions(c.urlParams_, opts...)
  87533. res, err := c.doRequest("json")
  87534. if res != nil && res.StatusCode == http.StatusNotModified {
  87535. if res.Body != nil {
  87536. res.Body.Close()
  87537. }
  87538. return nil, &googleapi.Error{
  87539. Code: res.StatusCode,
  87540. Header: res.Header,
  87541. }
  87542. }
  87543. if err != nil {
  87544. return nil, err
  87545. }
  87546. defer googleapi.CloseBody(res)
  87547. if err := googleapi.CheckResponse(res); err != nil {
  87548. return nil, err
  87549. }
  87550. ret := &Operation{
  87551. ServerResponse: googleapi.ServerResponse{
  87552. Header: res.Header,
  87553. HTTPStatusCode: res.StatusCode,
  87554. },
  87555. }
  87556. target := &ret
  87557. if err := gensupport.DecodeResponse(target, res); err != nil {
  87558. return nil, err
  87559. }
  87560. return ret, nil
  87561. // {
  87562. // "description": "Creates a subnetwork in the specified project using the data included in the request.",
  87563. // "httpMethod": "POST",
  87564. // "id": "compute.subnetworks.insert",
  87565. // "parameterOrder": [
  87566. // "project",
  87567. // "region"
  87568. // ],
  87569. // "parameters": {
  87570. // "project": {
  87571. // "description": "Project ID for this request.",
  87572. // "location": "path",
  87573. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87574. // "required": true,
  87575. // "type": "string"
  87576. // },
  87577. // "region": {
  87578. // "description": "Name of the region scoping this request.",
  87579. // "location": "path",
  87580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87581. // "required": true,
  87582. // "type": "string"
  87583. // },
  87584. // "requestId": {
  87585. // "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).",
  87586. // "location": "query",
  87587. // "type": "string"
  87588. // }
  87589. // },
  87590. // "path": "{project}/regions/{region}/subnetworks",
  87591. // "request": {
  87592. // "$ref": "Subnetwork"
  87593. // },
  87594. // "response": {
  87595. // "$ref": "Operation"
  87596. // },
  87597. // "scopes": [
  87598. // "https://www.googleapis.com/auth/cloud-platform",
  87599. // "https://www.googleapis.com/auth/compute"
  87600. // ]
  87601. // }
  87602. }
  87603. // method id "compute.subnetworks.list":
  87604. type SubnetworksListCall struct {
  87605. s *Service
  87606. project string
  87607. region string
  87608. urlParams_ gensupport.URLParams
  87609. ifNoneMatch_ string
  87610. ctx_ context.Context
  87611. header_ http.Header
  87612. }
  87613. // List: Retrieves a list of subnetworks available to the specified
  87614. // project.
  87615. func (r *SubnetworksService) List(project string, region string) *SubnetworksListCall {
  87616. c := &SubnetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87617. c.project = project
  87618. c.region = region
  87619. return c
  87620. }
  87621. // Filter sets the optional parameter "filter": A filter expression that
  87622. // filters resources listed in the response. The expression must specify
  87623. // the field name, a comparison operator, and the value that you want to
  87624. // use for filtering. The value must be a string, a number, or a
  87625. // boolean. The comparison operator must be either =, !=, >, or <.
  87626. //
  87627. // For example, if you are filtering Compute Engine instances, you can
  87628. // exclude instances named example-instance by specifying name !=
  87629. // example-instance.
  87630. //
  87631. // You can also filter nested fields. For example, you could specify
  87632. // scheduling.automaticRestart = false to include instances only if they
  87633. // are not scheduled for automatic restarts. You can use filtering on
  87634. // nested fields to filter based on resource labels.
  87635. //
  87636. // To filter on multiple expressions, provide each separate expression
  87637. // within parentheses. For example, (scheduling.automaticRestart = true)
  87638. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87639. // AND expression. However, you can include AND and OR expressions
  87640. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87641. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87642. // true).
  87643. func (c *SubnetworksListCall) Filter(filter string) *SubnetworksListCall {
  87644. c.urlParams_.Set("filter", filter)
  87645. return c
  87646. }
  87647. // MaxResults sets the optional parameter "maxResults": The maximum
  87648. // number of results per page that should be returned. If the number of
  87649. // available results is larger than maxResults, Compute Engine returns a
  87650. // nextPageToken that can be used to get the next page of results in
  87651. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87652. // (Default: 500)
  87653. func (c *SubnetworksListCall) MaxResults(maxResults int64) *SubnetworksListCall {
  87654. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87655. return c
  87656. }
  87657. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87658. // a certain order. By default, results are returned in alphanumerical
  87659. // order based on the resource name.
  87660. //
  87661. // You can also sort results in descending order based on the creation
  87662. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87663. // based on the creationTimestamp field in reverse chronological order
  87664. // (newest result first). Use this to sort resources like operations so
  87665. // that the newest operation is returned first.
  87666. //
  87667. // Currently, only sorting by name or creationTimestamp desc is
  87668. // supported.
  87669. func (c *SubnetworksListCall) OrderBy(orderBy string) *SubnetworksListCall {
  87670. c.urlParams_.Set("orderBy", orderBy)
  87671. return c
  87672. }
  87673. // PageToken sets the optional parameter "pageToken": Specifies a page
  87674. // token to use. Set pageToken to the nextPageToken returned by a
  87675. // previous list request to get the next page of results.
  87676. func (c *SubnetworksListCall) PageToken(pageToken string) *SubnetworksListCall {
  87677. c.urlParams_.Set("pageToken", pageToken)
  87678. return c
  87679. }
  87680. // Fields allows partial responses to be retrieved. See
  87681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87682. // for more information.
  87683. func (c *SubnetworksListCall) Fields(s ...googleapi.Field) *SubnetworksListCall {
  87684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87685. return c
  87686. }
  87687. // IfNoneMatch sets the optional parameter which makes the operation
  87688. // fail if the object's ETag matches the given value. This is useful for
  87689. // getting updates only after the object has changed since the last
  87690. // request. Use googleapi.IsNotModified to check whether the response
  87691. // error from Do is the result of In-None-Match.
  87692. func (c *SubnetworksListCall) IfNoneMatch(entityTag string) *SubnetworksListCall {
  87693. c.ifNoneMatch_ = entityTag
  87694. return c
  87695. }
  87696. // Context sets the context to be used in this call's Do method. Any
  87697. // pending HTTP request will be aborted if the provided context is
  87698. // canceled.
  87699. func (c *SubnetworksListCall) Context(ctx context.Context) *SubnetworksListCall {
  87700. c.ctx_ = ctx
  87701. return c
  87702. }
  87703. // Header returns an http.Header that can be modified by the caller to
  87704. // add HTTP headers to the request.
  87705. func (c *SubnetworksListCall) Header() http.Header {
  87706. if c.header_ == nil {
  87707. c.header_ = make(http.Header)
  87708. }
  87709. return c.header_
  87710. }
  87711. func (c *SubnetworksListCall) doRequest(alt string) (*http.Response, error) {
  87712. reqHeaders := make(http.Header)
  87713. for k, v := range c.header_ {
  87714. reqHeaders[k] = v
  87715. }
  87716. reqHeaders.Set("User-Agent", c.s.userAgent())
  87717. if c.ifNoneMatch_ != "" {
  87718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87719. }
  87720. var body io.Reader = nil
  87721. c.urlParams_.Set("alt", alt)
  87722. c.urlParams_.Set("prettyPrint", "false")
  87723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks")
  87724. urls += "?" + c.urlParams_.Encode()
  87725. req, err := http.NewRequest("GET", urls, body)
  87726. if err != nil {
  87727. return nil, err
  87728. }
  87729. req.Header = reqHeaders
  87730. googleapi.Expand(req.URL, map[string]string{
  87731. "project": c.project,
  87732. "region": c.region,
  87733. })
  87734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87735. }
  87736. // Do executes the "compute.subnetworks.list" call.
  87737. // Exactly one of *SubnetworkList or error will be non-nil. Any non-2xx
  87738. // status code is an error. Response headers are in either
  87739. // *SubnetworkList.ServerResponse.Header or (if a response was returned
  87740. // at all) in error.(*googleapi.Error).Header. Use
  87741. // googleapi.IsNotModified to check whether the returned error was
  87742. // because http.StatusNotModified was returned.
  87743. func (c *SubnetworksListCall) Do(opts ...googleapi.CallOption) (*SubnetworkList, error) {
  87744. gensupport.SetOptions(c.urlParams_, opts...)
  87745. res, err := c.doRequest("json")
  87746. if res != nil && res.StatusCode == http.StatusNotModified {
  87747. if res.Body != nil {
  87748. res.Body.Close()
  87749. }
  87750. return nil, &googleapi.Error{
  87751. Code: res.StatusCode,
  87752. Header: res.Header,
  87753. }
  87754. }
  87755. if err != nil {
  87756. return nil, err
  87757. }
  87758. defer googleapi.CloseBody(res)
  87759. if err := googleapi.CheckResponse(res); err != nil {
  87760. return nil, err
  87761. }
  87762. ret := &SubnetworkList{
  87763. ServerResponse: googleapi.ServerResponse{
  87764. Header: res.Header,
  87765. HTTPStatusCode: res.StatusCode,
  87766. },
  87767. }
  87768. target := &ret
  87769. if err := gensupport.DecodeResponse(target, res); err != nil {
  87770. return nil, err
  87771. }
  87772. return ret, nil
  87773. // {
  87774. // "description": "Retrieves a list of subnetworks available to the specified project.",
  87775. // "httpMethod": "GET",
  87776. // "id": "compute.subnetworks.list",
  87777. // "parameterOrder": [
  87778. // "project",
  87779. // "region"
  87780. // ],
  87781. // "parameters": {
  87782. // "filter": {
  87783. // "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).",
  87784. // "location": "query",
  87785. // "type": "string"
  87786. // },
  87787. // "maxResults": {
  87788. // "default": "500",
  87789. // "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)",
  87790. // "format": "uint32",
  87791. // "location": "query",
  87792. // "minimum": "0",
  87793. // "type": "integer"
  87794. // },
  87795. // "orderBy": {
  87796. // "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.",
  87797. // "location": "query",
  87798. // "type": "string"
  87799. // },
  87800. // "pageToken": {
  87801. // "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.",
  87802. // "location": "query",
  87803. // "type": "string"
  87804. // },
  87805. // "project": {
  87806. // "description": "Project ID for this request.",
  87807. // "location": "path",
  87808. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  87809. // "required": true,
  87810. // "type": "string"
  87811. // },
  87812. // "region": {
  87813. // "description": "Name of the region scoping this request.",
  87814. // "location": "path",
  87815. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  87816. // "required": true,
  87817. // "type": "string"
  87818. // }
  87819. // },
  87820. // "path": "{project}/regions/{region}/subnetworks",
  87821. // "response": {
  87822. // "$ref": "SubnetworkList"
  87823. // },
  87824. // "scopes": [
  87825. // "https://www.googleapis.com/auth/cloud-platform",
  87826. // "https://www.googleapis.com/auth/compute",
  87827. // "https://www.googleapis.com/auth/compute.readonly"
  87828. // ]
  87829. // }
  87830. }
  87831. // Pages invokes f for each page of results.
  87832. // A non-nil error returned from f will halt the iteration.
  87833. // The provided context supersedes any context provided to the Context method.
  87834. func (c *SubnetworksListCall) Pages(ctx context.Context, f func(*SubnetworkList) error) error {
  87835. c.ctx_ = ctx
  87836. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  87837. for {
  87838. x, err := c.Do()
  87839. if err != nil {
  87840. return err
  87841. }
  87842. if err := f(x); err != nil {
  87843. return err
  87844. }
  87845. if x.NextPageToken == "" {
  87846. return nil
  87847. }
  87848. c.PageToken(x.NextPageToken)
  87849. }
  87850. }
  87851. // method id "compute.subnetworks.listUsable":
  87852. type SubnetworksListUsableCall struct {
  87853. s *Service
  87854. project string
  87855. urlParams_ gensupport.URLParams
  87856. ifNoneMatch_ string
  87857. ctx_ context.Context
  87858. header_ http.Header
  87859. }
  87860. // ListUsable: Retrieves an aggregated list of usable subnetworks.
  87861. func (r *SubnetworksService) ListUsable(project string) *SubnetworksListUsableCall {
  87862. c := &SubnetworksListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  87863. c.project = project
  87864. return c
  87865. }
  87866. // Filter sets the optional parameter "filter": A filter expression that
  87867. // filters resources listed in the response. The expression must specify
  87868. // the field name, a comparison operator, and the value that you want to
  87869. // use for filtering. The value must be a string, a number, or a
  87870. // boolean. The comparison operator must be either =, !=, >, or <.
  87871. //
  87872. // For example, if you are filtering Compute Engine instances, you can
  87873. // exclude instances named example-instance by specifying name !=
  87874. // example-instance.
  87875. //
  87876. // You can also filter nested fields. For example, you could specify
  87877. // scheduling.automaticRestart = false to include instances only if they
  87878. // are not scheduled for automatic restarts. You can use filtering on
  87879. // nested fields to filter based on resource labels.
  87880. //
  87881. // To filter on multiple expressions, provide each separate expression
  87882. // within parentheses. For example, (scheduling.automaticRestart = true)
  87883. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  87884. // AND expression. However, you can include AND and OR expressions
  87885. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  87886. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  87887. // true).
  87888. func (c *SubnetworksListUsableCall) Filter(filter string) *SubnetworksListUsableCall {
  87889. c.urlParams_.Set("filter", filter)
  87890. return c
  87891. }
  87892. // MaxResults sets the optional parameter "maxResults": The maximum
  87893. // number of results per page that should be returned. If the number of
  87894. // available results is larger than maxResults, Compute Engine returns a
  87895. // nextPageToken that can be used to get the next page of results in
  87896. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  87897. // (Default: 500)
  87898. func (c *SubnetworksListUsableCall) MaxResults(maxResults int64) *SubnetworksListUsableCall {
  87899. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  87900. return c
  87901. }
  87902. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  87903. // a certain order. By default, results are returned in alphanumerical
  87904. // order based on the resource name.
  87905. //
  87906. // You can also sort results in descending order based on the creation
  87907. // timestamp using orderBy="creationTimestamp desc". This sorts results
  87908. // based on the creationTimestamp field in reverse chronological order
  87909. // (newest result first). Use this to sort resources like operations so
  87910. // that the newest operation is returned first.
  87911. //
  87912. // Currently, only sorting by name or creationTimestamp desc is
  87913. // supported.
  87914. func (c *SubnetworksListUsableCall) OrderBy(orderBy string) *SubnetworksListUsableCall {
  87915. c.urlParams_.Set("orderBy", orderBy)
  87916. return c
  87917. }
  87918. // PageToken sets the optional parameter "pageToken": Specifies a page
  87919. // token to use. Set pageToken to the nextPageToken returned by a
  87920. // previous list request to get the next page of results.
  87921. func (c *SubnetworksListUsableCall) PageToken(pageToken string) *SubnetworksListUsableCall {
  87922. c.urlParams_.Set("pageToken", pageToken)
  87923. return c
  87924. }
  87925. // Fields allows partial responses to be retrieved. See
  87926. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  87927. // for more information.
  87928. func (c *SubnetworksListUsableCall) Fields(s ...googleapi.Field) *SubnetworksListUsableCall {
  87929. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  87930. return c
  87931. }
  87932. // IfNoneMatch sets the optional parameter which makes the operation
  87933. // fail if the object's ETag matches the given value. This is useful for
  87934. // getting updates only after the object has changed since the last
  87935. // request. Use googleapi.IsNotModified to check whether the response
  87936. // error from Do is the result of In-None-Match.
  87937. func (c *SubnetworksListUsableCall) IfNoneMatch(entityTag string) *SubnetworksListUsableCall {
  87938. c.ifNoneMatch_ = entityTag
  87939. return c
  87940. }
  87941. // Context sets the context to be used in this call's Do method. Any
  87942. // pending HTTP request will be aborted if the provided context is
  87943. // canceled.
  87944. func (c *SubnetworksListUsableCall) Context(ctx context.Context) *SubnetworksListUsableCall {
  87945. c.ctx_ = ctx
  87946. return c
  87947. }
  87948. // Header returns an http.Header that can be modified by the caller to
  87949. // add HTTP headers to the request.
  87950. func (c *SubnetworksListUsableCall) Header() http.Header {
  87951. if c.header_ == nil {
  87952. c.header_ = make(http.Header)
  87953. }
  87954. return c.header_
  87955. }
  87956. func (c *SubnetworksListUsableCall) doRequest(alt string) (*http.Response, error) {
  87957. reqHeaders := make(http.Header)
  87958. for k, v := range c.header_ {
  87959. reqHeaders[k] = v
  87960. }
  87961. reqHeaders.Set("User-Agent", c.s.userAgent())
  87962. if c.ifNoneMatch_ != "" {
  87963. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  87964. }
  87965. var body io.Reader = nil
  87966. c.urlParams_.Set("alt", alt)
  87967. c.urlParams_.Set("prettyPrint", "false")
  87968. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/subnetworks/listUsable")
  87969. urls += "?" + c.urlParams_.Encode()
  87970. req, err := http.NewRequest("GET", urls, body)
  87971. if err != nil {
  87972. return nil, err
  87973. }
  87974. req.Header = reqHeaders
  87975. googleapi.Expand(req.URL, map[string]string{
  87976. "project": c.project,
  87977. })
  87978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  87979. }
  87980. // Do executes the "compute.subnetworks.listUsable" call.
  87981. // Exactly one of *UsableSubnetworksAggregatedList or error will be
  87982. // non-nil. Any non-2xx status code is an error. Response headers are in
  87983. // either *UsableSubnetworksAggregatedList.ServerResponse.Header or (if
  87984. // a response was returned at all) in error.(*googleapi.Error).Header.
  87985. // Use googleapi.IsNotModified to check whether the returned error was
  87986. // because http.StatusNotModified was returned.
  87987. func (c *SubnetworksListUsableCall) Do(opts ...googleapi.CallOption) (*UsableSubnetworksAggregatedList, error) {
  87988. gensupport.SetOptions(c.urlParams_, opts...)
  87989. res, err := c.doRequest("json")
  87990. if res != nil && res.StatusCode == http.StatusNotModified {
  87991. if res.Body != nil {
  87992. res.Body.Close()
  87993. }
  87994. return nil, &googleapi.Error{
  87995. Code: res.StatusCode,
  87996. Header: res.Header,
  87997. }
  87998. }
  87999. if err != nil {
  88000. return nil, err
  88001. }
  88002. defer googleapi.CloseBody(res)
  88003. if err := googleapi.CheckResponse(res); err != nil {
  88004. return nil, err
  88005. }
  88006. ret := &UsableSubnetworksAggregatedList{
  88007. ServerResponse: googleapi.ServerResponse{
  88008. Header: res.Header,
  88009. HTTPStatusCode: res.StatusCode,
  88010. },
  88011. }
  88012. target := &ret
  88013. if err := gensupport.DecodeResponse(target, res); err != nil {
  88014. return nil, err
  88015. }
  88016. return ret, nil
  88017. // {
  88018. // "description": "Retrieves an aggregated list of usable subnetworks.",
  88019. // "httpMethod": "GET",
  88020. // "id": "compute.subnetworks.listUsable",
  88021. // "parameterOrder": [
  88022. // "project"
  88023. // ],
  88024. // "parameters": {
  88025. // "filter": {
  88026. // "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).",
  88027. // "location": "query",
  88028. // "type": "string"
  88029. // },
  88030. // "maxResults": {
  88031. // "default": "500",
  88032. // "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)",
  88033. // "format": "uint32",
  88034. // "location": "query",
  88035. // "minimum": "0",
  88036. // "type": "integer"
  88037. // },
  88038. // "orderBy": {
  88039. // "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.",
  88040. // "location": "query",
  88041. // "type": "string"
  88042. // },
  88043. // "pageToken": {
  88044. // "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.",
  88045. // "location": "query",
  88046. // "type": "string"
  88047. // },
  88048. // "project": {
  88049. // "description": "Project ID for this request.",
  88050. // "location": "path",
  88051. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88052. // "required": true,
  88053. // "type": "string"
  88054. // }
  88055. // },
  88056. // "path": "{project}/aggregated/subnetworks/listUsable",
  88057. // "response": {
  88058. // "$ref": "UsableSubnetworksAggregatedList"
  88059. // },
  88060. // "scopes": [
  88061. // "https://www.googleapis.com/auth/cloud-platform",
  88062. // "https://www.googleapis.com/auth/compute",
  88063. // "https://www.googleapis.com/auth/compute.readonly"
  88064. // ]
  88065. // }
  88066. }
  88067. // Pages invokes f for each page of results.
  88068. // A non-nil error returned from f will halt the iteration.
  88069. // The provided context supersedes any context provided to the Context method.
  88070. func (c *SubnetworksListUsableCall) Pages(ctx context.Context, f func(*UsableSubnetworksAggregatedList) error) error {
  88071. c.ctx_ = ctx
  88072. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  88073. for {
  88074. x, err := c.Do()
  88075. if err != nil {
  88076. return err
  88077. }
  88078. if err := f(x); err != nil {
  88079. return err
  88080. }
  88081. if x.NextPageToken == "" {
  88082. return nil
  88083. }
  88084. c.PageToken(x.NextPageToken)
  88085. }
  88086. }
  88087. // method id "compute.subnetworks.patch":
  88088. type SubnetworksPatchCall struct {
  88089. s *Service
  88090. project string
  88091. region string
  88092. subnetwork string
  88093. subnetwork2 *Subnetwork
  88094. urlParams_ gensupport.URLParams
  88095. ctx_ context.Context
  88096. header_ http.Header
  88097. }
  88098. // Patch: Patches the specified subnetwork with the data included in the
  88099. // request. Only certain fields can up updated with a patch request as
  88100. // indicated in the field descriptions. You must specify the current
  88101. // fingeprint of the subnetwork resource being patched.
  88102. func (r *SubnetworksService) Patch(project string, region string, subnetwork string, subnetwork2 *Subnetwork) *SubnetworksPatchCall {
  88103. c := &SubnetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88104. c.project = project
  88105. c.region = region
  88106. c.subnetwork = subnetwork
  88107. c.subnetwork2 = subnetwork2
  88108. return c
  88109. }
  88110. // RequestId sets the optional parameter "requestId": An optional
  88111. // request ID to identify requests. Specify a unique request ID so that
  88112. // if you must retry your request, the server will know to ignore the
  88113. // request if it has already been completed.
  88114. //
  88115. // For example, consider a situation where you make an initial request
  88116. // and the request times out. If you make the request again with the
  88117. // same request ID, the server can check if original operation with the
  88118. // same request ID was received, and if so, will ignore the second
  88119. // request. This prevents clients from accidentally creating duplicate
  88120. // commitments.
  88121. //
  88122. // The request ID must be a valid UUID with the exception that zero UUID
  88123. // is not supported (00000000-0000-0000-0000-000000000000).
  88124. func (c *SubnetworksPatchCall) RequestId(requestId string) *SubnetworksPatchCall {
  88125. c.urlParams_.Set("requestId", requestId)
  88126. return c
  88127. }
  88128. // Fields allows partial responses to be retrieved. See
  88129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88130. // for more information.
  88131. func (c *SubnetworksPatchCall) Fields(s ...googleapi.Field) *SubnetworksPatchCall {
  88132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88133. return c
  88134. }
  88135. // Context sets the context to be used in this call's Do method. Any
  88136. // pending HTTP request will be aborted if the provided context is
  88137. // canceled.
  88138. func (c *SubnetworksPatchCall) Context(ctx context.Context) *SubnetworksPatchCall {
  88139. c.ctx_ = ctx
  88140. return c
  88141. }
  88142. // Header returns an http.Header that can be modified by the caller to
  88143. // add HTTP headers to the request.
  88144. func (c *SubnetworksPatchCall) Header() http.Header {
  88145. if c.header_ == nil {
  88146. c.header_ = make(http.Header)
  88147. }
  88148. return c.header_
  88149. }
  88150. func (c *SubnetworksPatchCall) doRequest(alt string) (*http.Response, error) {
  88151. reqHeaders := make(http.Header)
  88152. for k, v := range c.header_ {
  88153. reqHeaders[k] = v
  88154. }
  88155. reqHeaders.Set("User-Agent", c.s.userAgent())
  88156. var body io.Reader = nil
  88157. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetwork2)
  88158. if err != nil {
  88159. return nil, err
  88160. }
  88161. reqHeaders.Set("Content-Type", "application/json")
  88162. c.urlParams_.Set("alt", alt)
  88163. c.urlParams_.Set("prettyPrint", "false")
  88164. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}")
  88165. urls += "?" + c.urlParams_.Encode()
  88166. req, err := http.NewRequest("PATCH", urls, body)
  88167. if err != nil {
  88168. return nil, err
  88169. }
  88170. req.Header = reqHeaders
  88171. googleapi.Expand(req.URL, map[string]string{
  88172. "project": c.project,
  88173. "region": c.region,
  88174. "subnetwork": c.subnetwork,
  88175. })
  88176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88177. }
  88178. // Do executes the "compute.subnetworks.patch" call.
  88179. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88180. // status code is an error. Response headers are in either
  88181. // *Operation.ServerResponse.Header or (if a response was returned at
  88182. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88183. // to check whether the returned error was because
  88184. // http.StatusNotModified was returned.
  88185. func (c *SubnetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88186. gensupport.SetOptions(c.urlParams_, opts...)
  88187. res, err := c.doRequest("json")
  88188. if res != nil && res.StatusCode == http.StatusNotModified {
  88189. if res.Body != nil {
  88190. res.Body.Close()
  88191. }
  88192. return nil, &googleapi.Error{
  88193. Code: res.StatusCode,
  88194. Header: res.Header,
  88195. }
  88196. }
  88197. if err != nil {
  88198. return nil, err
  88199. }
  88200. defer googleapi.CloseBody(res)
  88201. if err := googleapi.CheckResponse(res); err != nil {
  88202. return nil, err
  88203. }
  88204. ret := &Operation{
  88205. ServerResponse: googleapi.ServerResponse{
  88206. Header: res.Header,
  88207. HTTPStatusCode: res.StatusCode,
  88208. },
  88209. }
  88210. target := &ret
  88211. if err := gensupport.DecodeResponse(target, res); err != nil {
  88212. return nil, err
  88213. }
  88214. return ret, nil
  88215. // {
  88216. // "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.",
  88217. // "httpMethod": "PATCH",
  88218. // "id": "compute.subnetworks.patch",
  88219. // "parameterOrder": [
  88220. // "project",
  88221. // "region",
  88222. // "subnetwork"
  88223. // ],
  88224. // "parameters": {
  88225. // "project": {
  88226. // "description": "Project ID for this request.",
  88227. // "location": "path",
  88228. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88229. // "required": true,
  88230. // "type": "string"
  88231. // },
  88232. // "region": {
  88233. // "description": "Name of the region scoping this request.",
  88234. // "location": "path",
  88235. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88236. // "required": true,
  88237. // "type": "string"
  88238. // },
  88239. // "requestId": {
  88240. // "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).",
  88241. // "location": "query",
  88242. // "type": "string"
  88243. // },
  88244. // "subnetwork": {
  88245. // "description": "Name of the Subnetwork resource to patch.",
  88246. // "location": "path",
  88247. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88248. // "required": true,
  88249. // "type": "string"
  88250. // }
  88251. // },
  88252. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}",
  88253. // "request": {
  88254. // "$ref": "Subnetwork"
  88255. // },
  88256. // "response": {
  88257. // "$ref": "Operation"
  88258. // },
  88259. // "scopes": [
  88260. // "https://www.googleapis.com/auth/cloud-platform",
  88261. // "https://www.googleapis.com/auth/compute"
  88262. // ]
  88263. // }
  88264. }
  88265. // method id "compute.subnetworks.setIamPolicy":
  88266. type SubnetworksSetIamPolicyCall struct {
  88267. s *Service
  88268. project string
  88269. region string
  88270. resource string
  88271. regionsetpolicyrequest *RegionSetPolicyRequest
  88272. urlParams_ gensupport.URLParams
  88273. ctx_ context.Context
  88274. header_ http.Header
  88275. }
  88276. // SetIamPolicy: Sets the access control policy on the specified
  88277. // resource. Replaces any existing policy.
  88278. func (r *SubnetworksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *SubnetworksSetIamPolicyCall {
  88279. c := &SubnetworksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88280. c.project = project
  88281. c.region = region
  88282. c.resource = resource
  88283. c.regionsetpolicyrequest = regionsetpolicyrequest
  88284. return c
  88285. }
  88286. // Fields allows partial responses to be retrieved. See
  88287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88288. // for more information.
  88289. func (c *SubnetworksSetIamPolicyCall) Fields(s ...googleapi.Field) *SubnetworksSetIamPolicyCall {
  88290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88291. return c
  88292. }
  88293. // Context sets the context to be used in this call's Do method. Any
  88294. // pending HTTP request will be aborted if the provided context is
  88295. // canceled.
  88296. func (c *SubnetworksSetIamPolicyCall) Context(ctx context.Context) *SubnetworksSetIamPolicyCall {
  88297. c.ctx_ = ctx
  88298. return c
  88299. }
  88300. // Header returns an http.Header that can be modified by the caller to
  88301. // add HTTP headers to the request.
  88302. func (c *SubnetworksSetIamPolicyCall) Header() http.Header {
  88303. if c.header_ == nil {
  88304. c.header_ = make(http.Header)
  88305. }
  88306. return c.header_
  88307. }
  88308. func (c *SubnetworksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  88309. reqHeaders := make(http.Header)
  88310. for k, v := range c.header_ {
  88311. reqHeaders[k] = v
  88312. }
  88313. reqHeaders.Set("User-Agent", c.s.userAgent())
  88314. var body io.Reader = nil
  88315. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest)
  88316. if err != nil {
  88317. return nil, err
  88318. }
  88319. reqHeaders.Set("Content-Type", "application/json")
  88320. c.urlParams_.Set("alt", alt)
  88321. c.urlParams_.Set("prettyPrint", "false")
  88322. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy")
  88323. urls += "?" + c.urlParams_.Encode()
  88324. req, err := http.NewRequest("POST", urls, body)
  88325. if err != nil {
  88326. return nil, err
  88327. }
  88328. req.Header = reqHeaders
  88329. googleapi.Expand(req.URL, map[string]string{
  88330. "project": c.project,
  88331. "region": c.region,
  88332. "resource": c.resource,
  88333. })
  88334. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88335. }
  88336. // Do executes the "compute.subnetworks.setIamPolicy" call.
  88337. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  88338. // code is an error. Response headers are in either
  88339. // *Policy.ServerResponse.Header or (if a response was returned at all)
  88340. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  88341. // check whether the returned error was because http.StatusNotModified
  88342. // was returned.
  88343. func (c *SubnetworksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  88344. gensupport.SetOptions(c.urlParams_, opts...)
  88345. res, err := c.doRequest("json")
  88346. if res != nil && res.StatusCode == http.StatusNotModified {
  88347. if res.Body != nil {
  88348. res.Body.Close()
  88349. }
  88350. return nil, &googleapi.Error{
  88351. Code: res.StatusCode,
  88352. Header: res.Header,
  88353. }
  88354. }
  88355. if err != nil {
  88356. return nil, err
  88357. }
  88358. defer googleapi.CloseBody(res)
  88359. if err := googleapi.CheckResponse(res); err != nil {
  88360. return nil, err
  88361. }
  88362. ret := &Policy{
  88363. ServerResponse: googleapi.ServerResponse{
  88364. Header: res.Header,
  88365. HTTPStatusCode: res.StatusCode,
  88366. },
  88367. }
  88368. target := &ret
  88369. if err := gensupport.DecodeResponse(target, res); err != nil {
  88370. return nil, err
  88371. }
  88372. return ret, nil
  88373. // {
  88374. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  88375. // "httpMethod": "POST",
  88376. // "id": "compute.subnetworks.setIamPolicy",
  88377. // "parameterOrder": [
  88378. // "project",
  88379. // "region",
  88380. // "resource"
  88381. // ],
  88382. // "parameters": {
  88383. // "project": {
  88384. // "description": "Project ID for this request.",
  88385. // "location": "path",
  88386. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88387. // "required": true,
  88388. // "type": "string"
  88389. // },
  88390. // "region": {
  88391. // "description": "The name of the region for this request.",
  88392. // "location": "path",
  88393. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88394. // "required": true,
  88395. // "type": "string"
  88396. // },
  88397. // "resource": {
  88398. // "description": "Name or id of the resource for this request.",
  88399. // "location": "path",
  88400. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88401. // "required": true,
  88402. // "type": "string"
  88403. // }
  88404. // },
  88405. // "path": "{project}/regions/{region}/subnetworks/{resource}/setIamPolicy",
  88406. // "request": {
  88407. // "$ref": "RegionSetPolicyRequest"
  88408. // },
  88409. // "response": {
  88410. // "$ref": "Policy"
  88411. // },
  88412. // "scopes": [
  88413. // "https://www.googleapis.com/auth/cloud-platform",
  88414. // "https://www.googleapis.com/auth/compute"
  88415. // ]
  88416. // }
  88417. }
  88418. // method id "compute.subnetworks.setPrivateIpGoogleAccess":
  88419. type SubnetworksSetPrivateIpGoogleAccessCall struct {
  88420. s *Service
  88421. project string
  88422. region string
  88423. subnetwork string
  88424. subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest
  88425. urlParams_ gensupport.URLParams
  88426. ctx_ context.Context
  88427. header_ http.Header
  88428. }
  88429. // SetPrivateIpGoogleAccess: Set whether VMs in this subnet can access
  88430. // Google services without assigning external IP addresses through
  88431. // Private Google Access.
  88432. func (r *SubnetworksService) SetPrivateIpGoogleAccess(project string, region string, subnetwork string, subnetworkssetprivateipgoogleaccessrequest *SubnetworksSetPrivateIpGoogleAccessRequest) *SubnetworksSetPrivateIpGoogleAccessCall {
  88433. c := &SubnetworksSetPrivateIpGoogleAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88434. c.project = project
  88435. c.region = region
  88436. c.subnetwork = subnetwork
  88437. c.subnetworkssetprivateipgoogleaccessrequest = subnetworkssetprivateipgoogleaccessrequest
  88438. return c
  88439. }
  88440. // RequestId sets the optional parameter "requestId": An optional
  88441. // request ID to identify requests. Specify a unique request ID so that
  88442. // if you must retry your request, the server will know to ignore the
  88443. // request if it has already been completed.
  88444. //
  88445. // For example, consider a situation where you make an initial request
  88446. // and the request times out. If you make the request again with the
  88447. // same request ID, the server can check if original operation with the
  88448. // same request ID was received, and if so, will ignore the second
  88449. // request. This prevents clients from accidentally creating duplicate
  88450. // commitments.
  88451. //
  88452. // The request ID must be a valid UUID with the exception that zero UUID
  88453. // is not supported (00000000-0000-0000-0000-000000000000).
  88454. func (c *SubnetworksSetPrivateIpGoogleAccessCall) RequestId(requestId string) *SubnetworksSetPrivateIpGoogleAccessCall {
  88455. c.urlParams_.Set("requestId", requestId)
  88456. return c
  88457. }
  88458. // Fields allows partial responses to be retrieved. See
  88459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88460. // for more information.
  88461. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Fields(s ...googleapi.Field) *SubnetworksSetPrivateIpGoogleAccessCall {
  88462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88463. return c
  88464. }
  88465. // Context sets the context to be used in this call's Do method. Any
  88466. // pending HTTP request will be aborted if the provided context is
  88467. // canceled.
  88468. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Context(ctx context.Context) *SubnetworksSetPrivateIpGoogleAccessCall {
  88469. c.ctx_ = ctx
  88470. return c
  88471. }
  88472. // Header returns an http.Header that can be modified by the caller to
  88473. // add HTTP headers to the request.
  88474. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Header() http.Header {
  88475. if c.header_ == nil {
  88476. c.header_ = make(http.Header)
  88477. }
  88478. return c.header_
  88479. }
  88480. func (c *SubnetworksSetPrivateIpGoogleAccessCall) doRequest(alt string) (*http.Response, error) {
  88481. reqHeaders := make(http.Header)
  88482. for k, v := range c.header_ {
  88483. reqHeaders[k] = v
  88484. }
  88485. reqHeaders.Set("User-Agent", c.s.userAgent())
  88486. var body io.Reader = nil
  88487. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subnetworkssetprivateipgoogleaccessrequest)
  88488. if err != nil {
  88489. return nil, err
  88490. }
  88491. reqHeaders.Set("Content-Type", "application/json")
  88492. c.urlParams_.Set("alt", alt)
  88493. c.urlParams_.Set("prettyPrint", "false")
  88494. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess")
  88495. urls += "?" + c.urlParams_.Encode()
  88496. req, err := http.NewRequest("POST", urls, body)
  88497. if err != nil {
  88498. return nil, err
  88499. }
  88500. req.Header = reqHeaders
  88501. googleapi.Expand(req.URL, map[string]string{
  88502. "project": c.project,
  88503. "region": c.region,
  88504. "subnetwork": c.subnetwork,
  88505. })
  88506. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88507. }
  88508. // Do executes the "compute.subnetworks.setPrivateIpGoogleAccess" call.
  88509. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88510. // status code is an error. Response headers are in either
  88511. // *Operation.ServerResponse.Header or (if a response was returned at
  88512. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88513. // to check whether the returned error was because
  88514. // http.StatusNotModified was returned.
  88515. func (c *SubnetworksSetPrivateIpGoogleAccessCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88516. gensupport.SetOptions(c.urlParams_, opts...)
  88517. res, err := c.doRequest("json")
  88518. if res != nil && res.StatusCode == http.StatusNotModified {
  88519. if res.Body != nil {
  88520. res.Body.Close()
  88521. }
  88522. return nil, &googleapi.Error{
  88523. Code: res.StatusCode,
  88524. Header: res.Header,
  88525. }
  88526. }
  88527. if err != nil {
  88528. return nil, err
  88529. }
  88530. defer googleapi.CloseBody(res)
  88531. if err := googleapi.CheckResponse(res); err != nil {
  88532. return nil, err
  88533. }
  88534. ret := &Operation{
  88535. ServerResponse: googleapi.ServerResponse{
  88536. Header: res.Header,
  88537. HTTPStatusCode: res.StatusCode,
  88538. },
  88539. }
  88540. target := &ret
  88541. if err := gensupport.DecodeResponse(target, res); err != nil {
  88542. return nil, err
  88543. }
  88544. return ret, nil
  88545. // {
  88546. // "description": "Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.",
  88547. // "httpMethod": "POST",
  88548. // "id": "compute.subnetworks.setPrivateIpGoogleAccess",
  88549. // "parameterOrder": [
  88550. // "project",
  88551. // "region",
  88552. // "subnetwork"
  88553. // ],
  88554. // "parameters": {
  88555. // "project": {
  88556. // "description": "Project ID for this request.",
  88557. // "location": "path",
  88558. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88559. // "required": true,
  88560. // "type": "string"
  88561. // },
  88562. // "region": {
  88563. // "description": "Name of the region scoping this request.",
  88564. // "location": "path",
  88565. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88566. // "required": true,
  88567. // "type": "string"
  88568. // },
  88569. // "requestId": {
  88570. // "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).",
  88571. // "location": "query",
  88572. // "type": "string"
  88573. // },
  88574. // "subnetwork": {
  88575. // "description": "Name of the Subnetwork resource.",
  88576. // "location": "path",
  88577. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88578. // "required": true,
  88579. // "type": "string"
  88580. // }
  88581. // },
  88582. // "path": "{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess",
  88583. // "request": {
  88584. // "$ref": "SubnetworksSetPrivateIpGoogleAccessRequest"
  88585. // },
  88586. // "response": {
  88587. // "$ref": "Operation"
  88588. // },
  88589. // "scopes": [
  88590. // "https://www.googleapis.com/auth/cloud-platform",
  88591. // "https://www.googleapis.com/auth/compute"
  88592. // ]
  88593. // }
  88594. }
  88595. // method id "compute.subnetworks.testIamPermissions":
  88596. type SubnetworksTestIamPermissionsCall struct {
  88597. s *Service
  88598. project string
  88599. region string
  88600. resource string
  88601. testpermissionsrequest *TestPermissionsRequest
  88602. urlParams_ gensupport.URLParams
  88603. ctx_ context.Context
  88604. header_ http.Header
  88605. }
  88606. // TestIamPermissions: Returns permissions that a caller has on the
  88607. // specified resource.
  88608. func (r *SubnetworksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *SubnetworksTestIamPermissionsCall {
  88609. c := &SubnetworksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88610. c.project = project
  88611. c.region = region
  88612. c.resource = resource
  88613. c.testpermissionsrequest = testpermissionsrequest
  88614. return c
  88615. }
  88616. // Fields allows partial responses to be retrieved. See
  88617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88618. // for more information.
  88619. func (c *SubnetworksTestIamPermissionsCall) Fields(s ...googleapi.Field) *SubnetworksTestIamPermissionsCall {
  88620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88621. return c
  88622. }
  88623. // Context sets the context to be used in this call's Do method. Any
  88624. // pending HTTP request will be aborted if the provided context is
  88625. // canceled.
  88626. func (c *SubnetworksTestIamPermissionsCall) Context(ctx context.Context) *SubnetworksTestIamPermissionsCall {
  88627. c.ctx_ = ctx
  88628. return c
  88629. }
  88630. // Header returns an http.Header that can be modified by the caller to
  88631. // add HTTP headers to the request.
  88632. func (c *SubnetworksTestIamPermissionsCall) Header() http.Header {
  88633. if c.header_ == nil {
  88634. c.header_ = make(http.Header)
  88635. }
  88636. return c.header_
  88637. }
  88638. func (c *SubnetworksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  88639. reqHeaders := make(http.Header)
  88640. for k, v := range c.header_ {
  88641. reqHeaders[k] = v
  88642. }
  88643. reqHeaders.Set("User-Agent", c.s.userAgent())
  88644. var body io.Reader = nil
  88645. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  88646. if err != nil {
  88647. return nil, err
  88648. }
  88649. reqHeaders.Set("Content-Type", "application/json")
  88650. c.urlParams_.Set("alt", alt)
  88651. c.urlParams_.Set("prettyPrint", "false")
  88652. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions")
  88653. urls += "?" + c.urlParams_.Encode()
  88654. req, err := http.NewRequest("POST", urls, body)
  88655. if err != nil {
  88656. return nil, err
  88657. }
  88658. req.Header = reqHeaders
  88659. googleapi.Expand(req.URL, map[string]string{
  88660. "project": c.project,
  88661. "region": c.region,
  88662. "resource": c.resource,
  88663. })
  88664. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88665. }
  88666. // Do executes the "compute.subnetworks.testIamPermissions" call.
  88667. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  88668. // non-2xx status code is an error. Response headers are in either
  88669. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  88670. // returned at all) in error.(*googleapi.Error).Header. Use
  88671. // googleapi.IsNotModified to check whether the returned error was
  88672. // because http.StatusNotModified was returned.
  88673. func (c *SubnetworksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  88674. gensupport.SetOptions(c.urlParams_, opts...)
  88675. res, err := c.doRequest("json")
  88676. if res != nil && res.StatusCode == http.StatusNotModified {
  88677. if res.Body != nil {
  88678. res.Body.Close()
  88679. }
  88680. return nil, &googleapi.Error{
  88681. Code: res.StatusCode,
  88682. Header: res.Header,
  88683. }
  88684. }
  88685. if err != nil {
  88686. return nil, err
  88687. }
  88688. defer googleapi.CloseBody(res)
  88689. if err := googleapi.CheckResponse(res); err != nil {
  88690. return nil, err
  88691. }
  88692. ret := &TestPermissionsResponse{
  88693. ServerResponse: googleapi.ServerResponse{
  88694. Header: res.Header,
  88695. HTTPStatusCode: res.StatusCode,
  88696. },
  88697. }
  88698. target := &ret
  88699. if err := gensupport.DecodeResponse(target, res); err != nil {
  88700. return nil, err
  88701. }
  88702. return ret, nil
  88703. // {
  88704. // "description": "Returns permissions that a caller has on the specified resource.",
  88705. // "httpMethod": "POST",
  88706. // "id": "compute.subnetworks.testIamPermissions",
  88707. // "parameterOrder": [
  88708. // "project",
  88709. // "region",
  88710. // "resource"
  88711. // ],
  88712. // "parameters": {
  88713. // "project": {
  88714. // "description": "Project ID for this request.",
  88715. // "location": "path",
  88716. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88717. // "required": true,
  88718. // "type": "string"
  88719. // },
  88720. // "region": {
  88721. // "description": "The name of the region for this request.",
  88722. // "location": "path",
  88723. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  88724. // "required": true,
  88725. // "type": "string"
  88726. // },
  88727. // "resource": {
  88728. // "description": "Name or id of the resource for this request.",
  88729. // "location": "path",
  88730. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88731. // "required": true,
  88732. // "type": "string"
  88733. // }
  88734. // },
  88735. // "path": "{project}/regions/{region}/subnetworks/{resource}/testIamPermissions",
  88736. // "request": {
  88737. // "$ref": "TestPermissionsRequest"
  88738. // },
  88739. // "response": {
  88740. // "$ref": "TestPermissionsResponse"
  88741. // },
  88742. // "scopes": [
  88743. // "https://www.googleapis.com/auth/cloud-platform",
  88744. // "https://www.googleapis.com/auth/compute",
  88745. // "https://www.googleapis.com/auth/compute.readonly"
  88746. // ]
  88747. // }
  88748. }
  88749. // method id "compute.targetHttpProxies.delete":
  88750. type TargetHttpProxiesDeleteCall struct {
  88751. s *Service
  88752. project string
  88753. targetHttpProxy string
  88754. urlParams_ gensupport.URLParams
  88755. ctx_ context.Context
  88756. header_ http.Header
  88757. }
  88758. // Delete: Deletes the specified TargetHttpProxy resource.
  88759. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete
  88760. func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall {
  88761. c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88762. c.project = project
  88763. c.targetHttpProxy = targetHttpProxy
  88764. return c
  88765. }
  88766. // RequestId sets the optional parameter "requestId": An optional
  88767. // request ID to identify requests. Specify a unique request ID so that
  88768. // if you must retry your request, the server will know to ignore the
  88769. // request if it has already been completed.
  88770. //
  88771. // For example, consider a situation where you make an initial request
  88772. // and the request times out. If you make the request again with the
  88773. // same request ID, the server can check if original operation with the
  88774. // same request ID was received, and if so, will ignore the second
  88775. // request. This prevents clients from accidentally creating duplicate
  88776. // commitments.
  88777. //
  88778. // The request ID must be a valid UUID with the exception that zero UUID
  88779. // is not supported (00000000-0000-0000-0000-000000000000).
  88780. func (c *TargetHttpProxiesDeleteCall) RequestId(requestId string) *TargetHttpProxiesDeleteCall {
  88781. c.urlParams_.Set("requestId", requestId)
  88782. return c
  88783. }
  88784. // Fields allows partial responses to be retrieved. See
  88785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88786. // for more information.
  88787. func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall {
  88788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88789. return c
  88790. }
  88791. // Context sets the context to be used in this call's Do method. Any
  88792. // pending HTTP request will be aborted if the provided context is
  88793. // canceled.
  88794. func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall {
  88795. c.ctx_ = ctx
  88796. return c
  88797. }
  88798. // Header returns an http.Header that can be modified by the caller to
  88799. // add HTTP headers to the request.
  88800. func (c *TargetHttpProxiesDeleteCall) Header() http.Header {
  88801. if c.header_ == nil {
  88802. c.header_ = make(http.Header)
  88803. }
  88804. return c.header_
  88805. }
  88806. func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  88807. reqHeaders := make(http.Header)
  88808. for k, v := range c.header_ {
  88809. reqHeaders[k] = v
  88810. }
  88811. reqHeaders.Set("User-Agent", c.s.userAgent())
  88812. var body io.Reader = nil
  88813. c.urlParams_.Set("alt", alt)
  88814. c.urlParams_.Set("prettyPrint", "false")
  88815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  88816. urls += "?" + c.urlParams_.Encode()
  88817. req, err := http.NewRequest("DELETE", urls, body)
  88818. if err != nil {
  88819. return nil, err
  88820. }
  88821. req.Header = reqHeaders
  88822. googleapi.Expand(req.URL, map[string]string{
  88823. "project": c.project,
  88824. "targetHttpProxy": c.targetHttpProxy,
  88825. })
  88826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88827. }
  88828. // Do executes the "compute.targetHttpProxies.delete" call.
  88829. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  88830. // status code is an error. Response headers are in either
  88831. // *Operation.ServerResponse.Header or (if a response was returned at
  88832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  88833. // to check whether the returned error was because
  88834. // http.StatusNotModified was returned.
  88835. func (c *TargetHttpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  88836. gensupport.SetOptions(c.urlParams_, opts...)
  88837. res, err := c.doRequest("json")
  88838. if res != nil && res.StatusCode == http.StatusNotModified {
  88839. if res.Body != nil {
  88840. res.Body.Close()
  88841. }
  88842. return nil, &googleapi.Error{
  88843. Code: res.StatusCode,
  88844. Header: res.Header,
  88845. }
  88846. }
  88847. if err != nil {
  88848. return nil, err
  88849. }
  88850. defer googleapi.CloseBody(res)
  88851. if err := googleapi.CheckResponse(res); err != nil {
  88852. return nil, err
  88853. }
  88854. ret := &Operation{
  88855. ServerResponse: googleapi.ServerResponse{
  88856. Header: res.Header,
  88857. HTTPStatusCode: res.StatusCode,
  88858. },
  88859. }
  88860. target := &ret
  88861. if err := gensupport.DecodeResponse(target, res); err != nil {
  88862. return nil, err
  88863. }
  88864. return ret, nil
  88865. // {
  88866. // "description": "Deletes the specified TargetHttpProxy resource.",
  88867. // "httpMethod": "DELETE",
  88868. // "id": "compute.targetHttpProxies.delete",
  88869. // "parameterOrder": [
  88870. // "project",
  88871. // "targetHttpProxy"
  88872. // ],
  88873. // "parameters": {
  88874. // "project": {
  88875. // "description": "Project ID for this request.",
  88876. // "location": "path",
  88877. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  88878. // "required": true,
  88879. // "type": "string"
  88880. // },
  88881. // "requestId": {
  88882. // "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).",
  88883. // "location": "query",
  88884. // "type": "string"
  88885. // },
  88886. // "targetHttpProxy": {
  88887. // "description": "Name of the TargetHttpProxy resource to delete.",
  88888. // "location": "path",
  88889. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  88890. // "required": true,
  88891. // "type": "string"
  88892. // }
  88893. // },
  88894. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  88895. // "response": {
  88896. // "$ref": "Operation"
  88897. // },
  88898. // "scopes": [
  88899. // "https://www.googleapis.com/auth/cloud-platform",
  88900. // "https://www.googleapis.com/auth/compute"
  88901. // ]
  88902. // }
  88903. }
  88904. // method id "compute.targetHttpProxies.get":
  88905. type TargetHttpProxiesGetCall struct {
  88906. s *Service
  88907. project string
  88908. targetHttpProxy string
  88909. urlParams_ gensupport.URLParams
  88910. ifNoneMatch_ string
  88911. ctx_ context.Context
  88912. header_ http.Header
  88913. }
  88914. // Get: Returns the specified TargetHttpProxy resource. Gets a list of
  88915. // available target HTTP proxies by making a list() request.
  88916. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get
  88917. func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall {
  88918. c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  88919. c.project = project
  88920. c.targetHttpProxy = targetHttpProxy
  88921. return c
  88922. }
  88923. // Fields allows partial responses to be retrieved. See
  88924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  88925. // for more information.
  88926. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall {
  88927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  88928. return c
  88929. }
  88930. // IfNoneMatch sets the optional parameter which makes the operation
  88931. // fail if the object's ETag matches the given value. This is useful for
  88932. // getting updates only after the object has changed since the last
  88933. // request. Use googleapi.IsNotModified to check whether the response
  88934. // error from Do is the result of In-None-Match.
  88935. func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall {
  88936. c.ifNoneMatch_ = entityTag
  88937. return c
  88938. }
  88939. // Context sets the context to be used in this call's Do method. Any
  88940. // pending HTTP request will be aborted if the provided context is
  88941. // canceled.
  88942. func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall {
  88943. c.ctx_ = ctx
  88944. return c
  88945. }
  88946. // Header returns an http.Header that can be modified by the caller to
  88947. // add HTTP headers to the request.
  88948. func (c *TargetHttpProxiesGetCall) Header() http.Header {
  88949. if c.header_ == nil {
  88950. c.header_ = make(http.Header)
  88951. }
  88952. return c.header_
  88953. }
  88954. func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  88955. reqHeaders := make(http.Header)
  88956. for k, v := range c.header_ {
  88957. reqHeaders[k] = v
  88958. }
  88959. reqHeaders.Set("User-Agent", c.s.userAgent())
  88960. if c.ifNoneMatch_ != "" {
  88961. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  88962. }
  88963. var body io.Reader = nil
  88964. c.urlParams_.Set("alt", alt)
  88965. c.urlParams_.Set("prettyPrint", "false")
  88966. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}")
  88967. urls += "?" + c.urlParams_.Encode()
  88968. req, err := http.NewRequest("GET", urls, body)
  88969. if err != nil {
  88970. return nil, err
  88971. }
  88972. req.Header = reqHeaders
  88973. googleapi.Expand(req.URL, map[string]string{
  88974. "project": c.project,
  88975. "targetHttpProxy": c.targetHttpProxy,
  88976. })
  88977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  88978. }
  88979. // Do executes the "compute.targetHttpProxies.get" call.
  88980. // Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx
  88981. // status code is an error. Response headers are in either
  88982. // *TargetHttpProxy.ServerResponse.Header or (if a response was returned
  88983. // at all) in error.(*googleapi.Error).Header. Use
  88984. // googleapi.IsNotModified to check whether the returned error was
  88985. // because http.StatusNotModified was returned.
  88986. func (c *TargetHttpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxy, error) {
  88987. gensupport.SetOptions(c.urlParams_, opts...)
  88988. res, err := c.doRequest("json")
  88989. if res != nil && res.StatusCode == http.StatusNotModified {
  88990. if res.Body != nil {
  88991. res.Body.Close()
  88992. }
  88993. return nil, &googleapi.Error{
  88994. Code: res.StatusCode,
  88995. Header: res.Header,
  88996. }
  88997. }
  88998. if err != nil {
  88999. return nil, err
  89000. }
  89001. defer googleapi.CloseBody(res)
  89002. if err := googleapi.CheckResponse(res); err != nil {
  89003. return nil, err
  89004. }
  89005. ret := &TargetHttpProxy{
  89006. ServerResponse: googleapi.ServerResponse{
  89007. Header: res.Header,
  89008. HTTPStatusCode: res.StatusCode,
  89009. },
  89010. }
  89011. target := &ret
  89012. if err := gensupport.DecodeResponse(target, res); err != nil {
  89013. return nil, err
  89014. }
  89015. return ret, nil
  89016. // {
  89017. // "description": "Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request.",
  89018. // "httpMethod": "GET",
  89019. // "id": "compute.targetHttpProxies.get",
  89020. // "parameterOrder": [
  89021. // "project",
  89022. // "targetHttpProxy"
  89023. // ],
  89024. // "parameters": {
  89025. // "project": {
  89026. // "description": "Project ID for this request.",
  89027. // "location": "path",
  89028. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89029. // "required": true,
  89030. // "type": "string"
  89031. // },
  89032. // "targetHttpProxy": {
  89033. // "description": "Name of the TargetHttpProxy resource to return.",
  89034. // "location": "path",
  89035. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89036. // "required": true,
  89037. // "type": "string"
  89038. // }
  89039. // },
  89040. // "path": "{project}/global/targetHttpProxies/{targetHttpProxy}",
  89041. // "response": {
  89042. // "$ref": "TargetHttpProxy"
  89043. // },
  89044. // "scopes": [
  89045. // "https://www.googleapis.com/auth/cloud-platform",
  89046. // "https://www.googleapis.com/auth/compute",
  89047. // "https://www.googleapis.com/auth/compute.readonly"
  89048. // ]
  89049. // }
  89050. }
  89051. // method id "compute.targetHttpProxies.insert":
  89052. type TargetHttpProxiesInsertCall struct {
  89053. s *Service
  89054. project string
  89055. targethttpproxy *TargetHttpProxy
  89056. urlParams_ gensupport.URLParams
  89057. ctx_ context.Context
  89058. header_ http.Header
  89059. }
  89060. // Insert: Creates a TargetHttpProxy resource in the specified project
  89061. // using the data included in the request.
  89062. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert
  89063. func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall {
  89064. c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89065. c.project = project
  89066. c.targethttpproxy = targethttpproxy
  89067. return c
  89068. }
  89069. // RequestId sets the optional parameter "requestId": An optional
  89070. // request ID to identify requests. Specify a unique request ID so that
  89071. // if you must retry your request, the server will know to ignore the
  89072. // request if it has already been completed.
  89073. //
  89074. // For example, consider a situation where you make an initial request
  89075. // and the request times out. If you make the request again with the
  89076. // same request ID, the server can check if original operation with the
  89077. // same request ID was received, and if so, will ignore the second
  89078. // request. This prevents clients from accidentally creating duplicate
  89079. // commitments.
  89080. //
  89081. // The request ID must be a valid UUID with the exception that zero UUID
  89082. // is not supported (00000000-0000-0000-0000-000000000000).
  89083. func (c *TargetHttpProxiesInsertCall) RequestId(requestId string) *TargetHttpProxiesInsertCall {
  89084. c.urlParams_.Set("requestId", requestId)
  89085. return c
  89086. }
  89087. // Fields allows partial responses to be retrieved. See
  89088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89089. // for more information.
  89090. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall {
  89091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89092. return c
  89093. }
  89094. // Context sets the context to be used in this call's Do method. Any
  89095. // pending HTTP request will be aborted if the provided context is
  89096. // canceled.
  89097. func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall {
  89098. c.ctx_ = ctx
  89099. return c
  89100. }
  89101. // Header returns an http.Header that can be modified by the caller to
  89102. // add HTTP headers to the request.
  89103. func (c *TargetHttpProxiesInsertCall) Header() http.Header {
  89104. if c.header_ == nil {
  89105. c.header_ = make(http.Header)
  89106. }
  89107. return c.header_
  89108. }
  89109. func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  89110. reqHeaders := make(http.Header)
  89111. for k, v := range c.header_ {
  89112. reqHeaders[k] = v
  89113. }
  89114. reqHeaders.Set("User-Agent", c.s.userAgent())
  89115. var body io.Reader = nil
  89116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy)
  89117. if err != nil {
  89118. return nil, err
  89119. }
  89120. reqHeaders.Set("Content-Type", "application/json")
  89121. c.urlParams_.Set("alt", alt)
  89122. c.urlParams_.Set("prettyPrint", "false")
  89123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  89124. urls += "?" + c.urlParams_.Encode()
  89125. req, err := http.NewRequest("POST", urls, body)
  89126. if err != nil {
  89127. return nil, err
  89128. }
  89129. req.Header = reqHeaders
  89130. googleapi.Expand(req.URL, map[string]string{
  89131. "project": c.project,
  89132. })
  89133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89134. }
  89135. // Do executes the "compute.targetHttpProxies.insert" call.
  89136. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89137. // status code is an error. Response headers are in either
  89138. // *Operation.ServerResponse.Header or (if a response was returned at
  89139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89140. // to check whether the returned error was because
  89141. // http.StatusNotModified was returned.
  89142. func (c *TargetHttpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89143. gensupport.SetOptions(c.urlParams_, opts...)
  89144. res, err := c.doRequest("json")
  89145. if res != nil && res.StatusCode == http.StatusNotModified {
  89146. if res.Body != nil {
  89147. res.Body.Close()
  89148. }
  89149. return nil, &googleapi.Error{
  89150. Code: res.StatusCode,
  89151. Header: res.Header,
  89152. }
  89153. }
  89154. if err != nil {
  89155. return nil, err
  89156. }
  89157. defer googleapi.CloseBody(res)
  89158. if err := googleapi.CheckResponse(res); err != nil {
  89159. return nil, err
  89160. }
  89161. ret := &Operation{
  89162. ServerResponse: googleapi.ServerResponse{
  89163. Header: res.Header,
  89164. HTTPStatusCode: res.StatusCode,
  89165. },
  89166. }
  89167. target := &ret
  89168. if err := gensupport.DecodeResponse(target, res); err != nil {
  89169. return nil, err
  89170. }
  89171. return ret, nil
  89172. // {
  89173. // "description": "Creates a TargetHttpProxy resource in the specified project using the data included in the request.",
  89174. // "httpMethod": "POST",
  89175. // "id": "compute.targetHttpProxies.insert",
  89176. // "parameterOrder": [
  89177. // "project"
  89178. // ],
  89179. // "parameters": {
  89180. // "project": {
  89181. // "description": "Project ID for this request.",
  89182. // "location": "path",
  89183. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89184. // "required": true,
  89185. // "type": "string"
  89186. // },
  89187. // "requestId": {
  89188. // "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).",
  89189. // "location": "query",
  89190. // "type": "string"
  89191. // }
  89192. // },
  89193. // "path": "{project}/global/targetHttpProxies",
  89194. // "request": {
  89195. // "$ref": "TargetHttpProxy"
  89196. // },
  89197. // "response": {
  89198. // "$ref": "Operation"
  89199. // },
  89200. // "scopes": [
  89201. // "https://www.googleapis.com/auth/cloud-platform",
  89202. // "https://www.googleapis.com/auth/compute"
  89203. // ]
  89204. // }
  89205. }
  89206. // method id "compute.targetHttpProxies.list":
  89207. type TargetHttpProxiesListCall struct {
  89208. s *Service
  89209. project string
  89210. urlParams_ gensupport.URLParams
  89211. ifNoneMatch_ string
  89212. ctx_ context.Context
  89213. header_ http.Header
  89214. }
  89215. // List: Retrieves the list of TargetHttpProxy resources available to
  89216. // the specified project.
  89217. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list
  89218. func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall {
  89219. c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89220. c.project = project
  89221. return c
  89222. }
  89223. // Filter sets the optional parameter "filter": A filter expression that
  89224. // filters resources listed in the response. The expression must specify
  89225. // the field name, a comparison operator, and the value that you want to
  89226. // use for filtering. The value must be a string, a number, or a
  89227. // boolean. The comparison operator must be either =, !=, >, or <.
  89228. //
  89229. // For example, if you are filtering Compute Engine instances, you can
  89230. // exclude instances named example-instance by specifying name !=
  89231. // example-instance.
  89232. //
  89233. // You can also filter nested fields. For example, you could specify
  89234. // scheduling.automaticRestart = false to include instances only if they
  89235. // are not scheduled for automatic restarts. You can use filtering on
  89236. // nested fields to filter based on resource labels.
  89237. //
  89238. // To filter on multiple expressions, provide each separate expression
  89239. // within parentheses. For example, (scheduling.automaticRestart = true)
  89240. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  89241. // AND expression. However, you can include AND and OR expressions
  89242. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  89243. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  89244. // true).
  89245. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall {
  89246. c.urlParams_.Set("filter", filter)
  89247. return c
  89248. }
  89249. // MaxResults sets the optional parameter "maxResults": The maximum
  89250. // number of results per page that should be returned. If the number of
  89251. // available results is larger than maxResults, Compute Engine returns a
  89252. // nextPageToken that can be used to get the next page of results in
  89253. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  89254. // (Default: 500)
  89255. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall {
  89256. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  89257. return c
  89258. }
  89259. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  89260. // a certain order. By default, results are returned in alphanumerical
  89261. // order based on the resource name.
  89262. //
  89263. // You can also sort results in descending order based on the creation
  89264. // timestamp using orderBy="creationTimestamp desc". This sorts results
  89265. // based on the creationTimestamp field in reverse chronological order
  89266. // (newest result first). Use this to sort resources like operations so
  89267. // that the newest operation is returned first.
  89268. //
  89269. // Currently, only sorting by name or creationTimestamp desc is
  89270. // supported.
  89271. func (c *TargetHttpProxiesListCall) OrderBy(orderBy string) *TargetHttpProxiesListCall {
  89272. c.urlParams_.Set("orderBy", orderBy)
  89273. return c
  89274. }
  89275. // PageToken sets the optional parameter "pageToken": Specifies a page
  89276. // token to use. Set pageToken to the nextPageToken returned by a
  89277. // previous list request to get the next page of results.
  89278. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall {
  89279. c.urlParams_.Set("pageToken", pageToken)
  89280. return c
  89281. }
  89282. // Fields allows partial responses to be retrieved. See
  89283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89284. // for more information.
  89285. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall {
  89286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89287. return c
  89288. }
  89289. // IfNoneMatch sets the optional parameter which makes the operation
  89290. // fail if the object's ETag matches the given value. This is useful for
  89291. // getting updates only after the object has changed since the last
  89292. // request. Use googleapi.IsNotModified to check whether the response
  89293. // error from Do is the result of In-None-Match.
  89294. func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall {
  89295. c.ifNoneMatch_ = entityTag
  89296. return c
  89297. }
  89298. // Context sets the context to be used in this call's Do method. Any
  89299. // pending HTTP request will be aborted if the provided context is
  89300. // canceled.
  89301. func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall {
  89302. c.ctx_ = ctx
  89303. return c
  89304. }
  89305. // Header returns an http.Header that can be modified by the caller to
  89306. // add HTTP headers to the request.
  89307. func (c *TargetHttpProxiesListCall) Header() http.Header {
  89308. if c.header_ == nil {
  89309. c.header_ = make(http.Header)
  89310. }
  89311. return c.header_
  89312. }
  89313. func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  89314. reqHeaders := make(http.Header)
  89315. for k, v := range c.header_ {
  89316. reqHeaders[k] = v
  89317. }
  89318. reqHeaders.Set("User-Agent", c.s.userAgent())
  89319. if c.ifNoneMatch_ != "" {
  89320. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89321. }
  89322. var body io.Reader = nil
  89323. c.urlParams_.Set("alt", alt)
  89324. c.urlParams_.Set("prettyPrint", "false")
  89325. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies")
  89326. urls += "?" + c.urlParams_.Encode()
  89327. req, err := http.NewRequest("GET", urls, body)
  89328. if err != nil {
  89329. return nil, err
  89330. }
  89331. req.Header = reqHeaders
  89332. googleapi.Expand(req.URL, map[string]string{
  89333. "project": c.project,
  89334. })
  89335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89336. }
  89337. // Do executes the "compute.targetHttpProxies.list" call.
  89338. // Exactly one of *TargetHttpProxyList or error will be non-nil. Any
  89339. // non-2xx status code is an error. Response headers are in either
  89340. // *TargetHttpProxyList.ServerResponse.Header or (if a response was
  89341. // returned at all) in error.(*googleapi.Error).Header. Use
  89342. // googleapi.IsNotModified to check whether the returned error was
  89343. // because http.StatusNotModified was returned.
  89344. func (c *TargetHttpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpProxyList, error) {
  89345. gensupport.SetOptions(c.urlParams_, opts...)
  89346. res, err := c.doRequest("json")
  89347. if res != nil && res.StatusCode == http.StatusNotModified {
  89348. if res.Body != nil {
  89349. res.Body.Close()
  89350. }
  89351. return nil, &googleapi.Error{
  89352. Code: res.StatusCode,
  89353. Header: res.Header,
  89354. }
  89355. }
  89356. if err != nil {
  89357. return nil, err
  89358. }
  89359. defer googleapi.CloseBody(res)
  89360. if err := googleapi.CheckResponse(res); err != nil {
  89361. return nil, err
  89362. }
  89363. ret := &TargetHttpProxyList{
  89364. ServerResponse: googleapi.ServerResponse{
  89365. Header: res.Header,
  89366. HTTPStatusCode: res.StatusCode,
  89367. },
  89368. }
  89369. target := &ret
  89370. if err := gensupport.DecodeResponse(target, res); err != nil {
  89371. return nil, err
  89372. }
  89373. return ret, nil
  89374. // {
  89375. // "description": "Retrieves the list of TargetHttpProxy resources available to the specified project.",
  89376. // "httpMethod": "GET",
  89377. // "id": "compute.targetHttpProxies.list",
  89378. // "parameterOrder": [
  89379. // "project"
  89380. // ],
  89381. // "parameters": {
  89382. // "filter": {
  89383. // "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).",
  89384. // "location": "query",
  89385. // "type": "string"
  89386. // },
  89387. // "maxResults": {
  89388. // "default": "500",
  89389. // "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)",
  89390. // "format": "uint32",
  89391. // "location": "query",
  89392. // "minimum": "0",
  89393. // "type": "integer"
  89394. // },
  89395. // "orderBy": {
  89396. // "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.",
  89397. // "location": "query",
  89398. // "type": "string"
  89399. // },
  89400. // "pageToken": {
  89401. // "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.",
  89402. // "location": "query",
  89403. // "type": "string"
  89404. // },
  89405. // "project": {
  89406. // "description": "Project ID for this request.",
  89407. // "location": "path",
  89408. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89409. // "required": true,
  89410. // "type": "string"
  89411. // }
  89412. // },
  89413. // "path": "{project}/global/targetHttpProxies",
  89414. // "response": {
  89415. // "$ref": "TargetHttpProxyList"
  89416. // },
  89417. // "scopes": [
  89418. // "https://www.googleapis.com/auth/cloud-platform",
  89419. // "https://www.googleapis.com/auth/compute",
  89420. // "https://www.googleapis.com/auth/compute.readonly"
  89421. // ]
  89422. // }
  89423. }
  89424. // Pages invokes f for each page of results.
  89425. // A non-nil error returned from f will halt the iteration.
  89426. // The provided context supersedes any context provided to the Context method.
  89427. func (c *TargetHttpProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpProxyList) error) error {
  89428. c.ctx_ = ctx
  89429. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  89430. for {
  89431. x, err := c.Do()
  89432. if err != nil {
  89433. return err
  89434. }
  89435. if err := f(x); err != nil {
  89436. return err
  89437. }
  89438. if x.NextPageToken == "" {
  89439. return nil
  89440. }
  89441. c.PageToken(x.NextPageToken)
  89442. }
  89443. }
  89444. // method id "compute.targetHttpProxies.setUrlMap":
  89445. type TargetHttpProxiesSetUrlMapCall struct {
  89446. s *Service
  89447. project string
  89448. targetHttpProxy string
  89449. urlmapreference *UrlMapReference
  89450. urlParams_ gensupport.URLParams
  89451. ctx_ context.Context
  89452. header_ http.Header
  89453. }
  89454. // SetUrlMap: Changes the URL map for TargetHttpProxy.
  89455. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap
  89456. func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall {
  89457. c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89458. c.project = project
  89459. c.targetHttpProxy = targetHttpProxy
  89460. c.urlmapreference = urlmapreference
  89461. return c
  89462. }
  89463. // RequestId sets the optional parameter "requestId": An optional
  89464. // request ID to identify requests. Specify a unique request ID so that
  89465. // if you must retry your request, the server will know to ignore the
  89466. // request if it has already been completed.
  89467. //
  89468. // For example, consider a situation where you make an initial request
  89469. // and the request times out. If you make the request again with the
  89470. // same request ID, the server can check if original operation with the
  89471. // same request ID was received, and if so, will ignore the second
  89472. // request. This prevents clients from accidentally creating duplicate
  89473. // commitments.
  89474. //
  89475. // The request ID must be a valid UUID with the exception that zero UUID
  89476. // is not supported (00000000-0000-0000-0000-000000000000).
  89477. func (c *TargetHttpProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpProxiesSetUrlMapCall {
  89478. c.urlParams_.Set("requestId", requestId)
  89479. return c
  89480. }
  89481. // Fields allows partial responses to be retrieved. See
  89482. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89483. // for more information.
  89484. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall {
  89485. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89486. return c
  89487. }
  89488. // Context sets the context to be used in this call's Do method. Any
  89489. // pending HTTP request will be aborted if the provided context is
  89490. // canceled.
  89491. func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall {
  89492. c.ctx_ = ctx
  89493. return c
  89494. }
  89495. // Header returns an http.Header that can be modified by the caller to
  89496. // add HTTP headers to the request.
  89497. func (c *TargetHttpProxiesSetUrlMapCall) Header() http.Header {
  89498. if c.header_ == nil {
  89499. c.header_ = make(http.Header)
  89500. }
  89501. return c.header_
  89502. }
  89503. func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  89504. reqHeaders := make(http.Header)
  89505. for k, v := range c.header_ {
  89506. reqHeaders[k] = v
  89507. }
  89508. reqHeaders.Set("User-Agent", c.s.userAgent())
  89509. var body io.Reader = nil
  89510. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  89511. if err != nil {
  89512. return nil, err
  89513. }
  89514. reqHeaders.Set("Content-Type", "application/json")
  89515. c.urlParams_.Set("alt", alt)
  89516. c.urlParams_.Set("prettyPrint", "false")
  89517. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap")
  89518. urls += "?" + c.urlParams_.Encode()
  89519. req, err := http.NewRequest("POST", urls, body)
  89520. if err != nil {
  89521. return nil, err
  89522. }
  89523. req.Header = reqHeaders
  89524. googleapi.Expand(req.URL, map[string]string{
  89525. "project": c.project,
  89526. "targetHttpProxy": c.targetHttpProxy,
  89527. })
  89528. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89529. }
  89530. // Do executes the "compute.targetHttpProxies.setUrlMap" call.
  89531. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89532. // status code is an error. Response headers are in either
  89533. // *Operation.ServerResponse.Header or (if a response was returned at
  89534. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89535. // to check whether the returned error was because
  89536. // http.StatusNotModified was returned.
  89537. func (c *TargetHttpProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89538. gensupport.SetOptions(c.urlParams_, opts...)
  89539. res, err := c.doRequest("json")
  89540. if res != nil && res.StatusCode == http.StatusNotModified {
  89541. if res.Body != nil {
  89542. res.Body.Close()
  89543. }
  89544. return nil, &googleapi.Error{
  89545. Code: res.StatusCode,
  89546. Header: res.Header,
  89547. }
  89548. }
  89549. if err != nil {
  89550. return nil, err
  89551. }
  89552. defer googleapi.CloseBody(res)
  89553. if err := googleapi.CheckResponse(res); err != nil {
  89554. return nil, err
  89555. }
  89556. ret := &Operation{
  89557. ServerResponse: googleapi.ServerResponse{
  89558. Header: res.Header,
  89559. HTTPStatusCode: res.StatusCode,
  89560. },
  89561. }
  89562. target := &ret
  89563. if err := gensupport.DecodeResponse(target, res); err != nil {
  89564. return nil, err
  89565. }
  89566. return ret, nil
  89567. // {
  89568. // "description": "Changes the URL map for TargetHttpProxy.",
  89569. // "httpMethod": "POST",
  89570. // "id": "compute.targetHttpProxies.setUrlMap",
  89571. // "parameterOrder": [
  89572. // "project",
  89573. // "targetHttpProxy"
  89574. // ],
  89575. // "parameters": {
  89576. // "project": {
  89577. // "description": "Project ID for this request.",
  89578. // "location": "path",
  89579. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89580. // "required": true,
  89581. // "type": "string"
  89582. // },
  89583. // "requestId": {
  89584. // "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).",
  89585. // "location": "query",
  89586. // "type": "string"
  89587. // },
  89588. // "targetHttpProxy": {
  89589. // "description": "Name of the TargetHttpProxy to set a URL map for.",
  89590. // "location": "path",
  89591. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89592. // "required": true,
  89593. // "type": "string"
  89594. // }
  89595. // },
  89596. // "path": "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap",
  89597. // "request": {
  89598. // "$ref": "UrlMapReference"
  89599. // },
  89600. // "response": {
  89601. // "$ref": "Operation"
  89602. // },
  89603. // "scopes": [
  89604. // "https://www.googleapis.com/auth/cloud-platform",
  89605. // "https://www.googleapis.com/auth/compute"
  89606. // ]
  89607. // }
  89608. }
  89609. // method id "compute.targetHttpsProxies.delete":
  89610. type TargetHttpsProxiesDeleteCall struct {
  89611. s *Service
  89612. project string
  89613. targetHttpsProxy string
  89614. urlParams_ gensupport.URLParams
  89615. ctx_ context.Context
  89616. header_ http.Header
  89617. }
  89618. // Delete: Deletes the specified TargetHttpsProxy resource.
  89619. func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall {
  89620. c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89621. c.project = project
  89622. c.targetHttpsProxy = targetHttpsProxy
  89623. return c
  89624. }
  89625. // RequestId sets the optional parameter "requestId": An optional
  89626. // request ID to identify requests. Specify a unique request ID so that
  89627. // if you must retry your request, the server will know to ignore the
  89628. // request if it has already been completed.
  89629. //
  89630. // For example, consider a situation where you make an initial request
  89631. // and the request times out. If you make the request again with the
  89632. // same request ID, the server can check if original operation with the
  89633. // same request ID was received, and if so, will ignore the second
  89634. // request. This prevents clients from accidentally creating duplicate
  89635. // commitments.
  89636. //
  89637. // The request ID must be a valid UUID with the exception that zero UUID
  89638. // is not supported (00000000-0000-0000-0000-000000000000).
  89639. func (c *TargetHttpsProxiesDeleteCall) RequestId(requestId string) *TargetHttpsProxiesDeleteCall {
  89640. c.urlParams_.Set("requestId", requestId)
  89641. return c
  89642. }
  89643. // Fields allows partial responses to be retrieved. See
  89644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89645. // for more information.
  89646. func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall {
  89647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89648. return c
  89649. }
  89650. // Context sets the context to be used in this call's Do method. Any
  89651. // pending HTTP request will be aborted if the provided context is
  89652. // canceled.
  89653. func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall {
  89654. c.ctx_ = ctx
  89655. return c
  89656. }
  89657. // Header returns an http.Header that can be modified by the caller to
  89658. // add HTTP headers to the request.
  89659. func (c *TargetHttpsProxiesDeleteCall) Header() http.Header {
  89660. if c.header_ == nil {
  89661. c.header_ = make(http.Header)
  89662. }
  89663. return c.header_
  89664. }
  89665. func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  89666. reqHeaders := make(http.Header)
  89667. for k, v := range c.header_ {
  89668. reqHeaders[k] = v
  89669. }
  89670. reqHeaders.Set("User-Agent", c.s.userAgent())
  89671. var body io.Reader = nil
  89672. c.urlParams_.Set("alt", alt)
  89673. c.urlParams_.Set("prettyPrint", "false")
  89674. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  89675. urls += "?" + c.urlParams_.Encode()
  89676. req, err := http.NewRequest("DELETE", urls, body)
  89677. if err != nil {
  89678. return nil, err
  89679. }
  89680. req.Header = reqHeaders
  89681. googleapi.Expand(req.URL, map[string]string{
  89682. "project": c.project,
  89683. "targetHttpsProxy": c.targetHttpsProxy,
  89684. })
  89685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89686. }
  89687. // Do executes the "compute.targetHttpsProxies.delete" call.
  89688. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89689. // status code is an error. Response headers are in either
  89690. // *Operation.ServerResponse.Header or (if a response was returned at
  89691. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89692. // to check whether the returned error was because
  89693. // http.StatusNotModified was returned.
  89694. func (c *TargetHttpsProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  89695. gensupport.SetOptions(c.urlParams_, opts...)
  89696. res, err := c.doRequest("json")
  89697. if res != nil && res.StatusCode == http.StatusNotModified {
  89698. if res.Body != nil {
  89699. res.Body.Close()
  89700. }
  89701. return nil, &googleapi.Error{
  89702. Code: res.StatusCode,
  89703. Header: res.Header,
  89704. }
  89705. }
  89706. if err != nil {
  89707. return nil, err
  89708. }
  89709. defer googleapi.CloseBody(res)
  89710. if err := googleapi.CheckResponse(res); err != nil {
  89711. return nil, err
  89712. }
  89713. ret := &Operation{
  89714. ServerResponse: googleapi.ServerResponse{
  89715. Header: res.Header,
  89716. HTTPStatusCode: res.StatusCode,
  89717. },
  89718. }
  89719. target := &ret
  89720. if err := gensupport.DecodeResponse(target, res); err != nil {
  89721. return nil, err
  89722. }
  89723. return ret, nil
  89724. // {
  89725. // "description": "Deletes the specified TargetHttpsProxy resource.",
  89726. // "httpMethod": "DELETE",
  89727. // "id": "compute.targetHttpsProxies.delete",
  89728. // "parameterOrder": [
  89729. // "project",
  89730. // "targetHttpsProxy"
  89731. // ],
  89732. // "parameters": {
  89733. // "project": {
  89734. // "description": "Project ID for this request.",
  89735. // "location": "path",
  89736. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89737. // "required": true,
  89738. // "type": "string"
  89739. // },
  89740. // "requestId": {
  89741. // "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).",
  89742. // "location": "query",
  89743. // "type": "string"
  89744. // },
  89745. // "targetHttpsProxy": {
  89746. // "description": "Name of the TargetHttpsProxy resource to delete.",
  89747. // "location": "path",
  89748. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89749. // "required": true,
  89750. // "type": "string"
  89751. // }
  89752. // },
  89753. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  89754. // "response": {
  89755. // "$ref": "Operation"
  89756. // },
  89757. // "scopes": [
  89758. // "https://www.googleapis.com/auth/cloud-platform",
  89759. // "https://www.googleapis.com/auth/compute"
  89760. // ]
  89761. // }
  89762. }
  89763. // method id "compute.targetHttpsProxies.get":
  89764. type TargetHttpsProxiesGetCall struct {
  89765. s *Service
  89766. project string
  89767. targetHttpsProxy string
  89768. urlParams_ gensupport.URLParams
  89769. ifNoneMatch_ string
  89770. ctx_ context.Context
  89771. header_ http.Header
  89772. }
  89773. // Get: Returns the specified TargetHttpsProxy resource. Gets a list of
  89774. // available target HTTPS proxies by making a list() request.
  89775. func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall {
  89776. c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89777. c.project = project
  89778. c.targetHttpsProxy = targetHttpsProxy
  89779. return c
  89780. }
  89781. // Fields allows partial responses to be retrieved. See
  89782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89783. // for more information.
  89784. func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall {
  89785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89786. return c
  89787. }
  89788. // IfNoneMatch sets the optional parameter which makes the operation
  89789. // fail if the object's ETag matches the given value. This is useful for
  89790. // getting updates only after the object has changed since the last
  89791. // request. Use googleapi.IsNotModified to check whether the response
  89792. // error from Do is the result of In-None-Match.
  89793. func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall {
  89794. c.ifNoneMatch_ = entityTag
  89795. return c
  89796. }
  89797. // Context sets the context to be used in this call's Do method. Any
  89798. // pending HTTP request will be aborted if the provided context is
  89799. // canceled.
  89800. func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall {
  89801. c.ctx_ = ctx
  89802. return c
  89803. }
  89804. // Header returns an http.Header that can be modified by the caller to
  89805. // add HTTP headers to the request.
  89806. func (c *TargetHttpsProxiesGetCall) Header() http.Header {
  89807. if c.header_ == nil {
  89808. c.header_ = make(http.Header)
  89809. }
  89810. return c.header_
  89811. }
  89812. func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  89813. reqHeaders := make(http.Header)
  89814. for k, v := range c.header_ {
  89815. reqHeaders[k] = v
  89816. }
  89817. reqHeaders.Set("User-Agent", c.s.userAgent())
  89818. if c.ifNoneMatch_ != "" {
  89819. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  89820. }
  89821. var body io.Reader = nil
  89822. c.urlParams_.Set("alt", alt)
  89823. c.urlParams_.Set("prettyPrint", "false")
  89824. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}")
  89825. urls += "?" + c.urlParams_.Encode()
  89826. req, err := http.NewRequest("GET", urls, body)
  89827. if err != nil {
  89828. return nil, err
  89829. }
  89830. req.Header = reqHeaders
  89831. googleapi.Expand(req.URL, map[string]string{
  89832. "project": c.project,
  89833. "targetHttpsProxy": c.targetHttpsProxy,
  89834. })
  89835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89836. }
  89837. // Do executes the "compute.targetHttpsProxies.get" call.
  89838. // Exactly one of *TargetHttpsProxy or error will be non-nil. Any
  89839. // non-2xx status code is an error. Response headers are in either
  89840. // *TargetHttpsProxy.ServerResponse.Header or (if a response was
  89841. // returned at all) in error.(*googleapi.Error).Header. Use
  89842. // googleapi.IsNotModified to check whether the returned error was
  89843. // because http.StatusNotModified was returned.
  89844. func (c *TargetHttpsProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxy, error) {
  89845. gensupport.SetOptions(c.urlParams_, opts...)
  89846. res, err := c.doRequest("json")
  89847. if res != nil && res.StatusCode == http.StatusNotModified {
  89848. if res.Body != nil {
  89849. res.Body.Close()
  89850. }
  89851. return nil, &googleapi.Error{
  89852. Code: res.StatusCode,
  89853. Header: res.Header,
  89854. }
  89855. }
  89856. if err != nil {
  89857. return nil, err
  89858. }
  89859. defer googleapi.CloseBody(res)
  89860. if err := googleapi.CheckResponse(res); err != nil {
  89861. return nil, err
  89862. }
  89863. ret := &TargetHttpsProxy{
  89864. ServerResponse: googleapi.ServerResponse{
  89865. Header: res.Header,
  89866. HTTPStatusCode: res.StatusCode,
  89867. },
  89868. }
  89869. target := &ret
  89870. if err := gensupport.DecodeResponse(target, res); err != nil {
  89871. return nil, err
  89872. }
  89873. return ret, nil
  89874. // {
  89875. // "description": "Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request.",
  89876. // "httpMethod": "GET",
  89877. // "id": "compute.targetHttpsProxies.get",
  89878. // "parameterOrder": [
  89879. // "project",
  89880. // "targetHttpsProxy"
  89881. // ],
  89882. // "parameters": {
  89883. // "project": {
  89884. // "description": "Project ID for this request.",
  89885. // "location": "path",
  89886. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  89887. // "required": true,
  89888. // "type": "string"
  89889. // },
  89890. // "targetHttpsProxy": {
  89891. // "description": "Name of the TargetHttpsProxy resource to return.",
  89892. // "location": "path",
  89893. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  89894. // "required": true,
  89895. // "type": "string"
  89896. // }
  89897. // },
  89898. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}",
  89899. // "response": {
  89900. // "$ref": "TargetHttpsProxy"
  89901. // },
  89902. // "scopes": [
  89903. // "https://www.googleapis.com/auth/cloud-platform",
  89904. // "https://www.googleapis.com/auth/compute",
  89905. // "https://www.googleapis.com/auth/compute.readonly"
  89906. // ]
  89907. // }
  89908. }
  89909. // method id "compute.targetHttpsProxies.insert":
  89910. type TargetHttpsProxiesInsertCall struct {
  89911. s *Service
  89912. project string
  89913. targethttpsproxy *TargetHttpsProxy
  89914. urlParams_ gensupport.URLParams
  89915. ctx_ context.Context
  89916. header_ http.Header
  89917. }
  89918. // Insert: Creates a TargetHttpsProxy resource in the specified project
  89919. // using the data included in the request.
  89920. func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall {
  89921. c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  89922. c.project = project
  89923. c.targethttpsproxy = targethttpsproxy
  89924. return c
  89925. }
  89926. // RequestId sets the optional parameter "requestId": An optional
  89927. // request ID to identify requests. Specify a unique request ID so that
  89928. // if you must retry your request, the server will know to ignore the
  89929. // request if it has already been completed.
  89930. //
  89931. // For example, consider a situation where you make an initial request
  89932. // and the request times out. If you make the request again with the
  89933. // same request ID, the server can check if original operation with the
  89934. // same request ID was received, and if so, will ignore the second
  89935. // request. This prevents clients from accidentally creating duplicate
  89936. // commitments.
  89937. //
  89938. // The request ID must be a valid UUID with the exception that zero UUID
  89939. // is not supported (00000000-0000-0000-0000-000000000000).
  89940. func (c *TargetHttpsProxiesInsertCall) RequestId(requestId string) *TargetHttpsProxiesInsertCall {
  89941. c.urlParams_.Set("requestId", requestId)
  89942. return c
  89943. }
  89944. // Fields allows partial responses to be retrieved. See
  89945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  89946. // for more information.
  89947. func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall {
  89948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  89949. return c
  89950. }
  89951. // Context sets the context to be used in this call's Do method. Any
  89952. // pending HTTP request will be aborted if the provided context is
  89953. // canceled.
  89954. func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall {
  89955. c.ctx_ = ctx
  89956. return c
  89957. }
  89958. // Header returns an http.Header that can be modified by the caller to
  89959. // add HTTP headers to the request.
  89960. func (c *TargetHttpsProxiesInsertCall) Header() http.Header {
  89961. if c.header_ == nil {
  89962. c.header_ = make(http.Header)
  89963. }
  89964. return c.header_
  89965. }
  89966. func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  89967. reqHeaders := make(http.Header)
  89968. for k, v := range c.header_ {
  89969. reqHeaders[k] = v
  89970. }
  89971. reqHeaders.Set("User-Agent", c.s.userAgent())
  89972. var body io.Reader = nil
  89973. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy)
  89974. if err != nil {
  89975. return nil, err
  89976. }
  89977. reqHeaders.Set("Content-Type", "application/json")
  89978. c.urlParams_.Set("alt", alt)
  89979. c.urlParams_.Set("prettyPrint", "false")
  89980. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  89981. urls += "?" + c.urlParams_.Encode()
  89982. req, err := http.NewRequest("POST", urls, body)
  89983. if err != nil {
  89984. return nil, err
  89985. }
  89986. req.Header = reqHeaders
  89987. googleapi.Expand(req.URL, map[string]string{
  89988. "project": c.project,
  89989. })
  89990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  89991. }
  89992. // Do executes the "compute.targetHttpsProxies.insert" call.
  89993. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  89994. // status code is an error. Response headers are in either
  89995. // *Operation.ServerResponse.Header or (if a response was returned at
  89996. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  89997. // to check whether the returned error was because
  89998. // http.StatusNotModified was returned.
  89999. func (c *TargetHttpsProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90000. gensupport.SetOptions(c.urlParams_, opts...)
  90001. res, err := c.doRequest("json")
  90002. if res != nil && res.StatusCode == http.StatusNotModified {
  90003. if res.Body != nil {
  90004. res.Body.Close()
  90005. }
  90006. return nil, &googleapi.Error{
  90007. Code: res.StatusCode,
  90008. Header: res.Header,
  90009. }
  90010. }
  90011. if err != nil {
  90012. return nil, err
  90013. }
  90014. defer googleapi.CloseBody(res)
  90015. if err := googleapi.CheckResponse(res); err != nil {
  90016. return nil, err
  90017. }
  90018. ret := &Operation{
  90019. ServerResponse: googleapi.ServerResponse{
  90020. Header: res.Header,
  90021. HTTPStatusCode: res.StatusCode,
  90022. },
  90023. }
  90024. target := &ret
  90025. if err := gensupport.DecodeResponse(target, res); err != nil {
  90026. return nil, err
  90027. }
  90028. return ret, nil
  90029. // {
  90030. // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.",
  90031. // "httpMethod": "POST",
  90032. // "id": "compute.targetHttpsProxies.insert",
  90033. // "parameterOrder": [
  90034. // "project"
  90035. // ],
  90036. // "parameters": {
  90037. // "project": {
  90038. // "description": "Project ID for this request.",
  90039. // "location": "path",
  90040. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90041. // "required": true,
  90042. // "type": "string"
  90043. // },
  90044. // "requestId": {
  90045. // "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).",
  90046. // "location": "query",
  90047. // "type": "string"
  90048. // }
  90049. // },
  90050. // "path": "{project}/global/targetHttpsProxies",
  90051. // "request": {
  90052. // "$ref": "TargetHttpsProxy"
  90053. // },
  90054. // "response": {
  90055. // "$ref": "Operation"
  90056. // },
  90057. // "scopes": [
  90058. // "https://www.googleapis.com/auth/cloud-platform",
  90059. // "https://www.googleapis.com/auth/compute"
  90060. // ]
  90061. // }
  90062. }
  90063. // method id "compute.targetHttpsProxies.list":
  90064. type TargetHttpsProxiesListCall struct {
  90065. s *Service
  90066. project string
  90067. urlParams_ gensupport.URLParams
  90068. ifNoneMatch_ string
  90069. ctx_ context.Context
  90070. header_ http.Header
  90071. }
  90072. // List: Retrieves the list of TargetHttpsProxy resources available to
  90073. // the specified project.
  90074. func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall {
  90075. c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90076. c.project = project
  90077. return c
  90078. }
  90079. // Filter sets the optional parameter "filter": A filter expression that
  90080. // filters resources listed in the response. The expression must specify
  90081. // the field name, a comparison operator, and the value that you want to
  90082. // use for filtering. The value must be a string, a number, or a
  90083. // boolean. The comparison operator must be either =, !=, >, or <.
  90084. //
  90085. // For example, if you are filtering Compute Engine instances, you can
  90086. // exclude instances named example-instance by specifying name !=
  90087. // example-instance.
  90088. //
  90089. // You can also filter nested fields. For example, you could specify
  90090. // scheduling.automaticRestart = false to include instances only if they
  90091. // are not scheduled for automatic restarts. You can use filtering on
  90092. // nested fields to filter based on resource labels.
  90093. //
  90094. // To filter on multiple expressions, provide each separate expression
  90095. // within parentheses. For example, (scheduling.automaticRestart = true)
  90096. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90097. // AND expression. However, you can include AND and OR expressions
  90098. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90099. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90100. // true).
  90101. func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall {
  90102. c.urlParams_.Set("filter", filter)
  90103. return c
  90104. }
  90105. // MaxResults sets the optional parameter "maxResults": The maximum
  90106. // number of results per page that should be returned. If the number of
  90107. // available results is larger than maxResults, Compute Engine returns a
  90108. // nextPageToken that can be used to get the next page of results in
  90109. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  90110. // (Default: 500)
  90111. func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall {
  90112. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  90113. return c
  90114. }
  90115. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  90116. // a certain order. By default, results are returned in alphanumerical
  90117. // order based on the resource name.
  90118. //
  90119. // You can also sort results in descending order based on the creation
  90120. // timestamp using orderBy="creationTimestamp desc". This sorts results
  90121. // based on the creationTimestamp field in reverse chronological order
  90122. // (newest result first). Use this to sort resources like operations so
  90123. // that the newest operation is returned first.
  90124. //
  90125. // Currently, only sorting by name or creationTimestamp desc is
  90126. // supported.
  90127. func (c *TargetHttpsProxiesListCall) OrderBy(orderBy string) *TargetHttpsProxiesListCall {
  90128. c.urlParams_.Set("orderBy", orderBy)
  90129. return c
  90130. }
  90131. // PageToken sets the optional parameter "pageToken": Specifies a page
  90132. // token to use. Set pageToken to the nextPageToken returned by a
  90133. // previous list request to get the next page of results.
  90134. func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall {
  90135. c.urlParams_.Set("pageToken", pageToken)
  90136. return c
  90137. }
  90138. // Fields allows partial responses to be retrieved. See
  90139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90140. // for more information.
  90141. func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall {
  90142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90143. return c
  90144. }
  90145. // IfNoneMatch sets the optional parameter which makes the operation
  90146. // fail if the object's ETag matches the given value. This is useful for
  90147. // getting updates only after the object has changed since the last
  90148. // request. Use googleapi.IsNotModified to check whether the response
  90149. // error from Do is the result of In-None-Match.
  90150. func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall {
  90151. c.ifNoneMatch_ = entityTag
  90152. return c
  90153. }
  90154. // Context sets the context to be used in this call's Do method. Any
  90155. // pending HTTP request will be aborted if the provided context is
  90156. // canceled.
  90157. func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall {
  90158. c.ctx_ = ctx
  90159. return c
  90160. }
  90161. // Header returns an http.Header that can be modified by the caller to
  90162. // add HTTP headers to the request.
  90163. func (c *TargetHttpsProxiesListCall) Header() http.Header {
  90164. if c.header_ == nil {
  90165. c.header_ = make(http.Header)
  90166. }
  90167. return c.header_
  90168. }
  90169. func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) {
  90170. reqHeaders := make(http.Header)
  90171. for k, v := range c.header_ {
  90172. reqHeaders[k] = v
  90173. }
  90174. reqHeaders.Set("User-Agent", c.s.userAgent())
  90175. if c.ifNoneMatch_ != "" {
  90176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  90177. }
  90178. var body io.Reader = nil
  90179. c.urlParams_.Set("alt", alt)
  90180. c.urlParams_.Set("prettyPrint", "false")
  90181. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies")
  90182. urls += "?" + c.urlParams_.Encode()
  90183. req, err := http.NewRequest("GET", urls, body)
  90184. if err != nil {
  90185. return nil, err
  90186. }
  90187. req.Header = reqHeaders
  90188. googleapi.Expand(req.URL, map[string]string{
  90189. "project": c.project,
  90190. })
  90191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90192. }
  90193. // Do executes the "compute.targetHttpsProxies.list" call.
  90194. // Exactly one of *TargetHttpsProxyList or error will be non-nil. Any
  90195. // non-2xx status code is an error. Response headers are in either
  90196. // *TargetHttpsProxyList.ServerResponse.Header or (if a response was
  90197. // returned at all) in error.(*googleapi.Error).Header. Use
  90198. // googleapi.IsNotModified to check whether the returned error was
  90199. // because http.StatusNotModified was returned.
  90200. func (c *TargetHttpsProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetHttpsProxyList, error) {
  90201. gensupport.SetOptions(c.urlParams_, opts...)
  90202. res, err := c.doRequest("json")
  90203. if res != nil && res.StatusCode == http.StatusNotModified {
  90204. if res.Body != nil {
  90205. res.Body.Close()
  90206. }
  90207. return nil, &googleapi.Error{
  90208. Code: res.StatusCode,
  90209. Header: res.Header,
  90210. }
  90211. }
  90212. if err != nil {
  90213. return nil, err
  90214. }
  90215. defer googleapi.CloseBody(res)
  90216. if err := googleapi.CheckResponse(res); err != nil {
  90217. return nil, err
  90218. }
  90219. ret := &TargetHttpsProxyList{
  90220. ServerResponse: googleapi.ServerResponse{
  90221. Header: res.Header,
  90222. HTTPStatusCode: res.StatusCode,
  90223. },
  90224. }
  90225. target := &ret
  90226. if err := gensupport.DecodeResponse(target, res); err != nil {
  90227. return nil, err
  90228. }
  90229. return ret, nil
  90230. // {
  90231. // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.",
  90232. // "httpMethod": "GET",
  90233. // "id": "compute.targetHttpsProxies.list",
  90234. // "parameterOrder": [
  90235. // "project"
  90236. // ],
  90237. // "parameters": {
  90238. // "filter": {
  90239. // "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).",
  90240. // "location": "query",
  90241. // "type": "string"
  90242. // },
  90243. // "maxResults": {
  90244. // "default": "500",
  90245. // "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)",
  90246. // "format": "uint32",
  90247. // "location": "query",
  90248. // "minimum": "0",
  90249. // "type": "integer"
  90250. // },
  90251. // "orderBy": {
  90252. // "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.",
  90253. // "location": "query",
  90254. // "type": "string"
  90255. // },
  90256. // "pageToken": {
  90257. // "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.",
  90258. // "location": "query",
  90259. // "type": "string"
  90260. // },
  90261. // "project": {
  90262. // "description": "Project ID for this request.",
  90263. // "location": "path",
  90264. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90265. // "required": true,
  90266. // "type": "string"
  90267. // }
  90268. // },
  90269. // "path": "{project}/global/targetHttpsProxies",
  90270. // "response": {
  90271. // "$ref": "TargetHttpsProxyList"
  90272. // },
  90273. // "scopes": [
  90274. // "https://www.googleapis.com/auth/cloud-platform",
  90275. // "https://www.googleapis.com/auth/compute",
  90276. // "https://www.googleapis.com/auth/compute.readonly"
  90277. // ]
  90278. // }
  90279. }
  90280. // Pages invokes f for each page of results.
  90281. // A non-nil error returned from f will halt the iteration.
  90282. // The provided context supersedes any context provided to the Context method.
  90283. func (c *TargetHttpsProxiesListCall) Pages(ctx context.Context, f func(*TargetHttpsProxyList) error) error {
  90284. c.ctx_ = ctx
  90285. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  90286. for {
  90287. x, err := c.Do()
  90288. if err != nil {
  90289. return err
  90290. }
  90291. if err := f(x); err != nil {
  90292. return err
  90293. }
  90294. if x.NextPageToken == "" {
  90295. return nil
  90296. }
  90297. c.PageToken(x.NextPageToken)
  90298. }
  90299. }
  90300. // method id "compute.targetHttpsProxies.setQuicOverride":
  90301. type TargetHttpsProxiesSetQuicOverrideCall struct {
  90302. s *Service
  90303. project string
  90304. targetHttpsProxy string
  90305. targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest
  90306. urlParams_ gensupport.URLParams
  90307. ctx_ context.Context
  90308. header_ http.Header
  90309. }
  90310. // SetQuicOverride: Sets the QUIC override policy for TargetHttpsProxy.
  90311. func (r *TargetHttpsProxiesService) SetQuicOverride(project string, targetHttpsProxy string, targethttpsproxiessetquicoverriderequest *TargetHttpsProxiesSetQuicOverrideRequest) *TargetHttpsProxiesSetQuicOverrideCall {
  90312. c := &TargetHttpsProxiesSetQuicOverrideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90313. c.project = project
  90314. c.targetHttpsProxy = targetHttpsProxy
  90315. c.targethttpsproxiessetquicoverriderequest = targethttpsproxiessetquicoverriderequest
  90316. return c
  90317. }
  90318. // RequestId sets the optional parameter "requestId": An optional
  90319. // request ID to identify requests. Specify a unique request ID so that
  90320. // if you must retry your request, the server will know to ignore the
  90321. // request if it has already been completed.
  90322. //
  90323. // For example, consider a situation where you make an initial request
  90324. // and the request times out. If you make the request again with the
  90325. // same request ID, the server can check if original operation with the
  90326. // same request ID was received, and if so, will ignore the second
  90327. // request. This prevents clients from accidentally creating duplicate
  90328. // commitments.
  90329. //
  90330. // The request ID must be a valid UUID with the exception that zero UUID
  90331. // is not supported (00000000-0000-0000-0000-000000000000).
  90332. func (c *TargetHttpsProxiesSetQuicOverrideCall) RequestId(requestId string) *TargetHttpsProxiesSetQuicOverrideCall {
  90333. c.urlParams_.Set("requestId", requestId)
  90334. return c
  90335. }
  90336. // Fields allows partial responses to be retrieved. See
  90337. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90338. // for more information.
  90339. func (c *TargetHttpsProxiesSetQuicOverrideCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetQuicOverrideCall {
  90340. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90341. return c
  90342. }
  90343. // Context sets the context to be used in this call's Do method. Any
  90344. // pending HTTP request will be aborted if the provided context is
  90345. // canceled.
  90346. func (c *TargetHttpsProxiesSetQuicOverrideCall) Context(ctx context.Context) *TargetHttpsProxiesSetQuicOverrideCall {
  90347. c.ctx_ = ctx
  90348. return c
  90349. }
  90350. // Header returns an http.Header that can be modified by the caller to
  90351. // add HTTP headers to the request.
  90352. func (c *TargetHttpsProxiesSetQuicOverrideCall) Header() http.Header {
  90353. if c.header_ == nil {
  90354. c.header_ = make(http.Header)
  90355. }
  90356. return c.header_
  90357. }
  90358. func (c *TargetHttpsProxiesSetQuicOverrideCall) doRequest(alt string) (*http.Response, error) {
  90359. reqHeaders := make(http.Header)
  90360. for k, v := range c.header_ {
  90361. reqHeaders[k] = v
  90362. }
  90363. reqHeaders.Set("User-Agent", c.s.userAgent())
  90364. var body io.Reader = nil
  90365. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetquicoverriderequest)
  90366. if err != nil {
  90367. return nil, err
  90368. }
  90369. reqHeaders.Set("Content-Type", "application/json")
  90370. c.urlParams_.Set("alt", alt)
  90371. c.urlParams_.Set("prettyPrint", "false")
  90372. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride")
  90373. urls += "?" + c.urlParams_.Encode()
  90374. req, err := http.NewRequest("POST", urls, body)
  90375. if err != nil {
  90376. return nil, err
  90377. }
  90378. req.Header = reqHeaders
  90379. googleapi.Expand(req.URL, map[string]string{
  90380. "project": c.project,
  90381. "targetHttpsProxy": c.targetHttpsProxy,
  90382. })
  90383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90384. }
  90385. // Do executes the "compute.targetHttpsProxies.setQuicOverride" call.
  90386. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90387. // status code is an error. Response headers are in either
  90388. // *Operation.ServerResponse.Header or (if a response was returned at
  90389. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90390. // to check whether the returned error was because
  90391. // http.StatusNotModified was returned.
  90392. func (c *TargetHttpsProxiesSetQuicOverrideCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90393. gensupport.SetOptions(c.urlParams_, opts...)
  90394. res, err := c.doRequest("json")
  90395. if res != nil && res.StatusCode == http.StatusNotModified {
  90396. if res.Body != nil {
  90397. res.Body.Close()
  90398. }
  90399. return nil, &googleapi.Error{
  90400. Code: res.StatusCode,
  90401. Header: res.Header,
  90402. }
  90403. }
  90404. if err != nil {
  90405. return nil, err
  90406. }
  90407. defer googleapi.CloseBody(res)
  90408. if err := googleapi.CheckResponse(res); err != nil {
  90409. return nil, err
  90410. }
  90411. ret := &Operation{
  90412. ServerResponse: googleapi.ServerResponse{
  90413. Header: res.Header,
  90414. HTTPStatusCode: res.StatusCode,
  90415. },
  90416. }
  90417. target := &ret
  90418. if err := gensupport.DecodeResponse(target, res); err != nil {
  90419. return nil, err
  90420. }
  90421. return ret, nil
  90422. // {
  90423. // "description": "Sets the QUIC override policy for TargetHttpsProxy.",
  90424. // "httpMethod": "POST",
  90425. // "id": "compute.targetHttpsProxies.setQuicOverride",
  90426. // "parameterOrder": [
  90427. // "project",
  90428. // "targetHttpsProxy"
  90429. // ],
  90430. // "parameters": {
  90431. // "project": {
  90432. // "description": "Project ID for this request.",
  90433. // "location": "path",
  90434. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90435. // "required": true,
  90436. // "type": "string"
  90437. // },
  90438. // "requestId": {
  90439. // "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).",
  90440. // "location": "query",
  90441. // "type": "string"
  90442. // },
  90443. // "targetHttpsProxy": {
  90444. // "description": "Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035.",
  90445. // "location": "path",
  90446. // "required": true,
  90447. // "type": "string"
  90448. // }
  90449. // },
  90450. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride",
  90451. // "request": {
  90452. // "$ref": "TargetHttpsProxiesSetQuicOverrideRequest"
  90453. // },
  90454. // "response": {
  90455. // "$ref": "Operation"
  90456. // },
  90457. // "scopes": [
  90458. // "https://www.googleapis.com/auth/cloud-platform",
  90459. // "https://www.googleapis.com/auth/compute"
  90460. // ]
  90461. // }
  90462. }
  90463. // method id "compute.targetHttpsProxies.setSslCertificates":
  90464. type TargetHttpsProxiesSetSslCertificatesCall struct {
  90465. s *Service
  90466. project string
  90467. targetHttpsProxy string
  90468. targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest
  90469. urlParams_ gensupport.URLParams
  90470. ctx_ context.Context
  90471. header_ http.Header
  90472. }
  90473. // SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy.
  90474. func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall {
  90475. c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90476. c.project = project
  90477. c.targetHttpsProxy = targetHttpsProxy
  90478. c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest
  90479. return c
  90480. }
  90481. // RequestId sets the optional parameter "requestId": An optional
  90482. // request ID to identify requests. Specify a unique request ID so that
  90483. // if you must retry your request, the server will know to ignore the
  90484. // request if it has already been completed.
  90485. //
  90486. // For example, consider a situation where you make an initial request
  90487. // and the request times out. If you make the request again with the
  90488. // same request ID, the server can check if original operation with the
  90489. // same request ID was received, and if so, will ignore the second
  90490. // request. This prevents clients from accidentally creating duplicate
  90491. // commitments.
  90492. //
  90493. // The request ID must be a valid UUID with the exception that zero UUID
  90494. // is not supported (00000000-0000-0000-0000-000000000000).
  90495. func (c *TargetHttpsProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetHttpsProxiesSetSslCertificatesCall {
  90496. c.urlParams_.Set("requestId", requestId)
  90497. return c
  90498. }
  90499. // Fields allows partial responses to be retrieved. See
  90500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90501. // for more information.
  90502. func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall {
  90503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90504. return c
  90505. }
  90506. // Context sets the context to be used in this call's Do method. Any
  90507. // pending HTTP request will be aborted if the provided context is
  90508. // canceled.
  90509. func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall {
  90510. c.ctx_ = ctx
  90511. return c
  90512. }
  90513. // Header returns an http.Header that can be modified by the caller to
  90514. // add HTTP headers to the request.
  90515. func (c *TargetHttpsProxiesSetSslCertificatesCall) Header() http.Header {
  90516. if c.header_ == nil {
  90517. c.header_ = make(http.Header)
  90518. }
  90519. return c.header_
  90520. }
  90521. func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  90522. reqHeaders := make(http.Header)
  90523. for k, v := range c.header_ {
  90524. reqHeaders[k] = v
  90525. }
  90526. reqHeaders.Set("User-Agent", c.s.userAgent())
  90527. var body io.Reader = nil
  90528. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest)
  90529. if err != nil {
  90530. return nil, err
  90531. }
  90532. reqHeaders.Set("Content-Type", "application/json")
  90533. c.urlParams_.Set("alt", alt)
  90534. c.urlParams_.Set("prettyPrint", "false")
  90535. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates")
  90536. urls += "?" + c.urlParams_.Encode()
  90537. req, err := http.NewRequest("POST", urls, body)
  90538. if err != nil {
  90539. return nil, err
  90540. }
  90541. req.Header = reqHeaders
  90542. googleapi.Expand(req.URL, map[string]string{
  90543. "project": c.project,
  90544. "targetHttpsProxy": c.targetHttpsProxy,
  90545. })
  90546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90547. }
  90548. // Do executes the "compute.targetHttpsProxies.setSslCertificates" call.
  90549. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90550. // status code is an error. Response headers are in either
  90551. // *Operation.ServerResponse.Header or (if a response was returned at
  90552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90553. // to check whether the returned error was because
  90554. // http.StatusNotModified was returned.
  90555. func (c *TargetHttpsProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90556. gensupport.SetOptions(c.urlParams_, opts...)
  90557. res, err := c.doRequest("json")
  90558. if res != nil && res.StatusCode == http.StatusNotModified {
  90559. if res.Body != nil {
  90560. res.Body.Close()
  90561. }
  90562. return nil, &googleapi.Error{
  90563. Code: res.StatusCode,
  90564. Header: res.Header,
  90565. }
  90566. }
  90567. if err != nil {
  90568. return nil, err
  90569. }
  90570. defer googleapi.CloseBody(res)
  90571. if err := googleapi.CheckResponse(res); err != nil {
  90572. return nil, err
  90573. }
  90574. ret := &Operation{
  90575. ServerResponse: googleapi.ServerResponse{
  90576. Header: res.Header,
  90577. HTTPStatusCode: res.StatusCode,
  90578. },
  90579. }
  90580. target := &ret
  90581. if err := gensupport.DecodeResponse(target, res); err != nil {
  90582. return nil, err
  90583. }
  90584. return ret, nil
  90585. // {
  90586. // "description": "Replaces SslCertificates for TargetHttpsProxy.",
  90587. // "httpMethod": "POST",
  90588. // "id": "compute.targetHttpsProxies.setSslCertificates",
  90589. // "parameterOrder": [
  90590. // "project",
  90591. // "targetHttpsProxy"
  90592. // ],
  90593. // "parameters": {
  90594. // "project": {
  90595. // "description": "Project ID for this request.",
  90596. // "location": "path",
  90597. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90598. // "required": true,
  90599. // "type": "string"
  90600. // },
  90601. // "requestId": {
  90602. // "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).",
  90603. // "location": "query",
  90604. // "type": "string"
  90605. // },
  90606. // "targetHttpsProxy": {
  90607. // "description": "Name of the TargetHttpsProxy resource to set an SslCertificates resource for.",
  90608. // "location": "path",
  90609. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90610. // "required": true,
  90611. // "type": "string"
  90612. // }
  90613. // },
  90614. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates",
  90615. // "request": {
  90616. // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest"
  90617. // },
  90618. // "response": {
  90619. // "$ref": "Operation"
  90620. // },
  90621. // "scopes": [
  90622. // "https://www.googleapis.com/auth/cloud-platform",
  90623. // "https://www.googleapis.com/auth/compute"
  90624. // ]
  90625. // }
  90626. }
  90627. // method id "compute.targetHttpsProxies.setSslPolicy":
  90628. type TargetHttpsProxiesSetSslPolicyCall struct {
  90629. s *Service
  90630. project string
  90631. targetHttpsProxy string
  90632. sslpolicyreference *SslPolicyReference
  90633. urlParams_ gensupport.URLParams
  90634. ctx_ context.Context
  90635. header_ http.Header
  90636. }
  90637. // SetSslPolicy: Sets the SSL policy for TargetHttpsProxy. The SSL
  90638. // policy specifies the server-side support for SSL features. This
  90639. // affects connections between clients and the HTTPS proxy load
  90640. // balancer. They do not affect the connection between the load balancer
  90641. // and the backends.
  90642. func (r *TargetHttpsProxiesService) SetSslPolicy(project string, targetHttpsProxy string, sslpolicyreference *SslPolicyReference) *TargetHttpsProxiesSetSslPolicyCall {
  90643. c := &TargetHttpsProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90644. c.project = project
  90645. c.targetHttpsProxy = targetHttpsProxy
  90646. c.sslpolicyreference = sslpolicyreference
  90647. return c
  90648. }
  90649. // RequestId sets the optional parameter "requestId": An optional
  90650. // request ID to identify requests. Specify a unique request ID so that
  90651. // if you must retry your request, the server will know to ignore the
  90652. // request if it has already been completed.
  90653. //
  90654. // For example, consider a situation where you make an initial request
  90655. // and the request times out. If you make the request again with the
  90656. // same request ID, the server can check if original operation with the
  90657. // same request ID was received, and if so, will ignore the second
  90658. // request. This prevents clients from accidentally creating duplicate
  90659. // commitments.
  90660. //
  90661. // The request ID must be a valid UUID with the exception that zero UUID
  90662. // is not supported (00000000-0000-0000-0000-000000000000).
  90663. func (c *TargetHttpsProxiesSetSslPolicyCall) RequestId(requestId string) *TargetHttpsProxiesSetSslPolicyCall {
  90664. c.urlParams_.Set("requestId", requestId)
  90665. return c
  90666. }
  90667. // Fields allows partial responses to be retrieved. See
  90668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90669. // for more information.
  90670. func (c *TargetHttpsProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslPolicyCall {
  90671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90672. return c
  90673. }
  90674. // Context sets the context to be used in this call's Do method. Any
  90675. // pending HTTP request will be aborted if the provided context is
  90676. // canceled.
  90677. func (c *TargetHttpsProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslPolicyCall {
  90678. c.ctx_ = ctx
  90679. return c
  90680. }
  90681. // Header returns an http.Header that can be modified by the caller to
  90682. // add HTTP headers to the request.
  90683. func (c *TargetHttpsProxiesSetSslPolicyCall) Header() http.Header {
  90684. if c.header_ == nil {
  90685. c.header_ = make(http.Header)
  90686. }
  90687. return c.header_
  90688. }
  90689. func (c *TargetHttpsProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  90690. reqHeaders := make(http.Header)
  90691. for k, v := range c.header_ {
  90692. reqHeaders[k] = v
  90693. }
  90694. reqHeaders.Set("User-Agent", c.s.userAgent())
  90695. var body io.Reader = nil
  90696. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  90697. if err != nil {
  90698. return nil, err
  90699. }
  90700. reqHeaders.Set("Content-Type", "application/json")
  90701. c.urlParams_.Set("alt", alt)
  90702. c.urlParams_.Set("prettyPrint", "false")
  90703. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy")
  90704. urls += "?" + c.urlParams_.Encode()
  90705. req, err := http.NewRequest("POST", urls, body)
  90706. if err != nil {
  90707. return nil, err
  90708. }
  90709. req.Header = reqHeaders
  90710. googleapi.Expand(req.URL, map[string]string{
  90711. "project": c.project,
  90712. "targetHttpsProxy": c.targetHttpsProxy,
  90713. })
  90714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90715. }
  90716. // Do executes the "compute.targetHttpsProxies.setSslPolicy" call.
  90717. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90718. // status code is an error. Response headers are in either
  90719. // *Operation.ServerResponse.Header or (if a response was returned at
  90720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90721. // to check whether the returned error was because
  90722. // http.StatusNotModified was returned.
  90723. func (c *TargetHttpsProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90724. gensupport.SetOptions(c.urlParams_, opts...)
  90725. res, err := c.doRequest("json")
  90726. if res != nil && res.StatusCode == http.StatusNotModified {
  90727. if res.Body != nil {
  90728. res.Body.Close()
  90729. }
  90730. return nil, &googleapi.Error{
  90731. Code: res.StatusCode,
  90732. Header: res.Header,
  90733. }
  90734. }
  90735. if err != nil {
  90736. return nil, err
  90737. }
  90738. defer googleapi.CloseBody(res)
  90739. if err := googleapi.CheckResponse(res); err != nil {
  90740. return nil, err
  90741. }
  90742. ret := &Operation{
  90743. ServerResponse: googleapi.ServerResponse{
  90744. Header: res.Header,
  90745. HTTPStatusCode: res.StatusCode,
  90746. },
  90747. }
  90748. target := &ret
  90749. if err := gensupport.DecodeResponse(target, res); err != nil {
  90750. return nil, err
  90751. }
  90752. return ret, nil
  90753. // {
  90754. // "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.",
  90755. // "httpMethod": "POST",
  90756. // "id": "compute.targetHttpsProxies.setSslPolicy",
  90757. // "parameterOrder": [
  90758. // "project",
  90759. // "targetHttpsProxy"
  90760. // ],
  90761. // "parameters": {
  90762. // "project": {
  90763. // "description": "Project ID for this request.",
  90764. // "location": "path",
  90765. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90766. // "required": true,
  90767. // "type": "string"
  90768. // },
  90769. // "requestId": {
  90770. // "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).",
  90771. // "location": "query",
  90772. // "type": "string"
  90773. // },
  90774. // "targetHttpsProxy": {
  90775. // "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.",
  90776. // "location": "path",
  90777. // "required": true,
  90778. // "type": "string"
  90779. // }
  90780. // },
  90781. // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy",
  90782. // "request": {
  90783. // "$ref": "SslPolicyReference"
  90784. // },
  90785. // "response": {
  90786. // "$ref": "Operation"
  90787. // },
  90788. // "scopes": [
  90789. // "https://www.googleapis.com/auth/cloud-platform",
  90790. // "https://www.googleapis.com/auth/compute"
  90791. // ]
  90792. // }
  90793. }
  90794. // method id "compute.targetHttpsProxies.setUrlMap":
  90795. type TargetHttpsProxiesSetUrlMapCall struct {
  90796. s *Service
  90797. project string
  90798. targetHttpsProxy string
  90799. urlmapreference *UrlMapReference
  90800. urlParams_ gensupport.URLParams
  90801. ctx_ context.Context
  90802. header_ http.Header
  90803. }
  90804. // SetUrlMap: Changes the URL map for TargetHttpsProxy.
  90805. func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall {
  90806. c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90807. c.project = project
  90808. c.targetHttpsProxy = targetHttpsProxy
  90809. c.urlmapreference = urlmapreference
  90810. return c
  90811. }
  90812. // RequestId sets the optional parameter "requestId": An optional
  90813. // request ID to identify requests. Specify a unique request ID so that
  90814. // if you must retry your request, the server will know to ignore the
  90815. // request if it has already been completed.
  90816. //
  90817. // For example, consider a situation where you make an initial request
  90818. // and the request times out. If you make the request again with the
  90819. // same request ID, the server can check if original operation with the
  90820. // same request ID was received, and if so, will ignore the second
  90821. // request. This prevents clients from accidentally creating duplicate
  90822. // commitments.
  90823. //
  90824. // The request ID must be a valid UUID with the exception that zero UUID
  90825. // is not supported (00000000-0000-0000-0000-000000000000).
  90826. func (c *TargetHttpsProxiesSetUrlMapCall) RequestId(requestId string) *TargetHttpsProxiesSetUrlMapCall {
  90827. c.urlParams_.Set("requestId", requestId)
  90828. return c
  90829. }
  90830. // Fields allows partial responses to be retrieved. See
  90831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  90832. // for more information.
  90833. func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall {
  90834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  90835. return c
  90836. }
  90837. // Context sets the context to be used in this call's Do method. Any
  90838. // pending HTTP request will be aborted if the provided context is
  90839. // canceled.
  90840. func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall {
  90841. c.ctx_ = ctx
  90842. return c
  90843. }
  90844. // Header returns an http.Header that can be modified by the caller to
  90845. // add HTTP headers to the request.
  90846. func (c *TargetHttpsProxiesSetUrlMapCall) Header() http.Header {
  90847. if c.header_ == nil {
  90848. c.header_ = make(http.Header)
  90849. }
  90850. return c.header_
  90851. }
  90852. func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) {
  90853. reqHeaders := make(http.Header)
  90854. for k, v := range c.header_ {
  90855. reqHeaders[k] = v
  90856. }
  90857. reqHeaders.Set("User-Agent", c.s.userAgent())
  90858. var body io.Reader = nil
  90859. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference)
  90860. if err != nil {
  90861. return nil, err
  90862. }
  90863. reqHeaders.Set("Content-Type", "application/json")
  90864. c.urlParams_.Set("alt", alt)
  90865. c.urlParams_.Set("prettyPrint", "false")
  90866. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap")
  90867. urls += "?" + c.urlParams_.Encode()
  90868. req, err := http.NewRequest("POST", urls, body)
  90869. if err != nil {
  90870. return nil, err
  90871. }
  90872. req.Header = reqHeaders
  90873. googleapi.Expand(req.URL, map[string]string{
  90874. "project": c.project,
  90875. "targetHttpsProxy": c.targetHttpsProxy,
  90876. })
  90877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  90878. }
  90879. // Do executes the "compute.targetHttpsProxies.setUrlMap" call.
  90880. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  90881. // status code is an error. Response headers are in either
  90882. // *Operation.ServerResponse.Header or (if a response was returned at
  90883. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  90884. // to check whether the returned error was because
  90885. // http.StatusNotModified was returned.
  90886. func (c *TargetHttpsProxiesSetUrlMapCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  90887. gensupport.SetOptions(c.urlParams_, opts...)
  90888. res, err := c.doRequest("json")
  90889. if res != nil && res.StatusCode == http.StatusNotModified {
  90890. if res.Body != nil {
  90891. res.Body.Close()
  90892. }
  90893. return nil, &googleapi.Error{
  90894. Code: res.StatusCode,
  90895. Header: res.Header,
  90896. }
  90897. }
  90898. if err != nil {
  90899. return nil, err
  90900. }
  90901. defer googleapi.CloseBody(res)
  90902. if err := googleapi.CheckResponse(res); err != nil {
  90903. return nil, err
  90904. }
  90905. ret := &Operation{
  90906. ServerResponse: googleapi.ServerResponse{
  90907. Header: res.Header,
  90908. HTTPStatusCode: res.StatusCode,
  90909. },
  90910. }
  90911. target := &ret
  90912. if err := gensupport.DecodeResponse(target, res); err != nil {
  90913. return nil, err
  90914. }
  90915. return ret, nil
  90916. // {
  90917. // "description": "Changes the URL map for TargetHttpsProxy.",
  90918. // "httpMethod": "POST",
  90919. // "id": "compute.targetHttpsProxies.setUrlMap",
  90920. // "parameterOrder": [
  90921. // "project",
  90922. // "targetHttpsProxy"
  90923. // ],
  90924. // "parameters": {
  90925. // "project": {
  90926. // "description": "Project ID for this request.",
  90927. // "location": "path",
  90928. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  90929. // "required": true,
  90930. // "type": "string"
  90931. // },
  90932. // "requestId": {
  90933. // "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).",
  90934. // "location": "query",
  90935. // "type": "string"
  90936. // },
  90937. // "targetHttpsProxy": {
  90938. // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.",
  90939. // "location": "path",
  90940. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  90941. // "required": true,
  90942. // "type": "string"
  90943. // }
  90944. // },
  90945. // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap",
  90946. // "request": {
  90947. // "$ref": "UrlMapReference"
  90948. // },
  90949. // "response": {
  90950. // "$ref": "Operation"
  90951. // },
  90952. // "scopes": [
  90953. // "https://www.googleapis.com/auth/cloud-platform",
  90954. // "https://www.googleapis.com/auth/compute"
  90955. // ]
  90956. // }
  90957. }
  90958. // method id "compute.targetInstances.aggregatedList":
  90959. type TargetInstancesAggregatedListCall struct {
  90960. s *Service
  90961. project string
  90962. urlParams_ gensupport.URLParams
  90963. ifNoneMatch_ string
  90964. ctx_ context.Context
  90965. header_ http.Header
  90966. }
  90967. // AggregatedList: Retrieves an aggregated list of target instances.
  90968. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList
  90969. func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall {
  90970. c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  90971. c.project = project
  90972. return c
  90973. }
  90974. // Filter sets the optional parameter "filter": A filter expression that
  90975. // filters resources listed in the response. The expression must specify
  90976. // the field name, a comparison operator, and the value that you want to
  90977. // use for filtering. The value must be a string, a number, or a
  90978. // boolean. The comparison operator must be either =, !=, >, or <.
  90979. //
  90980. // For example, if you are filtering Compute Engine instances, you can
  90981. // exclude instances named example-instance by specifying name !=
  90982. // example-instance.
  90983. //
  90984. // You can also filter nested fields. For example, you could specify
  90985. // scheduling.automaticRestart = false to include instances only if they
  90986. // are not scheduled for automatic restarts. You can use filtering on
  90987. // nested fields to filter based on resource labels.
  90988. //
  90989. // To filter on multiple expressions, provide each separate expression
  90990. // within parentheses. For example, (scheduling.automaticRestart = true)
  90991. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  90992. // AND expression. However, you can include AND and OR expressions
  90993. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  90994. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  90995. // true).
  90996. func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall {
  90997. c.urlParams_.Set("filter", filter)
  90998. return c
  90999. }
  91000. // MaxResults sets the optional parameter "maxResults": The maximum
  91001. // number of results per page that should be returned. If the number of
  91002. // available results is larger than maxResults, Compute Engine returns a
  91003. // nextPageToken that can be used to get the next page of results in
  91004. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91005. // (Default: 500)
  91006. func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall {
  91007. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91008. return c
  91009. }
  91010. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91011. // a certain order. By default, results are returned in alphanumerical
  91012. // order based on the resource name.
  91013. //
  91014. // You can also sort results in descending order based on the creation
  91015. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91016. // based on the creationTimestamp field in reverse chronological order
  91017. // (newest result first). Use this to sort resources like operations so
  91018. // that the newest operation is returned first.
  91019. //
  91020. // Currently, only sorting by name or creationTimestamp desc is
  91021. // supported.
  91022. func (c *TargetInstancesAggregatedListCall) OrderBy(orderBy string) *TargetInstancesAggregatedListCall {
  91023. c.urlParams_.Set("orderBy", orderBy)
  91024. return c
  91025. }
  91026. // PageToken sets the optional parameter "pageToken": Specifies a page
  91027. // token to use. Set pageToken to the nextPageToken returned by a
  91028. // previous list request to get the next page of results.
  91029. func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall {
  91030. c.urlParams_.Set("pageToken", pageToken)
  91031. return c
  91032. }
  91033. // Fields allows partial responses to be retrieved. See
  91034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91035. // for more information.
  91036. func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall {
  91037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91038. return c
  91039. }
  91040. // IfNoneMatch sets the optional parameter which makes the operation
  91041. // fail if the object's ETag matches the given value. This is useful for
  91042. // getting updates only after the object has changed since the last
  91043. // request. Use googleapi.IsNotModified to check whether the response
  91044. // error from Do is the result of In-None-Match.
  91045. func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall {
  91046. c.ifNoneMatch_ = entityTag
  91047. return c
  91048. }
  91049. // Context sets the context to be used in this call's Do method. Any
  91050. // pending HTTP request will be aborted if the provided context is
  91051. // canceled.
  91052. func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall {
  91053. c.ctx_ = ctx
  91054. return c
  91055. }
  91056. // Header returns an http.Header that can be modified by the caller to
  91057. // add HTTP headers to the request.
  91058. func (c *TargetInstancesAggregatedListCall) Header() http.Header {
  91059. if c.header_ == nil {
  91060. c.header_ = make(http.Header)
  91061. }
  91062. return c.header_
  91063. }
  91064. func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  91065. reqHeaders := make(http.Header)
  91066. for k, v := range c.header_ {
  91067. reqHeaders[k] = v
  91068. }
  91069. reqHeaders.Set("User-Agent", c.s.userAgent())
  91070. if c.ifNoneMatch_ != "" {
  91071. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91072. }
  91073. var body io.Reader = nil
  91074. c.urlParams_.Set("alt", alt)
  91075. c.urlParams_.Set("prettyPrint", "false")
  91076. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances")
  91077. urls += "?" + c.urlParams_.Encode()
  91078. req, err := http.NewRequest("GET", urls, body)
  91079. if err != nil {
  91080. return nil, err
  91081. }
  91082. req.Header = reqHeaders
  91083. googleapi.Expand(req.URL, map[string]string{
  91084. "project": c.project,
  91085. })
  91086. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91087. }
  91088. // Do executes the "compute.targetInstances.aggregatedList" call.
  91089. // Exactly one of *TargetInstanceAggregatedList or error will be
  91090. // non-nil. Any non-2xx status code is an error. Response headers are in
  91091. // either *TargetInstanceAggregatedList.ServerResponse.Header or (if a
  91092. // response was returned at all) in error.(*googleapi.Error).Header. Use
  91093. // googleapi.IsNotModified to check whether the returned error was
  91094. // because http.StatusNotModified was returned.
  91095. func (c *TargetInstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceAggregatedList, error) {
  91096. gensupport.SetOptions(c.urlParams_, opts...)
  91097. res, err := c.doRequest("json")
  91098. if res != nil && res.StatusCode == http.StatusNotModified {
  91099. if res.Body != nil {
  91100. res.Body.Close()
  91101. }
  91102. return nil, &googleapi.Error{
  91103. Code: res.StatusCode,
  91104. Header: res.Header,
  91105. }
  91106. }
  91107. if err != nil {
  91108. return nil, err
  91109. }
  91110. defer googleapi.CloseBody(res)
  91111. if err := googleapi.CheckResponse(res); err != nil {
  91112. return nil, err
  91113. }
  91114. ret := &TargetInstanceAggregatedList{
  91115. ServerResponse: googleapi.ServerResponse{
  91116. Header: res.Header,
  91117. HTTPStatusCode: res.StatusCode,
  91118. },
  91119. }
  91120. target := &ret
  91121. if err := gensupport.DecodeResponse(target, res); err != nil {
  91122. return nil, err
  91123. }
  91124. return ret, nil
  91125. // {
  91126. // "description": "Retrieves an aggregated list of target instances.",
  91127. // "httpMethod": "GET",
  91128. // "id": "compute.targetInstances.aggregatedList",
  91129. // "parameterOrder": [
  91130. // "project"
  91131. // ],
  91132. // "parameters": {
  91133. // "filter": {
  91134. // "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).",
  91135. // "location": "query",
  91136. // "type": "string"
  91137. // },
  91138. // "maxResults": {
  91139. // "default": "500",
  91140. // "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)",
  91141. // "format": "uint32",
  91142. // "location": "query",
  91143. // "minimum": "0",
  91144. // "type": "integer"
  91145. // },
  91146. // "orderBy": {
  91147. // "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.",
  91148. // "location": "query",
  91149. // "type": "string"
  91150. // },
  91151. // "pageToken": {
  91152. // "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.",
  91153. // "location": "query",
  91154. // "type": "string"
  91155. // },
  91156. // "project": {
  91157. // "description": "Project ID for this request.",
  91158. // "location": "path",
  91159. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91160. // "required": true,
  91161. // "type": "string"
  91162. // }
  91163. // },
  91164. // "path": "{project}/aggregated/targetInstances",
  91165. // "response": {
  91166. // "$ref": "TargetInstanceAggregatedList"
  91167. // },
  91168. // "scopes": [
  91169. // "https://www.googleapis.com/auth/cloud-platform",
  91170. // "https://www.googleapis.com/auth/compute",
  91171. // "https://www.googleapis.com/auth/compute.readonly"
  91172. // ]
  91173. // }
  91174. }
  91175. // Pages invokes f for each page of results.
  91176. // A non-nil error returned from f will halt the iteration.
  91177. // The provided context supersedes any context provided to the Context method.
  91178. func (c *TargetInstancesAggregatedListCall) Pages(ctx context.Context, f func(*TargetInstanceAggregatedList) error) error {
  91179. c.ctx_ = ctx
  91180. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91181. for {
  91182. x, err := c.Do()
  91183. if err != nil {
  91184. return err
  91185. }
  91186. if err := f(x); err != nil {
  91187. return err
  91188. }
  91189. if x.NextPageToken == "" {
  91190. return nil
  91191. }
  91192. c.PageToken(x.NextPageToken)
  91193. }
  91194. }
  91195. // method id "compute.targetInstances.delete":
  91196. type TargetInstancesDeleteCall struct {
  91197. s *Service
  91198. project string
  91199. zone string
  91200. targetInstance string
  91201. urlParams_ gensupport.URLParams
  91202. ctx_ context.Context
  91203. header_ http.Header
  91204. }
  91205. // Delete: Deletes the specified TargetInstance resource.
  91206. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete
  91207. func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall {
  91208. c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91209. c.project = project
  91210. c.zone = zone
  91211. c.targetInstance = targetInstance
  91212. return c
  91213. }
  91214. // RequestId sets the optional parameter "requestId": An optional
  91215. // request ID to identify requests. Specify a unique request ID so that
  91216. // if you must retry your request, the server will know to ignore the
  91217. // request if it has already been completed.
  91218. //
  91219. // For example, consider a situation where you make an initial request
  91220. // and the request times out. If you make the request again with the
  91221. // same request ID, the server can check if original operation with the
  91222. // same request ID was received, and if so, will ignore the second
  91223. // request. This prevents clients from accidentally creating duplicate
  91224. // commitments.
  91225. //
  91226. // The request ID must be a valid UUID with the exception that zero UUID
  91227. // is not supported (00000000-0000-0000-0000-000000000000).
  91228. func (c *TargetInstancesDeleteCall) RequestId(requestId string) *TargetInstancesDeleteCall {
  91229. c.urlParams_.Set("requestId", requestId)
  91230. return c
  91231. }
  91232. // Fields allows partial responses to be retrieved. See
  91233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91234. // for more information.
  91235. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall {
  91236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91237. return c
  91238. }
  91239. // Context sets the context to be used in this call's Do method. Any
  91240. // pending HTTP request will be aborted if the provided context is
  91241. // canceled.
  91242. func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall {
  91243. c.ctx_ = ctx
  91244. return c
  91245. }
  91246. // Header returns an http.Header that can be modified by the caller to
  91247. // add HTTP headers to the request.
  91248. func (c *TargetInstancesDeleteCall) Header() http.Header {
  91249. if c.header_ == nil {
  91250. c.header_ = make(http.Header)
  91251. }
  91252. return c.header_
  91253. }
  91254. func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  91255. reqHeaders := make(http.Header)
  91256. for k, v := range c.header_ {
  91257. reqHeaders[k] = v
  91258. }
  91259. reqHeaders.Set("User-Agent", c.s.userAgent())
  91260. var body io.Reader = nil
  91261. c.urlParams_.Set("alt", alt)
  91262. c.urlParams_.Set("prettyPrint", "false")
  91263. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  91264. urls += "?" + c.urlParams_.Encode()
  91265. req, err := http.NewRequest("DELETE", urls, body)
  91266. if err != nil {
  91267. return nil, err
  91268. }
  91269. req.Header = reqHeaders
  91270. googleapi.Expand(req.URL, map[string]string{
  91271. "project": c.project,
  91272. "zone": c.zone,
  91273. "targetInstance": c.targetInstance,
  91274. })
  91275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91276. }
  91277. // Do executes the "compute.targetInstances.delete" call.
  91278. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91279. // status code is an error. Response headers are in either
  91280. // *Operation.ServerResponse.Header or (if a response was returned at
  91281. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91282. // to check whether the returned error was because
  91283. // http.StatusNotModified was returned.
  91284. func (c *TargetInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91285. gensupport.SetOptions(c.urlParams_, opts...)
  91286. res, err := c.doRequest("json")
  91287. if res != nil && res.StatusCode == http.StatusNotModified {
  91288. if res.Body != nil {
  91289. res.Body.Close()
  91290. }
  91291. return nil, &googleapi.Error{
  91292. Code: res.StatusCode,
  91293. Header: res.Header,
  91294. }
  91295. }
  91296. if err != nil {
  91297. return nil, err
  91298. }
  91299. defer googleapi.CloseBody(res)
  91300. if err := googleapi.CheckResponse(res); err != nil {
  91301. return nil, err
  91302. }
  91303. ret := &Operation{
  91304. ServerResponse: googleapi.ServerResponse{
  91305. Header: res.Header,
  91306. HTTPStatusCode: res.StatusCode,
  91307. },
  91308. }
  91309. target := &ret
  91310. if err := gensupport.DecodeResponse(target, res); err != nil {
  91311. return nil, err
  91312. }
  91313. return ret, nil
  91314. // {
  91315. // "description": "Deletes the specified TargetInstance resource.",
  91316. // "httpMethod": "DELETE",
  91317. // "id": "compute.targetInstances.delete",
  91318. // "parameterOrder": [
  91319. // "project",
  91320. // "zone",
  91321. // "targetInstance"
  91322. // ],
  91323. // "parameters": {
  91324. // "project": {
  91325. // "description": "Project ID for this request.",
  91326. // "location": "path",
  91327. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91328. // "required": true,
  91329. // "type": "string"
  91330. // },
  91331. // "requestId": {
  91332. // "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).",
  91333. // "location": "query",
  91334. // "type": "string"
  91335. // },
  91336. // "targetInstance": {
  91337. // "description": "Name of the TargetInstance resource to delete.",
  91338. // "location": "path",
  91339. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91340. // "required": true,
  91341. // "type": "string"
  91342. // },
  91343. // "zone": {
  91344. // "description": "Name of the zone scoping this request.",
  91345. // "location": "path",
  91346. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91347. // "required": true,
  91348. // "type": "string"
  91349. // }
  91350. // },
  91351. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  91352. // "response": {
  91353. // "$ref": "Operation"
  91354. // },
  91355. // "scopes": [
  91356. // "https://www.googleapis.com/auth/cloud-platform",
  91357. // "https://www.googleapis.com/auth/compute"
  91358. // ]
  91359. // }
  91360. }
  91361. // method id "compute.targetInstances.get":
  91362. type TargetInstancesGetCall struct {
  91363. s *Service
  91364. project string
  91365. zone string
  91366. targetInstance string
  91367. urlParams_ gensupport.URLParams
  91368. ifNoneMatch_ string
  91369. ctx_ context.Context
  91370. header_ http.Header
  91371. }
  91372. // Get: Returns the specified TargetInstance resource. Gets a list of
  91373. // available target instances by making a list() request.
  91374. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get
  91375. func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall {
  91376. c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91377. c.project = project
  91378. c.zone = zone
  91379. c.targetInstance = targetInstance
  91380. return c
  91381. }
  91382. // Fields allows partial responses to be retrieved. See
  91383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91384. // for more information.
  91385. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall {
  91386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91387. return c
  91388. }
  91389. // IfNoneMatch sets the optional parameter which makes the operation
  91390. // fail if the object's ETag matches the given value. This is useful for
  91391. // getting updates only after the object has changed since the last
  91392. // request. Use googleapi.IsNotModified to check whether the response
  91393. // error from Do is the result of In-None-Match.
  91394. func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall {
  91395. c.ifNoneMatch_ = entityTag
  91396. return c
  91397. }
  91398. // Context sets the context to be used in this call's Do method. Any
  91399. // pending HTTP request will be aborted if the provided context is
  91400. // canceled.
  91401. func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall {
  91402. c.ctx_ = ctx
  91403. return c
  91404. }
  91405. // Header returns an http.Header that can be modified by the caller to
  91406. // add HTTP headers to the request.
  91407. func (c *TargetInstancesGetCall) Header() http.Header {
  91408. if c.header_ == nil {
  91409. c.header_ = make(http.Header)
  91410. }
  91411. return c.header_
  91412. }
  91413. func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  91414. reqHeaders := make(http.Header)
  91415. for k, v := range c.header_ {
  91416. reqHeaders[k] = v
  91417. }
  91418. reqHeaders.Set("User-Agent", c.s.userAgent())
  91419. if c.ifNoneMatch_ != "" {
  91420. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91421. }
  91422. var body io.Reader = nil
  91423. c.urlParams_.Set("alt", alt)
  91424. c.urlParams_.Set("prettyPrint", "false")
  91425. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}")
  91426. urls += "?" + c.urlParams_.Encode()
  91427. req, err := http.NewRequest("GET", urls, body)
  91428. if err != nil {
  91429. return nil, err
  91430. }
  91431. req.Header = reqHeaders
  91432. googleapi.Expand(req.URL, map[string]string{
  91433. "project": c.project,
  91434. "zone": c.zone,
  91435. "targetInstance": c.targetInstance,
  91436. })
  91437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91438. }
  91439. // Do executes the "compute.targetInstances.get" call.
  91440. // Exactly one of *TargetInstance or error will be non-nil. Any non-2xx
  91441. // status code is an error. Response headers are in either
  91442. // *TargetInstance.ServerResponse.Header or (if a response was returned
  91443. // at all) in error.(*googleapi.Error).Header. Use
  91444. // googleapi.IsNotModified to check whether the returned error was
  91445. // because http.StatusNotModified was returned.
  91446. func (c *TargetInstancesGetCall) Do(opts ...googleapi.CallOption) (*TargetInstance, error) {
  91447. gensupport.SetOptions(c.urlParams_, opts...)
  91448. res, err := c.doRequest("json")
  91449. if res != nil && res.StatusCode == http.StatusNotModified {
  91450. if res.Body != nil {
  91451. res.Body.Close()
  91452. }
  91453. return nil, &googleapi.Error{
  91454. Code: res.StatusCode,
  91455. Header: res.Header,
  91456. }
  91457. }
  91458. if err != nil {
  91459. return nil, err
  91460. }
  91461. defer googleapi.CloseBody(res)
  91462. if err := googleapi.CheckResponse(res); err != nil {
  91463. return nil, err
  91464. }
  91465. ret := &TargetInstance{
  91466. ServerResponse: googleapi.ServerResponse{
  91467. Header: res.Header,
  91468. HTTPStatusCode: res.StatusCode,
  91469. },
  91470. }
  91471. target := &ret
  91472. if err := gensupport.DecodeResponse(target, res); err != nil {
  91473. return nil, err
  91474. }
  91475. return ret, nil
  91476. // {
  91477. // "description": "Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request.",
  91478. // "httpMethod": "GET",
  91479. // "id": "compute.targetInstances.get",
  91480. // "parameterOrder": [
  91481. // "project",
  91482. // "zone",
  91483. // "targetInstance"
  91484. // ],
  91485. // "parameters": {
  91486. // "project": {
  91487. // "description": "Project ID for this request.",
  91488. // "location": "path",
  91489. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91490. // "required": true,
  91491. // "type": "string"
  91492. // },
  91493. // "targetInstance": {
  91494. // "description": "Name of the TargetInstance resource to return.",
  91495. // "location": "path",
  91496. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  91497. // "required": true,
  91498. // "type": "string"
  91499. // },
  91500. // "zone": {
  91501. // "description": "Name of the zone scoping this request.",
  91502. // "location": "path",
  91503. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91504. // "required": true,
  91505. // "type": "string"
  91506. // }
  91507. // },
  91508. // "path": "{project}/zones/{zone}/targetInstances/{targetInstance}",
  91509. // "response": {
  91510. // "$ref": "TargetInstance"
  91511. // },
  91512. // "scopes": [
  91513. // "https://www.googleapis.com/auth/cloud-platform",
  91514. // "https://www.googleapis.com/auth/compute",
  91515. // "https://www.googleapis.com/auth/compute.readonly"
  91516. // ]
  91517. // }
  91518. }
  91519. // method id "compute.targetInstances.insert":
  91520. type TargetInstancesInsertCall struct {
  91521. s *Service
  91522. project string
  91523. zone string
  91524. targetinstance *TargetInstance
  91525. urlParams_ gensupport.URLParams
  91526. ctx_ context.Context
  91527. header_ http.Header
  91528. }
  91529. // Insert: Creates a TargetInstance resource in the specified project
  91530. // and zone using the data included in the request.
  91531. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert
  91532. func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall {
  91533. c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91534. c.project = project
  91535. c.zone = zone
  91536. c.targetinstance = targetinstance
  91537. return c
  91538. }
  91539. // RequestId sets the optional parameter "requestId": An optional
  91540. // request ID to identify requests. Specify a unique request ID so that
  91541. // if you must retry your request, the server will know to ignore the
  91542. // request if it has already been completed.
  91543. //
  91544. // For example, consider a situation where you make an initial request
  91545. // and the request times out. If you make the request again with the
  91546. // same request ID, the server can check if original operation with the
  91547. // same request ID was received, and if so, will ignore the second
  91548. // request. This prevents clients from accidentally creating duplicate
  91549. // commitments.
  91550. //
  91551. // The request ID must be a valid UUID with the exception that zero UUID
  91552. // is not supported (00000000-0000-0000-0000-000000000000).
  91553. func (c *TargetInstancesInsertCall) RequestId(requestId string) *TargetInstancesInsertCall {
  91554. c.urlParams_.Set("requestId", requestId)
  91555. return c
  91556. }
  91557. // Fields allows partial responses to be retrieved. See
  91558. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91559. // for more information.
  91560. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall {
  91561. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91562. return c
  91563. }
  91564. // Context sets the context to be used in this call's Do method. Any
  91565. // pending HTTP request will be aborted if the provided context is
  91566. // canceled.
  91567. func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall {
  91568. c.ctx_ = ctx
  91569. return c
  91570. }
  91571. // Header returns an http.Header that can be modified by the caller to
  91572. // add HTTP headers to the request.
  91573. func (c *TargetInstancesInsertCall) Header() http.Header {
  91574. if c.header_ == nil {
  91575. c.header_ = make(http.Header)
  91576. }
  91577. return c.header_
  91578. }
  91579. func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) {
  91580. reqHeaders := make(http.Header)
  91581. for k, v := range c.header_ {
  91582. reqHeaders[k] = v
  91583. }
  91584. reqHeaders.Set("User-Agent", c.s.userAgent())
  91585. var body io.Reader = nil
  91586. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance)
  91587. if err != nil {
  91588. return nil, err
  91589. }
  91590. reqHeaders.Set("Content-Type", "application/json")
  91591. c.urlParams_.Set("alt", alt)
  91592. c.urlParams_.Set("prettyPrint", "false")
  91593. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  91594. urls += "?" + c.urlParams_.Encode()
  91595. req, err := http.NewRequest("POST", urls, body)
  91596. if err != nil {
  91597. return nil, err
  91598. }
  91599. req.Header = reqHeaders
  91600. googleapi.Expand(req.URL, map[string]string{
  91601. "project": c.project,
  91602. "zone": c.zone,
  91603. })
  91604. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91605. }
  91606. // Do executes the "compute.targetInstances.insert" call.
  91607. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  91608. // status code is an error. Response headers are in either
  91609. // *Operation.ServerResponse.Header or (if a response was returned at
  91610. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  91611. // to check whether the returned error was because
  91612. // http.StatusNotModified was returned.
  91613. func (c *TargetInstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  91614. gensupport.SetOptions(c.urlParams_, opts...)
  91615. res, err := c.doRequest("json")
  91616. if res != nil && res.StatusCode == http.StatusNotModified {
  91617. if res.Body != nil {
  91618. res.Body.Close()
  91619. }
  91620. return nil, &googleapi.Error{
  91621. Code: res.StatusCode,
  91622. Header: res.Header,
  91623. }
  91624. }
  91625. if err != nil {
  91626. return nil, err
  91627. }
  91628. defer googleapi.CloseBody(res)
  91629. if err := googleapi.CheckResponse(res); err != nil {
  91630. return nil, err
  91631. }
  91632. ret := &Operation{
  91633. ServerResponse: googleapi.ServerResponse{
  91634. Header: res.Header,
  91635. HTTPStatusCode: res.StatusCode,
  91636. },
  91637. }
  91638. target := &ret
  91639. if err := gensupport.DecodeResponse(target, res); err != nil {
  91640. return nil, err
  91641. }
  91642. return ret, nil
  91643. // {
  91644. // "description": "Creates a TargetInstance resource in the specified project and zone using the data included in the request.",
  91645. // "httpMethod": "POST",
  91646. // "id": "compute.targetInstances.insert",
  91647. // "parameterOrder": [
  91648. // "project",
  91649. // "zone"
  91650. // ],
  91651. // "parameters": {
  91652. // "project": {
  91653. // "description": "Project ID for this request.",
  91654. // "location": "path",
  91655. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91656. // "required": true,
  91657. // "type": "string"
  91658. // },
  91659. // "requestId": {
  91660. // "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).",
  91661. // "location": "query",
  91662. // "type": "string"
  91663. // },
  91664. // "zone": {
  91665. // "description": "Name of the zone scoping this request.",
  91666. // "location": "path",
  91667. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91668. // "required": true,
  91669. // "type": "string"
  91670. // }
  91671. // },
  91672. // "path": "{project}/zones/{zone}/targetInstances",
  91673. // "request": {
  91674. // "$ref": "TargetInstance"
  91675. // },
  91676. // "response": {
  91677. // "$ref": "Operation"
  91678. // },
  91679. // "scopes": [
  91680. // "https://www.googleapis.com/auth/cloud-platform",
  91681. // "https://www.googleapis.com/auth/compute"
  91682. // ]
  91683. // }
  91684. }
  91685. // method id "compute.targetInstances.list":
  91686. type TargetInstancesListCall struct {
  91687. s *Service
  91688. project string
  91689. zone string
  91690. urlParams_ gensupport.URLParams
  91691. ifNoneMatch_ string
  91692. ctx_ context.Context
  91693. header_ http.Header
  91694. }
  91695. // List: Retrieves a list of TargetInstance resources available to the
  91696. // specified project and zone.
  91697. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list
  91698. func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall {
  91699. c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91700. c.project = project
  91701. c.zone = zone
  91702. return c
  91703. }
  91704. // Filter sets the optional parameter "filter": A filter expression that
  91705. // filters resources listed in the response. The expression must specify
  91706. // the field name, a comparison operator, and the value that you want to
  91707. // use for filtering. The value must be a string, a number, or a
  91708. // boolean. The comparison operator must be either =, !=, >, or <.
  91709. //
  91710. // For example, if you are filtering Compute Engine instances, you can
  91711. // exclude instances named example-instance by specifying name !=
  91712. // example-instance.
  91713. //
  91714. // You can also filter nested fields. For example, you could specify
  91715. // scheduling.automaticRestart = false to include instances only if they
  91716. // are not scheduled for automatic restarts. You can use filtering on
  91717. // nested fields to filter based on resource labels.
  91718. //
  91719. // To filter on multiple expressions, provide each separate expression
  91720. // within parentheses. For example, (scheduling.automaticRestart = true)
  91721. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  91722. // AND expression. However, you can include AND and OR expressions
  91723. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  91724. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  91725. // true).
  91726. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall {
  91727. c.urlParams_.Set("filter", filter)
  91728. return c
  91729. }
  91730. // MaxResults sets the optional parameter "maxResults": The maximum
  91731. // number of results per page that should be returned. If the number of
  91732. // available results is larger than maxResults, Compute Engine returns a
  91733. // nextPageToken that can be used to get the next page of results in
  91734. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  91735. // (Default: 500)
  91736. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall {
  91737. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  91738. return c
  91739. }
  91740. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  91741. // a certain order. By default, results are returned in alphanumerical
  91742. // order based on the resource name.
  91743. //
  91744. // You can also sort results in descending order based on the creation
  91745. // timestamp using orderBy="creationTimestamp desc". This sorts results
  91746. // based on the creationTimestamp field in reverse chronological order
  91747. // (newest result first). Use this to sort resources like operations so
  91748. // that the newest operation is returned first.
  91749. //
  91750. // Currently, only sorting by name or creationTimestamp desc is
  91751. // supported.
  91752. func (c *TargetInstancesListCall) OrderBy(orderBy string) *TargetInstancesListCall {
  91753. c.urlParams_.Set("orderBy", orderBy)
  91754. return c
  91755. }
  91756. // PageToken sets the optional parameter "pageToken": Specifies a page
  91757. // token to use. Set pageToken to the nextPageToken returned by a
  91758. // previous list request to get the next page of results.
  91759. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall {
  91760. c.urlParams_.Set("pageToken", pageToken)
  91761. return c
  91762. }
  91763. // Fields allows partial responses to be retrieved. See
  91764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91765. // for more information.
  91766. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall {
  91767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91768. return c
  91769. }
  91770. // IfNoneMatch sets the optional parameter which makes the operation
  91771. // fail if the object's ETag matches the given value. This is useful for
  91772. // getting updates only after the object has changed since the last
  91773. // request. Use googleapi.IsNotModified to check whether the response
  91774. // error from Do is the result of In-None-Match.
  91775. func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall {
  91776. c.ifNoneMatch_ = entityTag
  91777. return c
  91778. }
  91779. // Context sets the context to be used in this call's Do method. Any
  91780. // pending HTTP request will be aborted if the provided context is
  91781. // canceled.
  91782. func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall {
  91783. c.ctx_ = ctx
  91784. return c
  91785. }
  91786. // Header returns an http.Header that can be modified by the caller to
  91787. // add HTTP headers to the request.
  91788. func (c *TargetInstancesListCall) Header() http.Header {
  91789. if c.header_ == nil {
  91790. c.header_ = make(http.Header)
  91791. }
  91792. return c.header_
  91793. }
  91794. func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) {
  91795. reqHeaders := make(http.Header)
  91796. for k, v := range c.header_ {
  91797. reqHeaders[k] = v
  91798. }
  91799. reqHeaders.Set("User-Agent", c.s.userAgent())
  91800. if c.ifNoneMatch_ != "" {
  91801. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  91802. }
  91803. var body io.Reader = nil
  91804. c.urlParams_.Set("alt", alt)
  91805. c.urlParams_.Set("prettyPrint", "false")
  91806. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances")
  91807. urls += "?" + c.urlParams_.Encode()
  91808. req, err := http.NewRequest("GET", urls, body)
  91809. if err != nil {
  91810. return nil, err
  91811. }
  91812. req.Header = reqHeaders
  91813. googleapi.Expand(req.URL, map[string]string{
  91814. "project": c.project,
  91815. "zone": c.zone,
  91816. })
  91817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  91818. }
  91819. // Do executes the "compute.targetInstances.list" call.
  91820. // Exactly one of *TargetInstanceList or error will be non-nil. Any
  91821. // non-2xx status code is an error. Response headers are in either
  91822. // *TargetInstanceList.ServerResponse.Header or (if a response was
  91823. // returned at all) in error.(*googleapi.Error).Header. Use
  91824. // googleapi.IsNotModified to check whether the returned error was
  91825. // because http.StatusNotModified was returned.
  91826. func (c *TargetInstancesListCall) Do(opts ...googleapi.CallOption) (*TargetInstanceList, error) {
  91827. gensupport.SetOptions(c.urlParams_, opts...)
  91828. res, err := c.doRequest("json")
  91829. if res != nil && res.StatusCode == http.StatusNotModified {
  91830. if res.Body != nil {
  91831. res.Body.Close()
  91832. }
  91833. return nil, &googleapi.Error{
  91834. Code: res.StatusCode,
  91835. Header: res.Header,
  91836. }
  91837. }
  91838. if err != nil {
  91839. return nil, err
  91840. }
  91841. defer googleapi.CloseBody(res)
  91842. if err := googleapi.CheckResponse(res); err != nil {
  91843. return nil, err
  91844. }
  91845. ret := &TargetInstanceList{
  91846. ServerResponse: googleapi.ServerResponse{
  91847. Header: res.Header,
  91848. HTTPStatusCode: res.StatusCode,
  91849. },
  91850. }
  91851. target := &ret
  91852. if err := gensupport.DecodeResponse(target, res); err != nil {
  91853. return nil, err
  91854. }
  91855. return ret, nil
  91856. // {
  91857. // "description": "Retrieves a list of TargetInstance resources available to the specified project and zone.",
  91858. // "httpMethod": "GET",
  91859. // "id": "compute.targetInstances.list",
  91860. // "parameterOrder": [
  91861. // "project",
  91862. // "zone"
  91863. // ],
  91864. // "parameters": {
  91865. // "filter": {
  91866. // "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).",
  91867. // "location": "query",
  91868. // "type": "string"
  91869. // },
  91870. // "maxResults": {
  91871. // "default": "500",
  91872. // "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)",
  91873. // "format": "uint32",
  91874. // "location": "query",
  91875. // "minimum": "0",
  91876. // "type": "integer"
  91877. // },
  91878. // "orderBy": {
  91879. // "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.",
  91880. // "location": "query",
  91881. // "type": "string"
  91882. // },
  91883. // "pageToken": {
  91884. // "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.",
  91885. // "location": "query",
  91886. // "type": "string"
  91887. // },
  91888. // "project": {
  91889. // "description": "Project ID for this request.",
  91890. // "location": "path",
  91891. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  91892. // "required": true,
  91893. // "type": "string"
  91894. // },
  91895. // "zone": {
  91896. // "description": "Name of the zone scoping this request.",
  91897. // "location": "path",
  91898. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  91899. // "required": true,
  91900. // "type": "string"
  91901. // }
  91902. // },
  91903. // "path": "{project}/zones/{zone}/targetInstances",
  91904. // "response": {
  91905. // "$ref": "TargetInstanceList"
  91906. // },
  91907. // "scopes": [
  91908. // "https://www.googleapis.com/auth/cloud-platform",
  91909. // "https://www.googleapis.com/auth/compute",
  91910. // "https://www.googleapis.com/auth/compute.readonly"
  91911. // ]
  91912. // }
  91913. }
  91914. // Pages invokes f for each page of results.
  91915. // A non-nil error returned from f will halt the iteration.
  91916. // The provided context supersedes any context provided to the Context method.
  91917. func (c *TargetInstancesListCall) Pages(ctx context.Context, f func(*TargetInstanceList) error) error {
  91918. c.ctx_ = ctx
  91919. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  91920. for {
  91921. x, err := c.Do()
  91922. if err != nil {
  91923. return err
  91924. }
  91925. if err := f(x); err != nil {
  91926. return err
  91927. }
  91928. if x.NextPageToken == "" {
  91929. return nil
  91930. }
  91931. c.PageToken(x.NextPageToken)
  91932. }
  91933. }
  91934. // method id "compute.targetPools.addHealthCheck":
  91935. type TargetPoolsAddHealthCheckCall struct {
  91936. s *Service
  91937. project string
  91938. region string
  91939. targetPool string
  91940. targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest
  91941. urlParams_ gensupport.URLParams
  91942. ctx_ context.Context
  91943. header_ http.Header
  91944. }
  91945. // AddHealthCheck: Adds health check URLs to a target pool.
  91946. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck
  91947. func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall {
  91948. c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  91949. c.project = project
  91950. c.region = region
  91951. c.targetPool = targetPool
  91952. c.targetpoolsaddhealthcheckrequest = targetpoolsaddhealthcheckrequest
  91953. return c
  91954. }
  91955. // RequestId sets the optional parameter "requestId": An optional
  91956. // request ID to identify requests. Specify a unique request ID so that
  91957. // if you must retry your request, the server will know to ignore the
  91958. // request if it has already been completed.
  91959. //
  91960. // For example, consider a situation where you make an initial request
  91961. // and the request times out. If you make the request again with the
  91962. // same request ID, the server can check if original operation with the
  91963. // same request ID was received, and if so, will ignore the second
  91964. // request. This prevents clients from accidentally creating duplicate
  91965. // commitments.
  91966. //
  91967. // The request ID must be a valid UUID with the exception that zero UUID
  91968. // is not supported (00000000-0000-0000-0000-000000000000).
  91969. func (c *TargetPoolsAddHealthCheckCall) RequestId(requestId string) *TargetPoolsAddHealthCheckCall {
  91970. c.urlParams_.Set("requestId", requestId)
  91971. return c
  91972. }
  91973. // Fields allows partial responses to be retrieved. See
  91974. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  91975. // for more information.
  91976. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall {
  91977. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  91978. return c
  91979. }
  91980. // Context sets the context to be used in this call's Do method. Any
  91981. // pending HTTP request will be aborted if the provided context is
  91982. // canceled.
  91983. func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall {
  91984. c.ctx_ = ctx
  91985. return c
  91986. }
  91987. // Header returns an http.Header that can be modified by the caller to
  91988. // add HTTP headers to the request.
  91989. func (c *TargetPoolsAddHealthCheckCall) Header() http.Header {
  91990. if c.header_ == nil {
  91991. c.header_ = make(http.Header)
  91992. }
  91993. return c.header_
  91994. }
  91995. func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  91996. reqHeaders := make(http.Header)
  91997. for k, v := range c.header_ {
  91998. reqHeaders[k] = v
  91999. }
  92000. reqHeaders.Set("User-Agent", c.s.userAgent())
  92001. var body io.Reader = nil
  92002. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest)
  92003. if err != nil {
  92004. return nil, err
  92005. }
  92006. reqHeaders.Set("Content-Type", "application/json")
  92007. c.urlParams_.Set("alt", alt)
  92008. c.urlParams_.Set("prettyPrint", "false")
  92009. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck")
  92010. urls += "?" + c.urlParams_.Encode()
  92011. req, err := http.NewRequest("POST", urls, body)
  92012. if err != nil {
  92013. return nil, err
  92014. }
  92015. req.Header = reqHeaders
  92016. googleapi.Expand(req.URL, map[string]string{
  92017. "project": c.project,
  92018. "region": c.region,
  92019. "targetPool": c.targetPool,
  92020. })
  92021. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92022. }
  92023. // Do executes the "compute.targetPools.addHealthCheck" call.
  92024. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92025. // status code is an error. Response headers are in either
  92026. // *Operation.ServerResponse.Header or (if a response was returned at
  92027. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92028. // to check whether the returned error was because
  92029. // http.StatusNotModified was returned.
  92030. func (c *TargetPoolsAddHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92031. gensupport.SetOptions(c.urlParams_, opts...)
  92032. res, err := c.doRequest("json")
  92033. if res != nil && res.StatusCode == http.StatusNotModified {
  92034. if res.Body != nil {
  92035. res.Body.Close()
  92036. }
  92037. return nil, &googleapi.Error{
  92038. Code: res.StatusCode,
  92039. Header: res.Header,
  92040. }
  92041. }
  92042. if err != nil {
  92043. return nil, err
  92044. }
  92045. defer googleapi.CloseBody(res)
  92046. if err := googleapi.CheckResponse(res); err != nil {
  92047. return nil, err
  92048. }
  92049. ret := &Operation{
  92050. ServerResponse: googleapi.ServerResponse{
  92051. Header: res.Header,
  92052. HTTPStatusCode: res.StatusCode,
  92053. },
  92054. }
  92055. target := &ret
  92056. if err := gensupport.DecodeResponse(target, res); err != nil {
  92057. return nil, err
  92058. }
  92059. return ret, nil
  92060. // {
  92061. // "description": "Adds health check URLs to a target pool.",
  92062. // "httpMethod": "POST",
  92063. // "id": "compute.targetPools.addHealthCheck",
  92064. // "parameterOrder": [
  92065. // "project",
  92066. // "region",
  92067. // "targetPool"
  92068. // ],
  92069. // "parameters": {
  92070. // "project": {
  92071. // "description": "Project ID for this request.",
  92072. // "location": "path",
  92073. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92074. // "required": true,
  92075. // "type": "string"
  92076. // },
  92077. // "region": {
  92078. // "description": "Name of the region scoping this request.",
  92079. // "location": "path",
  92080. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92081. // "required": true,
  92082. // "type": "string"
  92083. // },
  92084. // "requestId": {
  92085. // "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).",
  92086. // "location": "query",
  92087. // "type": "string"
  92088. // },
  92089. // "targetPool": {
  92090. // "description": "Name of the target pool to add a health check to.",
  92091. // "location": "path",
  92092. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92093. // "required": true,
  92094. // "type": "string"
  92095. // }
  92096. // },
  92097. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck",
  92098. // "request": {
  92099. // "$ref": "TargetPoolsAddHealthCheckRequest"
  92100. // },
  92101. // "response": {
  92102. // "$ref": "Operation"
  92103. // },
  92104. // "scopes": [
  92105. // "https://www.googleapis.com/auth/cloud-platform",
  92106. // "https://www.googleapis.com/auth/compute"
  92107. // ]
  92108. // }
  92109. }
  92110. // method id "compute.targetPools.addInstance":
  92111. type TargetPoolsAddInstanceCall struct {
  92112. s *Service
  92113. project string
  92114. region string
  92115. targetPool string
  92116. targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest
  92117. urlParams_ gensupport.URLParams
  92118. ctx_ context.Context
  92119. header_ http.Header
  92120. }
  92121. // AddInstance: Adds an instance to a target pool.
  92122. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance
  92123. func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall {
  92124. c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92125. c.project = project
  92126. c.region = region
  92127. c.targetPool = targetPool
  92128. c.targetpoolsaddinstancerequest = targetpoolsaddinstancerequest
  92129. return c
  92130. }
  92131. // RequestId sets the optional parameter "requestId": An optional
  92132. // request ID to identify requests. Specify a unique request ID so that
  92133. // if you must retry your request, the server will know to ignore the
  92134. // request if it has already been completed.
  92135. //
  92136. // For example, consider a situation where you make an initial request
  92137. // and the request times out. If you make the request again with the
  92138. // same request ID, the server can check if original operation with the
  92139. // same request ID was received, and if so, will ignore the second
  92140. // request. This prevents clients from accidentally creating duplicate
  92141. // commitments.
  92142. //
  92143. // The request ID must be a valid UUID with the exception that zero UUID
  92144. // is not supported (00000000-0000-0000-0000-000000000000).
  92145. func (c *TargetPoolsAddInstanceCall) RequestId(requestId string) *TargetPoolsAddInstanceCall {
  92146. c.urlParams_.Set("requestId", requestId)
  92147. return c
  92148. }
  92149. // Fields allows partial responses to be retrieved. See
  92150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92151. // for more information.
  92152. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall {
  92153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92154. return c
  92155. }
  92156. // Context sets the context to be used in this call's Do method. Any
  92157. // pending HTTP request will be aborted if the provided context is
  92158. // canceled.
  92159. func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall {
  92160. c.ctx_ = ctx
  92161. return c
  92162. }
  92163. // Header returns an http.Header that can be modified by the caller to
  92164. // add HTTP headers to the request.
  92165. func (c *TargetPoolsAddInstanceCall) Header() http.Header {
  92166. if c.header_ == nil {
  92167. c.header_ = make(http.Header)
  92168. }
  92169. return c.header_
  92170. }
  92171. func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) {
  92172. reqHeaders := make(http.Header)
  92173. for k, v := range c.header_ {
  92174. reqHeaders[k] = v
  92175. }
  92176. reqHeaders.Set("User-Agent", c.s.userAgent())
  92177. var body io.Reader = nil
  92178. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest)
  92179. if err != nil {
  92180. return nil, err
  92181. }
  92182. reqHeaders.Set("Content-Type", "application/json")
  92183. c.urlParams_.Set("alt", alt)
  92184. c.urlParams_.Set("prettyPrint", "false")
  92185. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance")
  92186. urls += "?" + c.urlParams_.Encode()
  92187. req, err := http.NewRequest("POST", urls, body)
  92188. if err != nil {
  92189. return nil, err
  92190. }
  92191. req.Header = reqHeaders
  92192. googleapi.Expand(req.URL, map[string]string{
  92193. "project": c.project,
  92194. "region": c.region,
  92195. "targetPool": c.targetPool,
  92196. })
  92197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92198. }
  92199. // Do executes the "compute.targetPools.addInstance" call.
  92200. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92201. // status code is an error. Response headers are in either
  92202. // *Operation.ServerResponse.Header or (if a response was returned at
  92203. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92204. // to check whether the returned error was because
  92205. // http.StatusNotModified was returned.
  92206. func (c *TargetPoolsAddInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92207. gensupport.SetOptions(c.urlParams_, opts...)
  92208. res, err := c.doRequest("json")
  92209. if res != nil && res.StatusCode == http.StatusNotModified {
  92210. if res.Body != nil {
  92211. res.Body.Close()
  92212. }
  92213. return nil, &googleapi.Error{
  92214. Code: res.StatusCode,
  92215. Header: res.Header,
  92216. }
  92217. }
  92218. if err != nil {
  92219. return nil, err
  92220. }
  92221. defer googleapi.CloseBody(res)
  92222. if err := googleapi.CheckResponse(res); err != nil {
  92223. return nil, err
  92224. }
  92225. ret := &Operation{
  92226. ServerResponse: googleapi.ServerResponse{
  92227. Header: res.Header,
  92228. HTTPStatusCode: res.StatusCode,
  92229. },
  92230. }
  92231. target := &ret
  92232. if err := gensupport.DecodeResponse(target, res); err != nil {
  92233. return nil, err
  92234. }
  92235. return ret, nil
  92236. // {
  92237. // "description": "Adds an instance to a target pool.",
  92238. // "httpMethod": "POST",
  92239. // "id": "compute.targetPools.addInstance",
  92240. // "parameterOrder": [
  92241. // "project",
  92242. // "region",
  92243. // "targetPool"
  92244. // ],
  92245. // "parameters": {
  92246. // "project": {
  92247. // "description": "Project ID for this request.",
  92248. // "location": "path",
  92249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92250. // "required": true,
  92251. // "type": "string"
  92252. // },
  92253. // "region": {
  92254. // "description": "Name of the region scoping this request.",
  92255. // "location": "path",
  92256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92257. // "required": true,
  92258. // "type": "string"
  92259. // },
  92260. // "requestId": {
  92261. // "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).",
  92262. // "location": "query",
  92263. // "type": "string"
  92264. // },
  92265. // "targetPool": {
  92266. // "description": "Name of the TargetPool resource to add instances to.",
  92267. // "location": "path",
  92268. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92269. // "required": true,
  92270. // "type": "string"
  92271. // }
  92272. // },
  92273. // "path": "{project}/regions/{region}/targetPools/{targetPool}/addInstance",
  92274. // "request": {
  92275. // "$ref": "TargetPoolsAddInstanceRequest"
  92276. // },
  92277. // "response": {
  92278. // "$ref": "Operation"
  92279. // },
  92280. // "scopes": [
  92281. // "https://www.googleapis.com/auth/cloud-platform",
  92282. // "https://www.googleapis.com/auth/compute"
  92283. // ]
  92284. // }
  92285. }
  92286. // method id "compute.targetPools.aggregatedList":
  92287. type TargetPoolsAggregatedListCall struct {
  92288. s *Service
  92289. project string
  92290. urlParams_ gensupport.URLParams
  92291. ifNoneMatch_ string
  92292. ctx_ context.Context
  92293. header_ http.Header
  92294. }
  92295. // AggregatedList: Retrieves an aggregated list of target pools.
  92296. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList
  92297. func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall {
  92298. c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92299. c.project = project
  92300. return c
  92301. }
  92302. // Filter sets the optional parameter "filter": A filter expression that
  92303. // filters resources listed in the response. The expression must specify
  92304. // the field name, a comparison operator, and the value that you want to
  92305. // use for filtering. The value must be a string, a number, or a
  92306. // boolean. The comparison operator must be either =, !=, >, or <.
  92307. //
  92308. // For example, if you are filtering Compute Engine instances, you can
  92309. // exclude instances named example-instance by specifying name !=
  92310. // example-instance.
  92311. //
  92312. // You can also filter nested fields. For example, you could specify
  92313. // scheduling.automaticRestart = false to include instances only if they
  92314. // are not scheduled for automatic restarts. You can use filtering on
  92315. // nested fields to filter based on resource labels.
  92316. //
  92317. // To filter on multiple expressions, provide each separate expression
  92318. // within parentheses. For example, (scheduling.automaticRestart = true)
  92319. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  92320. // AND expression. However, you can include AND and OR expressions
  92321. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  92322. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  92323. // true).
  92324. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall {
  92325. c.urlParams_.Set("filter", filter)
  92326. return c
  92327. }
  92328. // MaxResults sets the optional parameter "maxResults": The maximum
  92329. // number of results per page that should be returned. If the number of
  92330. // available results is larger than maxResults, Compute Engine returns a
  92331. // nextPageToken that can be used to get the next page of results in
  92332. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  92333. // (Default: 500)
  92334. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall {
  92335. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  92336. return c
  92337. }
  92338. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  92339. // a certain order. By default, results are returned in alphanumerical
  92340. // order based on the resource name.
  92341. //
  92342. // You can also sort results in descending order based on the creation
  92343. // timestamp using orderBy="creationTimestamp desc". This sorts results
  92344. // based on the creationTimestamp field in reverse chronological order
  92345. // (newest result first). Use this to sort resources like operations so
  92346. // that the newest operation is returned first.
  92347. //
  92348. // Currently, only sorting by name or creationTimestamp desc is
  92349. // supported.
  92350. func (c *TargetPoolsAggregatedListCall) OrderBy(orderBy string) *TargetPoolsAggregatedListCall {
  92351. c.urlParams_.Set("orderBy", orderBy)
  92352. return c
  92353. }
  92354. // PageToken sets the optional parameter "pageToken": Specifies a page
  92355. // token to use. Set pageToken to the nextPageToken returned by a
  92356. // previous list request to get the next page of results.
  92357. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall {
  92358. c.urlParams_.Set("pageToken", pageToken)
  92359. return c
  92360. }
  92361. // Fields allows partial responses to be retrieved. See
  92362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92363. // for more information.
  92364. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall {
  92365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92366. return c
  92367. }
  92368. // IfNoneMatch sets the optional parameter which makes the operation
  92369. // fail if the object's ETag matches the given value. This is useful for
  92370. // getting updates only after the object has changed since the last
  92371. // request. Use googleapi.IsNotModified to check whether the response
  92372. // error from Do is the result of In-None-Match.
  92373. func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall {
  92374. c.ifNoneMatch_ = entityTag
  92375. return c
  92376. }
  92377. // Context sets the context to be used in this call's Do method. Any
  92378. // pending HTTP request will be aborted if the provided context is
  92379. // canceled.
  92380. func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall {
  92381. c.ctx_ = ctx
  92382. return c
  92383. }
  92384. // Header returns an http.Header that can be modified by the caller to
  92385. // add HTTP headers to the request.
  92386. func (c *TargetPoolsAggregatedListCall) Header() http.Header {
  92387. if c.header_ == nil {
  92388. c.header_ = make(http.Header)
  92389. }
  92390. return c.header_
  92391. }
  92392. func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  92393. reqHeaders := make(http.Header)
  92394. for k, v := range c.header_ {
  92395. reqHeaders[k] = v
  92396. }
  92397. reqHeaders.Set("User-Agent", c.s.userAgent())
  92398. if c.ifNoneMatch_ != "" {
  92399. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92400. }
  92401. var body io.Reader = nil
  92402. c.urlParams_.Set("alt", alt)
  92403. c.urlParams_.Set("prettyPrint", "false")
  92404. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools")
  92405. urls += "?" + c.urlParams_.Encode()
  92406. req, err := http.NewRequest("GET", urls, body)
  92407. if err != nil {
  92408. return nil, err
  92409. }
  92410. req.Header = reqHeaders
  92411. googleapi.Expand(req.URL, map[string]string{
  92412. "project": c.project,
  92413. })
  92414. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92415. }
  92416. // Do executes the "compute.targetPools.aggregatedList" call.
  92417. // Exactly one of *TargetPoolAggregatedList or error will be non-nil.
  92418. // Any non-2xx status code is an error. Response headers are in either
  92419. // *TargetPoolAggregatedList.ServerResponse.Header or (if a response was
  92420. // returned at all) in error.(*googleapi.Error).Header. Use
  92421. // googleapi.IsNotModified to check whether the returned error was
  92422. // because http.StatusNotModified was returned.
  92423. func (c *TargetPoolsAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetPoolAggregatedList, error) {
  92424. gensupport.SetOptions(c.urlParams_, opts...)
  92425. res, err := c.doRequest("json")
  92426. if res != nil && res.StatusCode == http.StatusNotModified {
  92427. if res.Body != nil {
  92428. res.Body.Close()
  92429. }
  92430. return nil, &googleapi.Error{
  92431. Code: res.StatusCode,
  92432. Header: res.Header,
  92433. }
  92434. }
  92435. if err != nil {
  92436. return nil, err
  92437. }
  92438. defer googleapi.CloseBody(res)
  92439. if err := googleapi.CheckResponse(res); err != nil {
  92440. return nil, err
  92441. }
  92442. ret := &TargetPoolAggregatedList{
  92443. ServerResponse: googleapi.ServerResponse{
  92444. Header: res.Header,
  92445. HTTPStatusCode: res.StatusCode,
  92446. },
  92447. }
  92448. target := &ret
  92449. if err := gensupport.DecodeResponse(target, res); err != nil {
  92450. return nil, err
  92451. }
  92452. return ret, nil
  92453. // {
  92454. // "description": "Retrieves an aggregated list of target pools.",
  92455. // "httpMethod": "GET",
  92456. // "id": "compute.targetPools.aggregatedList",
  92457. // "parameterOrder": [
  92458. // "project"
  92459. // ],
  92460. // "parameters": {
  92461. // "filter": {
  92462. // "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).",
  92463. // "location": "query",
  92464. // "type": "string"
  92465. // },
  92466. // "maxResults": {
  92467. // "default": "500",
  92468. // "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)",
  92469. // "format": "uint32",
  92470. // "location": "query",
  92471. // "minimum": "0",
  92472. // "type": "integer"
  92473. // },
  92474. // "orderBy": {
  92475. // "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.",
  92476. // "location": "query",
  92477. // "type": "string"
  92478. // },
  92479. // "pageToken": {
  92480. // "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.",
  92481. // "location": "query",
  92482. // "type": "string"
  92483. // },
  92484. // "project": {
  92485. // "description": "Project ID for this request.",
  92486. // "location": "path",
  92487. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92488. // "required": true,
  92489. // "type": "string"
  92490. // }
  92491. // },
  92492. // "path": "{project}/aggregated/targetPools",
  92493. // "response": {
  92494. // "$ref": "TargetPoolAggregatedList"
  92495. // },
  92496. // "scopes": [
  92497. // "https://www.googleapis.com/auth/cloud-platform",
  92498. // "https://www.googleapis.com/auth/compute",
  92499. // "https://www.googleapis.com/auth/compute.readonly"
  92500. // ]
  92501. // }
  92502. }
  92503. // Pages invokes f for each page of results.
  92504. // A non-nil error returned from f will halt the iteration.
  92505. // The provided context supersedes any context provided to the Context method.
  92506. func (c *TargetPoolsAggregatedListCall) Pages(ctx context.Context, f func(*TargetPoolAggregatedList) error) error {
  92507. c.ctx_ = ctx
  92508. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  92509. for {
  92510. x, err := c.Do()
  92511. if err != nil {
  92512. return err
  92513. }
  92514. if err := f(x); err != nil {
  92515. return err
  92516. }
  92517. if x.NextPageToken == "" {
  92518. return nil
  92519. }
  92520. c.PageToken(x.NextPageToken)
  92521. }
  92522. }
  92523. // method id "compute.targetPools.delete":
  92524. type TargetPoolsDeleteCall struct {
  92525. s *Service
  92526. project string
  92527. region string
  92528. targetPool string
  92529. urlParams_ gensupport.URLParams
  92530. ctx_ context.Context
  92531. header_ http.Header
  92532. }
  92533. // Delete: Deletes the specified target pool.
  92534. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete
  92535. func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall {
  92536. c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92537. c.project = project
  92538. c.region = region
  92539. c.targetPool = targetPool
  92540. return c
  92541. }
  92542. // RequestId sets the optional parameter "requestId": An optional
  92543. // request ID to identify requests. Specify a unique request ID so that
  92544. // if you must retry your request, the server will know to ignore the
  92545. // request if it has already been completed.
  92546. //
  92547. // For example, consider a situation where you make an initial request
  92548. // and the request times out. If you make the request again with the
  92549. // same request ID, the server can check if original operation with the
  92550. // same request ID was received, and if so, will ignore the second
  92551. // request. This prevents clients from accidentally creating duplicate
  92552. // commitments.
  92553. //
  92554. // The request ID must be a valid UUID with the exception that zero UUID
  92555. // is not supported (00000000-0000-0000-0000-000000000000).
  92556. func (c *TargetPoolsDeleteCall) RequestId(requestId string) *TargetPoolsDeleteCall {
  92557. c.urlParams_.Set("requestId", requestId)
  92558. return c
  92559. }
  92560. // Fields allows partial responses to be retrieved. See
  92561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92562. // for more information.
  92563. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall {
  92564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92565. return c
  92566. }
  92567. // Context sets the context to be used in this call's Do method. Any
  92568. // pending HTTP request will be aborted if the provided context is
  92569. // canceled.
  92570. func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall {
  92571. c.ctx_ = ctx
  92572. return c
  92573. }
  92574. // Header returns an http.Header that can be modified by the caller to
  92575. // add HTTP headers to the request.
  92576. func (c *TargetPoolsDeleteCall) Header() http.Header {
  92577. if c.header_ == nil {
  92578. c.header_ = make(http.Header)
  92579. }
  92580. return c.header_
  92581. }
  92582. func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  92583. reqHeaders := make(http.Header)
  92584. for k, v := range c.header_ {
  92585. reqHeaders[k] = v
  92586. }
  92587. reqHeaders.Set("User-Agent", c.s.userAgent())
  92588. var body io.Reader = nil
  92589. c.urlParams_.Set("alt", alt)
  92590. c.urlParams_.Set("prettyPrint", "false")
  92591. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  92592. urls += "?" + c.urlParams_.Encode()
  92593. req, err := http.NewRequest("DELETE", urls, body)
  92594. if err != nil {
  92595. return nil, err
  92596. }
  92597. req.Header = reqHeaders
  92598. googleapi.Expand(req.URL, map[string]string{
  92599. "project": c.project,
  92600. "region": c.region,
  92601. "targetPool": c.targetPool,
  92602. })
  92603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92604. }
  92605. // Do executes the "compute.targetPools.delete" call.
  92606. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  92607. // status code is an error. Response headers are in either
  92608. // *Operation.ServerResponse.Header or (if a response was returned at
  92609. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92610. // to check whether the returned error was because
  92611. // http.StatusNotModified was returned.
  92612. func (c *TargetPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  92613. gensupport.SetOptions(c.urlParams_, opts...)
  92614. res, err := c.doRequest("json")
  92615. if res != nil && res.StatusCode == http.StatusNotModified {
  92616. if res.Body != nil {
  92617. res.Body.Close()
  92618. }
  92619. return nil, &googleapi.Error{
  92620. Code: res.StatusCode,
  92621. Header: res.Header,
  92622. }
  92623. }
  92624. if err != nil {
  92625. return nil, err
  92626. }
  92627. defer googleapi.CloseBody(res)
  92628. if err := googleapi.CheckResponse(res); err != nil {
  92629. return nil, err
  92630. }
  92631. ret := &Operation{
  92632. ServerResponse: googleapi.ServerResponse{
  92633. Header: res.Header,
  92634. HTTPStatusCode: res.StatusCode,
  92635. },
  92636. }
  92637. target := &ret
  92638. if err := gensupport.DecodeResponse(target, res); err != nil {
  92639. return nil, err
  92640. }
  92641. return ret, nil
  92642. // {
  92643. // "description": "Deletes the specified target pool.",
  92644. // "httpMethod": "DELETE",
  92645. // "id": "compute.targetPools.delete",
  92646. // "parameterOrder": [
  92647. // "project",
  92648. // "region",
  92649. // "targetPool"
  92650. // ],
  92651. // "parameters": {
  92652. // "project": {
  92653. // "description": "Project ID for this request.",
  92654. // "location": "path",
  92655. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92656. // "required": true,
  92657. // "type": "string"
  92658. // },
  92659. // "region": {
  92660. // "description": "Name of the region scoping this request.",
  92661. // "location": "path",
  92662. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92663. // "required": true,
  92664. // "type": "string"
  92665. // },
  92666. // "requestId": {
  92667. // "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).",
  92668. // "location": "query",
  92669. // "type": "string"
  92670. // },
  92671. // "targetPool": {
  92672. // "description": "Name of the TargetPool resource to delete.",
  92673. // "location": "path",
  92674. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92675. // "required": true,
  92676. // "type": "string"
  92677. // }
  92678. // },
  92679. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  92680. // "response": {
  92681. // "$ref": "Operation"
  92682. // },
  92683. // "scopes": [
  92684. // "https://www.googleapis.com/auth/cloud-platform",
  92685. // "https://www.googleapis.com/auth/compute"
  92686. // ]
  92687. // }
  92688. }
  92689. // method id "compute.targetPools.get":
  92690. type TargetPoolsGetCall struct {
  92691. s *Service
  92692. project string
  92693. region string
  92694. targetPool string
  92695. urlParams_ gensupport.URLParams
  92696. ifNoneMatch_ string
  92697. ctx_ context.Context
  92698. header_ http.Header
  92699. }
  92700. // Get: Returns the specified target pool. Gets a list of available
  92701. // target pools by making a list() request.
  92702. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get
  92703. func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall {
  92704. c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92705. c.project = project
  92706. c.region = region
  92707. c.targetPool = targetPool
  92708. return c
  92709. }
  92710. // Fields allows partial responses to be retrieved. See
  92711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92712. // for more information.
  92713. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall {
  92714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92715. return c
  92716. }
  92717. // IfNoneMatch sets the optional parameter which makes the operation
  92718. // fail if the object's ETag matches the given value. This is useful for
  92719. // getting updates only after the object has changed since the last
  92720. // request. Use googleapi.IsNotModified to check whether the response
  92721. // error from Do is the result of In-None-Match.
  92722. func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall {
  92723. c.ifNoneMatch_ = entityTag
  92724. return c
  92725. }
  92726. // Context sets the context to be used in this call's Do method. Any
  92727. // pending HTTP request will be aborted if the provided context is
  92728. // canceled.
  92729. func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall {
  92730. c.ctx_ = ctx
  92731. return c
  92732. }
  92733. // Header returns an http.Header that can be modified by the caller to
  92734. // add HTTP headers to the request.
  92735. func (c *TargetPoolsGetCall) Header() http.Header {
  92736. if c.header_ == nil {
  92737. c.header_ = make(http.Header)
  92738. }
  92739. return c.header_
  92740. }
  92741. func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  92742. reqHeaders := make(http.Header)
  92743. for k, v := range c.header_ {
  92744. reqHeaders[k] = v
  92745. }
  92746. reqHeaders.Set("User-Agent", c.s.userAgent())
  92747. if c.ifNoneMatch_ != "" {
  92748. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  92749. }
  92750. var body io.Reader = nil
  92751. c.urlParams_.Set("alt", alt)
  92752. c.urlParams_.Set("prettyPrint", "false")
  92753. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}")
  92754. urls += "?" + c.urlParams_.Encode()
  92755. req, err := http.NewRequest("GET", urls, body)
  92756. if err != nil {
  92757. return nil, err
  92758. }
  92759. req.Header = reqHeaders
  92760. googleapi.Expand(req.URL, map[string]string{
  92761. "project": c.project,
  92762. "region": c.region,
  92763. "targetPool": c.targetPool,
  92764. })
  92765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92766. }
  92767. // Do executes the "compute.targetPools.get" call.
  92768. // Exactly one of *TargetPool or error will be non-nil. Any non-2xx
  92769. // status code is an error. Response headers are in either
  92770. // *TargetPool.ServerResponse.Header or (if a response was returned at
  92771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  92772. // to check whether the returned error was because
  92773. // http.StatusNotModified was returned.
  92774. func (c *TargetPoolsGetCall) Do(opts ...googleapi.CallOption) (*TargetPool, error) {
  92775. gensupport.SetOptions(c.urlParams_, opts...)
  92776. res, err := c.doRequest("json")
  92777. if res != nil && res.StatusCode == http.StatusNotModified {
  92778. if res.Body != nil {
  92779. res.Body.Close()
  92780. }
  92781. return nil, &googleapi.Error{
  92782. Code: res.StatusCode,
  92783. Header: res.Header,
  92784. }
  92785. }
  92786. if err != nil {
  92787. return nil, err
  92788. }
  92789. defer googleapi.CloseBody(res)
  92790. if err := googleapi.CheckResponse(res); err != nil {
  92791. return nil, err
  92792. }
  92793. ret := &TargetPool{
  92794. ServerResponse: googleapi.ServerResponse{
  92795. Header: res.Header,
  92796. HTTPStatusCode: res.StatusCode,
  92797. },
  92798. }
  92799. target := &ret
  92800. if err := gensupport.DecodeResponse(target, res); err != nil {
  92801. return nil, err
  92802. }
  92803. return ret, nil
  92804. // {
  92805. // "description": "Returns the specified target pool. Gets a list of available target pools by making a list() request.",
  92806. // "httpMethod": "GET",
  92807. // "id": "compute.targetPools.get",
  92808. // "parameterOrder": [
  92809. // "project",
  92810. // "region",
  92811. // "targetPool"
  92812. // ],
  92813. // "parameters": {
  92814. // "project": {
  92815. // "description": "Project ID for this request.",
  92816. // "location": "path",
  92817. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92818. // "required": true,
  92819. // "type": "string"
  92820. // },
  92821. // "region": {
  92822. // "description": "Name of the region scoping this request.",
  92823. // "location": "path",
  92824. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92825. // "required": true,
  92826. // "type": "string"
  92827. // },
  92828. // "targetPool": {
  92829. // "description": "Name of the TargetPool resource to return.",
  92830. // "location": "path",
  92831. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92832. // "required": true,
  92833. // "type": "string"
  92834. // }
  92835. // },
  92836. // "path": "{project}/regions/{region}/targetPools/{targetPool}",
  92837. // "response": {
  92838. // "$ref": "TargetPool"
  92839. // },
  92840. // "scopes": [
  92841. // "https://www.googleapis.com/auth/cloud-platform",
  92842. // "https://www.googleapis.com/auth/compute",
  92843. // "https://www.googleapis.com/auth/compute.readonly"
  92844. // ]
  92845. // }
  92846. }
  92847. // method id "compute.targetPools.getHealth":
  92848. type TargetPoolsGetHealthCall struct {
  92849. s *Service
  92850. project string
  92851. region string
  92852. targetPool string
  92853. instancereference *InstanceReference
  92854. urlParams_ gensupport.URLParams
  92855. ctx_ context.Context
  92856. header_ http.Header
  92857. }
  92858. // GetHealth: Gets the most recent health check results for each IP for
  92859. // the instance that is referenced by the given target pool.
  92860. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth
  92861. func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall {
  92862. c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  92863. c.project = project
  92864. c.region = region
  92865. c.targetPool = targetPool
  92866. c.instancereference = instancereference
  92867. return c
  92868. }
  92869. // Fields allows partial responses to be retrieved. See
  92870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  92871. // for more information.
  92872. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall {
  92873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  92874. return c
  92875. }
  92876. // Context sets the context to be used in this call's Do method. Any
  92877. // pending HTTP request will be aborted if the provided context is
  92878. // canceled.
  92879. func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall {
  92880. c.ctx_ = ctx
  92881. return c
  92882. }
  92883. // Header returns an http.Header that can be modified by the caller to
  92884. // add HTTP headers to the request.
  92885. func (c *TargetPoolsGetHealthCall) Header() http.Header {
  92886. if c.header_ == nil {
  92887. c.header_ = make(http.Header)
  92888. }
  92889. return c.header_
  92890. }
  92891. func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) {
  92892. reqHeaders := make(http.Header)
  92893. for k, v := range c.header_ {
  92894. reqHeaders[k] = v
  92895. }
  92896. reqHeaders.Set("User-Agent", c.s.userAgent())
  92897. var body io.Reader = nil
  92898. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference)
  92899. if err != nil {
  92900. return nil, err
  92901. }
  92902. reqHeaders.Set("Content-Type", "application/json")
  92903. c.urlParams_.Set("alt", alt)
  92904. c.urlParams_.Set("prettyPrint", "false")
  92905. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth")
  92906. urls += "?" + c.urlParams_.Encode()
  92907. req, err := http.NewRequest("POST", urls, body)
  92908. if err != nil {
  92909. return nil, err
  92910. }
  92911. req.Header = reqHeaders
  92912. googleapi.Expand(req.URL, map[string]string{
  92913. "project": c.project,
  92914. "region": c.region,
  92915. "targetPool": c.targetPool,
  92916. })
  92917. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  92918. }
  92919. // Do executes the "compute.targetPools.getHealth" call.
  92920. // Exactly one of *TargetPoolInstanceHealth or error will be non-nil.
  92921. // Any non-2xx status code is an error. Response headers are in either
  92922. // *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was
  92923. // returned at all) in error.(*googleapi.Error).Header. Use
  92924. // googleapi.IsNotModified to check whether the returned error was
  92925. // because http.StatusNotModified was returned.
  92926. func (c *TargetPoolsGetHealthCall) Do(opts ...googleapi.CallOption) (*TargetPoolInstanceHealth, error) {
  92927. gensupport.SetOptions(c.urlParams_, opts...)
  92928. res, err := c.doRequest("json")
  92929. if res != nil && res.StatusCode == http.StatusNotModified {
  92930. if res.Body != nil {
  92931. res.Body.Close()
  92932. }
  92933. return nil, &googleapi.Error{
  92934. Code: res.StatusCode,
  92935. Header: res.Header,
  92936. }
  92937. }
  92938. if err != nil {
  92939. return nil, err
  92940. }
  92941. defer googleapi.CloseBody(res)
  92942. if err := googleapi.CheckResponse(res); err != nil {
  92943. return nil, err
  92944. }
  92945. ret := &TargetPoolInstanceHealth{
  92946. ServerResponse: googleapi.ServerResponse{
  92947. Header: res.Header,
  92948. HTTPStatusCode: res.StatusCode,
  92949. },
  92950. }
  92951. target := &ret
  92952. if err := gensupport.DecodeResponse(target, res); err != nil {
  92953. return nil, err
  92954. }
  92955. return ret, nil
  92956. // {
  92957. // "description": "Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.",
  92958. // "httpMethod": "POST",
  92959. // "id": "compute.targetPools.getHealth",
  92960. // "parameterOrder": [
  92961. // "project",
  92962. // "region",
  92963. // "targetPool"
  92964. // ],
  92965. // "parameters": {
  92966. // "project": {
  92967. // "description": "Project ID for this request.",
  92968. // "location": "path",
  92969. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  92970. // "required": true,
  92971. // "type": "string"
  92972. // },
  92973. // "region": {
  92974. // "description": "Name of the region scoping this request.",
  92975. // "location": "path",
  92976. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  92977. // "required": true,
  92978. // "type": "string"
  92979. // },
  92980. // "targetPool": {
  92981. // "description": "Name of the TargetPool resource to which the queried instance belongs.",
  92982. // "location": "path",
  92983. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  92984. // "required": true,
  92985. // "type": "string"
  92986. // }
  92987. // },
  92988. // "path": "{project}/regions/{region}/targetPools/{targetPool}/getHealth",
  92989. // "request": {
  92990. // "$ref": "InstanceReference"
  92991. // },
  92992. // "response": {
  92993. // "$ref": "TargetPoolInstanceHealth"
  92994. // },
  92995. // "scopes": [
  92996. // "https://www.googleapis.com/auth/cloud-platform",
  92997. // "https://www.googleapis.com/auth/compute",
  92998. // "https://www.googleapis.com/auth/compute.readonly"
  92999. // ]
  93000. // }
  93001. }
  93002. // method id "compute.targetPools.insert":
  93003. type TargetPoolsInsertCall struct {
  93004. s *Service
  93005. project string
  93006. region string
  93007. targetpool *TargetPool
  93008. urlParams_ gensupport.URLParams
  93009. ctx_ context.Context
  93010. header_ http.Header
  93011. }
  93012. // Insert: Creates a target pool in the specified project and region
  93013. // using the data included in the request.
  93014. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert
  93015. func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall {
  93016. c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93017. c.project = project
  93018. c.region = region
  93019. c.targetpool = targetpool
  93020. return c
  93021. }
  93022. // RequestId sets the optional parameter "requestId": An optional
  93023. // request ID to identify requests. Specify a unique request ID so that
  93024. // if you must retry your request, the server will know to ignore the
  93025. // request if it has already been completed.
  93026. //
  93027. // For example, consider a situation where you make an initial request
  93028. // and the request times out. If you make the request again with the
  93029. // same request ID, the server can check if original operation with the
  93030. // same request ID was received, and if so, will ignore the second
  93031. // request. This prevents clients from accidentally creating duplicate
  93032. // commitments.
  93033. //
  93034. // The request ID must be a valid UUID with the exception that zero UUID
  93035. // is not supported (00000000-0000-0000-0000-000000000000).
  93036. func (c *TargetPoolsInsertCall) RequestId(requestId string) *TargetPoolsInsertCall {
  93037. c.urlParams_.Set("requestId", requestId)
  93038. return c
  93039. }
  93040. // Fields allows partial responses to be retrieved. See
  93041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93042. // for more information.
  93043. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall {
  93044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93045. return c
  93046. }
  93047. // Context sets the context to be used in this call's Do method. Any
  93048. // pending HTTP request will be aborted if the provided context is
  93049. // canceled.
  93050. func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall {
  93051. c.ctx_ = ctx
  93052. return c
  93053. }
  93054. // Header returns an http.Header that can be modified by the caller to
  93055. // add HTTP headers to the request.
  93056. func (c *TargetPoolsInsertCall) Header() http.Header {
  93057. if c.header_ == nil {
  93058. c.header_ = make(http.Header)
  93059. }
  93060. return c.header_
  93061. }
  93062. func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) {
  93063. reqHeaders := make(http.Header)
  93064. for k, v := range c.header_ {
  93065. reqHeaders[k] = v
  93066. }
  93067. reqHeaders.Set("User-Agent", c.s.userAgent())
  93068. var body io.Reader = nil
  93069. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool)
  93070. if err != nil {
  93071. return nil, err
  93072. }
  93073. reqHeaders.Set("Content-Type", "application/json")
  93074. c.urlParams_.Set("alt", alt)
  93075. c.urlParams_.Set("prettyPrint", "false")
  93076. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  93077. urls += "?" + c.urlParams_.Encode()
  93078. req, err := http.NewRequest("POST", urls, body)
  93079. if err != nil {
  93080. return nil, err
  93081. }
  93082. req.Header = reqHeaders
  93083. googleapi.Expand(req.URL, map[string]string{
  93084. "project": c.project,
  93085. "region": c.region,
  93086. })
  93087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93088. }
  93089. // Do executes the "compute.targetPools.insert" call.
  93090. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93091. // status code is an error. Response headers are in either
  93092. // *Operation.ServerResponse.Header or (if a response was returned at
  93093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93094. // to check whether the returned error was because
  93095. // http.StatusNotModified was returned.
  93096. func (c *TargetPoolsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93097. gensupport.SetOptions(c.urlParams_, opts...)
  93098. res, err := c.doRequest("json")
  93099. if res != nil && res.StatusCode == http.StatusNotModified {
  93100. if res.Body != nil {
  93101. res.Body.Close()
  93102. }
  93103. return nil, &googleapi.Error{
  93104. Code: res.StatusCode,
  93105. Header: res.Header,
  93106. }
  93107. }
  93108. if err != nil {
  93109. return nil, err
  93110. }
  93111. defer googleapi.CloseBody(res)
  93112. if err := googleapi.CheckResponse(res); err != nil {
  93113. return nil, err
  93114. }
  93115. ret := &Operation{
  93116. ServerResponse: googleapi.ServerResponse{
  93117. Header: res.Header,
  93118. HTTPStatusCode: res.StatusCode,
  93119. },
  93120. }
  93121. target := &ret
  93122. if err := gensupport.DecodeResponse(target, res); err != nil {
  93123. return nil, err
  93124. }
  93125. return ret, nil
  93126. // {
  93127. // "description": "Creates a target pool in the specified project and region using the data included in the request.",
  93128. // "httpMethod": "POST",
  93129. // "id": "compute.targetPools.insert",
  93130. // "parameterOrder": [
  93131. // "project",
  93132. // "region"
  93133. // ],
  93134. // "parameters": {
  93135. // "project": {
  93136. // "description": "Project ID for this request.",
  93137. // "location": "path",
  93138. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93139. // "required": true,
  93140. // "type": "string"
  93141. // },
  93142. // "region": {
  93143. // "description": "Name of the region scoping this request.",
  93144. // "location": "path",
  93145. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93146. // "required": true,
  93147. // "type": "string"
  93148. // },
  93149. // "requestId": {
  93150. // "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).",
  93151. // "location": "query",
  93152. // "type": "string"
  93153. // }
  93154. // },
  93155. // "path": "{project}/regions/{region}/targetPools",
  93156. // "request": {
  93157. // "$ref": "TargetPool"
  93158. // },
  93159. // "response": {
  93160. // "$ref": "Operation"
  93161. // },
  93162. // "scopes": [
  93163. // "https://www.googleapis.com/auth/cloud-platform",
  93164. // "https://www.googleapis.com/auth/compute"
  93165. // ]
  93166. // }
  93167. }
  93168. // method id "compute.targetPools.list":
  93169. type TargetPoolsListCall struct {
  93170. s *Service
  93171. project string
  93172. region string
  93173. urlParams_ gensupport.URLParams
  93174. ifNoneMatch_ string
  93175. ctx_ context.Context
  93176. header_ http.Header
  93177. }
  93178. // List: Retrieves a list of target pools available to the specified
  93179. // project and region.
  93180. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list
  93181. func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall {
  93182. c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93183. c.project = project
  93184. c.region = region
  93185. return c
  93186. }
  93187. // Filter sets the optional parameter "filter": A filter expression that
  93188. // filters resources listed in the response. The expression must specify
  93189. // the field name, a comparison operator, and the value that you want to
  93190. // use for filtering. The value must be a string, a number, or a
  93191. // boolean. The comparison operator must be either =, !=, >, or <.
  93192. //
  93193. // For example, if you are filtering Compute Engine instances, you can
  93194. // exclude instances named example-instance by specifying name !=
  93195. // example-instance.
  93196. //
  93197. // You can also filter nested fields. For example, you could specify
  93198. // scheduling.automaticRestart = false to include instances only if they
  93199. // are not scheduled for automatic restarts. You can use filtering on
  93200. // nested fields to filter based on resource labels.
  93201. //
  93202. // To filter on multiple expressions, provide each separate expression
  93203. // within parentheses. For example, (scheduling.automaticRestart = true)
  93204. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  93205. // AND expression. However, you can include AND and OR expressions
  93206. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  93207. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  93208. // true).
  93209. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall {
  93210. c.urlParams_.Set("filter", filter)
  93211. return c
  93212. }
  93213. // MaxResults sets the optional parameter "maxResults": The maximum
  93214. // number of results per page that should be returned. If the number of
  93215. // available results is larger than maxResults, Compute Engine returns a
  93216. // nextPageToken that can be used to get the next page of results in
  93217. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  93218. // (Default: 500)
  93219. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall {
  93220. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  93221. return c
  93222. }
  93223. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  93224. // a certain order. By default, results are returned in alphanumerical
  93225. // order based on the resource name.
  93226. //
  93227. // You can also sort results in descending order based on the creation
  93228. // timestamp using orderBy="creationTimestamp desc". This sorts results
  93229. // based on the creationTimestamp field in reverse chronological order
  93230. // (newest result first). Use this to sort resources like operations so
  93231. // that the newest operation is returned first.
  93232. //
  93233. // Currently, only sorting by name or creationTimestamp desc is
  93234. // supported.
  93235. func (c *TargetPoolsListCall) OrderBy(orderBy string) *TargetPoolsListCall {
  93236. c.urlParams_.Set("orderBy", orderBy)
  93237. return c
  93238. }
  93239. // PageToken sets the optional parameter "pageToken": Specifies a page
  93240. // token to use. Set pageToken to the nextPageToken returned by a
  93241. // previous list request to get the next page of results.
  93242. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall {
  93243. c.urlParams_.Set("pageToken", pageToken)
  93244. return c
  93245. }
  93246. // Fields allows partial responses to be retrieved. See
  93247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93248. // for more information.
  93249. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall {
  93250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93251. return c
  93252. }
  93253. // IfNoneMatch sets the optional parameter which makes the operation
  93254. // fail if the object's ETag matches the given value. This is useful for
  93255. // getting updates only after the object has changed since the last
  93256. // request. Use googleapi.IsNotModified to check whether the response
  93257. // error from Do is the result of In-None-Match.
  93258. func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall {
  93259. c.ifNoneMatch_ = entityTag
  93260. return c
  93261. }
  93262. // Context sets the context to be used in this call's Do method. Any
  93263. // pending HTTP request will be aborted if the provided context is
  93264. // canceled.
  93265. func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall {
  93266. c.ctx_ = ctx
  93267. return c
  93268. }
  93269. // Header returns an http.Header that can be modified by the caller to
  93270. // add HTTP headers to the request.
  93271. func (c *TargetPoolsListCall) Header() http.Header {
  93272. if c.header_ == nil {
  93273. c.header_ = make(http.Header)
  93274. }
  93275. return c.header_
  93276. }
  93277. func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) {
  93278. reqHeaders := make(http.Header)
  93279. for k, v := range c.header_ {
  93280. reqHeaders[k] = v
  93281. }
  93282. reqHeaders.Set("User-Agent", c.s.userAgent())
  93283. if c.ifNoneMatch_ != "" {
  93284. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  93285. }
  93286. var body io.Reader = nil
  93287. c.urlParams_.Set("alt", alt)
  93288. c.urlParams_.Set("prettyPrint", "false")
  93289. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools")
  93290. urls += "?" + c.urlParams_.Encode()
  93291. req, err := http.NewRequest("GET", urls, body)
  93292. if err != nil {
  93293. return nil, err
  93294. }
  93295. req.Header = reqHeaders
  93296. googleapi.Expand(req.URL, map[string]string{
  93297. "project": c.project,
  93298. "region": c.region,
  93299. })
  93300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93301. }
  93302. // Do executes the "compute.targetPools.list" call.
  93303. // Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx
  93304. // status code is an error. Response headers are in either
  93305. // *TargetPoolList.ServerResponse.Header or (if a response was returned
  93306. // at all) in error.(*googleapi.Error).Header. Use
  93307. // googleapi.IsNotModified to check whether the returned error was
  93308. // because http.StatusNotModified was returned.
  93309. func (c *TargetPoolsListCall) Do(opts ...googleapi.CallOption) (*TargetPoolList, error) {
  93310. gensupport.SetOptions(c.urlParams_, opts...)
  93311. res, err := c.doRequest("json")
  93312. if res != nil && res.StatusCode == http.StatusNotModified {
  93313. if res.Body != nil {
  93314. res.Body.Close()
  93315. }
  93316. return nil, &googleapi.Error{
  93317. Code: res.StatusCode,
  93318. Header: res.Header,
  93319. }
  93320. }
  93321. if err != nil {
  93322. return nil, err
  93323. }
  93324. defer googleapi.CloseBody(res)
  93325. if err := googleapi.CheckResponse(res); err != nil {
  93326. return nil, err
  93327. }
  93328. ret := &TargetPoolList{
  93329. ServerResponse: googleapi.ServerResponse{
  93330. Header: res.Header,
  93331. HTTPStatusCode: res.StatusCode,
  93332. },
  93333. }
  93334. target := &ret
  93335. if err := gensupport.DecodeResponse(target, res); err != nil {
  93336. return nil, err
  93337. }
  93338. return ret, nil
  93339. // {
  93340. // "description": "Retrieves a list of target pools available to the specified project and region.",
  93341. // "httpMethod": "GET",
  93342. // "id": "compute.targetPools.list",
  93343. // "parameterOrder": [
  93344. // "project",
  93345. // "region"
  93346. // ],
  93347. // "parameters": {
  93348. // "filter": {
  93349. // "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).",
  93350. // "location": "query",
  93351. // "type": "string"
  93352. // },
  93353. // "maxResults": {
  93354. // "default": "500",
  93355. // "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)",
  93356. // "format": "uint32",
  93357. // "location": "query",
  93358. // "minimum": "0",
  93359. // "type": "integer"
  93360. // },
  93361. // "orderBy": {
  93362. // "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.",
  93363. // "location": "query",
  93364. // "type": "string"
  93365. // },
  93366. // "pageToken": {
  93367. // "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.",
  93368. // "location": "query",
  93369. // "type": "string"
  93370. // },
  93371. // "project": {
  93372. // "description": "Project ID for this request.",
  93373. // "location": "path",
  93374. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93375. // "required": true,
  93376. // "type": "string"
  93377. // },
  93378. // "region": {
  93379. // "description": "Name of the region scoping this request.",
  93380. // "location": "path",
  93381. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93382. // "required": true,
  93383. // "type": "string"
  93384. // }
  93385. // },
  93386. // "path": "{project}/regions/{region}/targetPools",
  93387. // "response": {
  93388. // "$ref": "TargetPoolList"
  93389. // },
  93390. // "scopes": [
  93391. // "https://www.googleapis.com/auth/cloud-platform",
  93392. // "https://www.googleapis.com/auth/compute",
  93393. // "https://www.googleapis.com/auth/compute.readonly"
  93394. // ]
  93395. // }
  93396. }
  93397. // Pages invokes f for each page of results.
  93398. // A non-nil error returned from f will halt the iteration.
  93399. // The provided context supersedes any context provided to the Context method.
  93400. func (c *TargetPoolsListCall) Pages(ctx context.Context, f func(*TargetPoolList) error) error {
  93401. c.ctx_ = ctx
  93402. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  93403. for {
  93404. x, err := c.Do()
  93405. if err != nil {
  93406. return err
  93407. }
  93408. if err := f(x); err != nil {
  93409. return err
  93410. }
  93411. if x.NextPageToken == "" {
  93412. return nil
  93413. }
  93414. c.PageToken(x.NextPageToken)
  93415. }
  93416. }
  93417. // method id "compute.targetPools.removeHealthCheck":
  93418. type TargetPoolsRemoveHealthCheckCall struct {
  93419. s *Service
  93420. project string
  93421. region string
  93422. targetPool string
  93423. targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest
  93424. urlParams_ gensupport.URLParams
  93425. ctx_ context.Context
  93426. header_ http.Header
  93427. }
  93428. // RemoveHealthCheck: Removes health check URL from a target pool.
  93429. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck
  93430. func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall {
  93431. c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93432. c.project = project
  93433. c.region = region
  93434. c.targetPool = targetPool
  93435. c.targetpoolsremovehealthcheckrequest = targetpoolsremovehealthcheckrequest
  93436. return c
  93437. }
  93438. // RequestId sets the optional parameter "requestId": An optional
  93439. // request ID to identify requests. Specify a unique request ID so that
  93440. // if you must retry your request, the server will know to ignore the
  93441. // request if it has already been completed.
  93442. //
  93443. // For example, consider a situation where you make an initial request
  93444. // and the request times out. If you make the request again with the
  93445. // same request ID, the server can check if original operation with the
  93446. // same request ID was received, and if so, will ignore the second
  93447. // request. This prevents clients from accidentally creating duplicate
  93448. // commitments.
  93449. //
  93450. // The request ID must be a valid UUID with the exception that zero UUID
  93451. // is not supported (00000000-0000-0000-0000-000000000000).
  93452. func (c *TargetPoolsRemoveHealthCheckCall) RequestId(requestId string) *TargetPoolsRemoveHealthCheckCall {
  93453. c.urlParams_.Set("requestId", requestId)
  93454. return c
  93455. }
  93456. // Fields allows partial responses to be retrieved. See
  93457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93458. // for more information.
  93459. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall {
  93460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93461. return c
  93462. }
  93463. // Context sets the context to be used in this call's Do method. Any
  93464. // pending HTTP request will be aborted if the provided context is
  93465. // canceled.
  93466. func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall {
  93467. c.ctx_ = ctx
  93468. return c
  93469. }
  93470. // Header returns an http.Header that can be modified by the caller to
  93471. // add HTTP headers to the request.
  93472. func (c *TargetPoolsRemoveHealthCheckCall) Header() http.Header {
  93473. if c.header_ == nil {
  93474. c.header_ = make(http.Header)
  93475. }
  93476. return c.header_
  93477. }
  93478. func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) {
  93479. reqHeaders := make(http.Header)
  93480. for k, v := range c.header_ {
  93481. reqHeaders[k] = v
  93482. }
  93483. reqHeaders.Set("User-Agent", c.s.userAgent())
  93484. var body io.Reader = nil
  93485. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest)
  93486. if err != nil {
  93487. return nil, err
  93488. }
  93489. reqHeaders.Set("Content-Type", "application/json")
  93490. c.urlParams_.Set("alt", alt)
  93491. c.urlParams_.Set("prettyPrint", "false")
  93492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck")
  93493. urls += "?" + c.urlParams_.Encode()
  93494. req, err := http.NewRequest("POST", urls, body)
  93495. if err != nil {
  93496. return nil, err
  93497. }
  93498. req.Header = reqHeaders
  93499. googleapi.Expand(req.URL, map[string]string{
  93500. "project": c.project,
  93501. "region": c.region,
  93502. "targetPool": c.targetPool,
  93503. })
  93504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93505. }
  93506. // Do executes the "compute.targetPools.removeHealthCheck" call.
  93507. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93508. // status code is an error. Response headers are in either
  93509. // *Operation.ServerResponse.Header or (if a response was returned at
  93510. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93511. // to check whether the returned error was because
  93512. // http.StatusNotModified was returned.
  93513. func (c *TargetPoolsRemoveHealthCheckCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93514. gensupport.SetOptions(c.urlParams_, opts...)
  93515. res, err := c.doRequest("json")
  93516. if res != nil && res.StatusCode == http.StatusNotModified {
  93517. if res.Body != nil {
  93518. res.Body.Close()
  93519. }
  93520. return nil, &googleapi.Error{
  93521. Code: res.StatusCode,
  93522. Header: res.Header,
  93523. }
  93524. }
  93525. if err != nil {
  93526. return nil, err
  93527. }
  93528. defer googleapi.CloseBody(res)
  93529. if err := googleapi.CheckResponse(res); err != nil {
  93530. return nil, err
  93531. }
  93532. ret := &Operation{
  93533. ServerResponse: googleapi.ServerResponse{
  93534. Header: res.Header,
  93535. HTTPStatusCode: res.StatusCode,
  93536. },
  93537. }
  93538. target := &ret
  93539. if err := gensupport.DecodeResponse(target, res); err != nil {
  93540. return nil, err
  93541. }
  93542. return ret, nil
  93543. // {
  93544. // "description": "Removes health check URL from a target pool.",
  93545. // "httpMethod": "POST",
  93546. // "id": "compute.targetPools.removeHealthCheck",
  93547. // "parameterOrder": [
  93548. // "project",
  93549. // "region",
  93550. // "targetPool"
  93551. // ],
  93552. // "parameters": {
  93553. // "project": {
  93554. // "description": "Project ID for this request.",
  93555. // "location": "path",
  93556. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93557. // "required": true,
  93558. // "type": "string"
  93559. // },
  93560. // "region": {
  93561. // "description": "Name of the region for this request.",
  93562. // "location": "path",
  93563. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93564. // "required": true,
  93565. // "type": "string"
  93566. // },
  93567. // "requestId": {
  93568. // "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).",
  93569. // "location": "query",
  93570. // "type": "string"
  93571. // },
  93572. // "targetPool": {
  93573. // "description": "Name of the target pool to remove health checks from.",
  93574. // "location": "path",
  93575. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93576. // "required": true,
  93577. // "type": "string"
  93578. // }
  93579. // },
  93580. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck",
  93581. // "request": {
  93582. // "$ref": "TargetPoolsRemoveHealthCheckRequest"
  93583. // },
  93584. // "response": {
  93585. // "$ref": "Operation"
  93586. // },
  93587. // "scopes": [
  93588. // "https://www.googleapis.com/auth/cloud-platform",
  93589. // "https://www.googleapis.com/auth/compute"
  93590. // ]
  93591. // }
  93592. }
  93593. // method id "compute.targetPools.removeInstance":
  93594. type TargetPoolsRemoveInstanceCall struct {
  93595. s *Service
  93596. project string
  93597. region string
  93598. targetPool string
  93599. targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest
  93600. urlParams_ gensupport.URLParams
  93601. ctx_ context.Context
  93602. header_ http.Header
  93603. }
  93604. // RemoveInstance: Removes instance URL from a target pool.
  93605. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance
  93606. func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall {
  93607. c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93608. c.project = project
  93609. c.region = region
  93610. c.targetPool = targetPool
  93611. c.targetpoolsremoveinstancerequest = targetpoolsremoveinstancerequest
  93612. return c
  93613. }
  93614. // RequestId sets the optional parameter "requestId": An optional
  93615. // request ID to identify requests. Specify a unique request ID so that
  93616. // if you must retry your request, the server will know to ignore the
  93617. // request if it has already been completed.
  93618. //
  93619. // For example, consider a situation where you make an initial request
  93620. // and the request times out. If you make the request again with the
  93621. // same request ID, the server can check if original operation with the
  93622. // same request ID was received, and if so, will ignore the second
  93623. // request. This prevents clients from accidentally creating duplicate
  93624. // commitments.
  93625. //
  93626. // The request ID must be a valid UUID with the exception that zero UUID
  93627. // is not supported (00000000-0000-0000-0000-000000000000).
  93628. func (c *TargetPoolsRemoveInstanceCall) RequestId(requestId string) *TargetPoolsRemoveInstanceCall {
  93629. c.urlParams_.Set("requestId", requestId)
  93630. return c
  93631. }
  93632. // Fields allows partial responses to be retrieved. See
  93633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93634. // for more information.
  93635. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall {
  93636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93637. return c
  93638. }
  93639. // Context sets the context to be used in this call's Do method. Any
  93640. // pending HTTP request will be aborted if the provided context is
  93641. // canceled.
  93642. func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall {
  93643. c.ctx_ = ctx
  93644. return c
  93645. }
  93646. // Header returns an http.Header that can be modified by the caller to
  93647. // add HTTP headers to the request.
  93648. func (c *TargetPoolsRemoveInstanceCall) Header() http.Header {
  93649. if c.header_ == nil {
  93650. c.header_ = make(http.Header)
  93651. }
  93652. return c.header_
  93653. }
  93654. func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) {
  93655. reqHeaders := make(http.Header)
  93656. for k, v := range c.header_ {
  93657. reqHeaders[k] = v
  93658. }
  93659. reqHeaders.Set("User-Agent", c.s.userAgent())
  93660. var body io.Reader = nil
  93661. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest)
  93662. if err != nil {
  93663. return nil, err
  93664. }
  93665. reqHeaders.Set("Content-Type", "application/json")
  93666. c.urlParams_.Set("alt", alt)
  93667. c.urlParams_.Set("prettyPrint", "false")
  93668. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance")
  93669. urls += "?" + c.urlParams_.Encode()
  93670. req, err := http.NewRequest("POST", urls, body)
  93671. if err != nil {
  93672. return nil, err
  93673. }
  93674. req.Header = reqHeaders
  93675. googleapi.Expand(req.URL, map[string]string{
  93676. "project": c.project,
  93677. "region": c.region,
  93678. "targetPool": c.targetPool,
  93679. })
  93680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93681. }
  93682. // Do executes the "compute.targetPools.removeInstance" call.
  93683. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93684. // status code is an error. Response headers are in either
  93685. // *Operation.ServerResponse.Header or (if a response was returned at
  93686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93687. // to check whether the returned error was because
  93688. // http.StatusNotModified was returned.
  93689. func (c *TargetPoolsRemoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93690. gensupport.SetOptions(c.urlParams_, opts...)
  93691. res, err := c.doRequest("json")
  93692. if res != nil && res.StatusCode == http.StatusNotModified {
  93693. if res.Body != nil {
  93694. res.Body.Close()
  93695. }
  93696. return nil, &googleapi.Error{
  93697. Code: res.StatusCode,
  93698. Header: res.Header,
  93699. }
  93700. }
  93701. if err != nil {
  93702. return nil, err
  93703. }
  93704. defer googleapi.CloseBody(res)
  93705. if err := googleapi.CheckResponse(res); err != nil {
  93706. return nil, err
  93707. }
  93708. ret := &Operation{
  93709. ServerResponse: googleapi.ServerResponse{
  93710. Header: res.Header,
  93711. HTTPStatusCode: res.StatusCode,
  93712. },
  93713. }
  93714. target := &ret
  93715. if err := gensupport.DecodeResponse(target, res); err != nil {
  93716. return nil, err
  93717. }
  93718. return ret, nil
  93719. // {
  93720. // "description": "Removes instance URL from a target pool.",
  93721. // "httpMethod": "POST",
  93722. // "id": "compute.targetPools.removeInstance",
  93723. // "parameterOrder": [
  93724. // "project",
  93725. // "region",
  93726. // "targetPool"
  93727. // ],
  93728. // "parameters": {
  93729. // "project": {
  93730. // "description": "Project ID for this request.",
  93731. // "location": "path",
  93732. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93733. // "required": true,
  93734. // "type": "string"
  93735. // },
  93736. // "region": {
  93737. // "description": "Name of the region scoping this request.",
  93738. // "location": "path",
  93739. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93740. // "required": true,
  93741. // "type": "string"
  93742. // },
  93743. // "requestId": {
  93744. // "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).",
  93745. // "location": "query",
  93746. // "type": "string"
  93747. // },
  93748. // "targetPool": {
  93749. // "description": "Name of the TargetPool resource to remove instances from.",
  93750. // "location": "path",
  93751. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93752. // "required": true,
  93753. // "type": "string"
  93754. // }
  93755. // },
  93756. // "path": "{project}/regions/{region}/targetPools/{targetPool}/removeInstance",
  93757. // "request": {
  93758. // "$ref": "TargetPoolsRemoveInstanceRequest"
  93759. // },
  93760. // "response": {
  93761. // "$ref": "Operation"
  93762. // },
  93763. // "scopes": [
  93764. // "https://www.googleapis.com/auth/cloud-platform",
  93765. // "https://www.googleapis.com/auth/compute"
  93766. // ]
  93767. // }
  93768. }
  93769. // method id "compute.targetPools.setBackup":
  93770. type TargetPoolsSetBackupCall struct {
  93771. s *Service
  93772. project string
  93773. region string
  93774. targetPool string
  93775. targetreference *TargetReference
  93776. urlParams_ gensupport.URLParams
  93777. ctx_ context.Context
  93778. header_ http.Header
  93779. }
  93780. // SetBackup: Changes a backup target pool's configurations.
  93781. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup
  93782. func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall {
  93783. c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93784. c.project = project
  93785. c.region = region
  93786. c.targetPool = targetPool
  93787. c.targetreference = targetreference
  93788. return c
  93789. }
  93790. // FailoverRatio sets the optional parameter "failoverRatio": New
  93791. // failoverRatio value for the target pool.
  93792. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall {
  93793. c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio))
  93794. return c
  93795. }
  93796. // RequestId sets the optional parameter "requestId": An optional
  93797. // request ID to identify requests. Specify a unique request ID so that
  93798. // if you must retry your request, the server will know to ignore the
  93799. // request if it has already been completed.
  93800. //
  93801. // For example, consider a situation where you make an initial request
  93802. // and the request times out. If you make the request again with the
  93803. // same request ID, the server can check if original operation with the
  93804. // same request ID was received, and if so, will ignore the second
  93805. // request. This prevents clients from accidentally creating duplicate
  93806. // commitments.
  93807. //
  93808. // The request ID must be a valid UUID with the exception that zero UUID
  93809. // is not supported (00000000-0000-0000-0000-000000000000).
  93810. func (c *TargetPoolsSetBackupCall) RequestId(requestId string) *TargetPoolsSetBackupCall {
  93811. c.urlParams_.Set("requestId", requestId)
  93812. return c
  93813. }
  93814. // Fields allows partial responses to be retrieved. See
  93815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93816. // for more information.
  93817. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall {
  93818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93819. return c
  93820. }
  93821. // Context sets the context to be used in this call's Do method. Any
  93822. // pending HTTP request will be aborted if the provided context is
  93823. // canceled.
  93824. func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall {
  93825. c.ctx_ = ctx
  93826. return c
  93827. }
  93828. // Header returns an http.Header that can be modified by the caller to
  93829. // add HTTP headers to the request.
  93830. func (c *TargetPoolsSetBackupCall) Header() http.Header {
  93831. if c.header_ == nil {
  93832. c.header_ = make(http.Header)
  93833. }
  93834. return c.header_
  93835. }
  93836. func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) {
  93837. reqHeaders := make(http.Header)
  93838. for k, v := range c.header_ {
  93839. reqHeaders[k] = v
  93840. }
  93841. reqHeaders.Set("User-Agent", c.s.userAgent())
  93842. var body io.Reader = nil
  93843. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference)
  93844. if err != nil {
  93845. return nil, err
  93846. }
  93847. reqHeaders.Set("Content-Type", "application/json")
  93848. c.urlParams_.Set("alt", alt)
  93849. c.urlParams_.Set("prettyPrint", "false")
  93850. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup")
  93851. urls += "?" + c.urlParams_.Encode()
  93852. req, err := http.NewRequest("POST", urls, body)
  93853. if err != nil {
  93854. return nil, err
  93855. }
  93856. req.Header = reqHeaders
  93857. googleapi.Expand(req.URL, map[string]string{
  93858. "project": c.project,
  93859. "region": c.region,
  93860. "targetPool": c.targetPool,
  93861. })
  93862. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  93863. }
  93864. // Do executes the "compute.targetPools.setBackup" call.
  93865. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  93866. // status code is an error. Response headers are in either
  93867. // *Operation.ServerResponse.Header or (if a response was returned at
  93868. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  93869. // to check whether the returned error was because
  93870. // http.StatusNotModified was returned.
  93871. func (c *TargetPoolsSetBackupCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  93872. gensupport.SetOptions(c.urlParams_, opts...)
  93873. res, err := c.doRequest("json")
  93874. if res != nil && res.StatusCode == http.StatusNotModified {
  93875. if res.Body != nil {
  93876. res.Body.Close()
  93877. }
  93878. return nil, &googleapi.Error{
  93879. Code: res.StatusCode,
  93880. Header: res.Header,
  93881. }
  93882. }
  93883. if err != nil {
  93884. return nil, err
  93885. }
  93886. defer googleapi.CloseBody(res)
  93887. if err := googleapi.CheckResponse(res); err != nil {
  93888. return nil, err
  93889. }
  93890. ret := &Operation{
  93891. ServerResponse: googleapi.ServerResponse{
  93892. Header: res.Header,
  93893. HTTPStatusCode: res.StatusCode,
  93894. },
  93895. }
  93896. target := &ret
  93897. if err := gensupport.DecodeResponse(target, res); err != nil {
  93898. return nil, err
  93899. }
  93900. return ret, nil
  93901. // {
  93902. // "description": "Changes a backup target pool's configurations.",
  93903. // "httpMethod": "POST",
  93904. // "id": "compute.targetPools.setBackup",
  93905. // "parameterOrder": [
  93906. // "project",
  93907. // "region",
  93908. // "targetPool"
  93909. // ],
  93910. // "parameters": {
  93911. // "failoverRatio": {
  93912. // "description": "New failoverRatio value for the target pool.",
  93913. // "format": "float",
  93914. // "location": "query",
  93915. // "type": "number"
  93916. // },
  93917. // "project": {
  93918. // "description": "Project ID for this request.",
  93919. // "location": "path",
  93920. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  93921. // "required": true,
  93922. // "type": "string"
  93923. // },
  93924. // "region": {
  93925. // "description": "Name of the region scoping this request.",
  93926. // "location": "path",
  93927. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  93928. // "required": true,
  93929. // "type": "string"
  93930. // },
  93931. // "requestId": {
  93932. // "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).",
  93933. // "location": "query",
  93934. // "type": "string"
  93935. // },
  93936. // "targetPool": {
  93937. // "description": "Name of the TargetPool resource to set a backup pool for.",
  93938. // "location": "path",
  93939. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  93940. // "required": true,
  93941. // "type": "string"
  93942. // }
  93943. // },
  93944. // "path": "{project}/regions/{region}/targetPools/{targetPool}/setBackup",
  93945. // "request": {
  93946. // "$ref": "TargetReference"
  93947. // },
  93948. // "response": {
  93949. // "$ref": "Operation"
  93950. // },
  93951. // "scopes": [
  93952. // "https://www.googleapis.com/auth/cloud-platform",
  93953. // "https://www.googleapis.com/auth/compute"
  93954. // ]
  93955. // }
  93956. }
  93957. // method id "compute.targetSslProxies.delete":
  93958. type TargetSslProxiesDeleteCall struct {
  93959. s *Service
  93960. project string
  93961. targetSslProxy string
  93962. urlParams_ gensupport.URLParams
  93963. ctx_ context.Context
  93964. header_ http.Header
  93965. }
  93966. // Delete: Deletes the specified TargetSslProxy resource.
  93967. func (r *TargetSslProxiesService) Delete(project string, targetSslProxy string) *TargetSslProxiesDeleteCall {
  93968. c := &TargetSslProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  93969. c.project = project
  93970. c.targetSslProxy = targetSslProxy
  93971. return c
  93972. }
  93973. // RequestId sets the optional parameter "requestId": An optional
  93974. // request ID to identify requests. Specify a unique request ID so that
  93975. // if you must retry your request, the server will know to ignore the
  93976. // request if it has already been completed.
  93977. //
  93978. // For example, consider a situation where you make an initial request
  93979. // and the request times out. If you make the request again with the
  93980. // same request ID, the server can check if original operation with the
  93981. // same request ID was received, and if so, will ignore the second
  93982. // request. This prevents clients from accidentally creating duplicate
  93983. // commitments.
  93984. //
  93985. // The request ID must be a valid UUID with the exception that zero UUID
  93986. // is not supported (00000000-0000-0000-0000-000000000000).
  93987. func (c *TargetSslProxiesDeleteCall) RequestId(requestId string) *TargetSslProxiesDeleteCall {
  93988. c.urlParams_.Set("requestId", requestId)
  93989. return c
  93990. }
  93991. // Fields allows partial responses to be retrieved. See
  93992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  93993. // for more information.
  93994. func (c *TargetSslProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetSslProxiesDeleteCall {
  93995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  93996. return c
  93997. }
  93998. // Context sets the context to be used in this call's Do method. Any
  93999. // pending HTTP request will be aborted if the provided context is
  94000. // canceled.
  94001. func (c *TargetSslProxiesDeleteCall) Context(ctx context.Context) *TargetSslProxiesDeleteCall {
  94002. c.ctx_ = ctx
  94003. return c
  94004. }
  94005. // Header returns an http.Header that can be modified by the caller to
  94006. // add HTTP headers to the request.
  94007. func (c *TargetSslProxiesDeleteCall) Header() http.Header {
  94008. if c.header_ == nil {
  94009. c.header_ = make(http.Header)
  94010. }
  94011. return c.header_
  94012. }
  94013. func (c *TargetSslProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  94014. reqHeaders := make(http.Header)
  94015. for k, v := range c.header_ {
  94016. reqHeaders[k] = v
  94017. }
  94018. reqHeaders.Set("User-Agent", c.s.userAgent())
  94019. var body io.Reader = nil
  94020. c.urlParams_.Set("alt", alt)
  94021. c.urlParams_.Set("prettyPrint", "false")
  94022. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  94023. urls += "?" + c.urlParams_.Encode()
  94024. req, err := http.NewRequest("DELETE", urls, body)
  94025. if err != nil {
  94026. return nil, err
  94027. }
  94028. req.Header = reqHeaders
  94029. googleapi.Expand(req.URL, map[string]string{
  94030. "project": c.project,
  94031. "targetSslProxy": c.targetSslProxy,
  94032. })
  94033. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94034. }
  94035. // Do executes the "compute.targetSslProxies.delete" call.
  94036. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94037. // status code is an error. Response headers are in either
  94038. // *Operation.ServerResponse.Header or (if a response was returned at
  94039. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94040. // to check whether the returned error was because
  94041. // http.StatusNotModified was returned.
  94042. func (c *TargetSslProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94043. gensupport.SetOptions(c.urlParams_, opts...)
  94044. res, err := c.doRequest("json")
  94045. if res != nil && res.StatusCode == http.StatusNotModified {
  94046. if res.Body != nil {
  94047. res.Body.Close()
  94048. }
  94049. return nil, &googleapi.Error{
  94050. Code: res.StatusCode,
  94051. Header: res.Header,
  94052. }
  94053. }
  94054. if err != nil {
  94055. return nil, err
  94056. }
  94057. defer googleapi.CloseBody(res)
  94058. if err := googleapi.CheckResponse(res); err != nil {
  94059. return nil, err
  94060. }
  94061. ret := &Operation{
  94062. ServerResponse: googleapi.ServerResponse{
  94063. Header: res.Header,
  94064. HTTPStatusCode: res.StatusCode,
  94065. },
  94066. }
  94067. target := &ret
  94068. if err := gensupport.DecodeResponse(target, res); err != nil {
  94069. return nil, err
  94070. }
  94071. return ret, nil
  94072. // {
  94073. // "description": "Deletes the specified TargetSslProxy resource.",
  94074. // "httpMethod": "DELETE",
  94075. // "id": "compute.targetSslProxies.delete",
  94076. // "parameterOrder": [
  94077. // "project",
  94078. // "targetSslProxy"
  94079. // ],
  94080. // "parameters": {
  94081. // "project": {
  94082. // "description": "Project ID for this request.",
  94083. // "location": "path",
  94084. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94085. // "required": true,
  94086. // "type": "string"
  94087. // },
  94088. // "requestId": {
  94089. // "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).",
  94090. // "location": "query",
  94091. // "type": "string"
  94092. // },
  94093. // "targetSslProxy": {
  94094. // "description": "Name of the TargetSslProxy resource to delete.",
  94095. // "location": "path",
  94096. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94097. // "required": true,
  94098. // "type": "string"
  94099. // }
  94100. // },
  94101. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  94102. // "response": {
  94103. // "$ref": "Operation"
  94104. // },
  94105. // "scopes": [
  94106. // "https://www.googleapis.com/auth/cloud-platform",
  94107. // "https://www.googleapis.com/auth/compute"
  94108. // ]
  94109. // }
  94110. }
  94111. // method id "compute.targetSslProxies.get":
  94112. type TargetSslProxiesGetCall struct {
  94113. s *Service
  94114. project string
  94115. targetSslProxy string
  94116. urlParams_ gensupport.URLParams
  94117. ifNoneMatch_ string
  94118. ctx_ context.Context
  94119. header_ http.Header
  94120. }
  94121. // Get: Returns the specified TargetSslProxy resource. Gets a list of
  94122. // available target SSL proxies by making a list() request.
  94123. func (r *TargetSslProxiesService) Get(project string, targetSslProxy string) *TargetSslProxiesGetCall {
  94124. c := &TargetSslProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94125. c.project = project
  94126. c.targetSslProxy = targetSslProxy
  94127. return c
  94128. }
  94129. // Fields allows partial responses to be retrieved. See
  94130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94131. // for more information.
  94132. func (c *TargetSslProxiesGetCall) Fields(s ...googleapi.Field) *TargetSslProxiesGetCall {
  94133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94134. return c
  94135. }
  94136. // IfNoneMatch sets the optional parameter which makes the operation
  94137. // fail if the object's ETag matches the given value. This is useful for
  94138. // getting updates only after the object has changed since the last
  94139. // request. Use googleapi.IsNotModified to check whether the response
  94140. // error from Do is the result of In-None-Match.
  94141. func (c *TargetSslProxiesGetCall) IfNoneMatch(entityTag string) *TargetSslProxiesGetCall {
  94142. c.ifNoneMatch_ = entityTag
  94143. return c
  94144. }
  94145. // Context sets the context to be used in this call's Do method. Any
  94146. // pending HTTP request will be aborted if the provided context is
  94147. // canceled.
  94148. func (c *TargetSslProxiesGetCall) Context(ctx context.Context) *TargetSslProxiesGetCall {
  94149. c.ctx_ = ctx
  94150. return c
  94151. }
  94152. // Header returns an http.Header that can be modified by the caller to
  94153. // add HTTP headers to the request.
  94154. func (c *TargetSslProxiesGetCall) Header() http.Header {
  94155. if c.header_ == nil {
  94156. c.header_ = make(http.Header)
  94157. }
  94158. return c.header_
  94159. }
  94160. func (c *TargetSslProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  94161. reqHeaders := make(http.Header)
  94162. for k, v := range c.header_ {
  94163. reqHeaders[k] = v
  94164. }
  94165. reqHeaders.Set("User-Agent", c.s.userAgent())
  94166. if c.ifNoneMatch_ != "" {
  94167. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94168. }
  94169. var body io.Reader = nil
  94170. c.urlParams_.Set("alt", alt)
  94171. c.urlParams_.Set("prettyPrint", "false")
  94172. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}")
  94173. urls += "?" + c.urlParams_.Encode()
  94174. req, err := http.NewRequest("GET", urls, body)
  94175. if err != nil {
  94176. return nil, err
  94177. }
  94178. req.Header = reqHeaders
  94179. googleapi.Expand(req.URL, map[string]string{
  94180. "project": c.project,
  94181. "targetSslProxy": c.targetSslProxy,
  94182. })
  94183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94184. }
  94185. // Do executes the "compute.targetSslProxies.get" call.
  94186. // Exactly one of *TargetSslProxy or error will be non-nil. Any non-2xx
  94187. // status code is an error. Response headers are in either
  94188. // *TargetSslProxy.ServerResponse.Header or (if a response was returned
  94189. // at all) in error.(*googleapi.Error).Header. Use
  94190. // googleapi.IsNotModified to check whether the returned error was
  94191. // because http.StatusNotModified was returned.
  94192. func (c *TargetSslProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetSslProxy, error) {
  94193. gensupport.SetOptions(c.urlParams_, opts...)
  94194. res, err := c.doRequest("json")
  94195. if res != nil && res.StatusCode == http.StatusNotModified {
  94196. if res.Body != nil {
  94197. res.Body.Close()
  94198. }
  94199. return nil, &googleapi.Error{
  94200. Code: res.StatusCode,
  94201. Header: res.Header,
  94202. }
  94203. }
  94204. if err != nil {
  94205. return nil, err
  94206. }
  94207. defer googleapi.CloseBody(res)
  94208. if err := googleapi.CheckResponse(res); err != nil {
  94209. return nil, err
  94210. }
  94211. ret := &TargetSslProxy{
  94212. ServerResponse: googleapi.ServerResponse{
  94213. Header: res.Header,
  94214. HTTPStatusCode: res.StatusCode,
  94215. },
  94216. }
  94217. target := &ret
  94218. if err := gensupport.DecodeResponse(target, res); err != nil {
  94219. return nil, err
  94220. }
  94221. return ret, nil
  94222. // {
  94223. // "description": "Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.",
  94224. // "httpMethod": "GET",
  94225. // "id": "compute.targetSslProxies.get",
  94226. // "parameterOrder": [
  94227. // "project",
  94228. // "targetSslProxy"
  94229. // ],
  94230. // "parameters": {
  94231. // "project": {
  94232. // "description": "Project ID for this request.",
  94233. // "location": "path",
  94234. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94235. // "required": true,
  94236. // "type": "string"
  94237. // },
  94238. // "targetSslProxy": {
  94239. // "description": "Name of the TargetSslProxy resource to return.",
  94240. // "location": "path",
  94241. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94242. // "required": true,
  94243. // "type": "string"
  94244. // }
  94245. // },
  94246. // "path": "{project}/global/targetSslProxies/{targetSslProxy}",
  94247. // "response": {
  94248. // "$ref": "TargetSslProxy"
  94249. // },
  94250. // "scopes": [
  94251. // "https://www.googleapis.com/auth/cloud-platform",
  94252. // "https://www.googleapis.com/auth/compute",
  94253. // "https://www.googleapis.com/auth/compute.readonly"
  94254. // ]
  94255. // }
  94256. }
  94257. // method id "compute.targetSslProxies.insert":
  94258. type TargetSslProxiesInsertCall struct {
  94259. s *Service
  94260. project string
  94261. targetsslproxy *TargetSslProxy
  94262. urlParams_ gensupport.URLParams
  94263. ctx_ context.Context
  94264. header_ http.Header
  94265. }
  94266. // Insert: Creates a TargetSslProxy resource in the specified project
  94267. // using the data included in the request.
  94268. func (r *TargetSslProxiesService) Insert(project string, targetsslproxy *TargetSslProxy) *TargetSslProxiesInsertCall {
  94269. c := &TargetSslProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94270. c.project = project
  94271. c.targetsslproxy = targetsslproxy
  94272. return c
  94273. }
  94274. // RequestId sets the optional parameter "requestId": An optional
  94275. // request ID to identify requests. Specify a unique request ID so that
  94276. // if you must retry your request, the server will know to ignore the
  94277. // request if it has already been completed.
  94278. //
  94279. // For example, consider a situation where you make an initial request
  94280. // and the request times out. If you make the request again with the
  94281. // same request ID, the server can check if original operation with the
  94282. // same request ID was received, and if so, will ignore the second
  94283. // request. This prevents clients from accidentally creating duplicate
  94284. // commitments.
  94285. //
  94286. // The request ID must be a valid UUID with the exception that zero UUID
  94287. // is not supported (00000000-0000-0000-0000-000000000000).
  94288. func (c *TargetSslProxiesInsertCall) RequestId(requestId string) *TargetSslProxiesInsertCall {
  94289. c.urlParams_.Set("requestId", requestId)
  94290. return c
  94291. }
  94292. // Fields allows partial responses to be retrieved. See
  94293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94294. // for more information.
  94295. func (c *TargetSslProxiesInsertCall) Fields(s ...googleapi.Field) *TargetSslProxiesInsertCall {
  94296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94297. return c
  94298. }
  94299. // Context sets the context to be used in this call's Do method. Any
  94300. // pending HTTP request will be aborted if the provided context is
  94301. // canceled.
  94302. func (c *TargetSslProxiesInsertCall) Context(ctx context.Context) *TargetSslProxiesInsertCall {
  94303. c.ctx_ = ctx
  94304. return c
  94305. }
  94306. // Header returns an http.Header that can be modified by the caller to
  94307. // add HTTP headers to the request.
  94308. func (c *TargetSslProxiesInsertCall) Header() http.Header {
  94309. if c.header_ == nil {
  94310. c.header_ = make(http.Header)
  94311. }
  94312. return c.header_
  94313. }
  94314. func (c *TargetSslProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  94315. reqHeaders := make(http.Header)
  94316. for k, v := range c.header_ {
  94317. reqHeaders[k] = v
  94318. }
  94319. reqHeaders.Set("User-Agent", c.s.userAgent())
  94320. var body io.Reader = nil
  94321. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxy)
  94322. if err != nil {
  94323. return nil, err
  94324. }
  94325. reqHeaders.Set("Content-Type", "application/json")
  94326. c.urlParams_.Set("alt", alt)
  94327. c.urlParams_.Set("prettyPrint", "false")
  94328. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  94329. urls += "?" + c.urlParams_.Encode()
  94330. req, err := http.NewRequest("POST", urls, body)
  94331. if err != nil {
  94332. return nil, err
  94333. }
  94334. req.Header = reqHeaders
  94335. googleapi.Expand(req.URL, map[string]string{
  94336. "project": c.project,
  94337. })
  94338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94339. }
  94340. // Do executes the "compute.targetSslProxies.insert" call.
  94341. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94342. // status code is an error. Response headers are in either
  94343. // *Operation.ServerResponse.Header or (if a response was returned at
  94344. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94345. // to check whether the returned error was because
  94346. // http.StatusNotModified was returned.
  94347. func (c *TargetSslProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94348. gensupport.SetOptions(c.urlParams_, opts...)
  94349. res, err := c.doRequest("json")
  94350. if res != nil && res.StatusCode == http.StatusNotModified {
  94351. if res.Body != nil {
  94352. res.Body.Close()
  94353. }
  94354. return nil, &googleapi.Error{
  94355. Code: res.StatusCode,
  94356. Header: res.Header,
  94357. }
  94358. }
  94359. if err != nil {
  94360. return nil, err
  94361. }
  94362. defer googleapi.CloseBody(res)
  94363. if err := googleapi.CheckResponse(res); err != nil {
  94364. return nil, err
  94365. }
  94366. ret := &Operation{
  94367. ServerResponse: googleapi.ServerResponse{
  94368. Header: res.Header,
  94369. HTTPStatusCode: res.StatusCode,
  94370. },
  94371. }
  94372. target := &ret
  94373. if err := gensupport.DecodeResponse(target, res); err != nil {
  94374. return nil, err
  94375. }
  94376. return ret, nil
  94377. // {
  94378. // "description": "Creates a TargetSslProxy resource in the specified project using the data included in the request.",
  94379. // "httpMethod": "POST",
  94380. // "id": "compute.targetSslProxies.insert",
  94381. // "parameterOrder": [
  94382. // "project"
  94383. // ],
  94384. // "parameters": {
  94385. // "project": {
  94386. // "description": "Project ID for this request.",
  94387. // "location": "path",
  94388. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94389. // "required": true,
  94390. // "type": "string"
  94391. // },
  94392. // "requestId": {
  94393. // "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).",
  94394. // "location": "query",
  94395. // "type": "string"
  94396. // }
  94397. // },
  94398. // "path": "{project}/global/targetSslProxies",
  94399. // "request": {
  94400. // "$ref": "TargetSslProxy"
  94401. // },
  94402. // "response": {
  94403. // "$ref": "Operation"
  94404. // },
  94405. // "scopes": [
  94406. // "https://www.googleapis.com/auth/cloud-platform",
  94407. // "https://www.googleapis.com/auth/compute"
  94408. // ]
  94409. // }
  94410. }
  94411. // method id "compute.targetSslProxies.list":
  94412. type TargetSslProxiesListCall struct {
  94413. s *Service
  94414. project string
  94415. urlParams_ gensupport.URLParams
  94416. ifNoneMatch_ string
  94417. ctx_ context.Context
  94418. header_ http.Header
  94419. }
  94420. // List: Retrieves the list of TargetSslProxy resources available to the
  94421. // specified project.
  94422. func (r *TargetSslProxiesService) List(project string) *TargetSslProxiesListCall {
  94423. c := &TargetSslProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94424. c.project = project
  94425. return c
  94426. }
  94427. // Filter sets the optional parameter "filter": A filter expression that
  94428. // filters resources listed in the response. The expression must specify
  94429. // the field name, a comparison operator, and the value that you want to
  94430. // use for filtering. The value must be a string, a number, or a
  94431. // boolean. The comparison operator must be either =, !=, >, or <.
  94432. //
  94433. // For example, if you are filtering Compute Engine instances, you can
  94434. // exclude instances named example-instance by specifying name !=
  94435. // example-instance.
  94436. //
  94437. // You can also filter nested fields. For example, you could specify
  94438. // scheduling.automaticRestart = false to include instances only if they
  94439. // are not scheduled for automatic restarts. You can use filtering on
  94440. // nested fields to filter based on resource labels.
  94441. //
  94442. // To filter on multiple expressions, provide each separate expression
  94443. // within parentheses. For example, (scheduling.automaticRestart = true)
  94444. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  94445. // AND expression. However, you can include AND and OR expressions
  94446. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  94447. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  94448. // true).
  94449. func (c *TargetSslProxiesListCall) Filter(filter string) *TargetSslProxiesListCall {
  94450. c.urlParams_.Set("filter", filter)
  94451. return c
  94452. }
  94453. // MaxResults sets the optional parameter "maxResults": The maximum
  94454. // number of results per page that should be returned. If the number of
  94455. // available results is larger than maxResults, Compute Engine returns a
  94456. // nextPageToken that can be used to get the next page of results in
  94457. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  94458. // (Default: 500)
  94459. func (c *TargetSslProxiesListCall) MaxResults(maxResults int64) *TargetSslProxiesListCall {
  94460. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  94461. return c
  94462. }
  94463. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  94464. // a certain order. By default, results are returned in alphanumerical
  94465. // order based on the resource name.
  94466. //
  94467. // You can also sort results in descending order based on the creation
  94468. // timestamp using orderBy="creationTimestamp desc". This sorts results
  94469. // based on the creationTimestamp field in reverse chronological order
  94470. // (newest result first). Use this to sort resources like operations so
  94471. // that the newest operation is returned first.
  94472. //
  94473. // Currently, only sorting by name or creationTimestamp desc is
  94474. // supported.
  94475. func (c *TargetSslProxiesListCall) OrderBy(orderBy string) *TargetSslProxiesListCall {
  94476. c.urlParams_.Set("orderBy", orderBy)
  94477. return c
  94478. }
  94479. // PageToken sets the optional parameter "pageToken": Specifies a page
  94480. // token to use. Set pageToken to the nextPageToken returned by a
  94481. // previous list request to get the next page of results.
  94482. func (c *TargetSslProxiesListCall) PageToken(pageToken string) *TargetSslProxiesListCall {
  94483. c.urlParams_.Set("pageToken", pageToken)
  94484. return c
  94485. }
  94486. // Fields allows partial responses to be retrieved. See
  94487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94488. // for more information.
  94489. func (c *TargetSslProxiesListCall) Fields(s ...googleapi.Field) *TargetSslProxiesListCall {
  94490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94491. return c
  94492. }
  94493. // IfNoneMatch sets the optional parameter which makes the operation
  94494. // fail if the object's ETag matches the given value. This is useful for
  94495. // getting updates only after the object has changed since the last
  94496. // request. Use googleapi.IsNotModified to check whether the response
  94497. // error from Do is the result of In-None-Match.
  94498. func (c *TargetSslProxiesListCall) IfNoneMatch(entityTag string) *TargetSslProxiesListCall {
  94499. c.ifNoneMatch_ = entityTag
  94500. return c
  94501. }
  94502. // Context sets the context to be used in this call's Do method. Any
  94503. // pending HTTP request will be aborted if the provided context is
  94504. // canceled.
  94505. func (c *TargetSslProxiesListCall) Context(ctx context.Context) *TargetSslProxiesListCall {
  94506. c.ctx_ = ctx
  94507. return c
  94508. }
  94509. // Header returns an http.Header that can be modified by the caller to
  94510. // add HTTP headers to the request.
  94511. func (c *TargetSslProxiesListCall) Header() http.Header {
  94512. if c.header_ == nil {
  94513. c.header_ = make(http.Header)
  94514. }
  94515. return c.header_
  94516. }
  94517. func (c *TargetSslProxiesListCall) doRequest(alt string) (*http.Response, error) {
  94518. reqHeaders := make(http.Header)
  94519. for k, v := range c.header_ {
  94520. reqHeaders[k] = v
  94521. }
  94522. reqHeaders.Set("User-Agent", c.s.userAgent())
  94523. if c.ifNoneMatch_ != "" {
  94524. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  94525. }
  94526. var body io.Reader = nil
  94527. c.urlParams_.Set("alt", alt)
  94528. c.urlParams_.Set("prettyPrint", "false")
  94529. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies")
  94530. urls += "?" + c.urlParams_.Encode()
  94531. req, err := http.NewRequest("GET", urls, body)
  94532. if err != nil {
  94533. return nil, err
  94534. }
  94535. req.Header = reqHeaders
  94536. googleapi.Expand(req.URL, map[string]string{
  94537. "project": c.project,
  94538. })
  94539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94540. }
  94541. // Do executes the "compute.targetSslProxies.list" call.
  94542. // Exactly one of *TargetSslProxyList or error will be non-nil. Any
  94543. // non-2xx status code is an error. Response headers are in either
  94544. // *TargetSslProxyList.ServerResponse.Header or (if a response was
  94545. // returned at all) in error.(*googleapi.Error).Header. Use
  94546. // googleapi.IsNotModified to check whether the returned error was
  94547. // because http.StatusNotModified was returned.
  94548. func (c *TargetSslProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetSslProxyList, error) {
  94549. gensupport.SetOptions(c.urlParams_, opts...)
  94550. res, err := c.doRequest("json")
  94551. if res != nil && res.StatusCode == http.StatusNotModified {
  94552. if res.Body != nil {
  94553. res.Body.Close()
  94554. }
  94555. return nil, &googleapi.Error{
  94556. Code: res.StatusCode,
  94557. Header: res.Header,
  94558. }
  94559. }
  94560. if err != nil {
  94561. return nil, err
  94562. }
  94563. defer googleapi.CloseBody(res)
  94564. if err := googleapi.CheckResponse(res); err != nil {
  94565. return nil, err
  94566. }
  94567. ret := &TargetSslProxyList{
  94568. ServerResponse: googleapi.ServerResponse{
  94569. Header: res.Header,
  94570. HTTPStatusCode: res.StatusCode,
  94571. },
  94572. }
  94573. target := &ret
  94574. if err := gensupport.DecodeResponse(target, res); err != nil {
  94575. return nil, err
  94576. }
  94577. return ret, nil
  94578. // {
  94579. // "description": "Retrieves the list of TargetSslProxy resources available to the specified project.",
  94580. // "httpMethod": "GET",
  94581. // "id": "compute.targetSslProxies.list",
  94582. // "parameterOrder": [
  94583. // "project"
  94584. // ],
  94585. // "parameters": {
  94586. // "filter": {
  94587. // "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).",
  94588. // "location": "query",
  94589. // "type": "string"
  94590. // },
  94591. // "maxResults": {
  94592. // "default": "500",
  94593. // "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)",
  94594. // "format": "uint32",
  94595. // "location": "query",
  94596. // "minimum": "0",
  94597. // "type": "integer"
  94598. // },
  94599. // "orderBy": {
  94600. // "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.",
  94601. // "location": "query",
  94602. // "type": "string"
  94603. // },
  94604. // "pageToken": {
  94605. // "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.",
  94606. // "location": "query",
  94607. // "type": "string"
  94608. // },
  94609. // "project": {
  94610. // "description": "Project ID for this request.",
  94611. // "location": "path",
  94612. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94613. // "required": true,
  94614. // "type": "string"
  94615. // }
  94616. // },
  94617. // "path": "{project}/global/targetSslProxies",
  94618. // "response": {
  94619. // "$ref": "TargetSslProxyList"
  94620. // },
  94621. // "scopes": [
  94622. // "https://www.googleapis.com/auth/cloud-platform",
  94623. // "https://www.googleapis.com/auth/compute",
  94624. // "https://www.googleapis.com/auth/compute.readonly"
  94625. // ]
  94626. // }
  94627. }
  94628. // Pages invokes f for each page of results.
  94629. // A non-nil error returned from f will halt the iteration.
  94630. // The provided context supersedes any context provided to the Context method.
  94631. func (c *TargetSslProxiesListCall) Pages(ctx context.Context, f func(*TargetSslProxyList) error) error {
  94632. c.ctx_ = ctx
  94633. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  94634. for {
  94635. x, err := c.Do()
  94636. if err != nil {
  94637. return err
  94638. }
  94639. if err := f(x); err != nil {
  94640. return err
  94641. }
  94642. if x.NextPageToken == "" {
  94643. return nil
  94644. }
  94645. c.PageToken(x.NextPageToken)
  94646. }
  94647. }
  94648. // method id "compute.targetSslProxies.setBackendService":
  94649. type TargetSslProxiesSetBackendServiceCall struct {
  94650. s *Service
  94651. project string
  94652. targetSslProxy string
  94653. targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest
  94654. urlParams_ gensupport.URLParams
  94655. ctx_ context.Context
  94656. header_ http.Header
  94657. }
  94658. // SetBackendService: Changes the BackendService for TargetSslProxy.
  94659. func (r *TargetSslProxiesService) SetBackendService(project string, targetSslProxy string, targetsslproxiessetbackendservicerequest *TargetSslProxiesSetBackendServiceRequest) *TargetSslProxiesSetBackendServiceCall {
  94660. c := &TargetSslProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94661. c.project = project
  94662. c.targetSslProxy = targetSslProxy
  94663. c.targetsslproxiessetbackendservicerequest = targetsslproxiessetbackendservicerequest
  94664. return c
  94665. }
  94666. // RequestId sets the optional parameter "requestId": An optional
  94667. // request ID to identify requests. Specify a unique request ID so that
  94668. // if you must retry your request, the server will know to ignore the
  94669. // request if it has already been completed.
  94670. //
  94671. // For example, consider a situation where you make an initial request
  94672. // and the request times out. If you make the request again with the
  94673. // same request ID, the server can check if original operation with the
  94674. // same request ID was received, and if so, will ignore the second
  94675. // request. This prevents clients from accidentally creating duplicate
  94676. // commitments.
  94677. //
  94678. // The request ID must be a valid UUID with the exception that zero UUID
  94679. // is not supported (00000000-0000-0000-0000-000000000000).
  94680. func (c *TargetSslProxiesSetBackendServiceCall) RequestId(requestId string) *TargetSslProxiesSetBackendServiceCall {
  94681. c.urlParams_.Set("requestId", requestId)
  94682. return c
  94683. }
  94684. // Fields allows partial responses to be retrieved. See
  94685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94686. // for more information.
  94687. func (c *TargetSslProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetBackendServiceCall {
  94688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94689. return c
  94690. }
  94691. // Context sets the context to be used in this call's Do method. Any
  94692. // pending HTTP request will be aborted if the provided context is
  94693. // canceled.
  94694. func (c *TargetSslProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetSslProxiesSetBackendServiceCall {
  94695. c.ctx_ = ctx
  94696. return c
  94697. }
  94698. // Header returns an http.Header that can be modified by the caller to
  94699. // add HTTP headers to the request.
  94700. func (c *TargetSslProxiesSetBackendServiceCall) Header() http.Header {
  94701. if c.header_ == nil {
  94702. c.header_ = make(http.Header)
  94703. }
  94704. return c.header_
  94705. }
  94706. func (c *TargetSslProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  94707. reqHeaders := make(http.Header)
  94708. for k, v := range c.header_ {
  94709. reqHeaders[k] = v
  94710. }
  94711. reqHeaders.Set("User-Agent", c.s.userAgent())
  94712. var body io.Reader = nil
  94713. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetbackendservicerequest)
  94714. if err != nil {
  94715. return nil, err
  94716. }
  94717. reqHeaders.Set("Content-Type", "application/json")
  94718. c.urlParams_.Set("alt", alt)
  94719. c.urlParams_.Set("prettyPrint", "false")
  94720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService")
  94721. urls += "?" + c.urlParams_.Encode()
  94722. req, err := http.NewRequest("POST", urls, body)
  94723. if err != nil {
  94724. return nil, err
  94725. }
  94726. req.Header = reqHeaders
  94727. googleapi.Expand(req.URL, map[string]string{
  94728. "project": c.project,
  94729. "targetSslProxy": c.targetSslProxy,
  94730. })
  94731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94732. }
  94733. // Do executes the "compute.targetSslProxies.setBackendService" call.
  94734. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94735. // status code is an error. Response headers are in either
  94736. // *Operation.ServerResponse.Header or (if a response was returned at
  94737. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94738. // to check whether the returned error was because
  94739. // http.StatusNotModified was returned.
  94740. func (c *TargetSslProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94741. gensupport.SetOptions(c.urlParams_, opts...)
  94742. res, err := c.doRequest("json")
  94743. if res != nil && res.StatusCode == http.StatusNotModified {
  94744. if res.Body != nil {
  94745. res.Body.Close()
  94746. }
  94747. return nil, &googleapi.Error{
  94748. Code: res.StatusCode,
  94749. Header: res.Header,
  94750. }
  94751. }
  94752. if err != nil {
  94753. return nil, err
  94754. }
  94755. defer googleapi.CloseBody(res)
  94756. if err := googleapi.CheckResponse(res); err != nil {
  94757. return nil, err
  94758. }
  94759. ret := &Operation{
  94760. ServerResponse: googleapi.ServerResponse{
  94761. Header: res.Header,
  94762. HTTPStatusCode: res.StatusCode,
  94763. },
  94764. }
  94765. target := &ret
  94766. if err := gensupport.DecodeResponse(target, res); err != nil {
  94767. return nil, err
  94768. }
  94769. return ret, nil
  94770. // {
  94771. // "description": "Changes the BackendService for TargetSslProxy.",
  94772. // "httpMethod": "POST",
  94773. // "id": "compute.targetSslProxies.setBackendService",
  94774. // "parameterOrder": [
  94775. // "project",
  94776. // "targetSslProxy"
  94777. // ],
  94778. // "parameters": {
  94779. // "project": {
  94780. // "description": "Project ID for this request.",
  94781. // "location": "path",
  94782. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94783. // "required": true,
  94784. // "type": "string"
  94785. // },
  94786. // "requestId": {
  94787. // "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).",
  94788. // "location": "query",
  94789. // "type": "string"
  94790. // },
  94791. // "targetSslProxy": {
  94792. // "description": "Name of the TargetSslProxy resource whose BackendService resource is to be set.",
  94793. // "location": "path",
  94794. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94795. // "required": true,
  94796. // "type": "string"
  94797. // }
  94798. // },
  94799. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setBackendService",
  94800. // "request": {
  94801. // "$ref": "TargetSslProxiesSetBackendServiceRequest"
  94802. // },
  94803. // "response": {
  94804. // "$ref": "Operation"
  94805. // },
  94806. // "scopes": [
  94807. // "https://www.googleapis.com/auth/cloud-platform",
  94808. // "https://www.googleapis.com/auth/compute"
  94809. // ]
  94810. // }
  94811. }
  94812. // method id "compute.targetSslProxies.setProxyHeader":
  94813. type TargetSslProxiesSetProxyHeaderCall struct {
  94814. s *Service
  94815. project string
  94816. targetSslProxy string
  94817. targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest
  94818. urlParams_ gensupport.URLParams
  94819. ctx_ context.Context
  94820. header_ http.Header
  94821. }
  94822. // SetProxyHeader: Changes the ProxyHeaderType for TargetSslProxy.
  94823. func (r *TargetSslProxiesService) SetProxyHeader(project string, targetSslProxy string, targetsslproxiessetproxyheaderrequest *TargetSslProxiesSetProxyHeaderRequest) *TargetSslProxiesSetProxyHeaderCall {
  94824. c := &TargetSslProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94825. c.project = project
  94826. c.targetSslProxy = targetSslProxy
  94827. c.targetsslproxiessetproxyheaderrequest = targetsslproxiessetproxyheaderrequest
  94828. return c
  94829. }
  94830. // RequestId sets the optional parameter "requestId": An optional
  94831. // request ID to identify requests. Specify a unique request ID so that
  94832. // if you must retry your request, the server will know to ignore the
  94833. // request if it has already been completed.
  94834. //
  94835. // For example, consider a situation where you make an initial request
  94836. // and the request times out. If you make the request again with the
  94837. // same request ID, the server can check if original operation with the
  94838. // same request ID was received, and if so, will ignore the second
  94839. // request. This prevents clients from accidentally creating duplicate
  94840. // commitments.
  94841. //
  94842. // The request ID must be a valid UUID with the exception that zero UUID
  94843. // is not supported (00000000-0000-0000-0000-000000000000).
  94844. func (c *TargetSslProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetSslProxiesSetProxyHeaderCall {
  94845. c.urlParams_.Set("requestId", requestId)
  94846. return c
  94847. }
  94848. // Fields allows partial responses to be retrieved. See
  94849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  94850. // for more information.
  94851. func (c *TargetSslProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetProxyHeaderCall {
  94852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  94853. return c
  94854. }
  94855. // Context sets the context to be used in this call's Do method. Any
  94856. // pending HTTP request will be aborted if the provided context is
  94857. // canceled.
  94858. func (c *TargetSslProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetSslProxiesSetProxyHeaderCall {
  94859. c.ctx_ = ctx
  94860. return c
  94861. }
  94862. // Header returns an http.Header that can be modified by the caller to
  94863. // add HTTP headers to the request.
  94864. func (c *TargetSslProxiesSetProxyHeaderCall) Header() http.Header {
  94865. if c.header_ == nil {
  94866. c.header_ = make(http.Header)
  94867. }
  94868. return c.header_
  94869. }
  94870. func (c *TargetSslProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  94871. reqHeaders := make(http.Header)
  94872. for k, v := range c.header_ {
  94873. reqHeaders[k] = v
  94874. }
  94875. reqHeaders.Set("User-Agent", c.s.userAgent())
  94876. var body io.Reader = nil
  94877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetproxyheaderrequest)
  94878. if err != nil {
  94879. return nil, err
  94880. }
  94881. reqHeaders.Set("Content-Type", "application/json")
  94882. c.urlParams_.Set("alt", alt)
  94883. c.urlParams_.Set("prettyPrint", "false")
  94884. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader")
  94885. urls += "?" + c.urlParams_.Encode()
  94886. req, err := http.NewRequest("POST", urls, body)
  94887. if err != nil {
  94888. return nil, err
  94889. }
  94890. req.Header = reqHeaders
  94891. googleapi.Expand(req.URL, map[string]string{
  94892. "project": c.project,
  94893. "targetSslProxy": c.targetSslProxy,
  94894. })
  94895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  94896. }
  94897. // Do executes the "compute.targetSslProxies.setProxyHeader" call.
  94898. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  94899. // status code is an error. Response headers are in either
  94900. // *Operation.ServerResponse.Header or (if a response was returned at
  94901. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  94902. // to check whether the returned error was because
  94903. // http.StatusNotModified was returned.
  94904. func (c *TargetSslProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  94905. gensupport.SetOptions(c.urlParams_, opts...)
  94906. res, err := c.doRequest("json")
  94907. if res != nil && res.StatusCode == http.StatusNotModified {
  94908. if res.Body != nil {
  94909. res.Body.Close()
  94910. }
  94911. return nil, &googleapi.Error{
  94912. Code: res.StatusCode,
  94913. Header: res.Header,
  94914. }
  94915. }
  94916. if err != nil {
  94917. return nil, err
  94918. }
  94919. defer googleapi.CloseBody(res)
  94920. if err := googleapi.CheckResponse(res); err != nil {
  94921. return nil, err
  94922. }
  94923. ret := &Operation{
  94924. ServerResponse: googleapi.ServerResponse{
  94925. Header: res.Header,
  94926. HTTPStatusCode: res.StatusCode,
  94927. },
  94928. }
  94929. target := &ret
  94930. if err := gensupport.DecodeResponse(target, res); err != nil {
  94931. return nil, err
  94932. }
  94933. return ret, nil
  94934. // {
  94935. // "description": "Changes the ProxyHeaderType for TargetSslProxy.",
  94936. // "httpMethod": "POST",
  94937. // "id": "compute.targetSslProxies.setProxyHeader",
  94938. // "parameterOrder": [
  94939. // "project",
  94940. // "targetSslProxy"
  94941. // ],
  94942. // "parameters": {
  94943. // "project": {
  94944. // "description": "Project ID for this request.",
  94945. // "location": "path",
  94946. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  94947. // "required": true,
  94948. // "type": "string"
  94949. // },
  94950. // "requestId": {
  94951. // "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).",
  94952. // "location": "query",
  94953. // "type": "string"
  94954. // },
  94955. // "targetSslProxy": {
  94956. // "description": "Name of the TargetSslProxy resource whose ProxyHeader is to be set.",
  94957. // "location": "path",
  94958. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  94959. // "required": true,
  94960. // "type": "string"
  94961. // }
  94962. // },
  94963. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader",
  94964. // "request": {
  94965. // "$ref": "TargetSslProxiesSetProxyHeaderRequest"
  94966. // },
  94967. // "response": {
  94968. // "$ref": "Operation"
  94969. // },
  94970. // "scopes": [
  94971. // "https://www.googleapis.com/auth/cloud-platform",
  94972. // "https://www.googleapis.com/auth/compute"
  94973. // ]
  94974. // }
  94975. }
  94976. // method id "compute.targetSslProxies.setSslCertificates":
  94977. type TargetSslProxiesSetSslCertificatesCall struct {
  94978. s *Service
  94979. project string
  94980. targetSslProxy string
  94981. targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest
  94982. urlParams_ gensupport.URLParams
  94983. ctx_ context.Context
  94984. header_ http.Header
  94985. }
  94986. // SetSslCertificates: Changes SslCertificates for TargetSslProxy.
  94987. func (r *TargetSslProxiesService) SetSslCertificates(project string, targetSslProxy string, targetsslproxiessetsslcertificatesrequest *TargetSslProxiesSetSslCertificatesRequest) *TargetSslProxiesSetSslCertificatesCall {
  94988. c := &TargetSslProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  94989. c.project = project
  94990. c.targetSslProxy = targetSslProxy
  94991. c.targetsslproxiessetsslcertificatesrequest = targetsslproxiessetsslcertificatesrequest
  94992. return c
  94993. }
  94994. // RequestId sets the optional parameter "requestId": An optional
  94995. // request ID to identify requests. Specify a unique request ID so that
  94996. // if you must retry your request, the server will know to ignore the
  94997. // request if it has already been completed.
  94998. //
  94999. // For example, consider a situation where you make an initial request
  95000. // and the request times out. If you make the request again with the
  95001. // same request ID, the server can check if original operation with the
  95002. // same request ID was received, and if so, will ignore the second
  95003. // request. This prevents clients from accidentally creating duplicate
  95004. // commitments.
  95005. //
  95006. // The request ID must be a valid UUID with the exception that zero UUID
  95007. // is not supported (00000000-0000-0000-0000-000000000000).
  95008. func (c *TargetSslProxiesSetSslCertificatesCall) RequestId(requestId string) *TargetSslProxiesSetSslCertificatesCall {
  95009. c.urlParams_.Set("requestId", requestId)
  95010. return c
  95011. }
  95012. // Fields allows partial responses to be retrieved. See
  95013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95014. // for more information.
  95015. func (c *TargetSslProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslCertificatesCall {
  95016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95017. return c
  95018. }
  95019. // Context sets the context to be used in this call's Do method. Any
  95020. // pending HTTP request will be aborted if the provided context is
  95021. // canceled.
  95022. func (c *TargetSslProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetSslProxiesSetSslCertificatesCall {
  95023. c.ctx_ = ctx
  95024. return c
  95025. }
  95026. // Header returns an http.Header that can be modified by the caller to
  95027. // add HTTP headers to the request.
  95028. func (c *TargetSslProxiesSetSslCertificatesCall) Header() http.Header {
  95029. if c.header_ == nil {
  95030. c.header_ = make(http.Header)
  95031. }
  95032. return c.header_
  95033. }
  95034. func (c *TargetSslProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) {
  95035. reqHeaders := make(http.Header)
  95036. for k, v := range c.header_ {
  95037. reqHeaders[k] = v
  95038. }
  95039. reqHeaders.Set("User-Agent", c.s.userAgent())
  95040. var body io.Reader = nil
  95041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetsslproxiessetsslcertificatesrequest)
  95042. if err != nil {
  95043. return nil, err
  95044. }
  95045. reqHeaders.Set("Content-Type", "application/json")
  95046. c.urlParams_.Set("alt", alt)
  95047. c.urlParams_.Set("prettyPrint", "false")
  95048. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates")
  95049. urls += "?" + c.urlParams_.Encode()
  95050. req, err := http.NewRequest("POST", urls, body)
  95051. if err != nil {
  95052. return nil, err
  95053. }
  95054. req.Header = reqHeaders
  95055. googleapi.Expand(req.URL, map[string]string{
  95056. "project": c.project,
  95057. "targetSslProxy": c.targetSslProxy,
  95058. })
  95059. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95060. }
  95061. // Do executes the "compute.targetSslProxies.setSslCertificates" call.
  95062. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95063. // status code is an error. Response headers are in either
  95064. // *Operation.ServerResponse.Header or (if a response was returned at
  95065. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95066. // to check whether the returned error was because
  95067. // http.StatusNotModified was returned.
  95068. func (c *TargetSslProxiesSetSslCertificatesCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95069. gensupport.SetOptions(c.urlParams_, opts...)
  95070. res, err := c.doRequest("json")
  95071. if res != nil && res.StatusCode == http.StatusNotModified {
  95072. if res.Body != nil {
  95073. res.Body.Close()
  95074. }
  95075. return nil, &googleapi.Error{
  95076. Code: res.StatusCode,
  95077. Header: res.Header,
  95078. }
  95079. }
  95080. if err != nil {
  95081. return nil, err
  95082. }
  95083. defer googleapi.CloseBody(res)
  95084. if err := googleapi.CheckResponse(res); err != nil {
  95085. return nil, err
  95086. }
  95087. ret := &Operation{
  95088. ServerResponse: googleapi.ServerResponse{
  95089. Header: res.Header,
  95090. HTTPStatusCode: res.StatusCode,
  95091. },
  95092. }
  95093. target := &ret
  95094. if err := gensupport.DecodeResponse(target, res); err != nil {
  95095. return nil, err
  95096. }
  95097. return ret, nil
  95098. // {
  95099. // "description": "Changes SslCertificates for TargetSslProxy.",
  95100. // "httpMethod": "POST",
  95101. // "id": "compute.targetSslProxies.setSslCertificates",
  95102. // "parameterOrder": [
  95103. // "project",
  95104. // "targetSslProxy"
  95105. // ],
  95106. // "parameters": {
  95107. // "project": {
  95108. // "description": "Project ID for this request.",
  95109. // "location": "path",
  95110. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95111. // "required": true,
  95112. // "type": "string"
  95113. // },
  95114. // "requestId": {
  95115. // "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).",
  95116. // "location": "query",
  95117. // "type": "string"
  95118. // },
  95119. // "targetSslProxy": {
  95120. // "description": "Name of the TargetSslProxy resource whose SslCertificate resource is to be set.",
  95121. // "location": "path",
  95122. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95123. // "required": true,
  95124. // "type": "string"
  95125. // }
  95126. // },
  95127. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates",
  95128. // "request": {
  95129. // "$ref": "TargetSslProxiesSetSslCertificatesRequest"
  95130. // },
  95131. // "response": {
  95132. // "$ref": "Operation"
  95133. // },
  95134. // "scopes": [
  95135. // "https://www.googleapis.com/auth/cloud-platform",
  95136. // "https://www.googleapis.com/auth/compute"
  95137. // ]
  95138. // }
  95139. }
  95140. // method id "compute.targetSslProxies.setSslPolicy":
  95141. type TargetSslProxiesSetSslPolicyCall struct {
  95142. s *Service
  95143. project string
  95144. targetSslProxy string
  95145. sslpolicyreference *SslPolicyReference
  95146. urlParams_ gensupport.URLParams
  95147. ctx_ context.Context
  95148. header_ http.Header
  95149. }
  95150. // SetSslPolicy: Sets the SSL policy for TargetSslProxy. The SSL policy
  95151. // specifies the server-side support for SSL features. This affects
  95152. // connections between clients and the SSL proxy load balancer. They do
  95153. // not affect the connection between the load balancer and the backends.
  95154. func (r *TargetSslProxiesService) SetSslPolicy(project string, targetSslProxy string, sslpolicyreference *SslPolicyReference) *TargetSslProxiesSetSslPolicyCall {
  95155. c := &TargetSslProxiesSetSslPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95156. c.project = project
  95157. c.targetSslProxy = targetSslProxy
  95158. c.sslpolicyreference = sslpolicyreference
  95159. return c
  95160. }
  95161. // RequestId sets the optional parameter "requestId": An optional
  95162. // request ID to identify requests. Specify a unique request ID so that
  95163. // if you must retry your request, the server will know to ignore the
  95164. // request if it has already been completed.
  95165. //
  95166. // For example, consider a situation where you make an initial request
  95167. // and the request times out. If you make the request again with the
  95168. // same request ID, the server can check if original operation with the
  95169. // same request ID was received, and if so, will ignore the second
  95170. // request. This prevents clients from accidentally creating duplicate
  95171. // commitments.
  95172. //
  95173. // The request ID must be a valid UUID with the exception that zero UUID
  95174. // is not supported (00000000-0000-0000-0000-000000000000).
  95175. func (c *TargetSslProxiesSetSslPolicyCall) RequestId(requestId string) *TargetSslProxiesSetSslPolicyCall {
  95176. c.urlParams_.Set("requestId", requestId)
  95177. return c
  95178. }
  95179. // Fields allows partial responses to be retrieved. See
  95180. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95181. // for more information.
  95182. func (c *TargetSslProxiesSetSslPolicyCall) Fields(s ...googleapi.Field) *TargetSslProxiesSetSslPolicyCall {
  95183. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95184. return c
  95185. }
  95186. // Context sets the context to be used in this call's Do method. Any
  95187. // pending HTTP request will be aborted if the provided context is
  95188. // canceled.
  95189. func (c *TargetSslProxiesSetSslPolicyCall) Context(ctx context.Context) *TargetSslProxiesSetSslPolicyCall {
  95190. c.ctx_ = ctx
  95191. return c
  95192. }
  95193. // Header returns an http.Header that can be modified by the caller to
  95194. // add HTTP headers to the request.
  95195. func (c *TargetSslProxiesSetSslPolicyCall) Header() http.Header {
  95196. if c.header_ == nil {
  95197. c.header_ = make(http.Header)
  95198. }
  95199. return c.header_
  95200. }
  95201. func (c *TargetSslProxiesSetSslPolicyCall) doRequest(alt string) (*http.Response, error) {
  95202. reqHeaders := make(http.Header)
  95203. for k, v := range c.header_ {
  95204. reqHeaders[k] = v
  95205. }
  95206. reqHeaders.Set("User-Agent", c.s.userAgent())
  95207. var body io.Reader = nil
  95208. body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslpolicyreference)
  95209. if err != nil {
  95210. return nil, err
  95211. }
  95212. reqHeaders.Set("Content-Type", "application/json")
  95213. c.urlParams_.Set("alt", alt)
  95214. c.urlParams_.Set("prettyPrint", "false")
  95215. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy")
  95216. urls += "?" + c.urlParams_.Encode()
  95217. req, err := http.NewRequest("POST", urls, body)
  95218. if err != nil {
  95219. return nil, err
  95220. }
  95221. req.Header = reqHeaders
  95222. googleapi.Expand(req.URL, map[string]string{
  95223. "project": c.project,
  95224. "targetSslProxy": c.targetSslProxy,
  95225. })
  95226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95227. }
  95228. // Do executes the "compute.targetSslProxies.setSslPolicy" call.
  95229. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95230. // status code is an error. Response headers are in either
  95231. // *Operation.ServerResponse.Header or (if a response was returned at
  95232. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95233. // to check whether the returned error was because
  95234. // http.StatusNotModified was returned.
  95235. func (c *TargetSslProxiesSetSslPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95236. gensupport.SetOptions(c.urlParams_, opts...)
  95237. res, err := c.doRequest("json")
  95238. if res != nil && res.StatusCode == http.StatusNotModified {
  95239. if res.Body != nil {
  95240. res.Body.Close()
  95241. }
  95242. return nil, &googleapi.Error{
  95243. Code: res.StatusCode,
  95244. Header: res.Header,
  95245. }
  95246. }
  95247. if err != nil {
  95248. return nil, err
  95249. }
  95250. defer googleapi.CloseBody(res)
  95251. if err := googleapi.CheckResponse(res); err != nil {
  95252. return nil, err
  95253. }
  95254. ret := &Operation{
  95255. ServerResponse: googleapi.ServerResponse{
  95256. Header: res.Header,
  95257. HTTPStatusCode: res.StatusCode,
  95258. },
  95259. }
  95260. target := &ret
  95261. if err := gensupport.DecodeResponse(target, res); err != nil {
  95262. return nil, err
  95263. }
  95264. return ret, nil
  95265. // {
  95266. // "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.",
  95267. // "httpMethod": "POST",
  95268. // "id": "compute.targetSslProxies.setSslPolicy",
  95269. // "parameterOrder": [
  95270. // "project",
  95271. // "targetSslProxy"
  95272. // ],
  95273. // "parameters": {
  95274. // "project": {
  95275. // "description": "Project ID for this request.",
  95276. // "location": "path",
  95277. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95278. // "required": true,
  95279. // "type": "string"
  95280. // },
  95281. // "requestId": {
  95282. // "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).",
  95283. // "location": "query",
  95284. // "type": "string"
  95285. // },
  95286. // "targetSslProxy": {
  95287. // "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.",
  95288. // "location": "path",
  95289. // "required": true,
  95290. // "type": "string"
  95291. // }
  95292. // },
  95293. // "path": "{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy",
  95294. // "request": {
  95295. // "$ref": "SslPolicyReference"
  95296. // },
  95297. // "response": {
  95298. // "$ref": "Operation"
  95299. // },
  95300. // "scopes": [
  95301. // "https://www.googleapis.com/auth/cloud-platform",
  95302. // "https://www.googleapis.com/auth/compute"
  95303. // ]
  95304. // }
  95305. }
  95306. // method id "compute.targetTcpProxies.delete":
  95307. type TargetTcpProxiesDeleteCall struct {
  95308. s *Service
  95309. project string
  95310. targetTcpProxy string
  95311. urlParams_ gensupport.URLParams
  95312. ctx_ context.Context
  95313. header_ http.Header
  95314. }
  95315. // Delete: Deletes the specified TargetTcpProxy resource.
  95316. func (r *TargetTcpProxiesService) Delete(project string, targetTcpProxy string) *TargetTcpProxiesDeleteCall {
  95317. c := &TargetTcpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95318. c.project = project
  95319. c.targetTcpProxy = targetTcpProxy
  95320. return c
  95321. }
  95322. // RequestId sets the optional parameter "requestId": An optional
  95323. // request ID to identify requests. Specify a unique request ID so that
  95324. // if you must retry your request, the server will know to ignore the
  95325. // request if it has already been completed.
  95326. //
  95327. // For example, consider a situation where you make an initial request
  95328. // and the request times out. If you make the request again with the
  95329. // same request ID, the server can check if original operation with the
  95330. // same request ID was received, and if so, will ignore the second
  95331. // request. This prevents clients from accidentally creating duplicate
  95332. // commitments.
  95333. //
  95334. // The request ID must be a valid UUID with the exception that zero UUID
  95335. // is not supported (00000000-0000-0000-0000-000000000000).
  95336. func (c *TargetTcpProxiesDeleteCall) RequestId(requestId string) *TargetTcpProxiesDeleteCall {
  95337. c.urlParams_.Set("requestId", requestId)
  95338. return c
  95339. }
  95340. // Fields allows partial responses to be retrieved. See
  95341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95342. // for more information.
  95343. func (c *TargetTcpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetTcpProxiesDeleteCall {
  95344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95345. return c
  95346. }
  95347. // Context sets the context to be used in this call's Do method. Any
  95348. // pending HTTP request will be aborted if the provided context is
  95349. // canceled.
  95350. func (c *TargetTcpProxiesDeleteCall) Context(ctx context.Context) *TargetTcpProxiesDeleteCall {
  95351. c.ctx_ = ctx
  95352. return c
  95353. }
  95354. // Header returns an http.Header that can be modified by the caller to
  95355. // add HTTP headers to the request.
  95356. func (c *TargetTcpProxiesDeleteCall) Header() http.Header {
  95357. if c.header_ == nil {
  95358. c.header_ = make(http.Header)
  95359. }
  95360. return c.header_
  95361. }
  95362. func (c *TargetTcpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  95363. reqHeaders := make(http.Header)
  95364. for k, v := range c.header_ {
  95365. reqHeaders[k] = v
  95366. }
  95367. reqHeaders.Set("User-Agent", c.s.userAgent())
  95368. var body io.Reader = nil
  95369. c.urlParams_.Set("alt", alt)
  95370. c.urlParams_.Set("prettyPrint", "false")
  95371. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  95372. urls += "?" + c.urlParams_.Encode()
  95373. req, err := http.NewRequest("DELETE", urls, body)
  95374. if err != nil {
  95375. return nil, err
  95376. }
  95377. req.Header = reqHeaders
  95378. googleapi.Expand(req.URL, map[string]string{
  95379. "project": c.project,
  95380. "targetTcpProxy": c.targetTcpProxy,
  95381. })
  95382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95383. }
  95384. // Do executes the "compute.targetTcpProxies.delete" call.
  95385. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95386. // status code is an error. Response headers are in either
  95387. // *Operation.ServerResponse.Header or (if a response was returned at
  95388. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95389. // to check whether the returned error was because
  95390. // http.StatusNotModified was returned.
  95391. func (c *TargetTcpProxiesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95392. gensupport.SetOptions(c.urlParams_, opts...)
  95393. res, err := c.doRequest("json")
  95394. if res != nil && res.StatusCode == http.StatusNotModified {
  95395. if res.Body != nil {
  95396. res.Body.Close()
  95397. }
  95398. return nil, &googleapi.Error{
  95399. Code: res.StatusCode,
  95400. Header: res.Header,
  95401. }
  95402. }
  95403. if err != nil {
  95404. return nil, err
  95405. }
  95406. defer googleapi.CloseBody(res)
  95407. if err := googleapi.CheckResponse(res); err != nil {
  95408. return nil, err
  95409. }
  95410. ret := &Operation{
  95411. ServerResponse: googleapi.ServerResponse{
  95412. Header: res.Header,
  95413. HTTPStatusCode: res.StatusCode,
  95414. },
  95415. }
  95416. target := &ret
  95417. if err := gensupport.DecodeResponse(target, res); err != nil {
  95418. return nil, err
  95419. }
  95420. return ret, nil
  95421. // {
  95422. // "description": "Deletes the specified TargetTcpProxy resource.",
  95423. // "httpMethod": "DELETE",
  95424. // "id": "compute.targetTcpProxies.delete",
  95425. // "parameterOrder": [
  95426. // "project",
  95427. // "targetTcpProxy"
  95428. // ],
  95429. // "parameters": {
  95430. // "project": {
  95431. // "description": "Project ID for this request.",
  95432. // "location": "path",
  95433. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95434. // "required": true,
  95435. // "type": "string"
  95436. // },
  95437. // "requestId": {
  95438. // "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).",
  95439. // "location": "query",
  95440. // "type": "string"
  95441. // },
  95442. // "targetTcpProxy": {
  95443. // "description": "Name of the TargetTcpProxy resource to delete.",
  95444. // "location": "path",
  95445. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95446. // "required": true,
  95447. // "type": "string"
  95448. // }
  95449. // },
  95450. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  95451. // "response": {
  95452. // "$ref": "Operation"
  95453. // },
  95454. // "scopes": [
  95455. // "https://www.googleapis.com/auth/cloud-platform",
  95456. // "https://www.googleapis.com/auth/compute"
  95457. // ]
  95458. // }
  95459. }
  95460. // method id "compute.targetTcpProxies.get":
  95461. type TargetTcpProxiesGetCall struct {
  95462. s *Service
  95463. project string
  95464. targetTcpProxy string
  95465. urlParams_ gensupport.URLParams
  95466. ifNoneMatch_ string
  95467. ctx_ context.Context
  95468. header_ http.Header
  95469. }
  95470. // Get: Returns the specified TargetTcpProxy resource. Gets a list of
  95471. // available target TCP proxies by making a list() request.
  95472. func (r *TargetTcpProxiesService) Get(project string, targetTcpProxy string) *TargetTcpProxiesGetCall {
  95473. c := &TargetTcpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95474. c.project = project
  95475. c.targetTcpProxy = targetTcpProxy
  95476. return c
  95477. }
  95478. // Fields allows partial responses to be retrieved. See
  95479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95480. // for more information.
  95481. func (c *TargetTcpProxiesGetCall) Fields(s ...googleapi.Field) *TargetTcpProxiesGetCall {
  95482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95483. return c
  95484. }
  95485. // IfNoneMatch sets the optional parameter which makes the operation
  95486. // fail if the object's ETag matches the given value. This is useful for
  95487. // getting updates only after the object has changed since the last
  95488. // request. Use googleapi.IsNotModified to check whether the response
  95489. // error from Do is the result of In-None-Match.
  95490. func (c *TargetTcpProxiesGetCall) IfNoneMatch(entityTag string) *TargetTcpProxiesGetCall {
  95491. c.ifNoneMatch_ = entityTag
  95492. return c
  95493. }
  95494. // Context sets the context to be used in this call's Do method. Any
  95495. // pending HTTP request will be aborted if the provided context is
  95496. // canceled.
  95497. func (c *TargetTcpProxiesGetCall) Context(ctx context.Context) *TargetTcpProxiesGetCall {
  95498. c.ctx_ = ctx
  95499. return c
  95500. }
  95501. // Header returns an http.Header that can be modified by the caller to
  95502. // add HTTP headers to the request.
  95503. func (c *TargetTcpProxiesGetCall) Header() http.Header {
  95504. if c.header_ == nil {
  95505. c.header_ = make(http.Header)
  95506. }
  95507. return c.header_
  95508. }
  95509. func (c *TargetTcpProxiesGetCall) doRequest(alt string) (*http.Response, error) {
  95510. reqHeaders := make(http.Header)
  95511. for k, v := range c.header_ {
  95512. reqHeaders[k] = v
  95513. }
  95514. reqHeaders.Set("User-Agent", c.s.userAgent())
  95515. if c.ifNoneMatch_ != "" {
  95516. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95517. }
  95518. var body io.Reader = nil
  95519. c.urlParams_.Set("alt", alt)
  95520. c.urlParams_.Set("prettyPrint", "false")
  95521. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}")
  95522. urls += "?" + c.urlParams_.Encode()
  95523. req, err := http.NewRequest("GET", urls, body)
  95524. if err != nil {
  95525. return nil, err
  95526. }
  95527. req.Header = reqHeaders
  95528. googleapi.Expand(req.URL, map[string]string{
  95529. "project": c.project,
  95530. "targetTcpProxy": c.targetTcpProxy,
  95531. })
  95532. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95533. }
  95534. // Do executes the "compute.targetTcpProxies.get" call.
  95535. // Exactly one of *TargetTcpProxy or error will be non-nil. Any non-2xx
  95536. // status code is an error. Response headers are in either
  95537. // *TargetTcpProxy.ServerResponse.Header or (if a response was returned
  95538. // at all) in error.(*googleapi.Error).Header. Use
  95539. // googleapi.IsNotModified to check whether the returned error was
  95540. // because http.StatusNotModified was returned.
  95541. func (c *TargetTcpProxiesGetCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxy, error) {
  95542. gensupport.SetOptions(c.urlParams_, opts...)
  95543. res, err := c.doRequest("json")
  95544. if res != nil && res.StatusCode == http.StatusNotModified {
  95545. if res.Body != nil {
  95546. res.Body.Close()
  95547. }
  95548. return nil, &googleapi.Error{
  95549. Code: res.StatusCode,
  95550. Header: res.Header,
  95551. }
  95552. }
  95553. if err != nil {
  95554. return nil, err
  95555. }
  95556. defer googleapi.CloseBody(res)
  95557. if err := googleapi.CheckResponse(res); err != nil {
  95558. return nil, err
  95559. }
  95560. ret := &TargetTcpProxy{
  95561. ServerResponse: googleapi.ServerResponse{
  95562. Header: res.Header,
  95563. HTTPStatusCode: res.StatusCode,
  95564. },
  95565. }
  95566. target := &ret
  95567. if err := gensupport.DecodeResponse(target, res); err != nil {
  95568. return nil, err
  95569. }
  95570. return ret, nil
  95571. // {
  95572. // "description": "Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.",
  95573. // "httpMethod": "GET",
  95574. // "id": "compute.targetTcpProxies.get",
  95575. // "parameterOrder": [
  95576. // "project",
  95577. // "targetTcpProxy"
  95578. // ],
  95579. // "parameters": {
  95580. // "project": {
  95581. // "description": "Project ID for this request.",
  95582. // "location": "path",
  95583. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95584. // "required": true,
  95585. // "type": "string"
  95586. // },
  95587. // "targetTcpProxy": {
  95588. // "description": "Name of the TargetTcpProxy resource to return.",
  95589. // "location": "path",
  95590. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  95591. // "required": true,
  95592. // "type": "string"
  95593. // }
  95594. // },
  95595. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}",
  95596. // "response": {
  95597. // "$ref": "TargetTcpProxy"
  95598. // },
  95599. // "scopes": [
  95600. // "https://www.googleapis.com/auth/cloud-platform",
  95601. // "https://www.googleapis.com/auth/compute",
  95602. // "https://www.googleapis.com/auth/compute.readonly"
  95603. // ]
  95604. // }
  95605. }
  95606. // method id "compute.targetTcpProxies.insert":
  95607. type TargetTcpProxiesInsertCall struct {
  95608. s *Service
  95609. project string
  95610. targettcpproxy *TargetTcpProxy
  95611. urlParams_ gensupport.URLParams
  95612. ctx_ context.Context
  95613. header_ http.Header
  95614. }
  95615. // Insert: Creates a TargetTcpProxy resource in the specified project
  95616. // using the data included in the request.
  95617. func (r *TargetTcpProxiesService) Insert(project string, targettcpproxy *TargetTcpProxy) *TargetTcpProxiesInsertCall {
  95618. c := &TargetTcpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95619. c.project = project
  95620. c.targettcpproxy = targettcpproxy
  95621. return c
  95622. }
  95623. // RequestId sets the optional parameter "requestId": An optional
  95624. // request ID to identify requests. Specify a unique request ID so that
  95625. // if you must retry your request, the server will know to ignore the
  95626. // request if it has already been completed.
  95627. //
  95628. // For example, consider a situation where you make an initial request
  95629. // and the request times out. If you make the request again with the
  95630. // same request ID, the server can check if original operation with the
  95631. // same request ID was received, and if so, will ignore the second
  95632. // request. This prevents clients from accidentally creating duplicate
  95633. // commitments.
  95634. //
  95635. // The request ID must be a valid UUID with the exception that zero UUID
  95636. // is not supported (00000000-0000-0000-0000-000000000000).
  95637. func (c *TargetTcpProxiesInsertCall) RequestId(requestId string) *TargetTcpProxiesInsertCall {
  95638. c.urlParams_.Set("requestId", requestId)
  95639. return c
  95640. }
  95641. // Fields allows partial responses to be retrieved. See
  95642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95643. // for more information.
  95644. func (c *TargetTcpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetTcpProxiesInsertCall {
  95645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95646. return c
  95647. }
  95648. // Context sets the context to be used in this call's Do method. Any
  95649. // pending HTTP request will be aborted if the provided context is
  95650. // canceled.
  95651. func (c *TargetTcpProxiesInsertCall) Context(ctx context.Context) *TargetTcpProxiesInsertCall {
  95652. c.ctx_ = ctx
  95653. return c
  95654. }
  95655. // Header returns an http.Header that can be modified by the caller to
  95656. // add HTTP headers to the request.
  95657. func (c *TargetTcpProxiesInsertCall) Header() http.Header {
  95658. if c.header_ == nil {
  95659. c.header_ = make(http.Header)
  95660. }
  95661. return c.header_
  95662. }
  95663. func (c *TargetTcpProxiesInsertCall) doRequest(alt string) (*http.Response, error) {
  95664. reqHeaders := make(http.Header)
  95665. for k, v := range c.header_ {
  95666. reqHeaders[k] = v
  95667. }
  95668. reqHeaders.Set("User-Agent", c.s.userAgent())
  95669. var body io.Reader = nil
  95670. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxy)
  95671. if err != nil {
  95672. return nil, err
  95673. }
  95674. reqHeaders.Set("Content-Type", "application/json")
  95675. c.urlParams_.Set("alt", alt)
  95676. c.urlParams_.Set("prettyPrint", "false")
  95677. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  95678. urls += "?" + c.urlParams_.Encode()
  95679. req, err := http.NewRequest("POST", urls, body)
  95680. if err != nil {
  95681. return nil, err
  95682. }
  95683. req.Header = reqHeaders
  95684. googleapi.Expand(req.URL, map[string]string{
  95685. "project": c.project,
  95686. })
  95687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95688. }
  95689. // Do executes the "compute.targetTcpProxies.insert" call.
  95690. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  95691. // status code is an error. Response headers are in either
  95692. // *Operation.ServerResponse.Header or (if a response was returned at
  95693. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  95694. // to check whether the returned error was because
  95695. // http.StatusNotModified was returned.
  95696. func (c *TargetTcpProxiesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  95697. gensupport.SetOptions(c.urlParams_, opts...)
  95698. res, err := c.doRequest("json")
  95699. if res != nil && res.StatusCode == http.StatusNotModified {
  95700. if res.Body != nil {
  95701. res.Body.Close()
  95702. }
  95703. return nil, &googleapi.Error{
  95704. Code: res.StatusCode,
  95705. Header: res.Header,
  95706. }
  95707. }
  95708. if err != nil {
  95709. return nil, err
  95710. }
  95711. defer googleapi.CloseBody(res)
  95712. if err := googleapi.CheckResponse(res); err != nil {
  95713. return nil, err
  95714. }
  95715. ret := &Operation{
  95716. ServerResponse: googleapi.ServerResponse{
  95717. Header: res.Header,
  95718. HTTPStatusCode: res.StatusCode,
  95719. },
  95720. }
  95721. target := &ret
  95722. if err := gensupport.DecodeResponse(target, res); err != nil {
  95723. return nil, err
  95724. }
  95725. return ret, nil
  95726. // {
  95727. // "description": "Creates a TargetTcpProxy resource in the specified project using the data included in the request.",
  95728. // "httpMethod": "POST",
  95729. // "id": "compute.targetTcpProxies.insert",
  95730. // "parameterOrder": [
  95731. // "project"
  95732. // ],
  95733. // "parameters": {
  95734. // "project": {
  95735. // "description": "Project ID for this request.",
  95736. // "location": "path",
  95737. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95738. // "required": true,
  95739. // "type": "string"
  95740. // },
  95741. // "requestId": {
  95742. // "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).",
  95743. // "location": "query",
  95744. // "type": "string"
  95745. // }
  95746. // },
  95747. // "path": "{project}/global/targetTcpProxies",
  95748. // "request": {
  95749. // "$ref": "TargetTcpProxy"
  95750. // },
  95751. // "response": {
  95752. // "$ref": "Operation"
  95753. // },
  95754. // "scopes": [
  95755. // "https://www.googleapis.com/auth/cloud-platform",
  95756. // "https://www.googleapis.com/auth/compute"
  95757. // ]
  95758. // }
  95759. }
  95760. // method id "compute.targetTcpProxies.list":
  95761. type TargetTcpProxiesListCall struct {
  95762. s *Service
  95763. project string
  95764. urlParams_ gensupport.URLParams
  95765. ifNoneMatch_ string
  95766. ctx_ context.Context
  95767. header_ http.Header
  95768. }
  95769. // List: Retrieves the list of TargetTcpProxy resources available to the
  95770. // specified project.
  95771. func (r *TargetTcpProxiesService) List(project string) *TargetTcpProxiesListCall {
  95772. c := &TargetTcpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  95773. c.project = project
  95774. return c
  95775. }
  95776. // Filter sets the optional parameter "filter": A filter expression that
  95777. // filters resources listed in the response. The expression must specify
  95778. // the field name, a comparison operator, and the value that you want to
  95779. // use for filtering. The value must be a string, a number, or a
  95780. // boolean. The comparison operator must be either =, !=, >, or <.
  95781. //
  95782. // For example, if you are filtering Compute Engine instances, you can
  95783. // exclude instances named example-instance by specifying name !=
  95784. // example-instance.
  95785. //
  95786. // You can also filter nested fields. For example, you could specify
  95787. // scheduling.automaticRestart = false to include instances only if they
  95788. // are not scheduled for automatic restarts. You can use filtering on
  95789. // nested fields to filter based on resource labels.
  95790. //
  95791. // To filter on multiple expressions, provide each separate expression
  95792. // within parentheses. For example, (scheduling.automaticRestart = true)
  95793. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  95794. // AND expression. However, you can include AND and OR expressions
  95795. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  95796. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  95797. // true).
  95798. func (c *TargetTcpProxiesListCall) Filter(filter string) *TargetTcpProxiesListCall {
  95799. c.urlParams_.Set("filter", filter)
  95800. return c
  95801. }
  95802. // MaxResults sets the optional parameter "maxResults": The maximum
  95803. // number of results per page that should be returned. If the number of
  95804. // available results is larger than maxResults, Compute Engine returns a
  95805. // nextPageToken that can be used to get the next page of results in
  95806. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  95807. // (Default: 500)
  95808. func (c *TargetTcpProxiesListCall) MaxResults(maxResults int64) *TargetTcpProxiesListCall {
  95809. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  95810. return c
  95811. }
  95812. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  95813. // a certain order. By default, results are returned in alphanumerical
  95814. // order based on the resource name.
  95815. //
  95816. // You can also sort results in descending order based on the creation
  95817. // timestamp using orderBy="creationTimestamp desc". This sorts results
  95818. // based on the creationTimestamp field in reverse chronological order
  95819. // (newest result first). Use this to sort resources like operations so
  95820. // that the newest operation is returned first.
  95821. //
  95822. // Currently, only sorting by name or creationTimestamp desc is
  95823. // supported.
  95824. func (c *TargetTcpProxiesListCall) OrderBy(orderBy string) *TargetTcpProxiesListCall {
  95825. c.urlParams_.Set("orderBy", orderBy)
  95826. return c
  95827. }
  95828. // PageToken sets the optional parameter "pageToken": Specifies a page
  95829. // token to use. Set pageToken to the nextPageToken returned by a
  95830. // previous list request to get the next page of results.
  95831. func (c *TargetTcpProxiesListCall) PageToken(pageToken string) *TargetTcpProxiesListCall {
  95832. c.urlParams_.Set("pageToken", pageToken)
  95833. return c
  95834. }
  95835. // Fields allows partial responses to be retrieved. See
  95836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  95837. // for more information.
  95838. func (c *TargetTcpProxiesListCall) Fields(s ...googleapi.Field) *TargetTcpProxiesListCall {
  95839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  95840. return c
  95841. }
  95842. // IfNoneMatch sets the optional parameter which makes the operation
  95843. // fail if the object's ETag matches the given value. This is useful for
  95844. // getting updates only after the object has changed since the last
  95845. // request. Use googleapi.IsNotModified to check whether the response
  95846. // error from Do is the result of In-None-Match.
  95847. func (c *TargetTcpProxiesListCall) IfNoneMatch(entityTag string) *TargetTcpProxiesListCall {
  95848. c.ifNoneMatch_ = entityTag
  95849. return c
  95850. }
  95851. // Context sets the context to be used in this call's Do method. Any
  95852. // pending HTTP request will be aborted if the provided context is
  95853. // canceled.
  95854. func (c *TargetTcpProxiesListCall) Context(ctx context.Context) *TargetTcpProxiesListCall {
  95855. c.ctx_ = ctx
  95856. return c
  95857. }
  95858. // Header returns an http.Header that can be modified by the caller to
  95859. // add HTTP headers to the request.
  95860. func (c *TargetTcpProxiesListCall) Header() http.Header {
  95861. if c.header_ == nil {
  95862. c.header_ = make(http.Header)
  95863. }
  95864. return c.header_
  95865. }
  95866. func (c *TargetTcpProxiesListCall) doRequest(alt string) (*http.Response, error) {
  95867. reqHeaders := make(http.Header)
  95868. for k, v := range c.header_ {
  95869. reqHeaders[k] = v
  95870. }
  95871. reqHeaders.Set("User-Agent", c.s.userAgent())
  95872. if c.ifNoneMatch_ != "" {
  95873. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  95874. }
  95875. var body io.Reader = nil
  95876. c.urlParams_.Set("alt", alt)
  95877. c.urlParams_.Set("prettyPrint", "false")
  95878. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies")
  95879. urls += "?" + c.urlParams_.Encode()
  95880. req, err := http.NewRequest("GET", urls, body)
  95881. if err != nil {
  95882. return nil, err
  95883. }
  95884. req.Header = reqHeaders
  95885. googleapi.Expand(req.URL, map[string]string{
  95886. "project": c.project,
  95887. })
  95888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  95889. }
  95890. // Do executes the "compute.targetTcpProxies.list" call.
  95891. // Exactly one of *TargetTcpProxyList or error will be non-nil. Any
  95892. // non-2xx status code is an error. Response headers are in either
  95893. // *TargetTcpProxyList.ServerResponse.Header or (if a response was
  95894. // returned at all) in error.(*googleapi.Error).Header. Use
  95895. // googleapi.IsNotModified to check whether the returned error was
  95896. // because http.StatusNotModified was returned.
  95897. func (c *TargetTcpProxiesListCall) Do(opts ...googleapi.CallOption) (*TargetTcpProxyList, error) {
  95898. gensupport.SetOptions(c.urlParams_, opts...)
  95899. res, err := c.doRequest("json")
  95900. if res != nil && res.StatusCode == http.StatusNotModified {
  95901. if res.Body != nil {
  95902. res.Body.Close()
  95903. }
  95904. return nil, &googleapi.Error{
  95905. Code: res.StatusCode,
  95906. Header: res.Header,
  95907. }
  95908. }
  95909. if err != nil {
  95910. return nil, err
  95911. }
  95912. defer googleapi.CloseBody(res)
  95913. if err := googleapi.CheckResponse(res); err != nil {
  95914. return nil, err
  95915. }
  95916. ret := &TargetTcpProxyList{
  95917. ServerResponse: googleapi.ServerResponse{
  95918. Header: res.Header,
  95919. HTTPStatusCode: res.StatusCode,
  95920. },
  95921. }
  95922. target := &ret
  95923. if err := gensupport.DecodeResponse(target, res); err != nil {
  95924. return nil, err
  95925. }
  95926. return ret, nil
  95927. // {
  95928. // "description": "Retrieves the list of TargetTcpProxy resources available to the specified project.",
  95929. // "httpMethod": "GET",
  95930. // "id": "compute.targetTcpProxies.list",
  95931. // "parameterOrder": [
  95932. // "project"
  95933. // ],
  95934. // "parameters": {
  95935. // "filter": {
  95936. // "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).",
  95937. // "location": "query",
  95938. // "type": "string"
  95939. // },
  95940. // "maxResults": {
  95941. // "default": "500",
  95942. // "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)",
  95943. // "format": "uint32",
  95944. // "location": "query",
  95945. // "minimum": "0",
  95946. // "type": "integer"
  95947. // },
  95948. // "orderBy": {
  95949. // "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.",
  95950. // "location": "query",
  95951. // "type": "string"
  95952. // },
  95953. // "pageToken": {
  95954. // "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.",
  95955. // "location": "query",
  95956. // "type": "string"
  95957. // },
  95958. // "project": {
  95959. // "description": "Project ID for this request.",
  95960. // "location": "path",
  95961. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  95962. // "required": true,
  95963. // "type": "string"
  95964. // }
  95965. // },
  95966. // "path": "{project}/global/targetTcpProxies",
  95967. // "response": {
  95968. // "$ref": "TargetTcpProxyList"
  95969. // },
  95970. // "scopes": [
  95971. // "https://www.googleapis.com/auth/cloud-platform",
  95972. // "https://www.googleapis.com/auth/compute",
  95973. // "https://www.googleapis.com/auth/compute.readonly"
  95974. // ]
  95975. // }
  95976. }
  95977. // Pages invokes f for each page of results.
  95978. // A non-nil error returned from f will halt the iteration.
  95979. // The provided context supersedes any context provided to the Context method.
  95980. func (c *TargetTcpProxiesListCall) Pages(ctx context.Context, f func(*TargetTcpProxyList) error) error {
  95981. c.ctx_ = ctx
  95982. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  95983. for {
  95984. x, err := c.Do()
  95985. if err != nil {
  95986. return err
  95987. }
  95988. if err := f(x); err != nil {
  95989. return err
  95990. }
  95991. if x.NextPageToken == "" {
  95992. return nil
  95993. }
  95994. c.PageToken(x.NextPageToken)
  95995. }
  95996. }
  95997. // method id "compute.targetTcpProxies.setBackendService":
  95998. type TargetTcpProxiesSetBackendServiceCall struct {
  95999. s *Service
  96000. project string
  96001. targetTcpProxy string
  96002. targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest
  96003. urlParams_ gensupport.URLParams
  96004. ctx_ context.Context
  96005. header_ http.Header
  96006. }
  96007. // SetBackendService: Changes the BackendService for TargetTcpProxy.
  96008. func (r *TargetTcpProxiesService) SetBackendService(project string, targetTcpProxy string, targettcpproxiessetbackendservicerequest *TargetTcpProxiesSetBackendServiceRequest) *TargetTcpProxiesSetBackendServiceCall {
  96009. c := &TargetTcpProxiesSetBackendServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96010. c.project = project
  96011. c.targetTcpProxy = targetTcpProxy
  96012. c.targettcpproxiessetbackendservicerequest = targettcpproxiessetbackendservicerequest
  96013. return c
  96014. }
  96015. // RequestId sets the optional parameter "requestId": An optional
  96016. // request ID to identify requests. Specify a unique request ID so that
  96017. // if you must retry your request, the server will know to ignore the
  96018. // request if it has already been completed.
  96019. //
  96020. // For example, consider a situation where you make an initial request
  96021. // and the request times out. If you make the request again with the
  96022. // same request ID, the server can check if original operation with the
  96023. // same request ID was received, and if so, will ignore the second
  96024. // request. This prevents clients from accidentally creating duplicate
  96025. // commitments.
  96026. //
  96027. // The request ID must be a valid UUID with the exception that zero UUID
  96028. // is not supported (00000000-0000-0000-0000-000000000000).
  96029. func (c *TargetTcpProxiesSetBackendServiceCall) RequestId(requestId string) *TargetTcpProxiesSetBackendServiceCall {
  96030. c.urlParams_.Set("requestId", requestId)
  96031. return c
  96032. }
  96033. // Fields allows partial responses to be retrieved. See
  96034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96035. // for more information.
  96036. func (c *TargetTcpProxiesSetBackendServiceCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetBackendServiceCall {
  96037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96038. return c
  96039. }
  96040. // Context sets the context to be used in this call's Do method. Any
  96041. // pending HTTP request will be aborted if the provided context is
  96042. // canceled.
  96043. func (c *TargetTcpProxiesSetBackendServiceCall) Context(ctx context.Context) *TargetTcpProxiesSetBackendServiceCall {
  96044. c.ctx_ = ctx
  96045. return c
  96046. }
  96047. // Header returns an http.Header that can be modified by the caller to
  96048. // add HTTP headers to the request.
  96049. func (c *TargetTcpProxiesSetBackendServiceCall) Header() http.Header {
  96050. if c.header_ == nil {
  96051. c.header_ = make(http.Header)
  96052. }
  96053. return c.header_
  96054. }
  96055. func (c *TargetTcpProxiesSetBackendServiceCall) doRequest(alt string) (*http.Response, error) {
  96056. reqHeaders := make(http.Header)
  96057. for k, v := range c.header_ {
  96058. reqHeaders[k] = v
  96059. }
  96060. reqHeaders.Set("User-Agent", c.s.userAgent())
  96061. var body io.Reader = nil
  96062. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetbackendservicerequest)
  96063. if err != nil {
  96064. return nil, err
  96065. }
  96066. reqHeaders.Set("Content-Type", "application/json")
  96067. c.urlParams_.Set("alt", alt)
  96068. c.urlParams_.Set("prettyPrint", "false")
  96069. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService")
  96070. urls += "?" + c.urlParams_.Encode()
  96071. req, err := http.NewRequest("POST", urls, body)
  96072. if err != nil {
  96073. return nil, err
  96074. }
  96075. req.Header = reqHeaders
  96076. googleapi.Expand(req.URL, map[string]string{
  96077. "project": c.project,
  96078. "targetTcpProxy": c.targetTcpProxy,
  96079. })
  96080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96081. }
  96082. // Do executes the "compute.targetTcpProxies.setBackendService" call.
  96083. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96084. // status code is an error. Response headers are in either
  96085. // *Operation.ServerResponse.Header or (if a response was returned at
  96086. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96087. // to check whether the returned error was because
  96088. // http.StatusNotModified was returned.
  96089. func (c *TargetTcpProxiesSetBackendServiceCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96090. gensupport.SetOptions(c.urlParams_, opts...)
  96091. res, err := c.doRequest("json")
  96092. if res != nil && res.StatusCode == http.StatusNotModified {
  96093. if res.Body != nil {
  96094. res.Body.Close()
  96095. }
  96096. return nil, &googleapi.Error{
  96097. Code: res.StatusCode,
  96098. Header: res.Header,
  96099. }
  96100. }
  96101. if err != nil {
  96102. return nil, err
  96103. }
  96104. defer googleapi.CloseBody(res)
  96105. if err := googleapi.CheckResponse(res); err != nil {
  96106. return nil, err
  96107. }
  96108. ret := &Operation{
  96109. ServerResponse: googleapi.ServerResponse{
  96110. Header: res.Header,
  96111. HTTPStatusCode: res.StatusCode,
  96112. },
  96113. }
  96114. target := &ret
  96115. if err := gensupport.DecodeResponse(target, res); err != nil {
  96116. return nil, err
  96117. }
  96118. return ret, nil
  96119. // {
  96120. // "description": "Changes the BackendService for TargetTcpProxy.",
  96121. // "httpMethod": "POST",
  96122. // "id": "compute.targetTcpProxies.setBackendService",
  96123. // "parameterOrder": [
  96124. // "project",
  96125. // "targetTcpProxy"
  96126. // ],
  96127. // "parameters": {
  96128. // "project": {
  96129. // "description": "Project ID for this request.",
  96130. // "location": "path",
  96131. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96132. // "required": true,
  96133. // "type": "string"
  96134. // },
  96135. // "requestId": {
  96136. // "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).",
  96137. // "location": "query",
  96138. // "type": "string"
  96139. // },
  96140. // "targetTcpProxy": {
  96141. // "description": "Name of the TargetTcpProxy resource whose BackendService resource is to be set.",
  96142. // "location": "path",
  96143. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96144. // "required": true,
  96145. // "type": "string"
  96146. // }
  96147. // },
  96148. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService",
  96149. // "request": {
  96150. // "$ref": "TargetTcpProxiesSetBackendServiceRequest"
  96151. // },
  96152. // "response": {
  96153. // "$ref": "Operation"
  96154. // },
  96155. // "scopes": [
  96156. // "https://www.googleapis.com/auth/cloud-platform",
  96157. // "https://www.googleapis.com/auth/compute"
  96158. // ]
  96159. // }
  96160. }
  96161. // method id "compute.targetTcpProxies.setProxyHeader":
  96162. type TargetTcpProxiesSetProxyHeaderCall struct {
  96163. s *Service
  96164. project string
  96165. targetTcpProxy string
  96166. targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest
  96167. urlParams_ gensupport.URLParams
  96168. ctx_ context.Context
  96169. header_ http.Header
  96170. }
  96171. // SetProxyHeader: Changes the ProxyHeaderType for TargetTcpProxy.
  96172. func (r *TargetTcpProxiesService) SetProxyHeader(project string, targetTcpProxy string, targettcpproxiessetproxyheaderrequest *TargetTcpProxiesSetProxyHeaderRequest) *TargetTcpProxiesSetProxyHeaderCall {
  96173. c := &TargetTcpProxiesSetProxyHeaderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96174. c.project = project
  96175. c.targetTcpProxy = targetTcpProxy
  96176. c.targettcpproxiessetproxyheaderrequest = targettcpproxiessetproxyheaderrequest
  96177. return c
  96178. }
  96179. // RequestId sets the optional parameter "requestId": An optional
  96180. // request ID to identify requests. Specify a unique request ID so that
  96181. // if you must retry your request, the server will know to ignore the
  96182. // request if it has already been completed.
  96183. //
  96184. // For example, consider a situation where you make an initial request
  96185. // and the request times out. If you make the request again with the
  96186. // same request ID, the server can check if original operation with the
  96187. // same request ID was received, and if so, will ignore the second
  96188. // request. This prevents clients from accidentally creating duplicate
  96189. // commitments.
  96190. //
  96191. // The request ID must be a valid UUID with the exception that zero UUID
  96192. // is not supported (00000000-0000-0000-0000-000000000000).
  96193. func (c *TargetTcpProxiesSetProxyHeaderCall) RequestId(requestId string) *TargetTcpProxiesSetProxyHeaderCall {
  96194. c.urlParams_.Set("requestId", requestId)
  96195. return c
  96196. }
  96197. // Fields allows partial responses to be retrieved. See
  96198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96199. // for more information.
  96200. func (c *TargetTcpProxiesSetProxyHeaderCall) Fields(s ...googleapi.Field) *TargetTcpProxiesSetProxyHeaderCall {
  96201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96202. return c
  96203. }
  96204. // Context sets the context to be used in this call's Do method. Any
  96205. // pending HTTP request will be aborted if the provided context is
  96206. // canceled.
  96207. func (c *TargetTcpProxiesSetProxyHeaderCall) Context(ctx context.Context) *TargetTcpProxiesSetProxyHeaderCall {
  96208. c.ctx_ = ctx
  96209. return c
  96210. }
  96211. // Header returns an http.Header that can be modified by the caller to
  96212. // add HTTP headers to the request.
  96213. func (c *TargetTcpProxiesSetProxyHeaderCall) Header() http.Header {
  96214. if c.header_ == nil {
  96215. c.header_ = make(http.Header)
  96216. }
  96217. return c.header_
  96218. }
  96219. func (c *TargetTcpProxiesSetProxyHeaderCall) doRequest(alt string) (*http.Response, error) {
  96220. reqHeaders := make(http.Header)
  96221. for k, v := range c.header_ {
  96222. reqHeaders[k] = v
  96223. }
  96224. reqHeaders.Set("User-Agent", c.s.userAgent())
  96225. var body io.Reader = nil
  96226. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targettcpproxiessetproxyheaderrequest)
  96227. if err != nil {
  96228. return nil, err
  96229. }
  96230. reqHeaders.Set("Content-Type", "application/json")
  96231. c.urlParams_.Set("alt", alt)
  96232. c.urlParams_.Set("prettyPrint", "false")
  96233. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader")
  96234. urls += "?" + c.urlParams_.Encode()
  96235. req, err := http.NewRequest("POST", urls, body)
  96236. if err != nil {
  96237. return nil, err
  96238. }
  96239. req.Header = reqHeaders
  96240. googleapi.Expand(req.URL, map[string]string{
  96241. "project": c.project,
  96242. "targetTcpProxy": c.targetTcpProxy,
  96243. })
  96244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96245. }
  96246. // Do executes the "compute.targetTcpProxies.setProxyHeader" call.
  96247. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96248. // status code is an error. Response headers are in either
  96249. // *Operation.ServerResponse.Header or (if a response was returned at
  96250. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96251. // to check whether the returned error was because
  96252. // http.StatusNotModified was returned.
  96253. func (c *TargetTcpProxiesSetProxyHeaderCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96254. gensupport.SetOptions(c.urlParams_, opts...)
  96255. res, err := c.doRequest("json")
  96256. if res != nil && res.StatusCode == http.StatusNotModified {
  96257. if res.Body != nil {
  96258. res.Body.Close()
  96259. }
  96260. return nil, &googleapi.Error{
  96261. Code: res.StatusCode,
  96262. Header: res.Header,
  96263. }
  96264. }
  96265. if err != nil {
  96266. return nil, err
  96267. }
  96268. defer googleapi.CloseBody(res)
  96269. if err := googleapi.CheckResponse(res); err != nil {
  96270. return nil, err
  96271. }
  96272. ret := &Operation{
  96273. ServerResponse: googleapi.ServerResponse{
  96274. Header: res.Header,
  96275. HTTPStatusCode: res.StatusCode,
  96276. },
  96277. }
  96278. target := &ret
  96279. if err := gensupport.DecodeResponse(target, res); err != nil {
  96280. return nil, err
  96281. }
  96282. return ret, nil
  96283. // {
  96284. // "description": "Changes the ProxyHeaderType for TargetTcpProxy.",
  96285. // "httpMethod": "POST",
  96286. // "id": "compute.targetTcpProxies.setProxyHeader",
  96287. // "parameterOrder": [
  96288. // "project",
  96289. // "targetTcpProxy"
  96290. // ],
  96291. // "parameters": {
  96292. // "project": {
  96293. // "description": "Project ID for this request.",
  96294. // "location": "path",
  96295. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96296. // "required": true,
  96297. // "type": "string"
  96298. // },
  96299. // "requestId": {
  96300. // "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).",
  96301. // "location": "query",
  96302. // "type": "string"
  96303. // },
  96304. // "targetTcpProxy": {
  96305. // "description": "Name of the TargetTcpProxy resource whose ProxyHeader is to be set.",
  96306. // "location": "path",
  96307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96308. // "required": true,
  96309. // "type": "string"
  96310. // }
  96311. // },
  96312. // "path": "{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader",
  96313. // "request": {
  96314. // "$ref": "TargetTcpProxiesSetProxyHeaderRequest"
  96315. // },
  96316. // "response": {
  96317. // "$ref": "Operation"
  96318. // },
  96319. // "scopes": [
  96320. // "https://www.googleapis.com/auth/cloud-platform",
  96321. // "https://www.googleapis.com/auth/compute"
  96322. // ]
  96323. // }
  96324. }
  96325. // method id "compute.targetVpnGateways.aggregatedList":
  96326. type TargetVpnGatewaysAggregatedListCall struct {
  96327. s *Service
  96328. project string
  96329. urlParams_ gensupport.URLParams
  96330. ifNoneMatch_ string
  96331. ctx_ context.Context
  96332. header_ http.Header
  96333. }
  96334. // AggregatedList: Retrieves an aggregated list of target VPN gateways.
  96335. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall {
  96336. c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96337. c.project = project
  96338. return c
  96339. }
  96340. // Filter sets the optional parameter "filter": A filter expression that
  96341. // filters resources listed in the response. The expression must specify
  96342. // the field name, a comparison operator, and the value that you want to
  96343. // use for filtering. The value must be a string, a number, or a
  96344. // boolean. The comparison operator must be either =, !=, >, or <.
  96345. //
  96346. // For example, if you are filtering Compute Engine instances, you can
  96347. // exclude instances named example-instance by specifying name !=
  96348. // example-instance.
  96349. //
  96350. // You can also filter nested fields. For example, you could specify
  96351. // scheduling.automaticRestart = false to include instances only if they
  96352. // are not scheduled for automatic restarts. You can use filtering on
  96353. // nested fields to filter based on resource labels.
  96354. //
  96355. // To filter on multiple expressions, provide each separate expression
  96356. // within parentheses. For example, (scheduling.automaticRestart = true)
  96357. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  96358. // AND expression. However, you can include AND and OR expressions
  96359. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  96360. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  96361. // true).
  96362. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall {
  96363. c.urlParams_.Set("filter", filter)
  96364. return c
  96365. }
  96366. // MaxResults sets the optional parameter "maxResults": The maximum
  96367. // number of results per page that should be returned. If the number of
  96368. // available results is larger than maxResults, Compute Engine returns a
  96369. // nextPageToken that can be used to get the next page of results in
  96370. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  96371. // (Default: 500)
  96372. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall {
  96373. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  96374. return c
  96375. }
  96376. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  96377. // a certain order. By default, results are returned in alphanumerical
  96378. // order based on the resource name.
  96379. //
  96380. // You can also sort results in descending order based on the creation
  96381. // timestamp using orderBy="creationTimestamp desc". This sorts results
  96382. // based on the creationTimestamp field in reverse chronological order
  96383. // (newest result first). Use this to sort resources like operations so
  96384. // that the newest operation is returned first.
  96385. //
  96386. // Currently, only sorting by name or creationTimestamp desc is
  96387. // supported.
  96388. func (c *TargetVpnGatewaysAggregatedListCall) OrderBy(orderBy string) *TargetVpnGatewaysAggregatedListCall {
  96389. c.urlParams_.Set("orderBy", orderBy)
  96390. return c
  96391. }
  96392. // PageToken sets the optional parameter "pageToken": Specifies a page
  96393. // token to use. Set pageToken to the nextPageToken returned by a
  96394. // previous list request to get the next page of results.
  96395. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall {
  96396. c.urlParams_.Set("pageToken", pageToken)
  96397. return c
  96398. }
  96399. // Fields allows partial responses to be retrieved. See
  96400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96401. // for more information.
  96402. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall {
  96403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96404. return c
  96405. }
  96406. // IfNoneMatch sets the optional parameter which makes the operation
  96407. // fail if the object's ETag matches the given value. This is useful for
  96408. // getting updates only after the object has changed since the last
  96409. // request. Use googleapi.IsNotModified to check whether the response
  96410. // error from Do is the result of In-None-Match.
  96411. func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall {
  96412. c.ifNoneMatch_ = entityTag
  96413. return c
  96414. }
  96415. // Context sets the context to be used in this call's Do method. Any
  96416. // pending HTTP request will be aborted if the provided context is
  96417. // canceled.
  96418. func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall {
  96419. c.ctx_ = ctx
  96420. return c
  96421. }
  96422. // Header returns an http.Header that can be modified by the caller to
  96423. // add HTTP headers to the request.
  96424. func (c *TargetVpnGatewaysAggregatedListCall) Header() http.Header {
  96425. if c.header_ == nil {
  96426. c.header_ = make(http.Header)
  96427. }
  96428. return c.header_
  96429. }
  96430. func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  96431. reqHeaders := make(http.Header)
  96432. for k, v := range c.header_ {
  96433. reqHeaders[k] = v
  96434. }
  96435. reqHeaders.Set("User-Agent", c.s.userAgent())
  96436. if c.ifNoneMatch_ != "" {
  96437. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96438. }
  96439. var body io.Reader = nil
  96440. c.urlParams_.Set("alt", alt)
  96441. c.urlParams_.Set("prettyPrint", "false")
  96442. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways")
  96443. urls += "?" + c.urlParams_.Encode()
  96444. req, err := http.NewRequest("GET", urls, body)
  96445. if err != nil {
  96446. return nil, err
  96447. }
  96448. req.Header = reqHeaders
  96449. googleapi.Expand(req.URL, map[string]string{
  96450. "project": c.project,
  96451. })
  96452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96453. }
  96454. // Do executes the "compute.targetVpnGateways.aggregatedList" call.
  96455. // Exactly one of *TargetVpnGatewayAggregatedList or error will be
  96456. // non-nil. Any non-2xx status code is an error. Response headers are in
  96457. // either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a
  96458. // response was returned at all) in error.(*googleapi.Error).Header. Use
  96459. // googleapi.IsNotModified to check whether the returned error was
  96460. // because http.StatusNotModified was returned.
  96461. func (c *TargetVpnGatewaysAggregatedListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayAggregatedList, error) {
  96462. gensupport.SetOptions(c.urlParams_, opts...)
  96463. res, err := c.doRequest("json")
  96464. if res != nil && res.StatusCode == http.StatusNotModified {
  96465. if res.Body != nil {
  96466. res.Body.Close()
  96467. }
  96468. return nil, &googleapi.Error{
  96469. Code: res.StatusCode,
  96470. Header: res.Header,
  96471. }
  96472. }
  96473. if err != nil {
  96474. return nil, err
  96475. }
  96476. defer googleapi.CloseBody(res)
  96477. if err := googleapi.CheckResponse(res); err != nil {
  96478. return nil, err
  96479. }
  96480. ret := &TargetVpnGatewayAggregatedList{
  96481. ServerResponse: googleapi.ServerResponse{
  96482. Header: res.Header,
  96483. HTTPStatusCode: res.StatusCode,
  96484. },
  96485. }
  96486. target := &ret
  96487. if err := gensupport.DecodeResponse(target, res); err != nil {
  96488. return nil, err
  96489. }
  96490. return ret, nil
  96491. // {
  96492. // "description": "Retrieves an aggregated list of target VPN gateways.",
  96493. // "httpMethod": "GET",
  96494. // "id": "compute.targetVpnGateways.aggregatedList",
  96495. // "parameterOrder": [
  96496. // "project"
  96497. // ],
  96498. // "parameters": {
  96499. // "filter": {
  96500. // "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).",
  96501. // "location": "query",
  96502. // "type": "string"
  96503. // },
  96504. // "maxResults": {
  96505. // "default": "500",
  96506. // "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)",
  96507. // "format": "uint32",
  96508. // "location": "query",
  96509. // "minimum": "0",
  96510. // "type": "integer"
  96511. // },
  96512. // "orderBy": {
  96513. // "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.",
  96514. // "location": "query",
  96515. // "type": "string"
  96516. // },
  96517. // "pageToken": {
  96518. // "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.",
  96519. // "location": "query",
  96520. // "type": "string"
  96521. // },
  96522. // "project": {
  96523. // "description": "Project ID for this request.",
  96524. // "location": "path",
  96525. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96526. // "required": true,
  96527. // "type": "string"
  96528. // }
  96529. // },
  96530. // "path": "{project}/aggregated/targetVpnGateways",
  96531. // "response": {
  96532. // "$ref": "TargetVpnGatewayAggregatedList"
  96533. // },
  96534. // "scopes": [
  96535. // "https://www.googleapis.com/auth/cloud-platform",
  96536. // "https://www.googleapis.com/auth/compute",
  96537. // "https://www.googleapis.com/auth/compute.readonly"
  96538. // ]
  96539. // }
  96540. }
  96541. // Pages invokes f for each page of results.
  96542. // A non-nil error returned from f will halt the iteration.
  96543. // The provided context supersedes any context provided to the Context method.
  96544. func (c *TargetVpnGatewaysAggregatedListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayAggregatedList) error) error {
  96545. c.ctx_ = ctx
  96546. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  96547. for {
  96548. x, err := c.Do()
  96549. if err != nil {
  96550. return err
  96551. }
  96552. if err := f(x); err != nil {
  96553. return err
  96554. }
  96555. if x.NextPageToken == "" {
  96556. return nil
  96557. }
  96558. c.PageToken(x.NextPageToken)
  96559. }
  96560. }
  96561. // method id "compute.targetVpnGateways.delete":
  96562. type TargetVpnGatewaysDeleteCall struct {
  96563. s *Service
  96564. project string
  96565. region string
  96566. targetVpnGateway string
  96567. urlParams_ gensupport.URLParams
  96568. ctx_ context.Context
  96569. header_ http.Header
  96570. }
  96571. // Delete: Deletes the specified target VPN gateway.
  96572. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall {
  96573. c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96574. c.project = project
  96575. c.region = region
  96576. c.targetVpnGateway = targetVpnGateway
  96577. return c
  96578. }
  96579. // RequestId sets the optional parameter "requestId": An optional
  96580. // request ID to identify requests. Specify a unique request ID so that
  96581. // if you must retry your request, the server will know to ignore the
  96582. // request if it has already been completed.
  96583. //
  96584. // For example, consider a situation where you make an initial request
  96585. // and the request times out. If you make the request again with the
  96586. // same request ID, the server can check if original operation with the
  96587. // same request ID was received, and if so, will ignore the second
  96588. // request. This prevents clients from accidentally creating duplicate
  96589. // commitments.
  96590. //
  96591. // The request ID must be a valid UUID with the exception that zero UUID
  96592. // is not supported (00000000-0000-0000-0000-000000000000).
  96593. func (c *TargetVpnGatewaysDeleteCall) RequestId(requestId string) *TargetVpnGatewaysDeleteCall {
  96594. c.urlParams_.Set("requestId", requestId)
  96595. return c
  96596. }
  96597. // Fields allows partial responses to be retrieved. See
  96598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96599. // for more information.
  96600. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall {
  96601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96602. return c
  96603. }
  96604. // Context sets the context to be used in this call's Do method. Any
  96605. // pending HTTP request will be aborted if the provided context is
  96606. // canceled.
  96607. func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall {
  96608. c.ctx_ = ctx
  96609. return c
  96610. }
  96611. // Header returns an http.Header that can be modified by the caller to
  96612. // add HTTP headers to the request.
  96613. func (c *TargetVpnGatewaysDeleteCall) Header() http.Header {
  96614. if c.header_ == nil {
  96615. c.header_ = make(http.Header)
  96616. }
  96617. return c.header_
  96618. }
  96619. func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) {
  96620. reqHeaders := make(http.Header)
  96621. for k, v := range c.header_ {
  96622. reqHeaders[k] = v
  96623. }
  96624. reqHeaders.Set("User-Agent", c.s.userAgent())
  96625. var body io.Reader = nil
  96626. c.urlParams_.Set("alt", alt)
  96627. c.urlParams_.Set("prettyPrint", "false")
  96628. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  96629. urls += "?" + c.urlParams_.Encode()
  96630. req, err := http.NewRequest("DELETE", urls, body)
  96631. if err != nil {
  96632. return nil, err
  96633. }
  96634. req.Header = reqHeaders
  96635. googleapi.Expand(req.URL, map[string]string{
  96636. "project": c.project,
  96637. "region": c.region,
  96638. "targetVpnGateway": c.targetVpnGateway,
  96639. })
  96640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96641. }
  96642. // Do executes the "compute.targetVpnGateways.delete" call.
  96643. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96644. // status code is an error. Response headers are in either
  96645. // *Operation.ServerResponse.Header or (if a response was returned at
  96646. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96647. // to check whether the returned error was because
  96648. // http.StatusNotModified was returned.
  96649. func (c *TargetVpnGatewaysDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96650. gensupport.SetOptions(c.urlParams_, opts...)
  96651. res, err := c.doRequest("json")
  96652. if res != nil && res.StatusCode == http.StatusNotModified {
  96653. if res.Body != nil {
  96654. res.Body.Close()
  96655. }
  96656. return nil, &googleapi.Error{
  96657. Code: res.StatusCode,
  96658. Header: res.Header,
  96659. }
  96660. }
  96661. if err != nil {
  96662. return nil, err
  96663. }
  96664. defer googleapi.CloseBody(res)
  96665. if err := googleapi.CheckResponse(res); err != nil {
  96666. return nil, err
  96667. }
  96668. ret := &Operation{
  96669. ServerResponse: googleapi.ServerResponse{
  96670. Header: res.Header,
  96671. HTTPStatusCode: res.StatusCode,
  96672. },
  96673. }
  96674. target := &ret
  96675. if err := gensupport.DecodeResponse(target, res); err != nil {
  96676. return nil, err
  96677. }
  96678. return ret, nil
  96679. // {
  96680. // "description": "Deletes the specified target VPN gateway.",
  96681. // "httpMethod": "DELETE",
  96682. // "id": "compute.targetVpnGateways.delete",
  96683. // "parameterOrder": [
  96684. // "project",
  96685. // "region",
  96686. // "targetVpnGateway"
  96687. // ],
  96688. // "parameters": {
  96689. // "project": {
  96690. // "description": "Project ID for this request.",
  96691. // "location": "path",
  96692. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96693. // "required": true,
  96694. // "type": "string"
  96695. // },
  96696. // "region": {
  96697. // "description": "Name of the region for this request.",
  96698. // "location": "path",
  96699. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96700. // "required": true,
  96701. // "type": "string"
  96702. // },
  96703. // "requestId": {
  96704. // "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).",
  96705. // "location": "query",
  96706. // "type": "string"
  96707. // },
  96708. // "targetVpnGateway": {
  96709. // "description": "Name of the target VPN gateway to delete.",
  96710. // "location": "path",
  96711. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96712. // "required": true,
  96713. // "type": "string"
  96714. // }
  96715. // },
  96716. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  96717. // "response": {
  96718. // "$ref": "Operation"
  96719. // },
  96720. // "scopes": [
  96721. // "https://www.googleapis.com/auth/cloud-platform",
  96722. // "https://www.googleapis.com/auth/compute"
  96723. // ]
  96724. // }
  96725. }
  96726. // method id "compute.targetVpnGateways.get":
  96727. type TargetVpnGatewaysGetCall struct {
  96728. s *Service
  96729. project string
  96730. region string
  96731. targetVpnGateway string
  96732. urlParams_ gensupport.URLParams
  96733. ifNoneMatch_ string
  96734. ctx_ context.Context
  96735. header_ http.Header
  96736. }
  96737. // Get: Returns the specified target VPN gateway. Gets a list of
  96738. // available target VPN gateways by making a list() request.
  96739. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall {
  96740. c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96741. c.project = project
  96742. c.region = region
  96743. c.targetVpnGateway = targetVpnGateway
  96744. return c
  96745. }
  96746. // Fields allows partial responses to be retrieved. See
  96747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96748. // for more information.
  96749. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall {
  96750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96751. return c
  96752. }
  96753. // IfNoneMatch sets the optional parameter which makes the operation
  96754. // fail if the object's ETag matches the given value. This is useful for
  96755. // getting updates only after the object has changed since the last
  96756. // request. Use googleapi.IsNotModified to check whether the response
  96757. // error from Do is the result of In-None-Match.
  96758. func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall {
  96759. c.ifNoneMatch_ = entityTag
  96760. return c
  96761. }
  96762. // Context sets the context to be used in this call's Do method. Any
  96763. // pending HTTP request will be aborted if the provided context is
  96764. // canceled.
  96765. func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall {
  96766. c.ctx_ = ctx
  96767. return c
  96768. }
  96769. // Header returns an http.Header that can be modified by the caller to
  96770. // add HTTP headers to the request.
  96771. func (c *TargetVpnGatewaysGetCall) Header() http.Header {
  96772. if c.header_ == nil {
  96773. c.header_ = make(http.Header)
  96774. }
  96775. return c.header_
  96776. }
  96777. func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) {
  96778. reqHeaders := make(http.Header)
  96779. for k, v := range c.header_ {
  96780. reqHeaders[k] = v
  96781. }
  96782. reqHeaders.Set("User-Agent", c.s.userAgent())
  96783. if c.ifNoneMatch_ != "" {
  96784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  96785. }
  96786. var body io.Reader = nil
  96787. c.urlParams_.Set("alt", alt)
  96788. c.urlParams_.Set("prettyPrint", "false")
  96789. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}")
  96790. urls += "?" + c.urlParams_.Encode()
  96791. req, err := http.NewRequest("GET", urls, body)
  96792. if err != nil {
  96793. return nil, err
  96794. }
  96795. req.Header = reqHeaders
  96796. googleapi.Expand(req.URL, map[string]string{
  96797. "project": c.project,
  96798. "region": c.region,
  96799. "targetVpnGateway": c.targetVpnGateway,
  96800. })
  96801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96802. }
  96803. // Do executes the "compute.targetVpnGateways.get" call.
  96804. // Exactly one of *TargetVpnGateway or error will be non-nil. Any
  96805. // non-2xx status code is an error. Response headers are in either
  96806. // *TargetVpnGateway.ServerResponse.Header or (if a response was
  96807. // returned at all) in error.(*googleapi.Error).Header. Use
  96808. // googleapi.IsNotModified to check whether the returned error was
  96809. // because http.StatusNotModified was returned.
  96810. func (c *TargetVpnGatewaysGetCall) Do(opts ...googleapi.CallOption) (*TargetVpnGateway, error) {
  96811. gensupport.SetOptions(c.urlParams_, opts...)
  96812. res, err := c.doRequest("json")
  96813. if res != nil && res.StatusCode == http.StatusNotModified {
  96814. if res.Body != nil {
  96815. res.Body.Close()
  96816. }
  96817. return nil, &googleapi.Error{
  96818. Code: res.StatusCode,
  96819. Header: res.Header,
  96820. }
  96821. }
  96822. if err != nil {
  96823. return nil, err
  96824. }
  96825. defer googleapi.CloseBody(res)
  96826. if err := googleapi.CheckResponse(res); err != nil {
  96827. return nil, err
  96828. }
  96829. ret := &TargetVpnGateway{
  96830. ServerResponse: googleapi.ServerResponse{
  96831. Header: res.Header,
  96832. HTTPStatusCode: res.StatusCode,
  96833. },
  96834. }
  96835. target := &ret
  96836. if err := gensupport.DecodeResponse(target, res); err != nil {
  96837. return nil, err
  96838. }
  96839. return ret, nil
  96840. // {
  96841. // "description": "Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.",
  96842. // "httpMethod": "GET",
  96843. // "id": "compute.targetVpnGateways.get",
  96844. // "parameterOrder": [
  96845. // "project",
  96846. // "region",
  96847. // "targetVpnGateway"
  96848. // ],
  96849. // "parameters": {
  96850. // "project": {
  96851. // "description": "Project ID for this request.",
  96852. // "location": "path",
  96853. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  96854. // "required": true,
  96855. // "type": "string"
  96856. // },
  96857. // "region": {
  96858. // "description": "Name of the region for this request.",
  96859. // "location": "path",
  96860. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  96861. // "required": true,
  96862. // "type": "string"
  96863. // },
  96864. // "targetVpnGateway": {
  96865. // "description": "Name of the target VPN gateway to return.",
  96866. // "location": "path",
  96867. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  96868. // "required": true,
  96869. // "type": "string"
  96870. // }
  96871. // },
  96872. // "path": "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}",
  96873. // "response": {
  96874. // "$ref": "TargetVpnGateway"
  96875. // },
  96876. // "scopes": [
  96877. // "https://www.googleapis.com/auth/cloud-platform",
  96878. // "https://www.googleapis.com/auth/compute",
  96879. // "https://www.googleapis.com/auth/compute.readonly"
  96880. // ]
  96881. // }
  96882. }
  96883. // method id "compute.targetVpnGateways.insert":
  96884. type TargetVpnGatewaysInsertCall struct {
  96885. s *Service
  96886. project string
  96887. region string
  96888. targetvpngateway *TargetVpnGateway
  96889. urlParams_ gensupport.URLParams
  96890. ctx_ context.Context
  96891. header_ http.Header
  96892. }
  96893. // Insert: Creates a target VPN gateway in the specified project and
  96894. // region using the data included in the request.
  96895. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall {
  96896. c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  96897. c.project = project
  96898. c.region = region
  96899. c.targetvpngateway = targetvpngateway
  96900. return c
  96901. }
  96902. // RequestId sets the optional parameter "requestId": An optional
  96903. // request ID to identify requests. Specify a unique request ID so that
  96904. // if you must retry your request, the server will know to ignore the
  96905. // request if it has already been completed.
  96906. //
  96907. // For example, consider a situation where you make an initial request
  96908. // and the request times out. If you make the request again with the
  96909. // same request ID, the server can check if original operation with the
  96910. // same request ID was received, and if so, will ignore the second
  96911. // request. This prevents clients from accidentally creating duplicate
  96912. // commitments.
  96913. //
  96914. // The request ID must be a valid UUID with the exception that zero UUID
  96915. // is not supported (00000000-0000-0000-0000-000000000000).
  96916. func (c *TargetVpnGatewaysInsertCall) RequestId(requestId string) *TargetVpnGatewaysInsertCall {
  96917. c.urlParams_.Set("requestId", requestId)
  96918. return c
  96919. }
  96920. // Fields allows partial responses to be retrieved. See
  96921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  96922. // for more information.
  96923. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall {
  96924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  96925. return c
  96926. }
  96927. // Context sets the context to be used in this call's Do method. Any
  96928. // pending HTTP request will be aborted if the provided context is
  96929. // canceled.
  96930. func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall {
  96931. c.ctx_ = ctx
  96932. return c
  96933. }
  96934. // Header returns an http.Header that can be modified by the caller to
  96935. // add HTTP headers to the request.
  96936. func (c *TargetVpnGatewaysInsertCall) Header() http.Header {
  96937. if c.header_ == nil {
  96938. c.header_ = make(http.Header)
  96939. }
  96940. return c.header_
  96941. }
  96942. func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) {
  96943. reqHeaders := make(http.Header)
  96944. for k, v := range c.header_ {
  96945. reqHeaders[k] = v
  96946. }
  96947. reqHeaders.Set("User-Agent", c.s.userAgent())
  96948. var body io.Reader = nil
  96949. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway)
  96950. if err != nil {
  96951. return nil, err
  96952. }
  96953. reqHeaders.Set("Content-Type", "application/json")
  96954. c.urlParams_.Set("alt", alt)
  96955. c.urlParams_.Set("prettyPrint", "false")
  96956. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  96957. urls += "?" + c.urlParams_.Encode()
  96958. req, err := http.NewRequest("POST", urls, body)
  96959. if err != nil {
  96960. return nil, err
  96961. }
  96962. req.Header = reqHeaders
  96963. googleapi.Expand(req.URL, map[string]string{
  96964. "project": c.project,
  96965. "region": c.region,
  96966. })
  96967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  96968. }
  96969. // Do executes the "compute.targetVpnGateways.insert" call.
  96970. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  96971. // status code is an error. Response headers are in either
  96972. // *Operation.ServerResponse.Header or (if a response was returned at
  96973. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  96974. // to check whether the returned error was because
  96975. // http.StatusNotModified was returned.
  96976. func (c *TargetVpnGatewaysInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  96977. gensupport.SetOptions(c.urlParams_, opts...)
  96978. res, err := c.doRequest("json")
  96979. if res != nil && res.StatusCode == http.StatusNotModified {
  96980. if res.Body != nil {
  96981. res.Body.Close()
  96982. }
  96983. return nil, &googleapi.Error{
  96984. Code: res.StatusCode,
  96985. Header: res.Header,
  96986. }
  96987. }
  96988. if err != nil {
  96989. return nil, err
  96990. }
  96991. defer googleapi.CloseBody(res)
  96992. if err := googleapi.CheckResponse(res); err != nil {
  96993. return nil, err
  96994. }
  96995. ret := &Operation{
  96996. ServerResponse: googleapi.ServerResponse{
  96997. Header: res.Header,
  96998. HTTPStatusCode: res.StatusCode,
  96999. },
  97000. }
  97001. target := &ret
  97002. if err := gensupport.DecodeResponse(target, res); err != nil {
  97003. return nil, err
  97004. }
  97005. return ret, nil
  97006. // {
  97007. // "description": "Creates a target VPN gateway in the specified project and region using the data included in the request.",
  97008. // "httpMethod": "POST",
  97009. // "id": "compute.targetVpnGateways.insert",
  97010. // "parameterOrder": [
  97011. // "project",
  97012. // "region"
  97013. // ],
  97014. // "parameters": {
  97015. // "project": {
  97016. // "description": "Project ID for this request.",
  97017. // "location": "path",
  97018. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97019. // "required": true,
  97020. // "type": "string"
  97021. // },
  97022. // "region": {
  97023. // "description": "Name of the region for this request.",
  97024. // "location": "path",
  97025. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97026. // "required": true,
  97027. // "type": "string"
  97028. // },
  97029. // "requestId": {
  97030. // "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).",
  97031. // "location": "query",
  97032. // "type": "string"
  97033. // }
  97034. // },
  97035. // "path": "{project}/regions/{region}/targetVpnGateways",
  97036. // "request": {
  97037. // "$ref": "TargetVpnGateway"
  97038. // },
  97039. // "response": {
  97040. // "$ref": "Operation"
  97041. // },
  97042. // "scopes": [
  97043. // "https://www.googleapis.com/auth/cloud-platform",
  97044. // "https://www.googleapis.com/auth/compute"
  97045. // ]
  97046. // }
  97047. }
  97048. // method id "compute.targetVpnGateways.list":
  97049. type TargetVpnGatewaysListCall struct {
  97050. s *Service
  97051. project string
  97052. region string
  97053. urlParams_ gensupport.URLParams
  97054. ifNoneMatch_ string
  97055. ctx_ context.Context
  97056. header_ http.Header
  97057. }
  97058. // List: Retrieves a list of target VPN gateways available to the
  97059. // specified project and region.
  97060. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall {
  97061. c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97062. c.project = project
  97063. c.region = region
  97064. return c
  97065. }
  97066. // Filter sets the optional parameter "filter": A filter expression that
  97067. // filters resources listed in the response. The expression must specify
  97068. // the field name, a comparison operator, and the value that you want to
  97069. // use for filtering. The value must be a string, a number, or a
  97070. // boolean. The comparison operator must be either =, !=, >, or <.
  97071. //
  97072. // For example, if you are filtering Compute Engine instances, you can
  97073. // exclude instances named example-instance by specifying name !=
  97074. // example-instance.
  97075. //
  97076. // You can also filter nested fields. For example, you could specify
  97077. // scheduling.automaticRestart = false to include instances only if they
  97078. // are not scheduled for automatic restarts. You can use filtering on
  97079. // nested fields to filter based on resource labels.
  97080. //
  97081. // To filter on multiple expressions, provide each separate expression
  97082. // within parentheses. For example, (scheduling.automaticRestart = true)
  97083. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97084. // AND expression. However, you can include AND and OR expressions
  97085. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97086. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97087. // true).
  97088. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall {
  97089. c.urlParams_.Set("filter", filter)
  97090. return c
  97091. }
  97092. // MaxResults sets the optional parameter "maxResults": The maximum
  97093. // number of results per page that should be returned. If the number of
  97094. // available results is larger than maxResults, Compute Engine returns a
  97095. // nextPageToken that can be used to get the next page of results in
  97096. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97097. // (Default: 500)
  97098. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall {
  97099. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97100. return c
  97101. }
  97102. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97103. // a certain order. By default, results are returned in alphanumerical
  97104. // order based on the resource name.
  97105. //
  97106. // You can also sort results in descending order based on the creation
  97107. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97108. // based on the creationTimestamp field in reverse chronological order
  97109. // (newest result first). Use this to sort resources like operations so
  97110. // that the newest operation is returned first.
  97111. //
  97112. // Currently, only sorting by name or creationTimestamp desc is
  97113. // supported.
  97114. func (c *TargetVpnGatewaysListCall) OrderBy(orderBy string) *TargetVpnGatewaysListCall {
  97115. c.urlParams_.Set("orderBy", orderBy)
  97116. return c
  97117. }
  97118. // PageToken sets the optional parameter "pageToken": Specifies a page
  97119. // token to use. Set pageToken to the nextPageToken returned by a
  97120. // previous list request to get the next page of results.
  97121. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall {
  97122. c.urlParams_.Set("pageToken", pageToken)
  97123. return c
  97124. }
  97125. // Fields allows partial responses to be retrieved. See
  97126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97127. // for more information.
  97128. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall {
  97129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97130. return c
  97131. }
  97132. // IfNoneMatch sets the optional parameter which makes the operation
  97133. // fail if the object's ETag matches the given value. This is useful for
  97134. // getting updates only after the object has changed since the last
  97135. // request. Use googleapi.IsNotModified to check whether the response
  97136. // error from Do is the result of In-None-Match.
  97137. func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall {
  97138. c.ifNoneMatch_ = entityTag
  97139. return c
  97140. }
  97141. // Context sets the context to be used in this call's Do method. Any
  97142. // pending HTTP request will be aborted if the provided context is
  97143. // canceled.
  97144. func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall {
  97145. c.ctx_ = ctx
  97146. return c
  97147. }
  97148. // Header returns an http.Header that can be modified by the caller to
  97149. // add HTTP headers to the request.
  97150. func (c *TargetVpnGatewaysListCall) Header() http.Header {
  97151. if c.header_ == nil {
  97152. c.header_ = make(http.Header)
  97153. }
  97154. return c.header_
  97155. }
  97156. func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) {
  97157. reqHeaders := make(http.Header)
  97158. for k, v := range c.header_ {
  97159. reqHeaders[k] = v
  97160. }
  97161. reqHeaders.Set("User-Agent", c.s.userAgent())
  97162. if c.ifNoneMatch_ != "" {
  97163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97164. }
  97165. var body io.Reader = nil
  97166. c.urlParams_.Set("alt", alt)
  97167. c.urlParams_.Set("prettyPrint", "false")
  97168. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways")
  97169. urls += "?" + c.urlParams_.Encode()
  97170. req, err := http.NewRequest("GET", urls, body)
  97171. if err != nil {
  97172. return nil, err
  97173. }
  97174. req.Header = reqHeaders
  97175. googleapi.Expand(req.URL, map[string]string{
  97176. "project": c.project,
  97177. "region": c.region,
  97178. })
  97179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97180. }
  97181. // Do executes the "compute.targetVpnGateways.list" call.
  97182. // Exactly one of *TargetVpnGatewayList or error will be non-nil. Any
  97183. // non-2xx status code is an error. Response headers are in either
  97184. // *TargetVpnGatewayList.ServerResponse.Header or (if a response was
  97185. // returned at all) in error.(*googleapi.Error).Header. Use
  97186. // googleapi.IsNotModified to check whether the returned error was
  97187. // because http.StatusNotModified was returned.
  97188. func (c *TargetVpnGatewaysListCall) Do(opts ...googleapi.CallOption) (*TargetVpnGatewayList, error) {
  97189. gensupport.SetOptions(c.urlParams_, opts...)
  97190. res, err := c.doRequest("json")
  97191. if res != nil && res.StatusCode == http.StatusNotModified {
  97192. if res.Body != nil {
  97193. res.Body.Close()
  97194. }
  97195. return nil, &googleapi.Error{
  97196. Code: res.StatusCode,
  97197. Header: res.Header,
  97198. }
  97199. }
  97200. if err != nil {
  97201. return nil, err
  97202. }
  97203. defer googleapi.CloseBody(res)
  97204. if err := googleapi.CheckResponse(res); err != nil {
  97205. return nil, err
  97206. }
  97207. ret := &TargetVpnGatewayList{
  97208. ServerResponse: googleapi.ServerResponse{
  97209. Header: res.Header,
  97210. HTTPStatusCode: res.StatusCode,
  97211. },
  97212. }
  97213. target := &ret
  97214. if err := gensupport.DecodeResponse(target, res); err != nil {
  97215. return nil, err
  97216. }
  97217. return ret, nil
  97218. // {
  97219. // "description": "Retrieves a list of target VPN gateways available to the specified project and region.",
  97220. // "httpMethod": "GET",
  97221. // "id": "compute.targetVpnGateways.list",
  97222. // "parameterOrder": [
  97223. // "project",
  97224. // "region"
  97225. // ],
  97226. // "parameters": {
  97227. // "filter": {
  97228. // "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).",
  97229. // "location": "query",
  97230. // "type": "string"
  97231. // },
  97232. // "maxResults": {
  97233. // "default": "500",
  97234. // "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)",
  97235. // "format": "uint32",
  97236. // "location": "query",
  97237. // "minimum": "0",
  97238. // "type": "integer"
  97239. // },
  97240. // "orderBy": {
  97241. // "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.",
  97242. // "location": "query",
  97243. // "type": "string"
  97244. // },
  97245. // "pageToken": {
  97246. // "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.",
  97247. // "location": "query",
  97248. // "type": "string"
  97249. // },
  97250. // "project": {
  97251. // "description": "Project ID for this request.",
  97252. // "location": "path",
  97253. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97254. // "required": true,
  97255. // "type": "string"
  97256. // },
  97257. // "region": {
  97258. // "description": "Name of the region for this request.",
  97259. // "location": "path",
  97260. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  97261. // "required": true,
  97262. // "type": "string"
  97263. // }
  97264. // },
  97265. // "path": "{project}/regions/{region}/targetVpnGateways",
  97266. // "response": {
  97267. // "$ref": "TargetVpnGatewayList"
  97268. // },
  97269. // "scopes": [
  97270. // "https://www.googleapis.com/auth/cloud-platform",
  97271. // "https://www.googleapis.com/auth/compute",
  97272. // "https://www.googleapis.com/auth/compute.readonly"
  97273. // ]
  97274. // }
  97275. }
  97276. // Pages invokes f for each page of results.
  97277. // A non-nil error returned from f will halt the iteration.
  97278. // The provided context supersedes any context provided to the Context method.
  97279. func (c *TargetVpnGatewaysListCall) Pages(ctx context.Context, f func(*TargetVpnGatewayList) error) error {
  97280. c.ctx_ = ctx
  97281. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  97282. for {
  97283. x, err := c.Do()
  97284. if err != nil {
  97285. return err
  97286. }
  97287. if err := f(x); err != nil {
  97288. return err
  97289. }
  97290. if x.NextPageToken == "" {
  97291. return nil
  97292. }
  97293. c.PageToken(x.NextPageToken)
  97294. }
  97295. }
  97296. // method id "compute.urlMaps.delete":
  97297. type UrlMapsDeleteCall struct {
  97298. s *Service
  97299. project string
  97300. urlMap string
  97301. urlParams_ gensupport.URLParams
  97302. ctx_ context.Context
  97303. header_ http.Header
  97304. }
  97305. // Delete: Deletes the specified UrlMap resource.
  97306. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete
  97307. func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall {
  97308. c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97309. c.project = project
  97310. c.urlMap = urlMap
  97311. return c
  97312. }
  97313. // RequestId sets the optional parameter "requestId": An optional
  97314. // request ID to identify requests. Specify a unique request ID so that
  97315. // if you must retry your request, the server will know to ignore the
  97316. // request if it has already been completed.
  97317. //
  97318. // For example, consider a situation where you make an initial request
  97319. // and the request times out. If you make the request again with the
  97320. // same request ID, the server can check if original operation with the
  97321. // same request ID was received, and if so, will ignore the second
  97322. // request. This prevents clients from accidentally creating duplicate
  97323. // commitments.
  97324. //
  97325. // The request ID must be a valid UUID with the exception that zero UUID
  97326. // is not supported (00000000-0000-0000-0000-000000000000).
  97327. func (c *UrlMapsDeleteCall) RequestId(requestId string) *UrlMapsDeleteCall {
  97328. c.urlParams_.Set("requestId", requestId)
  97329. return c
  97330. }
  97331. // Fields allows partial responses to be retrieved. See
  97332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97333. // for more information.
  97334. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall {
  97335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97336. return c
  97337. }
  97338. // Context sets the context to be used in this call's Do method. Any
  97339. // pending HTTP request will be aborted if the provided context is
  97340. // canceled.
  97341. func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall {
  97342. c.ctx_ = ctx
  97343. return c
  97344. }
  97345. // Header returns an http.Header that can be modified by the caller to
  97346. // add HTTP headers to the request.
  97347. func (c *UrlMapsDeleteCall) Header() http.Header {
  97348. if c.header_ == nil {
  97349. c.header_ = make(http.Header)
  97350. }
  97351. return c.header_
  97352. }
  97353. func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) {
  97354. reqHeaders := make(http.Header)
  97355. for k, v := range c.header_ {
  97356. reqHeaders[k] = v
  97357. }
  97358. reqHeaders.Set("User-Agent", c.s.userAgent())
  97359. var body io.Reader = nil
  97360. c.urlParams_.Set("alt", alt)
  97361. c.urlParams_.Set("prettyPrint", "false")
  97362. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  97363. urls += "?" + c.urlParams_.Encode()
  97364. req, err := http.NewRequest("DELETE", urls, body)
  97365. if err != nil {
  97366. return nil, err
  97367. }
  97368. req.Header = reqHeaders
  97369. googleapi.Expand(req.URL, map[string]string{
  97370. "project": c.project,
  97371. "urlMap": c.urlMap,
  97372. })
  97373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97374. }
  97375. // Do executes the "compute.urlMaps.delete" call.
  97376. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97377. // status code is an error. Response headers are in either
  97378. // *Operation.ServerResponse.Header or (if a response was returned at
  97379. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97380. // to check whether the returned error was because
  97381. // http.StatusNotModified was returned.
  97382. func (c *UrlMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97383. gensupport.SetOptions(c.urlParams_, opts...)
  97384. res, err := c.doRequest("json")
  97385. if res != nil && res.StatusCode == http.StatusNotModified {
  97386. if res.Body != nil {
  97387. res.Body.Close()
  97388. }
  97389. return nil, &googleapi.Error{
  97390. Code: res.StatusCode,
  97391. Header: res.Header,
  97392. }
  97393. }
  97394. if err != nil {
  97395. return nil, err
  97396. }
  97397. defer googleapi.CloseBody(res)
  97398. if err := googleapi.CheckResponse(res); err != nil {
  97399. return nil, err
  97400. }
  97401. ret := &Operation{
  97402. ServerResponse: googleapi.ServerResponse{
  97403. Header: res.Header,
  97404. HTTPStatusCode: res.StatusCode,
  97405. },
  97406. }
  97407. target := &ret
  97408. if err := gensupport.DecodeResponse(target, res); err != nil {
  97409. return nil, err
  97410. }
  97411. return ret, nil
  97412. // {
  97413. // "description": "Deletes the specified UrlMap resource.",
  97414. // "httpMethod": "DELETE",
  97415. // "id": "compute.urlMaps.delete",
  97416. // "parameterOrder": [
  97417. // "project",
  97418. // "urlMap"
  97419. // ],
  97420. // "parameters": {
  97421. // "project": {
  97422. // "description": "Project ID for this request.",
  97423. // "location": "path",
  97424. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97425. // "required": true,
  97426. // "type": "string"
  97427. // },
  97428. // "requestId": {
  97429. // "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).",
  97430. // "location": "query",
  97431. // "type": "string"
  97432. // },
  97433. // "urlMap": {
  97434. // "description": "Name of the UrlMap resource to delete.",
  97435. // "location": "path",
  97436. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97437. // "required": true,
  97438. // "type": "string"
  97439. // }
  97440. // },
  97441. // "path": "{project}/global/urlMaps/{urlMap}",
  97442. // "response": {
  97443. // "$ref": "Operation"
  97444. // },
  97445. // "scopes": [
  97446. // "https://www.googleapis.com/auth/cloud-platform",
  97447. // "https://www.googleapis.com/auth/compute"
  97448. // ]
  97449. // }
  97450. }
  97451. // method id "compute.urlMaps.get":
  97452. type UrlMapsGetCall struct {
  97453. s *Service
  97454. project string
  97455. urlMap string
  97456. urlParams_ gensupport.URLParams
  97457. ifNoneMatch_ string
  97458. ctx_ context.Context
  97459. header_ http.Header
  97460. }
  97461. // Get: Returns the specified UrlMap resource. Gets a list of available
  97462. // URL maps by making a list() request.
  97463. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get
  97464. func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall {
  97465. c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97466. c.project = project
  97467. c.urlMap = urlMap
  97468. return c
  97469. }
  97470. // Fields allows partial responses to be retrieved. See
  97471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97472. // for more information.
  97473. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall {
  97474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97475. return c
  97476. }
  97477. // IfNoneMatch sets the optional parameter which makes the operation
  97478. // fail if the object's ETag matches the given value. This is useful for
  97479. // getting updates only after the object has changed since the last
  97480. // request. Use googleapi.IsNotModified to check whether the response
  97481. // error from Do is the result of In-None-Match.
  97482. func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall {
  97483. c.ifNoneMatch_ = entityTag
  97484. return c
  97485. }
  97486. // Context sets the context to be used in this call's Do method. Any
  97487. // pending HTTP request will be aborted if the provided context is
  97488. // canceled.
  97489. func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall {
  97490. c.ctx_ = ctx
  97491. return c
  97492. }
  97493. // Header returns an http.Header that can be modified by the caller to
  97494. // add HTTP headers to the request.
  97495. func (c *UrlMapsGetCall) Header() http.Header {
  97496. if c.header_ == nil {
  97497. c.header_ = make(http.Header)
  97498. }
  97499. return c.header_
  97500. }
  97501. func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) {
  97502. reqHeaders := make(http.Header)
  97503. for k, v := range c.header_ {
  97504. reqHeaders[k] = v
  97505. }
  97506. reqHeaders.Set("User-Agent", c.s.userAgent())
  97507. if c.ifNoneMatch_ != "" {
  97508. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  97509. }
  97510. var body io.Reader = nil
  97511. c.urlParams_.Set("alt", alt)
  97512. c.urlParams_.Set("prettyPrint", "false")
  97513. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  97514. urls += "?" + c.urlParams_.Encode()
  97515. req, err := http.NewRequest("GET", urls, body)
  97516. if err != nil {
  97517. return nil, err
  97518. }
  97519. req.Header = reqHeaders
  97520. googleapi.Expand(req.URL, map[string]string{
  97521. "project": c.project,
  97522. "urlMap": c.urlMap,
  97523. })
  97524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97525. }
  97526. // Do executes the "compute.urlMaps.get" call.
  97527. // Exactly one of *UrlMap or error will be non-nil. Any non-2xx status
  97528. // code is an error. Response headers are in either
  97529. // *UrlMap.ServerResponse.Header or (if a response was returned at all)
  97530. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  97531. // check whether the returned error was because http.StatusNotModified
  97532. // was returned.
  97533. func (c *UrlMapsGetCall) Do(opts ...googleapi.CallOption) (*UrlMap, error) {
  97534. gensupport.SetOptions(c.urlParams_, opts...)
  97535. res, err := c.doRequest("json")
  97536. if res != nil && res.StatusCode == http.StatusNotModified {
  97537. if res.Body != nil {
  97538. res.Body.Close()
  97539. }
  97540. return nil, &googleapi.Error{
  97541. Code: res.StatusCode,
  97542. Header: res.Header,
  97543. }
  97544. }
  97545. if err != nil {
  97546. return nil, err
  97547. }
  97548. defer googleapi.CloseBody(res)
  97549. if err := googleapi.CheckResponse(res); err != nil {
  97550. return nil, err
  97551. }
  97552. ret := &UrlMap{
  97553. ServerResponse: googleapi.ServerResponse{
  97554. Header: res.Header,
  97555. HTTPStatusCode: res.StatusCode,
  97556. },
  97557. }
  97558. target := &ret
  97559. if err := gensupport.DecodeResponse(target, res); err != nil {
  97560. return nil, err
  97561. }
  97562. return ret, nil
  97563. // {
  97564. // "description": "Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.",
  97565. // "httpMethod": "GET",
  97566. // "id": "compute.urlMaps.get",
  97567. // "parameterOrder": [
  97568. // "project",
  97569. // "urlMap"
  97570. // ],
  97571. // "parameters": {
  97572. // "project": {
  97573. // "description": "Project ID for this request.",
  97574. // "location": "path",
  97575. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97576. // "required": true,
  97577. // "type": "string"
  97578. // },
  97579. // "urlMap": {
  97580. // "description": "Name of the UrlMap resource to return.",
  97581. // "location": "path",
  97582. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97583. // "required": true,
  97584. // "type": "string"
  97585. // }
  97586. // },
  97587. // "path": "{project}/global/urlMaps/{urlMap}",
  97588. // "response": {
  97589. // "$ref": "UrlMap"
  97590. // },
  97591. // "scopes": [
  97592. // "https://www.googleapis.com/auth/cloud-platform",
  97593. // "https://www.googleapis.com/auth/compute",
  97594. // "https://www.googleapis.com/auth/compute.readonly"
  97595. // ]
  97596. // }
  97597. }
  97598. // method id "compute.urlMaps.insert":
  97599. type UrlMapsInsertCall struct {
  97600. s *Service
  97601. project string
  97602. urlmap *UrlMap
  97603. urlParams_ gensupport.URLParams
  97604. ctx_ context.Context
  97605. header_ http.Header
  97606. }
  97607. // Insert: Creates a UrlMap resource in the specified project using the
  97608. // data included in the request.
  97609. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert
  97610. func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall {
  97611. c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97612. c.project = project
  97613. c.urlmap = urlmap
  97614. return c
  97615. }
  97616. // RequestId sets the optional parameter "requestId": An optional
  97617. // request ID to identify requests. Specify a unique request ID so that
  97618. // if you must retry your request, the server will know to ignore the
  97619. // request if it has already been completed.
  97620. //
  97621. // For example, consider a situation where you make an initial request
  97622. // and the request times out. If you make the request again with the
  97623. // same request ID, the server can check if original operation with the
  97624. // same request ID was received, and if so, will ignore the second
  97625. // request. This prevents clients from accidentally creating duplicate
  97626. // commitments.
  97627. //
  97628. // The request ID must be a valid UUID with the exception that zero UUID
  97629. // is not supported (00000000-0000-0000-0000-000000000000).
  97630. func (c *UrlMapsInsertCall) RequestId(requestId string) *UrlMapsInsertCall {
  97631. c.urlParams_.Set("requestId", requestId)
  97632. return c
  97633. }
  97634. // Fields allows partial responses to be retrieved. See
  97635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97636. // for more information.
  97637. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall {
  97638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97639. return c
  97640. }
  97641. // Context sets the context to be used in this call's Do method. Any
  97642. // pending HTTP request will be aborted if the provided context is
  97643. // canceled.
  97644. func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall {
  97645. c.ctx_ = ctx
  97646. return c
  97647. }
  97648. // Header returns an http.Header that can be modified by the caller to
  97649. // add HTTP headers to the request.
  97650. func (c *UrlMapsInsertCall) Header() http.Header {
  97651. if c.header_ == nil {
  97652. c.header_ = make(http.Header)
  97653. }
  97654. return c.header_
  97655. }
  97656. func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) {
  97657. reqHeaders := make(http.Header)
  97658. for k, v := range c.header_ {
  97659. reqHeaders[k] = v
  97660. }
  97661. reqHeaders.Set("User-Agent", c.s.userAgent())
  97662. var body io.Reader = nil
  97663. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  97664. if err != nil {
  97665. return nil, err
  97666. }
  97667. reqHeaders.Set("Content-Type", "application/json")
  97668. c.urlParams_.Set("alt", alt)
  97669. c.urlParams_.Set("prettyPrint", "false")
  97670. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  97671. urls += "?" + c.urlParams_.Encode()
  97672. req, err := http.NewRequest("POST", urls, body)
  97673. if err != nil {
  97674. return nil, err
  97675. }
  97676. req.Header = reqHeaders
  97677. googleapi.Expand(req.URL, map[string]string{
  97678. "project": c.project,
  97679. })
  97680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97681. }
  97682. // Do executes the "compute.urlMaps.insert" call.
  97683. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97684. // status code is an error. Response headers are in either
  97685. // *Operation.ServerResponse.Header or (if a response was returned at
  97686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97687. // to check whether the returned error was because
  97688. // http.StatusNotModified was returned.
  97689. func (c *UrlMapsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97690. gensupport.SetOptions(c.urlParams_, opts...)
  97691. res, err := c.doRequest("json")
  97692. if res != nil && res.StatusCode == http.StatusNotModified {
  97693. if res.Body != nil {
  97694. res.Body.Close()
  97695. }
  97696. return nil, &googleapi.Error{
  97697. Code: res.StatusCode,
  97698. Header: res.Header,
  97699. }
  97700. }
  97701. if err != nil {
  97702. return nil, err
  97703. }
  97704. defer googleapi.CloseBody(res)
  97705. if err := googleapi.CheckResponse(res); err != nil {
  97706. return nil, err
  97707. }
  97708. ret := &Operation{
  97709. ServerResponse: googleapi.ServerResponse{
  97710. Header: res.Header,
  97711. HTTPStatusCode: res.StatusCode,
  97712. },
  97713. }
  97714. target := &ret
  97715. if err := gensupport.DecodeResponse(target, res); err != nil {
  97716. return nil, err
  97717. }
  97718. return ret, nil
  97719. // {
  97720. // "description": "Creates a UrlMap resource in the specified project using the data included in the request.",
  97721. // "httpMethod": "POST",
  97722. // "id": "compute.urlMaps.insert",
  97723. // "parameterOrder": [
  97724. // "project"
  97725. // ],
  97726. // "parameters": {
  97727. // "project": {
  97728. // "description": "Project ID for this request.",
  97729. // "location": "path",
  97730. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97731. // "required": true,
  97732. // "type": "string"
  97733. // },
  97734. // "requestId": {
  97735. // "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).",
  97736. // "location": "query",
  97737. // "type": "string"
  97738. // }
  97739. // },
  97740. // "path": "{project}/global/urlMaps",
  97741. // "request": {
  97742. // "$ref": "UrlMap"
  97743. // },
  97744. // "response": {
  97745. // "$ref": "Operation"
  97746. // },
  97747. // "scopes": [
  97748. // "https://www.googleapis.com/auth/cloud-platform",
  97749. // "https://www.googleapis.com/auth/compute"
  97750. // ]
  97751. // }
  97752. }
  97753. // method id "compute.urlMaps.invalidateCache":
  97754. type UrlMapsInvalidateCacheCall struct {
  97755. s *Service
  97756. project string
  97757. urlMap string
  97758. cacheinvalidationrule *CacheInvalidationRule
  97759. urlParams_ gensupport.URLParams
  97760. ctx_ context.Context
  97761. header_ http.Header
  97762. }
  97763. // InvalidateCache: Initiates a cache invalidation operation,
  97764. // invalidating the specified path, scoped to the specified UrlMap.
  97765. func (r *UrlMapsService) InvalidateCache(project string, urlMap string, cacheinvalidationrule *CacheInvalidationRule) *UrlMapsInvalidateCacheCall {
  97766. c := &UrlMapsInvalidateCacheCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97767. c.project = project
  97768. c.urlMap = urlMap
  97769. c.cacheinvalidationrule = cacheinvalidationrule
  97770. return c
  97771. }
  97772. // RequestId sets the optional parameter "requestId": An optional
  97773. // request ID to identify requests. Specify a unique request ID so that
  97774. // if you must retry your request, the server will know to ignore the
  97775. // request if it has already been completed.
  97776. //
  97777. // For example, consider a situation where you make an initial request
  97778. // and the request times out. If you make the request again with the
  97779. // same request ID, the server can check if original operation with the
  97780. // same request ID was received, and if so, will ignore the second
  97781. // request. This prevents clients from accidentally creating duplicate
  97782. // commitments.
  97783. //
  97784. // The request ID must be a valid UUID with the exception that zero UUID
  97785. // is not supported (00000000-0000-0000-0000-000000000000).
  97786. func (c *UrlMapsInvalidateCacheCall) RequestId(requestId string) *UrlMapsInvalidateCacheCall {
  97787. c.urlParams_.Set("requestId", requestId)
  97788. return c
  97789. }
  97790. // Fields allows partial responses to be retrieved. See
  97791. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97792. // for more information.
  97793. func (c *UrlMapsInvalidateCacheCall) Fields(s ...googleapi.Field) *UrlMapsInvalidateCacheCall {
  97794. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97795. return c
  97796. }
  97797. // Context sets the context to be used in this call's Do method. Any
  97798. // pending HTTP request will be aborted if the provided context is
  97799. // canceled.
  97800. func (c *UrlMapsInvalidateCacheCall) Context(ctx context.Context) *UrlMapsInvalidateCacheCall {
  97801. c.ctx_ = ctx
  97802. return c
  97803. }
  97804. // Header returns an http.Header that can be modified by the caller to
  97805. // add HTTP headers to the request.
  97806. func (c *UrlMapsInvalidateCacheCall) Header() http.Header {
  97807. if c.header_ == nil {
  97808. c.header_ = make(http.Header)
  97809. }
  97810. return c.header_
  97811. }
  97812. func (c *UrlMapsInvalidateCacheCall) doRequest(alt string) (*http.Response, error) {
  97813. reqHeaders := make(http.Header)
  97814. for k, v := range c.header_ {
  97815. reqHeaders[k] = v
  97816. }
  97817. reqHeaders.Set("User-Agent", c.s.userAgent())
  97818. var body io.Reader = nil
  97819. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cacheinvalidationrule)
  97820. if err != nil {
  97821. return nil, err
  97822. }
  97823. reqHeaders.Set("Content-Type", "application/json")
  97824. c.urlParams_.Set("alt", alt)
  97825. c.urlParams_.Set("prettyPrint", "false")
  97826. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/invalidateCache")
  97827. urls += "?" + c.urlParams_.Encode()
  97828. req, err := http.NewRequest("POST", urls, body)
  97829. if err != nil {
  97830. return nil, err
  97831. }
  97832. req.Header = reqHeaders
  97833. googleapi.Expand(req.URL, map[string]string{
  97834. "project": c.project,
  97835. "urlMap": c.urlMap,
  97836. })
  97837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  97838. }
  97839. // Do executes the "compute.urlMaps.invalidateCache" call.
  97840. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  97841. // status code is an error. Response headers are in either
  97842. // *Operation.ServerResponse.Header or (if a response was returned at
  97843. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  97844. // to check whether the returned error was because
  97845. // http.StatusNotModified was returned.
  97846. func (c *UrlMapsInvalidateCacheCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  97847. gensupport.SetOptions(c.urlParams_, opts...)
  97848. res, err := c.doRequest("json")
  97849. if res != nil && res.StatusCode == http.StatusNotModified {
  97850. if res.Body != nil {
  97851. res.Body.Close()
  97852. }
  97853. return nil, &googleapi.Error{
  97854. Code: res.StatusCode,
  97855. Header: res.Header,
  97856. }
  97857. }
  97858. if err != nil {
  97859. return nil, err
  97860. }
  97861. defer googleapi.CloseBody(res)
  97862. if err := googleapi.CheckResponse(res); err != nil {
  97863. return nil, err
  97864. }
  97865. ret := &Operation{
  97866. ServerResponse: googleapi.ServerResponse{
  97867. Header: res.Header,
  97868. HTTPStatusCode: res.StatusCode,
  97869. },
  97870. }
  97871. target := &ret
  97872. if err := gensupport.DecodeResponse(target, res); err != nil {
  97873. return nil, err
  97874. }
  97875. return ret, nil
  97876. // {
  97877. // "description": "Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.",
  97878. // "httpMethod": "POST",
  97879. // "id": "compute.urlMaps.invalidateCache",
  97880. // "parameterOrder": [
  97881. // "project",
  97882. // "urlMap"
  97883. // ],
  97884. // "parameters": {
  97885. // "project": {
  97886. // "description": "Project ID for this request.",
  97887. // "location": "path",
  97888. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  97889. // "required": true,
  97890. // "type": "string"
  97891. // },
  97892. // "requestId": {
  97893. // "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).",
  97894. // "location": "query",
  97895. // "type": "string"
  97896. // },
  97897. // "urlMap": {
  97898. // "description": "Name of the UrlMap scoping this request.",
  97899. // "location": "path",
  97900. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  97901. // "required": true,
  97902. // "type": "string"
  97903. // }
  97904. // },
  97905. // "path": "{project}/global/urlMaps/{urlMap}/invalidateCache",
  97906. // "request": {
  97907. // "$ref": "CacheInvalidationRule"
  97908. // },
  97909. // "response": {
  97910. // "$ref": "Operation"
  97911. // },
  97912. // "scopes": [
  97913. // "https://www.googleapis.com/auth/cloud-platform",
  97914. // "https://www.googleapis.com/auth/compute"
  97915. // ]
  97916. // }
  97917. }
  97918. // method id "compute.urlMaps.list":
  97919. type UrlMapsListCall struct {
  97920. s *Service
  97921. project string
  97922. urlParams_ gensupport.URLParams
  97923. ifNoneMatch_ string
  97924. ctx_ context.Context
  97925. header_ http.Header
  97926. }
  97927. // List: Retrieves the list of UrlMap resources available to the
  97928. // specified project.
  97929. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list
  97930. func (r *UrlMapsService) List(project string) *UrlMapsListCall {
  97931. c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  97932. c.project = project
  97933. return c
  97934. }
  97935. // Filter sets the optional parameter "filter": A filter expression that
  97936. // filters resources listed in the response. The expression must specify
  97937. // the field name, a comparison operator, and the value that you want to
  97938. // use for filtering. The value must be a string, a number, or a
  97939. // boolean. The comparison operator must be either =, !=, >, or <.
  97940. //
  97941. // For example, if you are filtering Compute Engine instances, you can
  97942. // exclude instances named example-instance by specifying name !=
  97943. // example-instance.
  97944. //
  97945. // You can also filter nested fields. For example, you could specify
  97946. // scheduling.automaticRestart = false to include instances only if they
  97947. // are not scheduled for automatic restarts. You can use filtering on
  97948. // nested fields to filter based on resource labels.
  97949. //
  97950. // To filter on multiple expressions, provide each separate expression
  97951. // within parentheses. For example, (scheduling.automaticRestart = true)
  97952. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  97953. // AND expression. However, you can include AND and OR expressions
  97954. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  97955. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  97956. // true).
  97957. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall {
  97958. c.urlParams_.Set("filter", filter)
  97959. return c
  97960. }
  97961. // MaxResults sets the optional parameter "maxResults": The maximum
  97962. // number of results per page that should be returned. If the number of
  97963. // available results is larger than maxResults, Compute Engine returns a
  97964. // nextPageToken that can be used to get the next page of results in
  97965. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  97966. // (Default: 500)
  97967. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall {
  97968. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  97969. return c
  97970. }
  97971. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  97972. // a certain order. By default, results are returned in alphanumerical
  97973. // order based on the resource name.
  97974. //
  97975. // You can also sort results in descending order based on the creation
  97976. // timestamp using orderBy="creationTimestamp desc". This sorts results
  97977. // based on the creationTimestamp field in reverse chronological order
  97978. // (newest result first). Use this to sort resources like operations so
  97979. // that the newest operation is returned first.
  97980. //
  97981. // Currently, only sorting by name or creationTimestamp desc is
  97982. // supported.
  97983. func (c *UrlMapsListCall) OrderBy(orderBy string) *UrlMapsListCall {
  97984. c.urlParams_.Set("orderBy", orderBy)
  97985. return c
  97986. }
  97987. // PageToken sets the optional parameter "pageToken": Specifies a page
  97988. // token to use. Set pageToken to the nextPageToken returned by a
  97989. // previous list request to get the next page of results.
  97990. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall {
  97991. c.urlParams_.Set("pageToken", pageToken)
  97992. return c
  97993. }
  97994. // Fields allows partial responses to be retrieved. See
  97995. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  97996. // for more information.
  97997. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall {
  97998. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  97999. return c
  98000. }
  98001. // IfNoneMatch sets the optional parameter which makes the operation
  98002. // fail if the object's ETag matches the given value. This is useful for
  98003. // getting updates only after the object has changed since the last
  98004. // request. Use googleapi.IsNotModified to check whether the response
  98005. // error from Do is the result of In-None-Match.
  98006. func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall {
  98007. c.ifNoneMatch_ = entityTag
  98008. return c
  98009. }
  98010. // Context sets the context to be used in this call's Do method. Any
  98011. // pending HTTP request will be aborted if the provided context is
  98012. // canceled.
  98013. func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall {
  98014. c.ctx_ = ctx
  98015. return c
  98016. }
  98017. // Header returns an http.Header that can be modified by the caller to
  98018. // add HTTP headers to the request.
  98019. func (c *UrlMapsListCall) Header() http.Header {
  98020. if c.header_ == nil {
  98021. c.header_ = make(http.Header)
  98022. }
  98023. return c.header_
  98024. }
  98025. func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) {
  98026. reqHeaders := make(http.Header)
  98027. for k, v := range c.header_ {
  98028. reqHeaders[k] = v
  98029. }
  98030. reqHeaders.Set("User-Agent", c.s.userAgent())
  98031. if c.ifNoneMatch_ != "" {
  98032. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98033. }
  98034. var body io.Reader = nil
  98035. c.urlParams_.Set("alt", alt)
  98036. c.urlParams_.Set("prettyPrint", "false")
  98037. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps")
  98038. urls += "?" + c.urlParams_.Encode()
  98039. req, err := http.NewRequest("GET", urls, body)
  98040. if err != nil {
  98041. return nil, err
  98042. }
  98043. req.Header = reqHeaders
  98044. googleapi.Expand(req.URL, map[string]string{
  98045. "project": c.project,
  98046. })
  98047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98048. }
  98049. // Do executes the "compute.urlMaps.list" call.
  98050. // Exactly one of *UrlMapList or error will be non-nil. Any non-2xx
  98051. // status code is an error. Response headers are in either
  98052. // *UrlMapList.ServerResponse.Header or (if a response was returned at
  98053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98054. // to check whether the returned error was because
  98055. // http.StatusNotModified was returned.
  98056. func (c *UrlMapsListCall) Do(opts ...googleapi.CallOption) (*UrlMapList, error) {
  98057. gensupport.SetOptions(c.urlParams_, opts...)
  98058. res, err := c.doRequest("json")
  98059. if res != nil && res.StatusCode == http.StatusNotModified {
  98060. if res.Body != nil {
  98061. res.Body.Close()
  98062. }
  98063. return nil, &googleapi.Error{
  98064. Code: res.StatusCode,
  98065. Header: res.Header,
  98066. }
  98067. }
  98068. if err != nil {
  98069. return nil, err
  98070. }
  98071. defer googleapi.CloseBody(res)
  98072. if err := googleapi.CheckResponse(res); err != nil {
  98073. return nil, err
  98074. }
  98075. ret := &UrlMapList{
  98076. ServerResponse: googleapi.ServerResponse{
  98077. Header: res.Header,
  98078. HTTPStatusCode: res.StatusCode,
  98079. },
  98080. }
  98081. target := &ret
  98082. if err := gensupport.DecodeResponse(target, res); err != nil {
  98083. return nil, err
  98084. }
  98085. return ret, nil
  98086. // {
  98087. // "description": "Retrieves the list of UrlMap resources available to the specified project.",
  98088. // "httpMethod": "GET",
  98089. // "id": "compute.urlMaps.list",
  98090. // "parameterOrder": [
  98091. // "project"
  98092. // ],
  98093. // "parameters": {
  98094. // "filter": {
  98095. // "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).",
  98096. // "location": "query",
  98097. // "type": "string"
  98098. // },
  98099. // "maxResults": {
  98100. // "default": "500",
  98101. // "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)",
  98102. // "format": "uint32",
  98103. // "location": "query",
  98104. // "minimum": "0",
  98105. // "type": "integer"
  98106. // },
  98107. // "orderBy": {
  98108. // "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.",
  98109. // "location": "query",
  98110. // "type": "string"
  98111. // },
  98112. // "pageToken": {
  98113. // "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.",
  98114. // "location": "query",
  98115. // "type": "string"
  98116. // },
  98117. // "project": {
  98118. // "description": "Project ID for this request.",
  98119. // "location": "path",
  98120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98121. // "required": true,
  98122. // "type": "string"
  98123. // }
  98124. // },
  98125. // "path": "{project}/global/urlMaps",
  98126. // "response": {
  98127. // "$ref": "UrlMapList"
  98128. // },
  98129. // "scopes": [
  98130. // "https://www.googleapis.com/auth/cloud-platform",
  98131. // "https://www.googleapis.com/auth/compute",
  98132. // "https://www.googleapis.com/auth/compute.readonly"
  98133. // ]
  98134. // }
  98135. }
  98136. // Pages invokes f for each page of results.
  98137. // A non-nil error returned from f will halt the iteration.
  98138. // The provided context supersedes any context provided to the Context method.
  98139. func (c *UrlMapsListCall) Pages(ctx context.Context, f func(*UrlMapList) error) error {
  98140. c.ctx_ = ctx
  98141. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98142. for {
  98143. x, err := c.Do()
  98144. if err != nil {
  98145. return err
  98146. }
  98147. if err := f(x); err != nil {
  98148. return err
  98149. }
  98150. if x.NextPageToken == "" {
  98151. return nil
  98152. }
  98153. c.PageToken(x.NextPageToken)
  98154. }
  98155. }
  98156. // method id "compute.urlMaps.patch":
  98157. type UrlMapsPatchCall struct {
  98158. s *Service
  98159. project string
  98160. urlMap string
  98161. urlmap *UrlMap
  98162. urlParams_ gensupport.URLParams
  98163. ctx_ context.Context
  98164. header_ http.Header
  98165. }
  98166. // Patch: Patches the specified UrlMap resource with the data included
  98167. // in the request. This method supports PATCH semantics and uses the
  98168. // JSON merge patch format and processing rules.
  98169. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch
  98170. func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall {
  98171. c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98172. c.project = project
  98173. c.urlMap = urlMap
  98174. c.urlmap = urlmap
  98175. return c
  98176. }
  98177. // RequestId sets the optional parameter "requestId": An optional
  98178. // request ID to identify requests. Specify a unique request ID so that
  98179. // if you must retry your request, the server will know to ignore the
  98180. // request if it has already been completed.
  98181. //
  98182. // For example, consider a situation where you make an initial request
  98183. // and the request times out. If you make the request again with the
  98184. // same request ID, the server can check if original operation with the
  98185. // same request ID was received, and if so, will ignore the second
  98186. // request. This prevents clients from accidentally creating duplicate
  98187. // commitments.
  98188. //
  98189. // The request ID must be a valid UUID with the exception that zero UUID
  98190. // is not supported (00000000-0000-0000-0000-000000000000).
  98191. func (c *UrlMapsPatchCall) RequestId(requestId string) *UrlMapsPatchCall {
  98192. c.urlParams_.Set("requestId", requestId)
  98193. return c
  98194. }
  98195. // Fields allows partial responses to be retrieved. See
  98196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98197. // for more information.
  98198. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall {
  98199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98200. return c
  98201. }
  98202. // Context sets the context to be used in this call's Do method. Any
  98203. // pending HTTP request will be aborted if the provided context is
  98204. // canceled.
  98205. func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall {
  98206. c.ctx_ = ctx
  98207. return c
  98208. }
  98209. // Header returns an http.Header that can be modified by the caller to
  98210. // add HTTP headers to the request.
  98211. func (c *UrlMapsPatchCall) Header() http.Header {
  98212. if c.header_ == nil {
  98213. c.header_ = make(http.Header)
  98214. }
  98215. return c.header_
  98216. }
  98217. func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) {
  98218. reqHeaders := make(http.Header)
  98219. for k, v := range c.header_ {
  98220. reqHeaders[k] = v
  98221. }
  98222. reqHeaders.Set("User-Agent", c.s.userAgent())
  98223. var body io.Reader = nil
  98224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  98225. if err != nil {
  98226. return nil, err
  98227. }
  98228. reqHeaders.Set("Content-Type", "application/json")
  98229. c.urlParams_.Set("alt", alt)
  98230. c.urlParams_.Set("prettyPrint", "false")
  98231. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  98232. urls += "?" + c.urlParams_.Encode()
  98233. req, err := http.NewRequest("PATCH", urls, body)
  98234. if err != nil {
  98235. return nil, err
  98236. }
  98237. req.Header = reqHeaders
  98238. googleapi.Expand(req.URL, map[string]string{
  98239. "project": c.project,
  98240. "urlMap": c.urlMap,
  98241. })
  98242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98243. }
  98244. // Do executes the "compute.urlMaps.patch" call.
  98245. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98246. // status code is an error. Response headers are in either
  98247. // *Operation.ServerResponse.Header or (if a response was returned at
  98248. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98249. // to check whether the returned error was because
  98250. // http.StatusNotModified was returned.
  98251. func (c *UrlMapsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98252. gensupport.SetOptions(c.urlParams_, opts...)
  98253. res, err := c.doRequest("json")
  98254. if res != nil && res.StatusCode == http.StatusNotModified {
  98255. if res.Body != nil {
  98256. res.Body.Close()
  98257. }
  98258. return nil, &googleapi.Error{
  98259. Code: res.StatusCode,
  98260. Header: res.Header,
  98261. }
  98262. }
  98263. if err != nil {
  98264. return nil, err
  98265. }
  98266. defer googleapi.CloseBody(res)
  98267. if err := googleapi.CheckResponse(res); err != nil {
  98268. return nil, err
  98269. }
  98270. ret := &Operation{
  98271. ServerResponse: googleapi.ServerResponse{
  98272. Header: res.Header,
  98273. HTTPStatusCode: res.StatusCode,
  98274. },
  98275. }
  98276. target := &ret
  98277. if err := gensupport.DecodeResponse(target, res); err != nil {
  98278. return nil, err
  98279. }
  98280. return ret, nil
  98281. // {
  98282. // "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.",
  98283. // "httpMethod": "PATCH",
  98284. // "id": "compute.urlMaps.patch",
  98285. // "parameterOrder": [
  98286. // "project",
  98287. // "urlMap"
  98288. // ],
  98289. // "parameters": {
  98290. // "project": {
  98291. // "description": "Project ID for this request.",
  98292. // "location": "path",
  98293. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98294. // "required": true,
  98295. // "type": "string"
  98296. // },
  98297. // "requestId": {
  98298. // "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).",
  98299. // "location": "query",
  98300. // "type": "string"
  98301. // },
  98302. // "urlMap": {
  98303. // "description": "Name of the UrlMap resource to patch.",
  98304. // "location": "path",
  98305. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98306. // "required": true,
  98307. // "type": "string"
  98308. // }
  98309. // },
  98310. // "path": "{project}/global/urlMaps/{urlMap}",
  98311. // "request": {
  98312. // "$ref": "UrlMap"
  98313. // },
  98314. // "response": {
  98315. // "$ref": "Operation"
  98316. // },
  98317. // "scopes": [
  98318. // "https://www.googleapis.com/auth/cloud-platform",
  98319. // "https://www.googleapis.com/auth/compute"
  98320. // ]
  98321. // }
  98322. }
  98323. // method id "compute.urlMaps.update":
  98324. type UrlMapsUpdateCall struct {
  98325. s *Service
  98326. project string
  98327. urlMap string
  98328. urlmap *UrlMap
  98329. urlParams_ gensupport.URLParams
  98330. ctx_ context.Context
  98331. header_ http.Header
  98332. }
  98333. // Update: Updates the specified UrlMap resource with the data included
  98334. // in the request.
  98335. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update
  98336. func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall {
  98337. c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98338. c.project = project
  98339. c.urlMap = urlMap
  98340. c.urlmap = urlmap
  98341. return c
  98342. }
  98343. // RequestId sets the optional parameter "requestId": An optional
  98344. // request ID to identify requests. Specify a unique request ID so that
  98345. // if you must retry your request, the server will know to ignore the
  98346. // request if it has already been completed.
  98347. //
  98348. // For example, consider a situation where you make an initial request
  98349. // and the request times out. If you make the request again with the
  98350. // same request ID, the server can check if original operation with the
  98351. // same request ID was received, and if so, will ignore the second
  98352. // request. This prevents clients from accidentally creating duplicate
  98353. // commitments.
  98354. //
  98355. // The request ID must be a valid UUID with the exception that zero UUID
  98356. // is not supported (00000000-0000-0000-0000-000000000000).
  98357. func (c *UrlMapsUpdateCall) RequestId(requestId string) *UrlMapsUpdateCall {
  98358. c.urlParams_.Set("requestId", requestId)
  98359. return c
  98360. }
  98361. // Fields allows partial responses to be retrieved. See
  98362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98363. // for more information.
  98364. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall {
  98365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98366. return c
  98367. }
  98368. // Context sets the context to be used in this call's Do method. Any
  98369. // pending HTTP request will be aborted if the provided context is
  98370. // canceled.
  98371. func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall {
  98372. c.ctx_ = ctx
  98373. return c
  98374. }
  98375. // Header returns an http.Header that can be modified by the caller to
  98376. // add HTTP headers to the request.
  98377. func (c *UrlMapsUpdateCall) Header() http.Header {
  98378. if c.header_ == nil {
  98379. c.header_ = make(http.Header)
  98380. }
  98381. return c.header_
  98382. }
  98383. func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) {
  98384. reqHeaders := make(http.Header)
  98385. for k, v := range c.header_ {
  98386. reqHeaders[k] = v
  98387. }
  98388. reqHeaders.Set("User-Agent", c.s.userAgent())
  98389. var body io.Reader = nil
  98390. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap)
  98391. if err != nil {
  98392. return nil, err
  98393. }
  98394. reqHeaders.Set("Content-Type", "application/json")
  98395. c.urlParams_.Set("alt", alt)
  98396. c.urlParams_.Set("prettyPrint", "false")
  98397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}")
  98398. urls += "?" + c.urlParams_.Encode()
  98399. req, err := http.NewRequest("PUT", urls, body)
  98400. if err != nil {
  98401. return nil, err
  98402. }
  98403. req.Header = reqHeaders
  98404. googleapi.Expand(req.URL, map[string]string{
  98405. "project": c.project,
  98406. "urlMap": c.urlMap,
  98407. })
  98408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98409. }
  98410. // Do executes the "compute.urlMaps.update" call.
  98411. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98412. // status code is an error. Response headers are in either
  98413. // *Operation.ServerResponse.Header or (if a response was returned at
  98414. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98415. // to check whether the returned error was because
  98416. // http.StatusNotModified was returned.
  98417. func (c *UrlMapsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98418. gensupport.SetOptions(c.urlParams_, opts...)
  98419. res, err := c.doRequest("json")
  98420. if res != nil && res.StatusCode == http.StatusNotModified {
  98421. if res.Body != nil {
  98422. res.Body.Close()
  98423. }
  98424. return nil, &googleapi.Error{
  98425. Code: res.StatusCode,
  98426. Header: res.Header,
  98427. }
  98428. }
  98429. if err != nil {
  98430. return nil, err
  98431. }
  98432. defer googleapi.CloseBody(res)
  98433. if err := googleapi.CheckResponse(res); err != nil {
  98434. return nil, err
  98435. }
  98436. ret := &Operation{
  98437. ServerResponse: googleapi.ServerResponse{
  98438. Header: res.Header,
  98439. HTTPStatusCode: res.StatusCode,
  98440. },
  98441. }
  98442. target := &ret
  98443. if err := gensupport.DecodeResponse(target, res); err != nil {
  98444. return nil, err
  98445. }
  98446. return ret, nil
  98447. // {
  98448. // "description": "Updates the specified UrlMap resource with the data included in the request.",
  98449. // "httpMethod": "PUT",
  98450. // "id": "compute.urlMaps.update",
  98451. // "parameterOrder": [
  98452. // "project",
  98453. // "urlMap"
  98454. // ],
  98455. // "parameters": {
  98456. // "project": {
  98457. // "description": "Project ID for this request.",
  98458. // "location": "path",
  98459. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98460. // "required": true,
  98461. // "type": "string"
  98462. // },
  98463. // "requestId": {
  98464. // "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).",
  98465. // "location": "query",
  98466. // "type": "string"
  98467. // },
  98468. // "urlMap": {
  98469. // "description": "Name of the UrlMap resource to update.",
  98470. // "location": "path",
  98471. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98472. // "required": true,
  98473. // "type": "string"
  98474. // }
  98475. // },
  98476. // "path": "{project}/global/urlMaps/{urlMap}",
  98477. // "request": {
  98478. // "$ref": "UrlMap"
  98479. // },
  98480. // "response": {
  98481. // "$ref": "Operation"
  98482. // },
  98483. // "scopes": [
  98484. // "https://www.googleapis.com/auth/cloud-platform",
  98485. // "https://www.googleapis.com/auth/compute"
  98486. // ]
  98487. // }
  98488. }
  98489. // method id "compute.urlMaps.validate":
  98490. type UrlMapsValidateCall struct {
  98491. s *Service
  98492. project string
  98493. urlMap string
  98494. urlmapsvalidaterequest *UrlMapsValidateRequest
  98495. urlParams_ gensupport.URLParams
  98496. ctx_ context.Context
  98497. header_ http.Header
  98498. }
  98499. // Validate: Runs static validation for the UrlMap. In particular, the
  98500. // tests of the provided UrlMap will be run. Calling this method does
  98501. // NOT create the UrlMap.
  98502. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate
  98503. func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall {
  98504. c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98505. c.project = project
  98506. c.urlMap = urlMap
  98507. c.urlmapsvalidaterequest = urlmapsvalidaterequest
  98508. return c
  98509. }
  98510. // Fields allows partial responses to be retrieved. See
  98511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98512. // for more information.
  98513. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall {
  98514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98515. return c
  98516. }
  98517. // Context sets the context to be used in this call's Do method. Any
  98518. // pending HTTP request will be aborted if the provided context is
  98519. // canceled.
  98520. func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall {
  98521. c.ctx_ = ctx
  98522. return c
  98523. }
  98524. // Header returns an http.Header that can be modified by the caller to
  98525. // add HTTP headers to the request.
  98526. func (c *UrlMapsValidateCall) Header() http.Header {
  98527. if c.header_ == nil {
  98528. c.header_ = make(http.Header)
  98529. }
  98530. return c.header_
  98531. }
  98532. func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) {
  98533. reqHeaders := make(http.Header)
  98534. for k, v := range c.header_ {
  98535. reqHeaders[k] = v
  98536. }
  98537. reqHeaders.Set("User-Agent", c.s.userAgent())
  98538. var body io.Reader = nil
  98539. body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest)
  98540. if err != nil {
  98541. return nil, err
  98542. }
  98543. reqHeaders.Set("Content-Type", "application/json")
  98544. c.urlParams_.Set("alt", alt)
  98545. c.urlParams_.Set("prettyPrint", "false")
  98546. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate")
  98547. urls += "?" + c.urlParams_.Encode()
  98548. req, err := http.NewRequest("POST", urls, body)
  98549. if err != nil {
  98550. return nil, err
  98551. }
  98552. req.Header = reqHeaders
  98553. googleapi.Expand(req.URL, map[string]string{
  98554. "project": c.project,
  98555. "urlMap": c.urlMap,
  98556. })
  98557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98558. }
  98559. // Do executes the "compute.urlMaps.validate" call.
  98560. // Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any
  98561. // non-2xx status code is an error. Response headers are in either
  98562. // *UrlMapsValidateResponse.ServerResponse.Header or (if a response was
  98563. // returned at all) in error.(*googleapi.Error).Header. Use
  98564. // googleapi.IsNotModified to check whether the returned error was
  98565. // because http.StatusNotModified was returned.
  98566. func (c *UrlMapsValidateCall) Do(opts ...googleapi.CallOption) (*UrlMapsValidateResponse, error) {
  98567. gensupport.SetOptions(c.urlParams_, opts...)
  98568. res, err := c.doRequest("json")
  98569. if res != nil && res.StatusCode == http.StatusNotModified {
  98570. if res.Body != nil {
  98571. res.Body.Close()
  98572. }
  98573. return nil, &googleapi.Error{
  98574. Code: res.StatusCode,
  98575. Header: res.Header,
  98576. }
  98577. }
  98578. if err != nil {
  98579. return nil, err
  98580. }
  98581. defer googleapi.CloseBody(res)
  98582. if err := googleapi.CheckResponse(res); err != nil {
  98583. return nil, err
  98584. }
  98585. ret := &UrlMapsValidateResponse{
  98586. ServerResponse: googleapi.ServerResponse{
  98587. Header: res.Header,
  98588. HTTPStatusCode: res.StatusCode,
  98589. },
  98590. }
  98591. target := &ret
  98592. if err := gensupport.DecodeResponse(target, res); err != nil {
  98593. return nil, err
  98594. }
  98595. return ret, nil
  98596. // {
  98597. // "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.",
  98598. // "httpMethod": "POST",
  98599. // "id": "compute.urlMaps.validate",
  98600. // "parameterOrder": [
  98601. // "project",
  98602. // "urlMap"
  98603. // ],
  98604. // "parameters": {
  98605. // "project": {
  98606. // "description": "Project ID for this request.",
  98607. // "location": "path",
  98608. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98609. // "required": true,
  98610. // "type": "string"
  98611. // },
  98612. // "urlMap": {
  98613. // "description": "Name of the UrlMap resource to be validated as.",
  98614. // "location": "path",
  98615. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  98616. // "required": true,
  98617. // "type": "string"
  98618. // }
  98619. // },
  98620. // "path": "{project}/global/urlMaps/{urlMap}/validate",
  98621. // "request": {
  98622. // "$ref": "UrlMapsValidateRequest"
  98623. // },
  98624. // "response": {
  98625. // "$ref": "UrlMapsValidateResponse"
  98626. // },
  98627. // "scopes": [
  98628. // "https://www.googleapis.com/auth/cloud-platform",
  98629. // "https://www.googleapis.com/auth/compute"
  98630. // ]
  98631. // }
  98632. }
  98633. // method id "compute.vpnTunnels.aggregatedList":
  98634. type VpnTunnelsAggregatedListCall struct {
  98635. s *Service
  98636. project string
  98637. urlParams_ gensupport.URLParams
  98638. ifNoneMatch_ string
  98639. ctx_ context.Context
  98640. header_ http.Header
  98641. }
  98642. // AggregatedList: Retrieves an aggregated list of VPN tunnels.
  98643. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall {
  98644. c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98645. c.project = project
  98646. return c
  98647. }
  98648. // Filter sets the optional parameter "filter": A filter expression that
  98649. // filters resources listed in the response. The expression must specify
  98650. // the field name, a comparison operator, and the value that you want to
  98651. // use for filtering. The value must be a string, a number, or a
  98652. // boolean. The comparison operator must be either =, !=, >, or <.
  98653. //
  98654. // For example, if you are filtering Compute Engine instances, you can
  98655. // exclude instances named example-instance by specifying name !=
  98656. // example-instance.
  98657. //
  98658. // You can also filter nested fields. For example, you could specify
  98659. // scheduling.automaticRestart = false to include instances only if they
  98660. // are not scheduled for automatic restarts. You can use filtering on
  98661. // nested fields to filter based on resource labels.
  98662. //
  98663. // To filter on multiple expressions, provide each separate expression
  98664. // within parentheses. For example, (scheduling.automaticRestart = true)
  98665. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  98666. // AND expression. However, you can include AND and OR expressions
  98667. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  98668. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  98669. // true).
  98670. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall {
  98671. c.urlParams_.Set("filter", filter)
  98672. return c
  98673. }
  98674. // MaxResults sets the optional parameter "maxResults": The maximum
  98675. // number of results per page that should be returned. If the number of
  98676. // available results is larger than maxResults, Compute Engine returns a
  98677. // nextPageToken that can be used to get the next page of results in
  98678. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  98679. // (Default: 500)
  98680. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall {
  98681. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  98682. return c
  98683. }
  98684. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  98685. // a certain order. By default, results are returned in alphanumerical
  98686. // order based on the resource name.
  98687. //
  98688. // You can also sort results in descending order based on the creation
  98689. // timestamp using orderBy="creationTimestamp desc". This sorts results
  98690. // based on the creationTimestamp field in reverse chronological order
  98691. // (newest result first). Use this to sort resources like operations so
  98692. // that the newest operation is returned first.
  98693. //
  98694. // Currently, only sorting by name or creationTimestamp desc is
  98695. // supported.
  98696. func (c *VpnTunnelsAggregatedListCall) OrderBy(orderBy string) *VpnTunnelsAggregatedListCall {
  98697. c.urlParams_.Set("orderBy", orderBy)
  98698. return c
  98699. }
  98700. // PageToken sets the optional parameter "pageToken": Specifies a page
  98701. // token to use. Set pageToken to the nextPageToken returned by a
  98702. // previous list request to get the next page of results.
  98703. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall {
  98704. c.urlParams_.Set("pageToken", pageToken)
  98705. return c
  98706. }
  98707. // Fields allows partial responses to be retrieved. See
  98708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98709. // for more information.
  98710. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall {
  98711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98712. return c
  98713. }
  98714. // IfNoneMatch sets the optional parameter which makes the operation
  98715. // fail if the object's ETag matches the given value. This is useful for
  98716. // getting updates only after the object has changed since the last
  98717. // request. Use googleapi.IsNotModified to check whether the response
  98718. // error from Do is the result of In-None-Match.
  98719. func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall {
  98720. c.ifNoneMatch_ = entityTag
  98721. return c
  98722. }
  98723. // Context sets the context to be used in this call's Do method. Any
  98724. // pending HTTP request will be aborted if the provided context is
  98725. // canceled.
  98726. func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall {
  98727. c.ctx_ = ctx
  98728. return c
  98729. }
  98730. // Header returns an http.Header that can be modified by the caller to
  98731. // add HTTP headers to the request.
  98732. func (c *VpnTunnelsAggregatedListCall) Header() http.Header {
  98733. if c.header_ == nil {
  98734. c.header_ = make(http.Header)
  98735. }
  98736. return c.header_
  98737. }
  98738. func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) {
  98739. reqHeaders := make(http.Header)
  98740. for k, v := range c.header_ {
  98741. reqHeaders[k] = v
  98742. }
  98743. reqHeaders.Set("User-Agent", c.s.userAgent())
  98744. if c.ifNoneMatch_ != "" {
  98745. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  98746. }
  98747. var body io.Reader = nil
  98748. c.urlParams_.Set("alt", alt)
  98749. c.urlParams_.Set("prettyPrint", "false")
  98750. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels")
  98751. urls += "?" + c.urlParams_.Encode()
  98752. req, err := http.NewRequest("GET", urls, body)
  98753. if err != nil {
  98754. return nil, err
  98755. }
  98756. req.Header = reqHeaders
  98757. googleapi.Expand(req.URL, map[string]string{
  98758. "project": c.project,
  98759. })
  98760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98761. }
  98762. // Do executes the "compute.vpnTunnels.aggregatedList" call.
  98763. // Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any
  98764. // non-2xx status code is an error. Response headers are in either
  98765. // *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was
  98766. // returned at all) in error.(*googleapi.Error).Header. Use
  98767. // googleapi.IsNotModified to check whether the returned error was
  98768. // because http.StatusNotModified was returned.
  98769. func (c *VpnTunnelsAggregatedListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelAggregatedList, error) {
  98770. gensupport.SetOptions(c.urlParams_, opts...)
  98771. res, err := c.doRequest("json")
  98772. if res != nil && res.StatusCode == http.StatusNotModified {
  98773. if res.Body != nil {
  98774. res.Body.Close()
  98775. }
  98776. return nil, &googleapi.Error{
  98777. Code: res.StatusCode,
  98778. Header: res.Header,
  98779. }
  98780. }
  98781. if err != nil {
  98782. return nil, err
  98783. }
  98784. defer googleapi.CloseBody(res)
  98785. if err := googleapi.CheckResponse(res); err != nil {
  98786. return nil, err
  98787. }
  98788. ret := &VpnTunnelAggregatedList{
  98789. ServerResponse: googleapi.ServerResponse{
  98790. Header: res.Header,
  98791. HTTPStatusCode: res.StatusCode,
  98792. },
  98793. }
  98794. target := &ret
  98795. if err := gensupport.DecodeResponse(target, res); err != nil {
  98796. return nil, err
  98797. }
  98798. return ret, nil
  98799. // {
  98800. // "description": "Retrieves an aggregated list of VPN tunnels.",
  98801. // "httpMethod": "GET",
  98802. // "id": "compute.vpnTunnels.aggregatedList",
  98803. // "parameterOrder": [
  98804. // "project"
  98805. // ],
  98806. // "parameters": {
  98807. // "filter": {
  98808. // "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).",
  98809. // "location": "query",
  98810. // "type": "string"
  98811. // },
  98812. // "maxResults": {
  98813. // "default": "500",
  98814. // "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)",
  98815. // "format": "uint32",
  98816. // "location": "query",
  98817. // "minimum": "0",
  98818. // "type": "integer"
  98819. // },
  98820. // "orderBy": {
  98821. // "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.",
  98822. // "location": "query",
  98823. // "type": "string"
  98824. // },
  98825. // "pageToken": {
  98826. // "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.",
  98827. // "location": "query",
  98828. // "type": "string"
  98829. // },
  98830. // "project": {
  98831. // "description": "Project ID for this request.",
  98832. // "location": "path",
  98833. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  98834. // "required": true,
  98835. // "type": "string"
  98836. // }
  98837. // },
  98838. // "path": "{project}/aggregated/vpnTunnels",
  98839. // "response": {
  98840. // "$ref": "VpnTunnelAggregatedList"
  98841. // },
  98842. // "scopes": [
  98843. // "https://www.googleapis.com/auth/cloud-platform",
  98844. // "https://www.googleapis.com/auth/compute",
  98845. // "https://www.googleapis.com/auth/compute.readonly"
  98846. // ]
  98847. // }
  98848. }
  98849. // Pages invokes f for each page of results.
  98850. // A non-nil error returned from f will halt the iteration.
  98851. // The provided context supersedes any context provided to the Context method.
  98852. func (c *VpnTunnelsAggregatedListCall) Pages(ctx context.Context, f func(*VpnTunnelAggregatedList) error) error {
  98853. c.ctx_ = ctx
  98854. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  98855. for {
  98856. x, err := c.Do()
  98857. if err != nil {
  98858. return err
  98859. }
  98860. if err := f(x); err != nil {
  98861. return err
  98862. }
  98863. if x.NextPageToken == "" {
  98864. return nil
  98865. }
  98866. c.PageToken(x.NextPageToken)
  98867. }
  98868. }
  98869. // method id "compute.vpnTunnels.delete":
  98870. type VpnTunnelsDeleteCall struct {
  98871. s *Service
  98872. project string
  98873. region string
  98874. vpnTunnel string
  98875. urlParams_ gensupport.URLParams
  98876. ctx_ context.Context
  98877. header_ http.Header
  98878. }
  98879. // Delete: Deletes the specified VpnTunnel resource.
  98880. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall {
  98881. c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  98882. c.project = project
  98883. c.region = region
  98884. c.vpnTunnel = vpnTunnel
  98885. return c
  98886. }
  98887. // RequestId sets the optional parameter "requestId": An optional
  98888. // request ID to identify requests. Specify a unique request ID so that
  98889. // if you must retry your request, the server will know to ignore the
  98890. // request if it has already been completed.
  98891. //
  98892. // For example, consider a situation where you make an initial request
  98893. // and the request times out. If you make the request again with the
  98894. // same request ID, the server can check if original operation with the
  98895. // same request ID was received, and if so, will ignore the second
  98896. // request. This prevents clients from accidentally creating duplicate
  98897. // commitments.
  98898. //
  98899. // The request ID must be a valid UUID with the exception that zero UUID
  98900. // is not supported (00000000-0000-0000-0000-000000000000).
  98901. func (c *VpnTunnelsDeleteCall) RequestId(requestId string) *VpnTunnelsDeleteCall {
  98902. c.urlParams_.Set("requestId", requestId)
  98903. return c
  98904. }
  98905. // Fields allows partial responses to be retrieved. See
  98906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  98907. // for more information.
  98908. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall {
  98909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  98910. return c
  98911. }
  98912. // Context sets the context to be used in this call's Do method. Any
  98913. // pending HTTP request will be aborted if the provided context is
  98914. // canceled.
  98915. func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall {
  98916. c.ctx_ = ctx
  98917. return c
  98918. }
  98919. // Header returns an http.Header that can be modified by the caller to
  98920. // add HTTP headers to the request.
  98921. func (c *VpnTunnelsDeleteCall) Header() http.Header {
  98922. if c.header_ == nil {
  98923. c.header_ = make(http.Header)
  98924. }
  98925. return c.header_
  98926. }
  98927. func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  98928. reqHeaders := make(http.Header)
  98929. for k, v := range c.header_ {
  98930. reqHeaders[k] = v
  98931. }
  98932. reqHeaders.Set("User-Agent", c.s.userAgent())
  98933. var body io.Reader = nil
  98934. c.urlParams_.Set("alt", alt)
  98935. c.urlParams_.Set("prettyPrint", "false")
  98936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  98937. urls += "?" + c.urlParams_.Encode()
  98938. req, err := http.NewRequest("DELETE", urls, body)
  98939. if err != nil {
  98940. return nil, err
  98941. }
  98942. req.Header = reqHeaders
  98943. googleapi.Expand(req.URL, map[string]string{
  98944. "project": c.project,
  98945. "region": c.region,
  98946. "vpnTunnel": c.vpnTunnel,
  98947. })
  98948. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  98949. }
  98950. // Do executes the "compute.vpnTunnels.delete" call.
  98951. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  98952. // status code is an error. Response headers are in either
  98953. // *Operation.ServerResponse.Header or (if a response was returned at
  98954. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  98955. // to check whether the returned error was because
  98956. // http.StatusNotModified was returned.
  98957. func (c *VpnTunnelsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  98958. gensupport.SetOptions(c.urlParams_, opts...)
  98959. res, err := c.doRequest("json")
  98960. if res != nil && res.StatusCode == http.StatusNotModified {
  98961. if res.Body != nil {
  98962. res.Body.Close()
  98963. }
  98964. return nil, &googleapi.Error{
  98965. Code: res.StatusCode,
  98966. Header: res.Header,
  98967. }
  98968. }
  98969. if err != nil {
  98970. return nil, err
  98971. }
  98972. defer googleapi.CloseBody(res)
  98973. if err := googleapi.CheckResponse(res); err != nil {
  98974. return nil, err
  98975. }
  98976. ret := &Operation{
  98977. ServerResponse: googleapi.ServerResponse{
  98978. Header: res.Header,
  98979. HTTPStatusCode: res.StatusCode,
  98980. },
  98981. }
  98982. target := &ret
  98983. if err := gensupport.DecodeResponse(target, res); err != nil {
  98984. return nil, err
  98985. }
  98986. return ret, nil
  98987. // {
  98988. // "description": "Deletes the specified VpnTunnel resource.",
  98989. // "httpMethod": "DELETE",
  98990. // "id": "compute.vpnTunnels.delete",
  98991. // "parameterOrder": [
  98992. // "project",
  98993. // "region",
  98994. // "vpnTunnel"
  98995. // ],
  98996. // "parameters": {
  98997. // "project": {
  98998. // "description": "Project ID for this request.",
  98999. // "location": "path",
  99000. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99001. // "required": true,
  99002. // "type": "string"
  99003. // },
  99004. // "region": {
  99005. // "description": "Name of the region for this request.",
  99006. // "location": "path",
  99007. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99008. // "required": true,
  99009. // "type": "string"
  99010. // },
  99011. // "requestId": {
  99012. // "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).",
  99013. // "location": "query",
  99014. // "type": "string"
  99015. // },
  99016. // "vpnTunnel": {
  99017. // "description": "Name of the VpnTunnel resource to delete.",
  99018. // "location": "path",
  99019. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99020. // "required": true,
  99021. // "type": "string"
  99022. // }
  99023. // },
  99024. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  99025. // "response": {
  99026. // "$ref": "Operation"
  99027. // },
  99028. // "scopes": [
  99029. // "https://www.googleapis.com/auth/cloud-platform",
  99030. // "https://www.googleapis.com/auth/compute"
  99031. // ]
  99032. // }
  99033. }
  99034. // method id "compute.vpnTunnels.get":
  99035. type VpnTunnelsGetCall struct {
  99036. s *Service
  99037. project string
  99038. region string
  99039. vpnTunnel string
  99040. urlParams_ gensupport.URLParams
  99041. ifNoneMatch_ string
  99042. ctx_ context.Context
  99043. header_ http.Header
  99044. }
  99045. // Get: Returns the specified VpnTunnel resource. Gets a list of
  99046. // available VPN tunnels by making a list() request.
  99047. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall {
  99048. c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99049. c.project = project
  99050. c.region = region
  99051. c.vpnTunnel = vpnTunnel
  99052. return c
  99053. }
  99054. // Fields allows partial responses to be retrieved. See
  99055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99056. // for more information.
  99057. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall {
  99058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99059. return c
  99060. }
  99061. // IfNoneMatch sets the optional parameter which makes the operation
  99062. // fail if the object's ETag matches the given value. This is useful for
  99063. // getting updates only after the object has changed since the last
  99064. // request. Use googleapi.IsNotModified to check whether the response
  99065. // error from Do is the result of In-None-Match.
  99066. func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall {
  99067. c.ifNoneMatch_ = entityTag
  99068. return c
  99069. }
  99070. // Context sets the context to be used in this call's Do method. Any
  99071. // pending HTTP request will be aborted if the provided context is
  99072. // canceled.
  99073. func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall {
  99074. c.ctx_ = ctx
  99075. return c
  99076. }
  99077. // Header returns an http.Header that can be modified by the caller to
  99078. // add HTTP headers to the request.
  99079. func (c *VpnTunnelsGetCall) Header() http.Header {
  99080. if c.header_ == nil {
  99081. c.header_ = make(http.Header)
  99082. }
  99083. return c.header_
  99084. }
  99085. func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) {
  99086. reqHeaders := make(http.Header)
  99087. for k, v := range c.header_ {
  99088. reqHeaders[k] = v
  99089. }
  99090. reqHeaders.Set("User-Agent", c.s.userAgent())
  99091. if c.ifNoneMatch_ != "" {
  99092. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99093. }
  99094. var body io.Reader = nil
  99095. c.urlParams_.Set("alt", alt)
  99096. c.urlParams_.Set("prettyPrint", "false")
  99097. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}")
  99098. urls += "?" + c.urlParams_.Encode()
  99099. req, err := http.NewRequest("GET", urls, body)
  99100. if err != nil {
  99101. return nil, err
  99102. }
  99103. req.Header = reqHeaders
  99104. googleapi.Expand(req.URL, map[string]string{
  99105. "project": c.project,
  99106. "region": c.region,
  99107. "vpnTunnel": c.vpnTunnel,
  99108. })
  99109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99110. }
  99111. // Do executes the "compute.vpnTunnels.get" call.
  99112. // Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx
  99113. // status code is an error. Response headers are in either
  99114. // *VpnTunnel.ServerResponse.Header or (if a response was returned at
  99115. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99116. // to check whether the returned error was because
  99117. // http.StatusNotModified was returned.
  99118. func (c *VpnTunnelsGetCall) Do(opts ...googleapi.CallOption) (*VpnTunnel, error) {
  99119. gensupport.SetOptions(c.urlParams_, opts...)
  99120. res, err := c.doRequest("json")
  99121. if res != nil && res.StatusCode == http.StatusNotModified {
  99122. if res.Body != nil {
  99123. res.Body.Close()
  99124. }
  99125. return nil, &googleapi.Error{
  99126. Code: res.StatusCode,
  99127. Header: res.Header,
  99128. }
  99129. }
  99130. if err != nil {
  99131. return nil, err
  99132. }
  99133. defer googleapi.CloseBody(res)
  99134. if err := googleapi.CheckResponse(res); err != nil {
  99135. return nil, err
  99136. }
  99137. ret := &VpnTunnel{
  99138. ServerResponse: googleapi.ServerResponse{
  99139. Header: res.Header,
  99140. HTTPStatusCode: res.StatusCode,
  99141. },
  99142. }
  99143. target := &ret
  99144. if err := gensupport.DecodeResponse(target, res); err != nil {
  99145. return nil, err
  99146. }
  99147. return ret, nil
  99148. // {
  99149. // "description": "Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.",
  99150. // "httpMethod": "GET",
  99151. // "id": "compute.vpnTunnels.get",
  99152. // "parameterOrder": [
  99153. // "project",
  99154. // "region",
  99155. // "vpnTunnel"
  99156. // ],
  99157. // "parameters": {
  99158. // "project": {
  99159. // "description": "Project ID for this request.",
  99160. // "location": "path",
  99161. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99162. // "required": true,
  99163. // "type": "string"
  99164. // },
  99165. // "region": {
  99166. // "description": "Name of the region for this request.",
  99167. // "location": "path",
  99168. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99169. // "required": true,
  99170. // "type": "string"
  99171. // },
  99172. // "vpnTunnel": {
  99173. // "description": "Name of the VpnTunnel resource to return.",
  99174. // "location": "path",
  99175. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99176. // "required": true,
  99177. // "type": "string"
  99178. // }
  99179. // },
  99180. // "path": "{project}/regions/{region}/vpnTunnels/{vpnTunnel}",
  99181. // "response": {
  99182. // "$ref": "VpnTunnel"
  99183. // },
  99184. // "scopes": [
  99185. // "https://www.googleapis.com/auth/cloud-platform",
  99186. // "https://www.googleapis.com/auth/compute",
  99187. // "https://www.googleapis.com/auth/compute.readonly"
  99188. // ]
  99189. // }
  99190. }
  99191. // method id "compute.vpnTunnels.insert":
  99192. type VpnTunnelsInsertCall struct {
  99193. s *Service
  99194. project string
  99195. region string
  99196. vpntunnel *VpnTunnel
  99197. urlParams_ gensupport.URLParams
  99198. ctx_ context.Context
  99199. header_ http.Header
  99200. }
  99201. // Insert: Creates a VpnTunnel resource in the specified project and
  99202. // region using the data included in the request.
  99203. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall {
  99204. c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99205. c.project = project
  99206. c.region = region
  99207. c.vpntunnel = vpntunnel
  99208. return c
  99209. }
  99210. // RequestId sets the optional parameter "requestId": An optional
  99211. // request ID to identify requests. Specify a unique request ID so that
  99212. // if you must retry your request, the server will know to ignore the
  99213. // request if it has already been completed.
  99214. //
  99215. // For example, consider a situation where you make an initial request
  99216. // and the request times out. If you make the request again with the
  99217. // same request ID, the server can check if original operation with the
  99218. // same request ID was received, and if so, will ignore the second
  99219. // request. This prevents clients from accidentally creating duplicate
  99220. // commitments.
  99221. //
  99222. // The request ID must be a valid UUID with the exception that zero UUID
  99223. // is not supported (00000000-0000-0000-0000-000000000000).
  99224. func (c *VpnTunnelsInsertCall) RequestId(requestId string) *VpnTunnelsInsertCall {
  99225. c.urlParams_.Set("requestId", requestId)
  99226. return c
  99227. }
  99228. // Fields allows partial responses to be retrieved. See
  99229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99230. // for more information.
  99231. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall {
  99232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99233. return c
  99234. }
  99235. // Context sets the context to be used in this call's Do method. Any
  99236. // pending HTTP request will be aborted if the provided context is
  99237. // canceled.
  99238. func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall {
  99239. c.ctx_ = ctx
  99240. return c
  99241. }
  99242. // Header returns an http.Header that can be modified by the caller to
  99243. // add HTTP headers to the request.
  99244. func (c *VpnTunnelsInsertCall) Header() http.Header {
  99245. if c.header_ == nil {
  99246. c.header_ = make(http.Header)
  99247. }
  99248. return c.header_
  99249. }
  99250. func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) {
  99251. reqHeaders := make(http.Header)
  99252. for k, v := range c.header_ {
  99253. reqHeaders[k] = v
  99254. }
  99255. reqHeaders.Set("User-Agent", c.s.userAgent())
  99256. var body io.Reader = nil
  99257. body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel)
  99258. if err != nil {
  99259. return nil, err
  99260. }
  99261. reqHeaders.Set("Content-Type", "application/json")
  99262. c.urlParams_.Set("alt", alt)
  99263. c.urlParams_.Set("prettyPrint", "false")
  99264. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  99265. urls += "?" + c.urlParams_.Encode()
  99266. req, err := http.NewRequest("POST", urls, body)
  99267. if err != nil {
  99268. return nil, err
  99269. }
  99270. req.Header = reqHeaders
  99271. googleapi.Expand(req.URL, map[string]string{
  99272. "project": c.project,
  99273. "region": c.region,
  99274. })
  99275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99276. }
  99277. // Do executes the "compute.vpnTunnels.insert" call.
  99278. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99279. // status code is an error. Response headers are in either
  99280. // *Operation.ServerResponse.Header or (if a response was returned at
  99281. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99282. // to check whether the returned error was because
  99283. // http.StatusNotModified was returned.
  99284. func (c *VpnTunnelsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99285. gensupport.SetOptions(c.urlParams_, opts...)
  99286. res, err := c.doRequest("json")
  99287. if res != nil && res.StatusCode == http.StatusNotModified {
  99288. if res.Body != nil {
  99289. res.Body.Close()
  99290. }
  99291. return nil, &googleapi.Error{
  99292. Code: res.StatusCode,
  99293. Header: res.Header,
  99294. }
  99295. }
  99296. if err != nil {
  99297. return nil, err
  99298. }
  99299. defer googleapi.CloseBody(res)
  99300. if err := googleapi.CheckResponse(res); err != nil {
  99301. return nil, err
  99302. }
  99303. ret := &Operation{
  99304. ServerResponse: googleapi.ServerResponse{
  99305. Header: res.Header,
  99306. HTTPStatusCode: res.StatusCode,
  99307. },
  99308. }
  99309. target := &ret
  99310. if err := gensupport.DecodeResponse(target, res); err != nil {
  99311. return nil, err
  99312. }
  99313. return ret, nil
  99314. // {
  99315. // "description": "Creates a VpnTunnel resource in the specified project and region using the data included in the request.",
  99316. // "httpMethod": "POST",
  99317. // "id": "compute.vpnTunnels.insert",
  99318. // "parameterOrder": [
  99319. // "project",
  99320. // "region"
  99321. // ],
  99322. // "parameters": {
  99323. // "project": {
  99324. // "description": "Project ID for this request.",
  99325. // "location": "path",
  99326. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99327. // "required": true,
  99328. // "type": "string"
  99329. // },
  99330. // "region": {
  99331. // "description": "Name of the region for this request.",
  99332. // "location": "path",
  99333. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99334. // "required": true,
  99335. // "type": "string"
  99336. // },
  99337. // "requestId": {
  99338. // "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).",
  99339. // "location": "query",
  99340. // "type": "string"
  99341. // }
  99342. // },
  99343. // "path": "{project}/regions/{region}/vpnTunnels",
  99344. // "request": {
  99345. // "$ref": "VpnTunnel"
  99346. // },
  99347. // "response": {
  99348. // "$ref": "Operation"
  99349. // },
  99350. // "scopes": [
  99351. // "https://www.googleapis.com/auth/cloud-platform",
  99352. // "https://www.googleapis.com/auth/compute"
  99353. // ]
  99354. // }
  99355. }
  99356. // method id "compute.vpnTunnels.list":
  99357. type VpnTunnelsListCall struct {
  99358. s *Service
  99359. project string
  99360. region string
  99361. urlParams_ gensupport.URLParams
  99362. ifNoneMatch_ string
  99363. ctx_ context.Context
  99364. header_ http.Header
  99365. }
  99366. // List: Retrieves a list of VpnTunnel resources contained in the
  99367. // specified project and region.
  99368. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall {
  99369. c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99370. c.project = project
  99371. c.region = region
  99372. return c
  99373. }
  99374. // Filter sets the optional parameter "filter": A filter expression that
  99375. // filters resources listed in the response. The expression must specify
  99376. // the field name, a comparison operator, and the value that you want to
  99377. // use for filtering. The value must be a string, a number, or a
  99378. // boolean. The comparison operator must be either =, !=, >, or <.
  99379. //
  99380. // For example, if you are filtering Compute Engine instances, you can
  99381. // exclude instances named example-instance by specifying name !=
  99382. // example-instance.
  99383. //
  99384. // You can also filter nested fields. For example, you could specify
  99385. // scheduling.automaticRestart = false to include instances only if they
  99386. // are not scheduled for automatic restarts. You can use filtering on
  99387. // nested fields to filter based on resource labels.
  99388. //
  99389. // To filter on multiple expressions, provide each separate expression
  99390. // within parentheses. For example, (scheduling.automaticRestart = true)
  99391. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99392. // AND expression. However, you can include AND and OR expressions
  99393. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99394. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99395. // true).
  99396. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall {
  99397. c.urlParams_.Set("filter", filter)
  99398. return c
  99399. }
  99400. // MaxResults sets the optional parameter "maxResults": The maximum
  99401. // number of results per page that should be returned. If the number of
  99402. // available results is larger than maxResults, Compute Engine returns a
  99403. // nextPageToken that can be used to get the next page of results in
  99404. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99405. // (Default: 500)
  99406. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall {
  99407. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99408. return c
  99409. }
  99410. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99411. // a certain order. By default, results are returned in alphanumerical
  99412. // order based on the resource name.
  99413. //
  99414. // You can also sort results in descending order based on the creation
  99415. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99416. // based on the creationTimestamp field in reverse chronological order
  99417. // (newest result first). Use this to sort resources like operations so
  99418. // that the newest operation is returned first.
  99419. //
  99420. // Currently, only sorting by name or creationTimestamp desc is
  99421. // supported.
  99422. func (c *VpnTunnelsListCall) OrderBy(orderBy string) *VpnTunnelsListCall {
  99423. c.urlParams_.Set("orderBy", orderBy)
  99424. return c
  99425. }
  99426. // PageToken sets the optional parameter "pageToken": Specifies a page
  99427. // token to use. Set pageToken to the nextPageToken returned by a
  99428. // previous list request to get the next page of results.
  99429. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall {
  99430. c.urlParams_.Set("pageToken", pageToken)
  99431. return c
  99432. }
  99433. // Fields allows partial responses to be retrieved. See
  99434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99435. // for more information.
  99436. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall {
  99437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99438. return c
  99439. }
  99440. // IfNoneMatch sets the optional parameter which makes the operation
  99441. // fail if the object's ETag matches the given value. This is useful for
  99442. // getting updates only after the object has changed since the last
  99443. // request. Use googleapi.IsNotModified to check whether the response
  99444. // error from Do is the result of In-None-Match.
  99445. func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall {
  99446. c.ifNoneMatch_ = entityTag
  99447. return c
  99448. }
  99449. // Context sets the context to be used in this call's Do method. Any
  99450. // pending HTTP request will be aborted if the provided context is
  99451. // canceled.
  99452. func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall {
  99453. c.ctx_ = ctx
  99454. return c
  99455. }
  99456. // Header returns an http.Header that can be modified by the caller to
  99457. // add HTTP headers to the request.
  99458. func (c *VpnTunnelsListCall) Header() http.Header {
  99459. if c.header_ == nil {
  99460. c.header_ = make(http.Header)
  99461. }
  99462. return c.header_
  99463. }
  99464. func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) {
  99465. reqHeaders := make(http.Header)
  99466. for k, v := range c.header_ {
  99467. reqHeaders[k] = v
  99468. }
  99469. reqHeaders.Set("User-Agent", c.s.userAgent())
  99470. if c.ifNoneMatch_ != "" {
  99471. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99472. }
  99473. var body io.Reader = nil
  99474. c.urlParams_.Set("alt", alt)
  99475. c.urlParams_.Set("prettyPrint", "false")
  99476. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels")
  99477. urls += "?" + c.urlParams_.Encode()
  99478. req, err := http.NewRequest("GET", urls, body)
  99479. if err != nil {
  99480. return nil, err
  99481. }
  99482. req.Header = reqHeaders
  99483. googleapi.Expand(req.URL, map[string]string{
  99484. "project": c.project,
  99485. "region": c.region,
  99486. })
  99487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99488. }
  99489. // Do executes the "compute.vpnTunnels.list" call.
  99490. // Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx
  99491. // status code is an error. Response headers are in either
  99492. // *VpnTunnelList.ServerResponse.Header or (if a response was returned
  99493. // at all) in error.(*googleapi.Error).Header. Use
  99494. // googleapi.IsNotModified to check whether the returned error was
  99495. // because http.StatusNotModified was returned.
  99496. func (c *VpnTunnelsListCall) Do(opts ...googleapi.CallOption) (*VpnTunnelList, error) {
  99497. gensupport.SetOptions(c.urlParams_, opts...)
  99498. res, err := c.doRequest("json")
  99499. if res != nil && res.StatusCode == http.StatusNotModified {
  99500. if res.Body != nil {
  99501. res.Body.Close()
  99502. }
  99503. return nil, &googleapi.Error{
  99504. Code: res.StatusCode,
  99505. Header: res.Header,
  99506. }
  99507. }
  99508. if err != nil {
  99509. return nil, err
  99510. }
  99511. defer googleapi.CloseBody(res)
  99512. if err := googleapi.CheckResponse(res); err != nil {
  99513. return nil, err
  99514. }
  99515. ret := &VpnTunnelList{
  99516. ServerResponse: googleapi.ServerResponse{
  99517. Header: res.Header,
  99518. HTTPStatusCode: res.StatusCode,
  99519. },
  99520. }
  99521. target := &ret
  99522. if err := gensupport.DecodeResponse(target, res); err != nil {
  99523. return nil, err
  99524. }
  99525. return ret, nil
  99526. // {
  99527. // "description": "Retrieves a list of VpnTunnel resources contained in the specified project and region.",
  99528. // "httpMethod": "GET",
  99529. // "id": "compute.vpnTunnels.list",
  99530. // "parameterOrder": [
  99531. // "project",
  99532. // "region"
  99533. // ],
  99534. // "parameters": {
  99535. // "filter": {
  99536. // "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).",
  99537. // "location": "query",
  99538. // "type": "string"
  99539. // },
  99540. // "maxResults": {
  99541. // "default": "500",
  99542. // "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)",
  99543. // "format": "uint32",
  99544. // "location": "query",
  99545. // "minimum": "0",
  99546. // "type": "integer"
  99547. // },
  99548. // "orderBy": {
  99549. // "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.",
  99550. // "location": "query",
  99551. // "type": "string"
  99552. // },
  99553. // "pageToken": {
  99554. // "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.",
  99555. // "location": "query",
  99556. // "type": "string"
  99557. // },
  99558. // "project": {
  99559. // "description": "Project ID for this request.",
  99560. // "location": "path",
  99561. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99562. // "required": true,
  99563. // "type": "string"
  99564. // },
  99565. // "region": {
  99566. // "description": "Name of the region for this request.",
  99567. // "location": "path",
  99568. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99569. // "required": true,
  99570. // "type": "string"
  99571. // }
  99572. // },
  99573. // "path": "{project}/regions/{region}/vpnTunnels",
  99574. // "response": {
  99575. // "$ref": "VpnTunnelList"
  99576. // },
  99577. // "scopes": [
  99578. // "https://www.googleapis.com/auth/cloud-platform",
  99579. // "https://www.googleapis.com/auth/compute",
  99580. // "https://www.googleapis.com/auth/compute.readonly"
  99581. // ]
  99582. // }
  99583. }
  99584. // Pages invokes f for each page of results.
  99585. // A non-nil error returned from f will halt the iteration.
  99586. // The provided context supersedes any context provided to the Context method.
  99587. func (c *VpnTunnelsListCall) Pages(ctx context.Context, f func(*VpnTunnelList) error) error {
  99588. c.ctx_ = ctx
  99589. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  99590. for {
  99591. x, err := c.Do()
  99592. if err != nil {
  99593. return err
  99594. }
  99595. if err := f(x); err != nil {
  99596. return err
  99597. }
  99598. if x.NextPageToken == "" {
  99599. return nil
  99600. }
  99601. c.PageToken(x.NextPageToken)
  99602. }
  99603. }
  99604. // method id "compute.zoneOperations.delete":
  99605. type ZoneOperationsDeleteCall struct {
  99606. s *Service
  99607. project string
  99608. zone string
  99609. operation string
  99610. urlParams_ gensupport.URLParams
  99611. ctx_ context.Context
  99612. header_ http.Header
  99613. }
  99614. // Delete: Deletes the specified zone-specific Operations resource.
  99615. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete
  99616. func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall {
  99617. c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99618. c.project = project
  99619. c.zone = zone
  99620. c.operation = operation
  99621. return c
  99622. }
  99623. // Fields allows partial responses to be retrieved. See
  99624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99625. // for more information.
  99626. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall {
  99627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99628. return c
  99629. }
  99630. // Context sets the context to be used in this call's Do method. Any
  99631. // pending HTTP request will be aborted if the provided context is
  99632. // canceled.
  99633. func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall {
  99634. c.ctx_ = ctx
  99635. return c
  99636. }
  99637. // Header returns an http.Header that can be modified by the caller to
  99638. // add HTTP headers to the request.
  99639. func (c *ZoneOperationsDeleteCall) Header() http.Header {
  99640. if c.header_ == nil {
  99641. c.header_ = make(http.Header)
  99642. }
  99643. return c.header_
  99644. }
  99645. func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  99646. reqHeaders := make(http.Header)
  99647. for k, v := range c.header_ {
  99648. reqHeaders[k] = v
  99649. }
  99650. reqHeaders.Set("User-Agent", c.s.userAgent())
  99651. var body io.Reader = nil
  99652. c.urlParams_.Set("alt", alt)
  99653. c.urlParams_.Set("prettyPrint", "false")
  99654. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  99655. urls += "?" + c.urlParams_.Encode()
  99656. req, err := http.NewRequest("DELETE", urls, body)
  99657. if err != nil {
  99658. return nil, err
  99659. }
  99660. req.Header = reqHeaders
  99661. googleapi.Expand(req.URL, map[string]string{
  99662. "project": c.project,
  99663. "zone": c.zone,
  99664. "operation": c.operation,
  99665. })
  99666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99667. }
  99668. // Do executes the "compute.zoneOperations.delete" call.
  99669. func (c *ZoneOperationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  99670. gensupport.SetOptions(c.urlParams_, opts...)
  99671. res, err := c.doRequest("json")
  99672. if err != nil {
  99673. return err
  99674. }
  99675. defer googleapi.CloseBody(res)
  99676. if err := googleapi.CheckResponse(res); err != nil {
  99677. return err
  99678. }
  99679. return nil
  99680. // {
  99681. // "description": "Deletes the specified zone-specific Operations resource.",
  99682. // "httpMethod": "DELETE",
  99683. // "id": "compute.zoneOperations.delete",
  99684. // "parameterOrder": [
  99685. // "project",
  99686. // "zone",
  99687. // "operation"
  99688. // ],
  99689. // "parameters": {
  99690. // "operation": {
  99691. // "description": "Name of the Operations resource to delete.",
  99692. // "location": "path",
  99693. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99694. // "required": true,
  99695. // "type": "string"
  99696. // },
  99697. // "project": {
  99698. // "description": "Project ID for this request.",
  99699. // "location": "path",
  99700. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99701. // "required": true,
  99702. // "type": "string"
  99703. // },
  99704. // "zone": {
  99705. // "description": "Name of the zone for this request.",
  99706. // "location": "path",
  99707. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99708. // "required": true,
  99709. // "type": "string"
  99710. // }
  99711. // },
  99712. // "path": "{project}/zones/{zone}/operations/{operation}",
  99713. // "scopes": [
  99714. // "https://www.googleapis.com/auth/cloud-platform",
  99715. // "https://www.googleapis.com/auth/compute"
  99716. // ]
  99717. // }
  99718. }
  99719. // method id "compute.zoneOperations.get":
  99720. type ZoneOperationsGetCall struct {
  99721. s *Service
  99722. project string
  99723. zone string
  99724. operation string
  99725. urlParams_ gensupport.URLParams
  99726. ifNoneMatch_ string
  99727. ctx_ context.Context
  99728. header_ http.Header
  99729. }
  99730. // Get: Retrieves the specified zone-specific Operations resource.
  99731. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get
  99732. func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall {
  99733. c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99734. c.project = project
  99735. c.zone = zone
  99736. c.operation = operation
  99737. return c
  99738. }
  99739. // Fields allows partial responses to be retrieved. See
  99740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99741. // for more information.
  99742. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall {
  99743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99744. return c
  99745. }
  99746. // IfNoneMatch sets the optional parameter which makes the operation
  99747. // fail if the object's ETag matches the given value. This is useful for
  99748. // getting updates only after the object has changed since the last
  99749. // request. Use googleapi.IsNotModified to check whether the response
  99750. // error from Do is the result of In-None-Match.
  99751. func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall {
  99752. c.ifNoneMatch_ = entityTag
  99753. return c
  99754. }
  99755. // Context sets the context to be used in this call's Do method. Any
  99756. // pending HTTP request will be aborted if the provided context is
  99757. // canceled.
  99758. func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall {
  99759. c.ctx_ = ctx
  99760. return c
  99761. }
  99762. // Header returns an http.Header that can be modified by the caller to
  99763. // add HTTP headers to the request.
  99764. func (c *ZoneOperationsGetCall) Header() http.Header {
  99765. if c.header_ == nil {
  99766. c.header_ = make(http.Header)
  99767. }
  99768. return c.header_
  99769. }
  99770. func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  99771. reqHeaders := make(http.Header)
  99772. for k, v := range c.header_ {
  99773. reqHeaders[k] = v
  99774. }
  99775. reqHeaders.Set("User-Agent", c.s.userAgent())
  99776. if c.ifNoneMatch_ != "" {
  99777. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99778. }
  99779. var body io.Reader = nil
  99780. c.urlParams_.Set("alt", alt)
  99781. c.urlParams_.Set("prettyPrint", "false")
  99782. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}")
  99783. urls += "?" + c.urlParams_.Encode()
  99784. req, err := http.NewRequest("GET", urls, body)
  99785. if err != nil {
  99786. return nil, err
  99787. }
  99788. req.Header = reqHeaders
  99789. googleapi.Expand(req.URL, map[string]string{
  99790. "project": c.project,
  99791. "zone": c.zone,
  99792. "operation": c.operation,
  99793. })
  99794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  99795. }
  99796. // Do executes the "compute.zoneOperations.get" call.
  99797. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  99798. // status code is an error. Response headers are in either
  99799. // *Operation.ServerResponse.Header or (if a response was returned at
  99800. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  99801. // to check whether the returned error was because
  99802. // http.StatusNotModified was returned.
  99803. func (c *ZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  99804. gensupport.SetOptions(c.urlParams_, opts...)
  99805. res, err := c.doRequest("json")
  99806. if res != nil && res.StatusCode == http.StatusNotModified {
  99807. if res.Body != nil {
  99808. res.Body.Close()
  99809. }
  99810. return nil, &googleapi.Error{
  99811. Code: res.StatusCode,
  99812. Header: res.Header,
  99813. }
  99814. }
  99815. if err != nil {
  99816. return nil, err
  99817. }
  99818. defer googleapi.CloseBody(res)
  99819. if err := googleapi.CheckResponse(res); err != nil {
  99820. return nil, err
  99821. }
  99822. ret := &Operation{
  99823. ServerResponse: googleapi.ServerResponse{
  99824. Header: res.Header,
  99825. HTTPStatusCode: res.StatusCode,
  99826. },
  99827. }
  99828. target := &ret
  99829. if err := gensupport.DecodeResponse(target, res); err != nil {
  99830. return nil, err
  99831. }
  99832. return ret, nil
  99833. // {
  99834. // "description": "Retrieves the specified zone-specific Operations resource.",
  99835. // "httpMethod": "GET",
  99836. // "id": "compute.zoneOperations.get",
  99837. // "parameterOrder": [
  99838. // "project",
  99839. // "zone",
  99840. // "operation"
  99841. // ],
  99842. // "parameters": {
  99843. // "operation": {
  99844. // "description": "Name of the Operations resource to return.",
  99845. // "location": "path",
  99846. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  99847. // "required": true,
  99848. // "type": "string"
  99849. // },
  99850. // "project": {
  99851. // "description": "Project ID for this request.",
  99852. // "location": "path",
  99853. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  99854. // "required": true,
  99855. // "type": "string"
  99856. // },
  99857. // "zone": {
  99858. // "description": "Name of the zone for this request.",
  99859. // "location": "path",
  99860. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  99861. // "required": true,
  99862. // "type": "string"
  99863. // }
  99864. // },
  99865. // "path": "{project}/zones/{zone}/operations/{operation}",
  99866. // "response": {
  99867. // "$ref": "Operation"
  99868. // },
  99869. // "scopes": [
  99870. // "https://www.googleapis.com/auth/cloud-platform",
  99871. // "https://www.googleapis.com/auth/compute",
  99872. // "https://www.googleapis.com/auth/compute.readonly"
  99873. // ]
  99874. // }
  99875. }
  99876. // method id "compute.zoneOperations.list":
  99877. type ZoneOperationsListCall struct {
  99878. s *Service
  99879. project string
  99880. zone string
  99881. urlParams_ gensupport.URLParams
  99882. ifNoneMatch_ string
  99883. ctx_ context.Context
  99884. header_ http.Header
  99885. }
  99886. // List: Retrieves a list of Operation resources contained within the
  99887. // specified zone.
  99888. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list
  99889. func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall {
  99890. c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  99891. c.project = project
  99892. c.zone = zone
  99893. return c
  99894. }
  99895. // Filter sets the optional parameter "filter": A filter expression that
  99896. // filters resources listed in the response. The expression must specify
  99897. // the field name, a comparison operator, and the value that you want to
  99898. // use for filtering. The value must be a string, a number, or a
  99899. // boolean. The comparison operator must be either =, !=, >, or <.
  99900. //
  99901. // For example, if you are filtering Compute Engine instances, you can
  99902. // exclude instances named example-instance by specifying name !=
  99903. // example-instance.
  99904. //
  99905. // You can also filter nested fields. For example, you could specify
  99906. // scheduling.automaticRestart = false to include instances only if they
  99907. // are not scheduled for automatic restarts. You can use filtering on
  99908. // nested fields to filter based on resource labels.
  99909. //
  99910. // To filter on multiple expressions, provide each separate expression
  99911. // within parentheses. For example, (scheduling.automaticRestart = true)
  99912. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  99913. // AND expression. However, you can include AND and OR expressions
  99914. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  99915. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  99916. // true).
  99917. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall {
  99918. c.urlParams_.Set("filter", filter)
  99919. return c
  99920. }
  99921. // MaxResults sets the optional parameter "maxResults": The maximum
  99922. // number of results per page that should be returned. If the number of
  99923. // available results is larger than maxResults, Compute Engine returns a
  99924. // nextPageToken that can be used to get the next page of results in
  99925. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  99926. // (Default: 500)
  99927. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall {
  99928. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  99929. return c
  99930. }
  99931. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  99932. // a certain order. By default, results are returned in alphanumerical
  99933. // order based on the resource name.
  99934. //
  99935. // You can also sort results in descending order based on the creation
  99936. // timestamp using orderBy="creationTimestamp desc". This sorts results
  99937. // based on the creationTimestamp field in reverse chronological order
  99938. // (newest result first). Use this to sort resources like operations so
  99939. // that the newest operation is returned first.
  99940. //
  99941. // Currently, only sorting by name or creationTimestamp desc is
  99942. // supported.
  99943. func (c *ZoneOperationsListCall) OrderBy(orderBy string) *ZoneOperationsListCall {
  99944. c.urlParams_.Set("orderBy", orderBy)
  99945. return c
  99946. }
  99947. // PageToken sets the optional parameter "pageToken": Specifies a page
  99948. // token to use. Set pageToken to the nextPageToken returned by a
  99949. // previous list request to get the next page of results.
  99950. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall {
  99951. c.urlParams_.Set("pageToken", pageToken)
  99952. return c
  99953. }
  99954. // Fields allows partial responses to be retrieved. See
  99955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  99956. // for more information.
  99957. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall {
  99958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  99959. return c
  99960. }
  99961. // IfNoneMatch sets the optional parameter which makes the operation
  99962. // fail if the object's ETag matches the given value. This is useful for
  99963. // getting updates only after the object has changed since the last
  99964. // request. Use googleapi.IsNotModified to check whether the response
  99965. // error from Do is the result of In-None-Match.
  99966. func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall {
  99967. c.ifNoneMatch_ = entityTag
  99968. return c
  99969. }
  99970. // Context sets the context to be used in this call's Do method. Any
  99971. // pending HTTP request will be aborted if the provided context is
  99972. // canceled.
  99973. func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall {
  99974. c.ctx_ = ctx
  99975. return c
  99976. }
  99977. // Header returns an http.Header that can be modified by the caller to
  99978. // add HTTP headers to the request.
  99979. func (c *ZoneOperationsListCall) Header() http.Header {
  99980. if c.header_ == nil {
  99981. c.header_ = make(http.Header)
  99982. }
  99983. return c.header_
  99984. }
  99985. func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  99986. reqHeaders := make(http.Header)
  99987. for k, v := range c.header_ {
  99988. reqHeaders[k] = v
  99989. }
  99990. reqHeaders.Set("User-Agent", c.s.userAgent())
  99991. if c.ifNoneMatch_ != "" {
  99992. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  99993. }
  99994. var body io.Reader = nil
  99995. c.urlParams_.Set("alt", alt)
  99996. c.urlParams_.Set("prettyPrint", "false")
  99997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations")
  99998. urls += "?" + c.urlParams_.Encode()
  99999. req, err := http.NewRequest("GET", urls, body)
  100000. if err != nil {
  100001. return nil, err
  100002. }
  100003. req.Header = reqHeaders
  100004. googleapi.Expand(req.URL, map[string]string{
  100005. "project": c.project,
  100006. "zone": c.zone,
  100007. })
  100008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100009. }
  100010. // Do executes the "compute.zoneOperations.list" call.
  100011. // Exactly one of *OperationList or error will be non-nil. Any non-2xx
  100012. // status code is an error. Response headers are in either
  100013. // *OperationList.ServerResponse.Header or (if a response was returned
  100014. // at all) in error.(*googleapi.Error).Header. Use
  100015. // googleapi.IsNotModified to check whether the returned error was
  100016. // because http.StatusNotModified was returned.
  100017. func (c *ZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*OperationList, error) {
  100018. gensupport.SetOptions(c.urlParams_, opts...)
  100019. res, err := c.doRequest("json")
  100020. if res != nil && res.StatusCode == http.StatusNotModified {
  100021. if res.Body != nil {
  100022. res.Body.Close()
  100023. }
  100024. return nil, &googleapi.Error{
  100025. Code: res.StatusCode,
  100026. Header: res.Header,
  100027. }
  100028. }
  100029. if err != nil {
  100030. return nil, err
  100031. }
  100032. defer googleapi.CloseBody(res)
  100033. if err := googleapi.CheckResponse(res); err != nil {
  100034. return nil, err
  100035. }
  100036. ret := &OperationList{
  100037. ServerResponse: googleapi.ServerResponse{
  100038. Header: res.Header,
  100039. HTTPStatusCode: res.StatusCode,
  100040. },
  100041. }
  100042. target := &ret
  100043. if err := gensupport.DecodeResponse(target, res); err != nil {
  100044. return nil, err
  100045. }
  100046. return ret, nil
  100047. // {
  100048. // "description": "Retrieves a list of Operation resources contained within the specified zone.",
  100049. // "httpMethod": "GET",
  100050. // "id": "compute.zoneOperations.list",
  100051. // "parameterOrder": [
  100052. // "project",
  100053. // "zone"
  100054. // ],
  100055. // "parameters": {
  100056. // "filter": {
  100057. // "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).",
  100058. // "location": "query",
  100059. // "type": "string"
  100060. // },
  100061. // "maxResults": {
  100062. // "default": "500",
  100063. // "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)",
  100064. // "format": "uint32",
  100065. // "location": "query",
  100066. // "minimum": "0",
  100067. // "type": "integer"
  100068. // },
  100069. // "orderBy": {
  100070. // "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.",
  100071. // "location": "query",
  100072. // "type": "string"
  100073. // },
  100074. // "pageToken": {
  100075. // "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.",
  100076. // "location": "query",
  100077. // "type": "string"
  100078. // },
  100079. // "project": {
  100080. // "description": "Project ID for this request.",
  100081. // "location": "path",
  100082. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100083. // "required": true,
  100084. // "type": "string"
  100085. // },
  100086. // "zone": {
  100087. // "description": "Name of the zone for request.",
  100088. // "location": "path",
  100089. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  100090. // "required": true,
  100091. // "type": "string"
  100092. // }
  100093. // },
  100094. // "path": "{project}/zones/{zone}/operations",
  100095. // "response": {
  100096. // "$ref": "OperationList"
  100097. // },
  100098. // "scopes": [
  100099. // "https://www.googleapis.com/auth/cloud-platform",
  100100. // "https://www.googleapis.com/auth/compute",
  100101. // "https://www.googleapis.com/auth/compute.readonly"
  100102. // ]
  100103. // }
  100104. }
  100105. // Pages invokes f for each page of results.
  100106. // A non-nil error returned from f will halt the iteration.
  100107. // The provided context supersedes any context provided to the Context method.
  100108. func (c *ZoneOperationsListCall) Pages(ctx context.Context, f func(*OperationList) error) error {
  100109. c.ctx_ = ctx
  100110. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100111. for {
  100112. x, err := c.Do()
  100113. if err != nil {
  100114. return err
  100115. }
  100116. if err := f(x); err != nil {
  100117. return err
  100118. }
  100119. if x.NextPageToken == "" {
  100120. return nil
  100121. }
  100122. c.PageToken(x.NextPageToken)
  100123. }
  100124. }
  100125. // method id "compute.zones.get":
  100126. type ZonesGetCall struct {
  100127. s *Service
  100128. project string
  100129. zone string
  100130. urlParams_ gensupport.URLParams
  100131. ifNoneMatch_ string
  100132. ctx_ context.Context
  100133. header_ http.Header
  100134. }
  100135. // Get: Returns the specified Zone resource. Gets a list of available
  100136. // zones by making a list() request.
  100137. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get
  100138. func (r *ZonesService) Get(project string, zone string) *ZonesGetCall {
  100139. c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100140. c.project = project
  100141. c.zone = zone
  100142. return c
  100143. }
  100144. // Fields allows partial responses to be retrieved. See
  100145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100146. // for more information.
  100147. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall {
  100148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100149. return c
  100150. }
  100151. // IfNoneMatch sets the optional parameter which makes the operation
  100152. // fail if the object's ETag matches the given value. This is useful for
  100153. // getting updates only after the object has changed since the last
  100154. // request. Use googleapi.IsNotModified to check whether the response
  100155. // error from Do is the result of In-None-Match.
  100156. func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall {
  100157. c.ifNoneMatch_ = entityTag
  100158. return c
  100159. }
  100160. // Context sets the context to be used in this call's Do method. Any
  100161. // pending HTTP request will be aborted if the provided context is
  100162. // canceled.
  100163. func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall {
  100164. c.ctx_ = ctx
  100165. return c
  100166. }
  100167. // Header returns an http.Header that can be modified by the caller to
  100168. // add HTTP headers to the request.
  100169. func (c *ZonesGetCall) Header() http.Header {
  100170. if c.header_ == nil {
  100171. c.header_ = make(http.Header)
  100172. }
  100173. return c.header_
  100174. }
  100175. func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) {
  100176. reqHeaders := make(http.Header)
  100177. for k, v := range c.header_ {
  100178. reqHeaders[k] = v
  100179. }
  100180. reqHeaders.Set("User-Agent", c.s.userAgent())
  100181. if c.ifNoneMatch_ != "" {
  100182. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100183. }
  100184. var body io.Reader = nil
  100185. c.urlParams_.Set("alt", alt)
  100186. c.urlParams_.Set("prettyPrint", "false")
  100187. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}")
  100188. urls += "?" + c.urlParams_.Encode()
  100189. req, err := http.NewRequest("GET", urls, body)
  100190. if err != nil {
  100191. return nil, err
  100192. }
  100193. req.Header = reqHeaders
  100194. googleapi.Expand(req.URL, map[string]string{
  100195. "project": c.project,
  100196. "zone": c.zone,
  100197. })
  100198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100199. }
  100200. // Do executes the "compute.zones.get" call.
  100201. // Exactly one of *Zone or error will be non-nil. Any non-2xx status
  100202. // code is an error. Response headers are in either
  100203. // *Zone.ServerResponse.Header or (if a response was returned at all) in
  100204. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  100205. // whether the returned error was because http.StatusNotModified was
  100206. // returned.
  100207. func (c *ZonesGetCall) Do(opts ...googleapi.CallOption) (*Zone, error) {
  100208. gensupport.SetOptions(c.urlParams_, opts...)
  100209. res, err := c.doRequest("json")
  100210. if res != nil && res.StatusCode == http.StatusNotModified {
  100211. if res.Body != nil {
  100212. res.Body.Close()
  100213. }
  100214. return nil, &googleapi.Error{
  100215. Code: res.StatusCode,
  100216. Header: res.Header,
  100217. }
  100218. }
  100219. if err != nil {
  100220. return nil, err
  100221. }
  100222. defer googleapi.CloseBody(res)
  100223. if err := googleapi.CheckResponse(res); err != nil {
  100224. return nil, err
  100225. }
  100226. ret := &Zone{
  100227. ServerResponse: googleapi.ServerResponse{
  100228. Header: res.Header,
  100229. HTTPStatusCode: res.StatusCode,
  100230. },
  100231. }
  100232. target := &ret
  100233. if err := gensupport.DecodeResponse(target, res); err != nil {
  100234. return nil, err
  100235. }
  100236. return ret, nil
  100237. // {
  100238. // "description": "Returns the specified Zone resource. Gets a list of available zones by making a list() request.",
  100239. // "httpMethod": "GET",
  100240. // "id": "compute.zones.get",
  100241. // "parameterOrder": [
  100242. // "project",
  100243. // "zone"
  100244. // ],
  100245. // "parameters": {
  100246. // "project": {
  100247. // "description": "Project ID for this request.",
  100248. // "location": "path",
  100249. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100250. // "required": true,
  100251. // "type": "string"
  100252. // },
  100253. // "zone": {
  100254. // "description": "Name of the zone resource to return.",
  100255. // "location": "path",
  100256. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  100257. // "required": true,
  100258. // "type": "string"
  100259. // }
  100260. // },
  100261. // "path": "{project}/zones/{zone}",
  100262. // "response": {
  100263. // "$ref": "Zone"
  100264. // },
  100265. // "scopes": [
  100266. // "https://www.googleapis.com/auth/cloud-platform",
  100267. // "https://www.googleapis.com/auth/compute",
  100268. // "https://www.googleapis.com/auth/compute.readonly"
  100269. // ]
  100270. // }
  100271. }
  100272. // method id "compute.zones.list":
  100273. type ZonesListCall struct {
  100274. s *Service
  100275. project string
  100276. urlParams_ gensupport.URLParams
  100277. ifNoneMatch_ string
  100278. ctx_ context.Context
  100279. header_ http.Header
  100280. }
  100281. // List: Retrieves the list of Zone resources available to the specified
  100282. // project.
  100283. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list
  100284. func (r *ZonesService) List(project string) *ZonesListCall {
  100285. c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  100286. c.project = project
  100287. return c
  100288. }
  100289. // Filter sets the optional parameter "filter": A filter expression that
  100290. // filters resources listed in the response. The expression must specify
  100291. // the field name, a comparison operator, and the value that you want to
  100292. // use for filtering. The value must be a string, a number, or a
  100293. // boolean. The comparison operator must be either =, !=, >, or <.
  100294. //
  100295. // For example, if you are filtering Compute Engine instances, you can
  100296. // exclude instances named example-instance by specifying name !=
  100297. // example-instance.
  100298. //
  100299. // You can also filter nested fields. For example, you could specify
  100300. // scheduling.automaticRestart = false to include instances only if they
  100301. // are not scheduled for automatic restarts. You can use filtering on
  100302. // nested fields to filter based on resource labels.
  100303. //
  100304. // To filter on multiple expressions, provide each separate expression
  100305. // within parentheses. For example, (scheduling.automaticRestart = true)
  100306. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  100307. // AND expression. However, you can include AND and OR expressions
  100308. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  100309. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  100310. // true).
  100311. func (c *ZonesListCall) Filter(filter string) *ZonesListCall {
  100312. c.urlParams_.Set("filter", filter)
  100313. return c
  100314. }
  100315. // MaxResults sets the optional parameter "maxResults": The maximum
  100316. // number of results per page that should be returned. If the number of
  100317. // available results is larger than maxResults, Compute Engine returns a
  100318. // nextPageToken that can be used to get the next page of results in
  100319. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  100320. // (Default: 500)
  100321. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall {
  100322. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  100323. return c
  100324. }
  100325. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  100326. // a certain order. By default, results are returned in alphanumerical
  100327. // order based on the resource name.
  100328. //
  100329. // You can also sort results in descending order based on the creation
  100330. // timestamp using orderBy="creationTimestamp desc". This sorts results
  100331. // based on the creationTimestamp field in reverse chronological order
  100332. // (newest result first). Use this to sort resources like operations so
  100333. // that the newest operation is returned first.
  100334. //
  100335. // Currently, only sorting by name or creationTimestamp desc is
  100336. // supported.
  100337. func (c *ZonesListCall) OrderBy(orderBy string) *ZonesListCall {
  100338. c.urlParams_.Set("orderBy", orderBy)
  100339. return c
  100340. }
  100341. // PageToken sets the optional parameter "pageToken": Specifies a page
  100342. // token to use. Set pageToken to the nextPageToken returned by a
  100343. // previous list request to get the next page of results.
  100344. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall {
  100345. c.urlParams_.Set("pageToken", pageToken)
  100346. return c
  100347. }
  100348. // Fields allows partial responses to be retrieved. See
  100349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  100350. // for more information.
  100351. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall {
  100352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  100353. return c
  100354. }
  100355. // IfNoneMatch sets the optional parameter which makes the operation
  100356. // fail if the object's ETag matches the given value. This is useful for
  100357. // getting updates only after the object has changed since the last
  100358. // request. Use googleapi.IsNotModified to check whether the response
  100359. // error from Do is the result of In-None-Match.
  100360. func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall {
  100361. c.ifNoneMatch_ = entityTag
  100362. return c
  100363. }
  100364. // Context sets the context to be used in this call's Do method. Any
  100365. // pending HTTP request will be aborted if the provided context is
  100366. // canceled.
  100367. func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall {
  100368. c.ctx_ = ctx
  100369. return c
  100370. }
  100371. // Header returns an http.Header that can be modified by the caller to
  100372. // add HTTP headers to the request.
  100373. func (c *ZonesListCall) Header() http.Header {
  100374. if c.header_ == nil {
  100375. c.header_ = make(http.Header)
  100376. }
  100377. return c.header_
  100378. }
  100379. func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) {
  100380. reqHeaders := make(http.Header)
  100381. for k, v := range c.header_ {
  100382. reqHeaders[k] = v
  100383. }
  100384. reqHeaders.Set("User-Agent", c.s.userAgent())
  100385. if c.ifNoneMatch_ != "" {
  100386. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  100387. }
  100388. var body io.Reader = nil
  100389. c.urlParams_.Set("alt", alt)
  100390. c.urlParams_.Set("prettyPrint", "false")
  100391. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones")
  100392. urls += "?" + c.urlParams_.Encode()
  100393. req, err := http.NewRequest("GET", urls, body)
  100394. if err != nil {
  100395. return nil, err
  100396. }
  100397. req.Header = reqHeaders
  100398. googleapi.Expand(req.URL, map[string]string{
  100399. "project": c.project,
  100400. })
  100401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  100402. }
  100403. // Do executes the "compute.zones.list" call.
  100404. // Exactly one of *ZoneList or error will be non-nil. Any non-2xx status
  100405. // code is an error. Response headers are in either
  100406. // *ZoneList.ServerResponse.Header or (if a response was returned at
  100407. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  100408. // to check whether the returned error was because
  100409. // http.StatusNotModified was returned.
  100410. func (c *ZonesListCall) Do(opts ...googleapi.CallOption) (*ZoneList, error) {
  100411. gensupport.SetOptions(c.urlParams_, opts...)
  100412. res, err := c.doRequest("json")
  100413. if res != nil && res.StatusCode == http.StatusNotModified {
  100414. if res.Body != nil {
  100415. res.Body.Close()
  100416. }
  100417. return nil, &googleapi.Error{
  100418. Code: res.StatusCode,
  100419. Header: res.Header,
  100420. }
  100421. }
  100422. if err != nil {
  100423. return nil, err
  100424. }
  100425. defer googleapi.CloseBody(res)
  100426. if err := googleapi.CheckResponse(res); err != nil {
  100427. return nil, err
  100428. }
  100429. ret := &ZoneList{
  100430. ServerResponse: googleapi.ServerResponse{
  100431. Header: res.Header,
  100432. HTTPStatusCode: res.StatusCode,
  100433. },
  100434. }
  100435. target := &ret
  100436. if err := gensupport.DecodeResponse(target, res); err != nil {
  100437. return nil, err
  100438. }
  100439. return ret, nil
  100440. // {
  100441. // "description": "Retrieves the list of Zone resources available to the specified project.",
  100442. // "httpMethod": "GET",
  100443. // "id": "compute.zones.list",
  100444. // "parameterOrder": [
  100445. // "project"
  100446. // ],
  100447. // "parameters": {
  100448. // "filter": {
  100449. // "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).",
  100450. // "location": "query",
  100451. // "type": "string"
  100452. // },
  100453. // "maxResults": {
  100454. // "default": "500",
  100455. // "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)",
  100456. // "format": "uint32",
  100457. // "location": "query",
  100458. // "minimum": "0",
  100459. // "type": "integer"
  100460. // },
  100461. // "orderBy": {
  100462. // "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.",
  100463. // "location": "query",
  100464. // "type": "string"
  100465. // },
  100466. // "pageToken": {
  100467. // "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.",
  100468. // "location": "query",
  100469. // "type": "string"
  100470. // },
  100471. // "project": {
  100472. // "description": "Project ID for this request.",
  100473. // "location": "path",
  100474. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  100475. // "required": true,
  100476. // "type": "string"
  100477. // }
  100478. // },
  100479. // "path": "{project}/zones",
  100480. // "response": {
  100481. // "$ref": "ZoneList"
  100482. // },
  100483. // "scopes": [
  100484. // "https://www.googleapis.com/auth/cloud-platform",
  100485. // "https://www.googleapis.com/auth/compute",
  100486. // "https://www.googleapis.com/auth/compute.readonly"
  100487. // ]
  100488. // }
  100489. }
  100490. // Pages invokes f for each page of results.
  100491. // A non-nil error returned from f will halt the iteration.
  100492. // The provided context supersedes any context provided to the Context method.
  100493. func (c *ZonesListCall) Pages(ctx context.Context, f func(*ZoneList) error) error {
  100494. c.ctx_ = ctx
  100495. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  100496. for {
  100497. x, err := c.Do()
  100498. if err != nil {
  100499. return err
  100500. }
  100501. if err := f(x); err != nil {
  100502. return err
  100503. }
  100504. if x.NextPageToken == "" {
  100505. return nil
  100506. }
  100507. c.PageToken(x.NextPageToken)
  100508. }
  100509. }